diff options
| author | Jason Monk <jmonk@google.com> | 2014-05-07 10:06:48 -0400 |
|---|---|---|
| committer | Jason Monk <jmonk@google.com> | 2014-05-07 15:15:53 -0400 |
| commit | a57e5e006bb7c60d0eb77d4ecf43d658b80f9d1f (patch) | |
| tree | 1d5f35a025d5b250c1a84933cd8b84b911d3f9ba /core | |
| parent | 627aad9c200cb19aa505504dcd232a3710e96a25 (diff) | |
| download | frameworks_base-a57e5e006bb7c60d0eb77d4ecf43d658b80f9d1f.zip frameworks_base-a57e5e006bb7c60d0eb77d4ecf43d658b80f9d1f.tar.gz frameworks_base-a57e5e006bb7c60d0eb77d4ecf43d658b80f9d1f.tar.bz2 | |
Make Lock Task API public.
Change-Id: Ieaf944dc69e206e091d8257e0f92013b082ceaac
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 8981c88..2dfa500 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; @@ -5680,7 +5681,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); @@ -5688,7 +5698,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(); |
