DeviceLockManager.ClearDeviceRestrictions(IExecutor, IOutcomeReceiver) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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:
- Disable debugging features (DisallowDebuggingFeatures, depending on the configuration and build)
- Disable installing from unknown sources (DisallowInstallUnknownSources, when configured in the backend)
- Disable outgoing calls (DisallowOutgoingCalls, when configured in the backend and the device is locked)
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:
SecurityExceptionif the caller is missing the ManageDeviceLockState permission.IllegalStateExceptionif the device has already been cleared or if policies could not be enforced for the clear state.java.util.concurrent.TimeoutExceptionif the response from the underlying binder call is not received within the specified duration (10 seconds).
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.