summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorMaurice Lam <yukl@google.com>2014-04-28 18:24:28 -0700
committerMaurice Lam <yukl@google.com>2014-05-20 09:38:22 -0700
commit99c6e072aa6681b581a4c2308d7cd4a72948e27c (patch)
tree81940cf164ec14d0c5be2e2f19bb17e7fd703e1f /policy
parent77bc0a17e8668945548f3b4936e4888ec3eb189e (diff)
downloadframeworks_base-99c6e072aa6681b581a4c2308d7cd4a72948e27c.zip
frameworks_base-99c6e072aa6681b581a4c2308d7cd4a72948e27c.tar.gz
frameworks_base-99c6e072aa6681b581a4c2308d7cd4a72948e27c.tar.bz2
Disable swipe-to-reveal nav bar / status bar during setup
Make the system refuse to show system navigation bar when immersive mode is on before finishing setup. Change-Id: Id6383e13bdb7e4c4b93b2fbaf83c154c387af694
Diffstat (limited to 'policy')
-rw-r--r--policy/src/com/android/internal/policy/impl/ImmersiveModeConfirmation.java5
-rw-r--r--policy/src/com/android/internal/policy/impl/PhoneWindowManager.java12
2 files changed, 14 insertions, 3 deletions
diff --git a/policy/src/com/android/internal/policy/impl/ImmersiveModeConfirmation.java b/policy/src/com/android/internal/policy/impl/ImmersiveModeConfirmation.java
index 5602206..a4c2ddd 100644
--- a/policy/src/com/android/internal/policy/impl/ImmersiveModeConfirmation.java
+++ b/policy/src/com/android/internal/policy/impl/ImmersiveModeConfirmation.java
@@ -115,13 +115,14 @@ public class ImmersiveModeConfirmation {
}
}
- public void immersiveModeChanged(String pkg, boolean isImmersiveMode) {
+ public void immersiveModeChanged(String pkg, boolean isImmersiveMode,
+ boolean userSetupComplete) {
mHandler.removeMessages(H.SHOW);
if (isImmersiveMode) {
final boolean disabled = PolicyControl.disableImmersiveConfirmation(pkg);
if (DEBUG) Slog.d(TAG, String.format("immersiveModeChanged() disabled=%s mConfirmed=%s",
disabled, mConfirmed));
- if (!disabled && (DEBUG_SHOW_EVERY_TIME || !mConfirmed)) {
+ if (!disabled && (DEBUG_SHOW_EVERY_TIME || !mConfirmed) && userSetupComplete) {
mHandler.sendEmptyMessageDelayed(H.SHOW, mShowDelayMs);
}
} else {
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
index 6390a69..d0305e0 100644
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -775,6 +775,11 @@ public class PhoneWindowManager implements WindowManagerPolicy {
mContext.getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 0) != 0;
}
+ boolean isUserSetupComplete() {
+ return Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.USER_SETUP_COMPLETE, 0, UserHandle.USER_CURRENT) != 0;
+ }
+
private void handleLongPressOnHome() {
if (mLongPressOnHomeBehavior != LONG_PRESS_HOME_NOTHING) {
mHomeConsumed = true;
@@ -4294,6 +4299,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
private void requestTransientBars(WindowState swipeTarget) {
synchronized (mWindowManagerFuncs.getWindowManagerLock()) {
+ if (!isUserSetupComplete()) {
+ // Swipe-up for navigation bar is disabled during setup
+ return;
+ }
boolean sb = mStatusBarController.checkShowTransientBarLw();
boolean nb = mNavigationBarController.checkShowTransientBarLw();
if (sb || nb) {
@@ -5270,7 +5279,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
boolean newImmersiveMode = isImmersiveMode(vis);
if (win != null && oldImmersiveMode != newImmersiveMode) {
final String pkg = win.getOwningPackage();
- mImmersiveModeConfirmation.immersiveModeChanged(pkg, newImmersiveMode);
+ mImmersiveModeConfirmation.immersiveModeChanged(pkg, newImmersiveMode,
+ isUserSetupComplete());
}
vis = mNavigationBarController.updateVisibilityLw(transientNavBarAllowed, oldVis, vis);