Interface PermissionManager
-
- All Implemented Interfaces:
-
com.pointrlabs.core.management.interfaces.Advertiser
,com.pointrlabs.core.management.interfaces.PointrManager
public interface PermissionManager implements Advertiser<PermissionManager.Listener>, PointrManager
Manager that is responsible for all Android Permission related actions of the Pointr SDK
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
PermissionManager.Listener
-
Method Summary
Modifier and Type Method Description abstract Unit
requestBluetoothService()
Asks for Bluetooth Services to be enabled, if it is not already enabled. abstract Unit
requestBluetoothPermission(Activity activity, Integer requestCode)
Asks for Bluetooth Permissions android.Manifest.permission.BLUETOOTH_CONNECT&android.Manifest.permission.BLUETOOTH_SCAN to be granted, if it is not already granted. abstract Unit
requestLocationService(Activity activity)
Asks for Location Services to be enabled, if it is not already enabled. abstract Unit
requestLocationPermissionForAlways(Activity activity, Integer requestCode)
Asks for android.Manifest.permission.ACCESS_BACKGROUND_LOCATION, if it is not already granted. abstract Unit
requestLocationPermissionForWhileInUse(Activity activity, Integer requestCode)
Asks for android.Manifest.permission.ACCESS_FINE_LOCATION to be granted, if it is not already granted. abstract Unit
requestOnlyNecessaryPermissions(Activity activity, Integer requestCode)
Asks for android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.BLUETOOTH_SCAN and android.Manifest.permission.BLUETOOTH_CONNECT to be granted, if it is not already granted. abstract Unit
requestNotificationPermission(Activity activity, Integer requestCode)
Asks for android.Manifest.permission.POST_NOTIFICATIONS to be granted, if it is not already granted. abstract Boolean
getShouldRequestBluetoothService()
Determines whether Pointr SDK should ask for Bluetooth Service when needed. abstract Unit
setShouldRequestBluetoothService(Boolean shouldRequestBluetoothService)
Determines whether Pointr SDK should ask for Bluetooth Service when needed. abstract Boolean
getShouldRequestBluetoothPermission()
Determines whether Pointr SDK should ask for Bluetooth Permissions (android.Manifest.permission.BLUETOOTH_CONNECT&android.Manifest.permission.BLUETOOTH_SCAN) when needed. abstract Unit
setShouldRequestBluetoothPermission(Boolean shouldRequestBluetoothPermission)
Determines whether Pointr SDK should ask for Bluetooth Permissions (android.Manifest.permission.BLUETOOTH_CONNECT&android.Manifest.permission.BLUETOOTH_SCAN) when needed. abstract Boolean
getShouldRequestLocationService()
Determines whether Pointr SDK should ask for Location Service when needed. abstract Unit
setShouldRequestLocationService(Boolean shouldRequestLocationService)
Determines whether Pointr SDK should ask for Location Service when needed. abstract Boolean
getShouldRequestLocationPermissionForAlways()
Determines whether Pointr SDK should ask for android.Manifest.permission.ACCESS_BACKGROUND_LOCATION when needed. abstract Unit
setShouldRequestLocationPermissionForAlways(Boolean shouldRequestLocationPermissionForAlways)
Determines whether Pointr SDK should ask for android.Manifest.permission.ACCESS_BACKGROUND_LOCATION when needed. abstract Boolean
getShouldRequestLocationPermissionForWhileInUse()
Determines whether Pointr SDK should ask for android.Manifest.permission.ACCESS_FINE_LOCATION when needed. abstract Unit
setShouldRequestLocationPermissionForWhileInUse(Boolean shouldRequestLocationPermissionForWhileInUse)
Determines whether Pointr SDK should ask for android.Manifest.permission.ACCESS_FINE_LOCATION when needed. abstract Boolean
getShouldRequestNotificationPermission()
Determines whether Pointr SDK should ask for android.Manifest.permission.POST_NOTIFICATIONS when needed. abstract Unit
setShouldRequestNotificationPermission(Boolean shouldRequestNotificationPermission)
Determines whether Pointr SDK should ask for android.Manifest.permission.POST_NOTIFICATIONS when needed. abstract BluetoothManager
getBluetoothManager()
Returns the bluetooth manager safely. abstract Boolean
isBluetoothServicesEnabled()
True if Bluetooth Service is enabled, false otherwise. abstract Boolean
isLocationServicesEnabled()
True if Location Service is enabled, false otherwise. abstract Boolean
isBleScanAlwaysEnabled()
True if Bluetooth Scanning is enabled always when location services is enabled. abstract BluetoothPermissionState
getBluetoothPermissionState()
Current Bluetooth Permission State. abstract LocationPermissionState
getLocationPermissionState()
Current Location Permission State. abstract Boolean
getHasBluetoothPermission()
True if required Bluetooth permissions (android.Manifest.permission.BLUETOOTH_CONNECT&android.Manifest.permission.BLUETOOTH_SCAN) are granted, false otherwise. abstract Boolean
getHasLocationPermissionAlways()
True if android.Manifest.permission.ACCESS_BACKGROUND_LOCATION is granted, false otherwise. abstract Boolean
getHasLocationPermissionWhileInUse()
True if android.Manifest.permission.ACCESS_FINE_LOCATION is granted, false otherwise. abstract Boolean
getHasLocationPermissionAlwaysOrWhileInUse()
True if android.Manifest.permission.ACCESS_BACKGROUND_LOCATION or android.Manifest.permission.ACCESS_FINE_LOCATION is granted, false otherwise. abstract Boolean
getHasLocationPermissionNotPrecise()
True if android.Manifest.permission.ACCESS_COARSE_LOCATION is granted, false otherwise. abstract Boolean
getHasNotificationPermission()
True if android.Manifest.permission.POST_NOTIFICATIONS is granted, false otherwise. -
Methods inherited from class com.pointrlabs.core.management.interfaces.Advertiser
addListener, removeListener
-
Methods inherited from class com.pointrlabs.core.management.interfaces.PointrManager
start, stop
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
requestBluetoothService
abstract Unit requestBluetoothService()
Asks for Bluetooth Services to be enabled, if it is not already enabled.
-
requestBluetoothPermission
@RequiresApi(value = 31) abstract Unit requestBluetoothPermission(Activity activity, Integer requestCode)
Asks for Bluetooth Permissions android.Manifest.permission.BLUETOOTH_CONNECT&android.Manifest.permission.BLUETOOTH_SCAN to be granted, if it is not already granted. Applicable for Android S and later.
-
requestLocationService
abstract Unit requestLocationService(Activity activity)
Asks for Location Services to be enabled, if it is not already enabled.
- Parameters:
activity
- An activity that will be used as context to ask for permission
-
requestLocationPermissionForAlways
@RequiresApi(value = 29) abstract Unit requestLocationPermissionForAlways(Activity activity, Integer requestCode)
Asks for android.Manifest.permission.ACCESS_BACKGROUND_LOCATION, if it is not already granted. Applicable for Android Q and later.
- Parameters:
activity
- An activity that will be used as context to ask for permissionrequestCode
- To track for request's result.
-
requestLocationPermissionForWhileInUse
@RequiresApi(value = 23) abstract Unit requestLocationPermissionForWhileInUse(Activity activity, Integer requestCode)
Asks for android.Manifest.permission.ACCESS_FINE_LOCATION to be granted, if it is not already granted. Applicable for Android M and later.
- Parameters:
activity
- An activity that will be used as context to ask for permissionrequestCode
- To track for request's result.
-
requestOnlyNecessaryPermissions
@RequiresApi(value = 23) abstract Unit requestOnlyNecessaryPermissions(Activity activity, Integer requestCode)
Asks for android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.BLUETOOTH_SCAN and android.Manifest.permission.BLUETOOTH_CONNECT to be granted, if it is not already granted. Applicable for Android M and later.
- Parameters:
activity
- An activity that will be used as context to ask for permissionrequestCode
- To track for request's result.
-
requestNotificationPermission
abstract Unit requestNotificationPermission(Activity activity, Integer requestCode)
Asks for android.Manifest.permission.POST_NOTIFICATIONS to be granted, if it is not already granted.
- Parameters:
activity
- An activity that will be used as context to ask for permissionrequestCode
- To track for request's result.
-
getShouldRequestBluetoothService
abstract Boolean getShouldRequestBluetoothService()
Determines whether Pointr SDK should ask for Bluetooth Service when needed. True by default. Set it to false, to disable this behavior.
-
setShouldRequestBluetoothService
abstract Unit setShouldRequestBluetoothService(Boolean shouldRequestBluetoothService)
Determines whether Pointr SDK should ask for Bluetooth Service when needed. True by default. Set it to false, to disable this behavior.
-
getShouldRequestBluetoothPermission
abstract Boolean getShouldRequestBluetoothPermission()
Determines whether Pointr SDK should ask for Bluetooth Permissions (android.Manifest.permission.BLUETOOTH_CONNECT&android.Manifest.permission.BLUETOOTH_SCAN) when needed. True by default. Set it to false, to disable this behavior. Applicable for Android S and later.
-
setShouldRequestBluetoothPermission
abstract Unit setShouldRequestBluetoothPermission(Boolean shouldRequestBluetoothPermission)
Determines whether Pointr SDK should ask for Bluetooth Permissions (android.Manifest.permission.BLUETOOTH_CONNECT&android.Manifest.permission.BLUETOOTH_SCAN) when needed. True by default. Set it to false, to disable this behavior. Applicable for Android S and later.
-
getShouldRequestLocationService
abstract Boolean getShouldRequestLocationService()
Determines whether Pointr SDK should ask for Location Service when needed. True by default. Set it to false, to disable this behavior.
-
setShouldRequestLocationService
abstract Unit setShouldRequestLocationService(Boolean shouldRequestLocationService)
Determines whether Pointr SDK should ask for Location Service when needed. True by default. Set it to false, to disable this behavior.
-
getShouldRequestLocationPermissionForAlways
abstract Boolean getShouldRequestLocationPermissionForAlways()
Determines whether Pointr SDK should ask for android.Manifest.permission.ACCESS_BACKGROUND_LOCATION when needed. True by default. Set it to false, to disable this behavior.
-
setShouldRequestLocationPermissionForAlways
abstract Unit setShouldRequestLocationPermissionForAlways(Boolean shouldRequestLocationPermissionForAlways)
Determines whether Pointr SDK should ask for android.Manifest.permission.ACCESS_BACKGROUND_LOCATION when needed. True by default. Set it to false, to disable this behavior.
-
getShouldRequestLocationPermissionForWhileInUse
abstract Boolean getShouldRequestLocationPermissionForWhileInUse()
Determines whether Pointr SDK should ask for android.Manifest.permission.ACCESS_FINE_LOCATION when needed. True by default. Set it to false, to disable this behavior.
-
setShouldRequestLocationPermissionForWhileInUse
abstract Unit setShouldRequestLocationPermissionForWhileInUse(Boolean shouldRequestLocationPermissionForWhileInUse)
Determines whether Pointr SDK should ask for android.Manifest.permission.ACCESS_FINE_LOCATION when needed. True by default. Set it to false, to disable this behavior.
-
getShouldRequestNotificationPermission
abstract Boolean getShouldRequestNotificationPermission()
Determines whether Pointr SDK should ask for android.Manifest.permission.POST_NOTIFICATIONS when needed. True by default. Set it to false, to disable this behavior.
-
setShouldRequestNotificationPermission
abstract Unit setShouldRequestNotificationPermission(Boolean shouldRequestNotificationPermission)
Determines whether Pointr SDK should ask for android.Manifest.permission.POST_NOTIFICATIONS when needed. True by default. Set it to false, to disable this behavior.
-
getBluetoothManager
abstract BluetoothManager getBluetoothManager()
Returns the bluetooth manager safely. This access can throw exception if proper permissions are not given. So, all access to bluetooth manager should be done from here
-
isBluetoothServicesEnabled
abstract Boolean isBluetoothServicesEnabled()
True if Bluetooth Service is enabled, false otherwise.
-
isLocationServicesEnabled
abstract Boolean isLocationServicesEnabled()
True if Location Service is enabled, false otherwise.
-
isBleScanAlwaysEnabled
abstract Boolean isBleScanAlwaysEnabled()
True if Bluetooth Scanning is enabled always when location services is enabled. Supported for Android 7 and later.
-
getBluetoothPermissionState
abstract BluetoothPermissionState getBluetoothPermissionState()
Current Bluetooth Permission State. See BluetoothPermissionState
-
getLocationPermissionState
abstract LocationPermissionState getLocationPermissionState()
Current Location Permission State. See LocationPermissionState
-
getHasBluetoothPermission
abstract Boolean getHasBluetoothPermission()
True if required Bluetooth permissions (android.Manifest.permission.BLUETOOTH_CONNECT&android.Manifest.permission.BLUETOOTH_SCAN) are granted, false otherwise.
-
getHasLocationPermissionAlways
abstract Boolean getHasLocationPermissionAlways()
True if android.Manifest.permission.ACCESS_BACKGROUND_LOCATION is granted, false otherwise.
-
getHasLocationPermissionWhileInUse
abstract Boolean getHasLocationPermissionWhileInUse()
True if android.Manifest.permission.ACCESS_FINE_LOCATION is granted, false otherwise.
-
getHasLocationPermissionAlwaysOrWhileInUse
abstract Boolean getHasLocationPermissionAlwaysOrWhileInUse()
True if android.Manifest.permission.ACCESS_BACKGROUND_LOCATION or android.Manifest.permission.ACCESS_FINE_LOCATION is granted, false otherwise.
-
getHasLocationPermissionNotPrecise
abstract Boolean getHasLocationPermissionNotPrecise()
True if android.Manifest.permission.ACCESS_COARSE_LOCATION is granted, false otherwise.
-
getHasNotificationPermission
abstract Boolean getHasNotificationPermission()
True if android.Manifest.permission.POST_NOTIFICATIONS is granted, false otherwise.
-
-
-
-