public abstract class RestrictionsReceiver extends BroadcastReceiver
DevicePolicyManager.setRestrictionsProvider(ComponentName, ComponentName)
.
The function of a Restrictions Provider is to transport permission requests from apps on this
device to an administrator (most likely on a remote device or computer) and deliver back
responses. The response should be sent back to the app via
RestrictionsManager.notifyPermissionResponse(String, PersistableBundle)
.
RestrictionsManager
BroadcastReceiver.PendingResult
Constructor and Description |
---|
RestrictionsReceiver() |
Modifier and Type | Method and Description |
---|---|
void |
onReceive(Context context,
Intent intent)
Intercept standard Restrictions Provider broadcasts.
|
abstract void |
onRequestPermission(Context context,
String packageName,
String requestType,
String requestId,
PersistableBundle request)
An asynchronous permission request made by an application for an operation that requires
authorization by a local or remote administrator other than the user.
|
abortBroadcast, clearAbortBroadcast, getAbortBroadcast, getDebugUnregister, getPendingResult, getResultCode, getResultData, getResultExtras, getSendingUserId, goAsync, isInitialStickyBroadcast, isOrderedBroadcast, peekService, setDebugUnregister, setOrderedHint, setPendingResult, setResult, setResultCode, setResultData, setResultExtras
public abstract void onRequestPermission(Context context, String packageName, String requestType, String requestId, PersistableBundle request)
If the request bundle contains the key RestrictionsManager.REQUEST_KEY_NEW_REQUEST
,
then a new request must be sent. Otherwise the provider can look up any previous response
to the same requestId and return the cached response.
packageName
- the application requesting permission.requestType
- the type of request, which determines the content and presentation of
the request data.request
- the request data bundle containing at a minimum a request id.RestrictionsManager.REQUEST_TYPE_APPROVAL
,
RestrictionsManager#REQUEST_TYPE_LOCAL_APPROVAL
,
RestrictionsManager.REQUEST_KEY_ID
public void onReceive(Context context, Intent intent)
onReceive
in class BroadcastReceiver
context
- The Context in which the receiver is running.intent
- The Intent being received.