DeviceLockManager.ClearDeviceRestrictions(IExecutor, IOutcomeReceiver) Method

Definition

Clear device restrictions.

[Android.Runtime.Register("clearDeviceRestrictions", "(Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=36)]
[Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_LOCK_STATE")]
public void ClearDeviceRestrictions(Java.Util.Concurrent.IExecutor executor, Android.OS.IOutcomeReceiver callback);
[<Android.Runtime.Register("clearDeviceRestrictions", "(Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=36)>]
[<Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_LOCK_STATE")>]
member this.ClearDeviceRestrictions : Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit

Parameters

executor
IExecutor

the Executor on which to invoke the callback.

callback
IOutcomeReceiver

this returns either success or an exception.

Attributes

Remarks

Clear device restrictions.

After a device determines that it's part of a program (e.g. financing) by checking in with the device lock backend, it will go though a provisioning flow and install a kiosk app.

At this point, the device is "restricted" and the creditor kiosk app is able to lock the device. For example, a creditor kiosk app in a financing use case may lock the device (using #lockDevice) if payments are missed and unlock (using #unlockDevice)) once they are resumed.

The Device Lock solution will also put in place some additional restrictions when a device is enrolled in the program, namely:

<ul> <li>Disable debugging features (android.os.UserManager#DISALLOW_DEBUGGING_FEATURES) <li>Disable installing from unknown sources (android.os.UserManager#DISALLOW_INSTALL_UNKNOWN_SOURCES, when configured in the backend) <li>Disable outgoing calls (android.os.UserManager#DISALLOW_OUTGOING_CALLS, when configured in the backend and the device is locked) </ul>

Once the program is completed (e.g. the device has been fully paid off), the kiosk app can use the #clearDeviceRestrictions API to lift the above restrictions.

At this point, the kiosk app has relinquished its ability to lock the device.

Exceptions that can be returned through the ParcelableException on the callback's onError method: <ul> <li>SecurityException if the caller is missing the android.android.Manifest.permission.MANAGE_DEVICE_LOCK_STATE permission. <li>IllegalStateException if the device has already been cleared or if policies could not be enforced for the clear state. <li>java.util.concurrent.TimeoutException if the response from the underlying binder call is not received within the specified duration (10 seconds). </ul>

Java documentation for android.devicelock.DeviceLockManager.clearDeviceRestrictions(java.util.concurrent.Executor, android.os.OutcomeReceiver<java.lang.Void, java.lang.Exception>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to