public final class RuntimePermissionPresenter extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RuntimePermissionPresenter.OnResultCallback
Listener for delivering a result.
|
Modifier and Type | Field and Description |
---|---|
static String |
KEY_RESULT
The key for retrieving the result from the returned bundle.
|
Modifier and Type | Method and Description |
---|---|
void |
getAppPermissions(String packageName,
RuntimePermissionPresenter.OnResultCallback callback,
Handler handler)
Gets the runtime permissions for an app.
|
void |
getAppsUsingPermissions(boolean system,
RuntimePermissionPresenter.OnResultCallback callback,
Handler handler)
Gets the system apps that use runtime permissions.
|
static RuntimePermissionPresenter |
getInstance(Context context)
Gets the singleton runtime permission presenter.
|
public static final String KEY_RESULT
public static RuntimePermissionPresenter getInstance(Context context)
context
- Context for accessing resources.public void getAppPermissions(String packageName, RuntimePermissionPresenter.OnResultCallback callback, Handler handler)
packageName
- The package for which to query.callback
- Callback to receive the result.handler
- Handler on which to invoke the callback.public void getAppsUsingPermissions(boolean system, RuntimePermissionPresenter.OnResultCallback callback, Handler handler)
system
- If true only system apps are returned otherwise only
non-system ones are returned.callback
- Callback to receive the result.handler
- Handler on which to invoke the callback.