diff options
| author | Jason Monk <jmonk@google.com> | 2014-05-07 19:18:22 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-05-07 19:18:23 +0000 |
| commit | 01d1d907530e23f5e86edabada9c354420277df0 (patch) | |
| tree | 0a6f552b19d66d81d91a70dfd0e84245147e64ac /core | |
| parent | 9d75ccb6a1b3b300c33ce3ceab5eaece0ad55d42 (diff) | |
| parent | a57e5e006bb7c60d0eb77d4ecf43d658b80f9d1f (diff) | |
| download | frameworks_base-01d1d907530e23f5e86edabada9c354420277df0.zip frameworks_base-01d1d907530e23f5e86edabada9c354420277df0.tar.gz frameworks_base-01d1d907530e23f5e86edabada9c354420277df0.tar.bz2 | |
Merge "Make Lock Task API public."
Diffstat (limited to 'core')
| -rw-r--r-- | core/java/android/app/Activity.java | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index af3a92c..4df486a 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -29,6 +29,7 @@ import com.android.internal.policy.PolicyManager; import android.annotation.IntDef; import android.annotation.Nullable; +import android.app.admin.DevicePolicyManager; import android.content.ComponentCallbacks2; import android.content.ComponentName; import android.content.ContentResolver; @@ -5689,7 +5690,16 @@ public class Activity extends ContextThemeWrapper } } - /** @hide */ + /** + * Put this Activity in a mode where the user is locked to the + * current task. + * + * This will prevent the user from launching other apps, going to settings, + * or reaching the home screen. + * + * Lock task mode will only start if the activity has been whitelisted by the + * Device Owner through {@link DevicePolicyManager#setLockTaskComponents}. + */ public void startLockTask() { try { ActivityManagerNative.getDefault().startLockTaskMode(mToken); @@ -5697,7 +5707,15 @@ public class Activity extends ContextThemeWrapper } } - /** @hide */ + /** + * Allow the user to switch away from the current task. + * + * Called to end the mode started by {@link Activity#startLockTask}. This + * can only be called by activities that have successfully called + * startLockTask previously. + * + * This will allow the user to exit this app and move onto other activities. + */ public void stopLockTask() { try { ActivityManagerNative.getDefault().stopLockTaskMode(); |
