Class Overview
Abstract implementation of a Restrictions Provider BroadcastReceiver. To implement a
Restrictions Provider, extend from this class and implement the abstract methods.
Export this receiver in the manifest. A profile owner device admin can then register this
component as a Restrictions Provider using
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
notifyPermissionResponse(String, PersistableBundle)
.
Summary
[Expand]
Inherited Methods |
From class
android.content.BroadcastReceiver
final
void
|
abortBroadcast()
Sets the flag indicating that this receiver should abort the
current broadcast; only works with broadcasts sent through
Context.sendOrderedBroadcast .
|
final
void
|
clearAbortBroadcast()
Clears the flag indicating that this receiver should abort the current
broadcast.
|
final
boolean
|
getAbortBroadcast()
Returns the flag indicating whether or not this receiver should
abort the current broadcast.
|
final
boolean
|
getDebugUnregister()
|
final
int
|
getResultCode()
Retrieve the current result code, as set by the previous receiver.
|
final
String
|
getResultData()
Retrieve the current result data, as set by the previous receiver.
|
final
Bundle
|
getResultExtras(boolean makeMap)
Retrieve the current result extra data, as set by the previous receiver.
|
final
BroadcastReceiver.PendingResult
|
goAsync()
This can be called by an application in onReceive(Context, Intent) to allow
it to keep the broadcast active after returning from that function.
|
final
boolean
|
isInitialStickyBroadcast()
Returns true if the receiver is currently processing the initial
value of a sticky broadcast -- that is, the value that was last
broadcast and is currently held in the sticky cache, so this is
not directly the result of a broadcast right now.
|
final
boolean
|
isOrderedBroadcast()
Returns true if the receiver is currently processing an ordered
broadcast.
|
abstract
void
|
onReceive(Context context, Intent intent)
This method is called when the BroadcastReceiver is receiving an Intent
broadcast.
|
IBinder
|
peekService(Context myContext, Intent service)
Provide a binder to an already-running service.
|
final
void
|
setDebugUnregister(boolean debug)
|
final
void
|
setOrderedHint(boolean isOrdered)
For internal use, sets the hint about whether this BroadcastReceiver is
running in ordered mode.
|
final
void
|
setResult(int code, String data, Bundle extras)
|
final
void
|
setResultCode(int code)
|
final
void
|
setResultData(String data)
|
final
void
|
setResultExtras(Bundle extras)
|
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
Public Constructors
public
RestrictionsReceiver
()
Public Methods
public
void
onReceive
(Context context, Intent intent)
Intercept standard Restrictions Provider broadcasts. Implementations
should not override this method; it is better to implement the
convenience callbacks for each action.
Parameters
context
| The Context in which the receiver is running. |
intent
| The Intent being received.
|
public
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. The Restrictions
Provider should transfer the request to the administrator and deliver back a response, when
available. The calling application is aware that the response could take an indefinite
amount of time.
If the request bundle contains the key 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.
Parameters
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. |