Package io.okhi.android_core.models
Class OkHiPermissionService
java.lang.Object
io.okhi.android_core.models.OkHiPermissionService
-
Field Summary
-
Constructor Summary
ConstructorDescriptionOkHiPermissionService
(android.app.Activity activity) OkHiPermissionService
(androidx.appcompat.app.AppCompatActivity activity) -
Method Summary
Modifier and TypeMethodDescriptionstatic Boolean
canOpenProtectedApps
(android.content.Context context) static boolean
isBackgroundLocationPermissionGranted
(android.content.Context context) static boolean
isLocationPermissionGranted
(android.content.Context context) static boolean
isNotificationPermissionGranted
(android.content.Context context) static boolean
isPackageInstalled
(String packageName, android.content.Context context) void
onRequestPermissionsResult
(int requestCode, String[] permissions, int[] grantResults, OkHiPermissionHandler permissionHandler) static void
openProtectedAppsSettings
(android.app.Activity activity, int requestCode) void
void
requestBackgroundLocationPermission
(String rationaleTitle, String rationaleMessage, OkHiRequestHandler<Boolean> handler) void
void
requestLocationPermission
(String rationaleTitle, String rationaleMessage, OkHiRequestHandler<Boolean> handler) void
-
Field Details
-
PROTECTED_APPS_PACKAGE_NAME
- See Also:
-
PROTECTED_APPS_CLASS_NAME
- See Also:
-
-
Constructor Details
-
OkHiPermissionService
public OkHiPermissionService(androidx.appcompat.app.AppCompatActivity activity) -
OkHiPermissionService
public OkHiPermissionService(android.app.Activity activity)
-
-
Method Details
-
onRequestPermissionsResult
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults, OkHiPermissionHandler permissionHandler) -
isBackgroundLocationPermissionGranted
public static boolean isBackgroundLocationPermissionGranted(android.content.Context context) -
isLocationPermissionGranted
public static boolean isLocationPermissionGranted(android.content.Context context) -
isPackageInstalled
-
requestLocationPermission
public void requestLocationPermission(String rationaleTitle, String rationaleMessage, OkHiRequestHandler<Boolean> handler) -
requestBackgroundLocationPermission
public void requestBackgroundLocationPermission(String rationaleTitle, String rationaleMessage, OkHiRequestHandler<Boolean> handler) -
requestBackgroundLocationPermission
-
requestLocationPermission
-
openProtectedAppsSettings
public static void openProtectedAppsSettings(android.app.Activity activity, int requestCode) throws OkHiException - Throws:
OkHiException
-
canOpenProtectedApps
-
isNotificationPermissionGranted
public static boolean isNotificationPermissionGranted(android.content.Context context) -
requestNotificationPermission
-