summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);