diff options
| author | justinzhang <justinzhang@google.com> | 2014-05-08 20:35:12 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-05-08 20:35:12 +0000 |
| commit | ed32c842c6d0cc31587256bfbfc2693588ee556c (patch) | |
| tree | cd8af6e14eeed2947b1a8f56d5b673a64758b11b /core/java/android/app | |
| parent | 3b1ae5e40b9bcdec8ecf1cdeb01fd9f834825a58 (diff) | |
| parent | 511e0d8323d2d2ed341ba40b15bc646e134ac03b (diff) | |
| download | frameworks_base-ed32c842c6d0cc31587256bfbfc2693588ee556c.zip frameworks_base-ed32c842c6d0cc31587256bfbfc2693588ee556c.tar.gz frameworks_base-ed32c842c6d0cc31587256bfbfc2693588ee556c.tar.bz2 | |
Merge "DevicePolicyManager Authentication for Lock Task"
Diffstat (limited to 'core/java/android/app')
| -rw-r--r-- | core/java/android/app/admin/DevicePolicyManager.java | 47 | ||||
| -rw-r--r-- | core/java/android/app/admin/IDevicePolicyManager.aidl | 4 |
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); } |
