From 73c2aee40a0e0ab2e8bd2bbbc560aa31c38eaac2 Mon Sep 17 00:00:00 2001 From: Christopher Tate Date: Thu, 15 Mar 2012 16:27:14 -0700 Subject: Make immersive mode public & imply update locking Activity.setImmersive(boolean) / android:immersive="bool" are now public. In addition, if the foreground activity is immersive then an update lock will be held on its behalf. This lets applications such as movie players suppress the display of intrusive notifications, OTA-availability dialogs, and the like while they are displaying content that ought not to be rudely interrupted. The update lock aspect of this mode is *advisory*, not binding -- the update mechanism is not actually constrained; it simply uses this information in deciding whether/when to prompt the user. It's more a guideline than a rule. Bug 7681380 Change-Id: I3c412a84cbf3933e3bf0168f2c71c54a86e4b7e5 --- core/java/android/app/Activity.java | 7 +++---- core/java/android/content/pm/ActivityInfo.java | 10 ++++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'core/java') diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 5dc9da2..4f3f245 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -4818,8 +4818,8 @@ public class Activity extends ContextThemeWrapper * android:immersive but may be changed at runtime by * {@link #setImmersive}. * + * @see #setImmersive(boolean) * @see android.content.pm.ActivityInfo#FLAG_IMMERSIVE - * @hide */ public boolean isImmersive() { try { @@ -4831,7 +4831,7 @@ public class Activity extends ContextThemeWrapper /** * Adjust the current immersive mode setting. - * + * * Note that changing this value will have no effect on the activity's * {@link android.content.pm.ActivityInfo} structure; that is, if * android:immersive is set to true @@ -4840,9 +4840,8 @@ public class Activity extends ContextThemeWrapper * always have its {@link android.content.pm.ActivityInfo#FLAG_IMMERSIVE * FLAG_IMMERSIVE} bit set. * - * @see #isImmersive + * @see #isImmersive() * @see android.content.pm.ActivityInfo#FLAG_IMMERSIVE - * @hide */ public void setImmersive(boolean i) { try { diff --git a/core/java/android/content/pm/ActivityInfo.java b/core/java/android/content/pm/ActivityInfo.java index e2ca1dd..8f3b62d 100644 --- a/core/java/android/content/pm/ActivityInfo.java +++ b/core/java/android/content/pm/ActivityInfo.java @@ -161,7 +161,6 @@ public class ActivityInfo extends ComponentInfo */ public static final int FLAG_SHOW_ON_LOCK_SCREEN = 0x0400; /** - * @hide * Bit in {@link #flags} corresponding to an immersive activity * that wishes not to be interrupted by notifications. * Applications that hide the system notification bar with @@ -174,7 +173,14 @@ public class ActivityInfo extends ComponentInfo * {@link #FLAG_IMMERSIVE} set, however, will not be interrupted; the * notification may be shown in some other way (such as a small floating * "toast" window). - * {@see android.app.Notification#FLAG_HIGH_PRIORITY} + * + * Note that this flag will always reflect the Activity's + * android:immersive manifest definition, even if the Activity's + * immersive state is changed at runtime via + * {@link android.app.Activity#setImmersive(boolean)}. + * + * @see android.app.Notification#FLAG_HIGH_PRIORITY + * @see android.app.Activity#setImmersive(boolean) */ public static final int FLAG_IMMERSIVE = 0x0800; /** -- cgit v1.1