-
Notifications
You must be signed in to change notification settings - Fork 583
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BLUETOOTH_CONNECT Handling and Helper Functions Added
Get Recommended BLE Connect Runtime Permissions LocationServicesStatusApi31.isLocationPermissionOk() Always Returns True RxBleClient State Now Also Returns BLUETOOTH_PERMISSION_NOT_GRANTED BlePermissionException Class Added to Throw Missing BLUETOOTH_SCAN and BLUETOOTH_CONNECT Exceptions
- Loading branch information
1 parent
f30abcc
commit 808ad98
Showing
9 changed files
with
143 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
rxandroidble/src/main/java/com/polidea/rxandroidble2/exceptions/BlePermissionException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.polidea.rxandroidble2.exceptions; | ||
|
||
|
||
import android.Manifest; | ||
|
||
import androidx.annotation.StringDef; | ||
|
||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
|
||
public class BlePermissionException extends BleException { | ||
|
||
@StringDef({Manifest.permission.BLUETOOTH_SCAN, Manifest.permission.BLUETOOTH_CONNECT}) | ||
@Retention(RetentionPolicy.SOURCE) | ||
public @interface Permission { | ||
} | ||
|
||
public BlePermissionException(@Permission String permission) { | ||
super(createMessage(permission)); | ||
} | ||
|
||
private static String createMessage(@Permission String permission) { | ||
return "BLE permission exception: " + permission; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters