summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/admin/DevicePolicyManager.java47
-rw-r--r--core/java/android/app/admin/IDevicePolicyManager.aidl4
2 files changed, 51 insertions, 0 deletions
diff --git a/core/java/android/app/admin/DevicePolicyManager.java b/core/java/android/app/admin/DevicePolicyManager.java
index 61ff60a..24bb2cc 100644
--- a/core/java/android/app/admin/DevicePolicyManager.java
+++ b/core/java/android/app/admin/DevicePolicyManager.java
@@ -2125,4 +2125,51 @@ public class DevicePolicyManager {
return null;
}
+
+ /**
+ * Sets which components may enter lock task mode.
+ *
+ * This function can only be called by the device owner or the profile owner.
+ * @param components The list of components allowed to enter lock task mode
+ */
+ public void setLockTaskComponents(ComponentName[] components) throws SecurityException {
+ if (mService != null) {
+ try {
+ mService.setLockTaskComponents(components);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed talking with device policy service", e);
+ }
+ }
+ }
+
+ /**
+ * This function returns the list of components allowed to start the lock task mode.
+ * @hide
+ */
+ public ComponentName[] getLockTaskComponents() {
+ if (mService != null) {
+ try {
+ return mService.getLockTaskComponents();
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed talking with device policy service", e);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * This function lets the caller know whether the given component is allowed to start the
+ * lock task mode.
+ * @param component The component to check
+ */
+ public boolean isLockTaskPermitted(ComponentName component) {
+ if (mService != null) {
+ try {
+ return mService.isLockTaskPermitted(component);
+ } catch (RemoteException e) {
+ Log.w(TAG, "Failed talking with device policy service", e);
+ }
+ }
+ return false;
+ }
}
diff --git a/core/java/android/app/admin/IDevicePolicyManager.aidl b/core/java/android/app/admin/IDevicePolicyManager.aidl
index 0096580..03ced0f 100644
--- a/core/java/android/app/admin/IDevicePolicyManager.aidl
+++ b/core/java/android/app/admin/IDevicePolicyManager.aidl
@@ -129,4 +129,8 @@ interface IDevicePolicyManager {
void setAccountManagementDisabled(in ComponentName who, in String accountType, in boolean disabled);
String[] getAccountTypesWithManagementDisabled();
+
+ void setLockTaskComponents(in ComponentName[] components);
+ ComponentName[] getLockTaskComponents();
+ boolean isLockTaskPermitted(in ComponentName component);
}