Språk

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 used to invoke OnResult(Object). OnError(Object) may be invoked without this executor.

callback
IOutcomeReceiver

The receiver for a successful result 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 through 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(IExecutor, IOutcomeReceiver)) if payments are missed and unlock (using UnlockDevice(IExecutor, IOutcomeReceiver)) once they are resumed.

The Device Lock solution can also put in place additional restrictions when a device is enrolled in the program, including:

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

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

Exceptions that can be passed to the callback's OnError(Object) method:

  • SecurityException if the caller is missing the ManageDeviceLockState permission.
  • IllegalStateException if the device has already been cleared or if policies could not be enforced for the clear state.
  • java.util.concurrent.TimeoutException if the response from the underlying binder call is not received within the specified duration (10 seconds).

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