Show navbar on lock screen if gestural nav
Fixes: 129854083 Test: switch nav model, to go lock screen, unlock Test: switch nav model, receive notification Test: switch nav model, dock device Change-Id: I9f0118af93924c733a7ee17f50158bbe099edc18
This commit is contained in:
@@ -1152,7 +1152,6 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
if (mBrightnessMirrorController != null) {
|
||||
mBrightnessMirrorController.onDensityOrFontScaleChanged();
|
||||
}
|
||||
mStatusBarKeyguardViewManager.onDensityOrFontScaleChanged();
|
||||
// TODO: Bring these out of StatusBar.
|
||||
((UserInfoControllerImpl) Dependency.get(UserInfoController.class))
|
||||
.onDensityOrFontScaleChanged();
|
||||
@@ -3949,6 +3948,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
}
|
||||
|
||||
private void setPulsing(boolean pulsing) {
|
||||
mStatusBarKeyguardViewManager.setPulsing(pulsing);
|
||||
mKeyguardViewMediator.setPulsing(pulsing);
|
||||
mNotificationPanel.setPulsing(pulsing);
|
||||
mVisualStabilityManager.setPulsing(pulsing);
|
||||
|
||||
@@ -40,14 +40,18 @@ import com.android.keyguard.KeyguardUpdateMonitorCallback;
|
||||
import com.android.keyguard.ViewMediatorCallback;
|
||||
import com.android.systemui.DejankUtils;
|
||||
import com.android.systemui.Dependency;
|
||||
import com.android.systemui.SysUiServiceProvider;
|
||||
import com.android.systemui.SystemUIFactory;
|
||||
import com.android.systemui.dock.DockManager;
|
||||
import com.android.systemui.keyguard.DismissCallbackRegistry;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.shared.system.QuickStepContract;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
import com.android.systemui.statusbar.NotificationMediaManager;
|
||||
import com.android.systemui.statusbar.RemoteInputController;
|
||||
import com.android.systemui.statusbar.SysuiStatusBarStateController;
|
||||
import com.android.systemui.statusbar.phone.KeyguardBouncer.BouncerExpansionCallback;
|
||||
import com.android.systemui.statusbar.policy.ConfigurationController;
|
||||
import com.android.systemui.statusbar.policy.KeyguardMonitor;
|
||||
import com.android.systemui.statusbar.policy.KeyguardMonitorImpl;
|
||||
|
||||
@@ -61,7 +65,7 @@ import java.util.ArrayList;
|
||||
* {@link com.android.keyguard.KeyguardViewBase}.
|
||||
*/
|
||||
public class StatusBarKeyguardViewManager implements RemoteInputController.Callback,
|
||||
StatusBarStateController.StateListener {
|
||||
StatusBarStateController.StateListener, ConfigurationController.ConfigurationListener {
|
||||
|
||||
// When hiding the Keyguard with timing supplied from WindowManager, better be early than late.
|
||||
private static final long HIDE_TIMING_CORRECTION_MS = - 16 * 3;
|
||||
@@ -105,6 +109,18 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
mNotificationPanelView.updateLockIcon();
|
||||
}
|
||||
};
|
||||
private final DockManager.DockEventListener mDockEventListener =
|
||||
new DockManager.DockEventListener() {
|
||||
@Override
|
||||
public void onEvent(int event) {
|
||||
boolean isDocked = mDockManager.isDocked();
|
||||
if (isDocked == mIsDocked) {
|
||||
return;
|
||||
}
|
||||
mIsDocked = isDocked;
|
||||
updateStates();
|
||||
}
|
||||
};
|
||||
|
||||
protected LockPatternUtils mLockPatternUtils;
|
||||
protected ViewMediatorCallback mViewMediatorCallback;
|
||||
@@ -119,6 +135,9 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
protected boolean mOccluded;
|
||||
protected boolean mRemoteInputActive;
|
||||
private boolean mDozing;
|
||||
private boolean mPulsing;
|
||||
private boolean mGesturalNav;
|
||||
private boolean mIsDocked;
|
||||
|
||||
protected boolean mFirstUpdate = true;
|
||||
protected boolean mLastShowing;
|
||||
@@ -127,6 +146,9 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
private boolean mLastBouncerDismissible;
|
||||
protected boolean mLastRemoteInputActive;
|
||||
private boolean mLastDozing;
|
||||
private boolean mLastGesturalNav;
|
||||
private boolean mLastIsDocked;
|
||||
private boolean mLastPulsing;
|
||||
private int mLastBiometricMode;
|
||||
private boolean mGoingToSleepVisibleNotOccluded;
|
||||
|
||||
@@ -139,6 +161,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
(KeyguardMonitorImpl) Dependency.get(KeyguardMonitor.class);
|
||||
private final NotificationMediaManager mMediaManager =
|
||||
Dependency.get(NotificationMediaManager.class);
|
||||
private final DockManager mDockManager;
|
||||
|
||||
private final KeyguardUpdateMonitorCallback mUpdateMonitorCallback =
|
||||
new KeyguardUpdateMonitorCallback() {
|
||||
@@ -159,8 +182,15 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
mViewMediatorCallback = callback;
|
||||
mLockPatternUtils = lockPatternUtils;
|
||||
mStatusBarWindowController = Dependency.get(StatusBarWindowController.class);
|
||||
mGesturalNav = QuickStepContract.isGesturalMode(context);
|
||||
KeyguardUpdateMonitor.getInstance(context).registerCallback(mUpdateMonitorCallback);
|
||||
Dependency.get(StatusBarStateController.class).addCallback(this);
|
||||
Dependency.get(ConfigurationController.class).addCallback(this);
|
||||
mDockManager = SysUiServiceProvider.getComponent(context, DockManager.class);
|
||||
if (mDockManager != null) {
|
||||
mDockManager.addListener(mDockEventListener);
|
||||
mIsDocked = mDockManager.isDocked();
|
||||
}
|
||||
}
|
||||
|
||||
public void registerStatusBar(StatusBar statusBar,
|
||||
@@ -241,6 +271,9 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
}
|
||||
|
||||
private void hideBouncer(boolean destroyView) {
|
||||
if (mBouncer == null) {
|
||||
return;
|
||||
}
|
||||
mBouncer.hide(destroyView);
|
||||
cancelPendingWakeupAction();
|
||||
}
|
||||
@@ -354,6 +387,16 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* If {@link StatusBar} is pulsing.
|
||||
*/
|
||||
public void setPulsing(boolean pulsing) {
|
||||
if (mPulsing != pulsing) {
|
||||
mPulsing = pulsing;
|
||||
updateStates();
|
||||
}
|
||||
}
|
||||
|
||||
public void setNeedsInput(boolean needsInput) {
|
||||
mStatusBarWindowController.setKeyguardNeedsInput(needsInput);
|
||||
}
|
||||
@@ -492,10 +535,20 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
StatsLog.KEYGUARD_STATE_CHANGED__STATE__HIDDEN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDensityOrFontScaleChanged() {
|
||||
hideBouncer(true /* destroyView */);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOverlayChanged() {
|
||||
boolean gesturalNav = QuickStepContract.isGesturalMode(mContext);
|
||||
if (gesturalNav != mGesturalNav) {
|
||||
mGesturalNav = gesturalNav;
|
||||
updateStates();
|
||||
}
|
||||
}
|
||||
|
||||
public void onThemeChanged() {
|
||||
hideBouncer(true /* destroyView */);
|
||||
mBouncer.prepare();
|
||||
@@ -643,7 +696,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
mLastBouncerDismissible = bouncerDismissible;
|
||||
mLastRemoteInputActive = remoteInputActive;
|
||||
mLastDozing = mDozing;
|
||||
mLastPulsing = mPulsing;
|
||||
mLastBiometricMode = mBiometricUnlockController.getMode();
|
||||
mLastGesturalNav = mGesturalNav;
|
||||
mLastIsDocked = mIsDocked;
|
||||
mStatusBar.onKeyguardViewManagerStatesUpdated();
|
||||
}
|
||||
|
||||
@@ -671,8 +727,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
int biometricMode = mBiometricUnlockController.getMode();
|
||||
boolean keyguardShowing = mShowing && !mOccluded;
|
||||
boolean hideWhileDozing = mDozing && biometricMode != MODE_WAKE_AND_UNLOCK_PULSING;
|
||||
boolean keyguardWithGestureNav = (keyguardShowing && !mDozing || mPulsing && !mIsDocked)
|
||||
&& mGesturalNav;
|
||||
return (!keyguardShowing && !hideWhileDozing || mBouncer.isShowing()
|
||||
|| mRemoteInputActive);
|
||||
|| mRemoteInputActive || keyguardWithGestureNav);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -681,8 +739,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
|
||||
protected boolean getLastNavBarVisible() {
|
||||
boolean keyguardShowing = mLastShowing && !mLastOccluded;
|
||||
boolean hideWhileDozing = mLastDozing && mLastBiometricMode != MODE_WAKE_AND_UNLOCK_PULSING;
|
||||
boolean keyguardWithGestureNav = (keyguardShowing && !mLastDozing
|
||||
|| mLastPulsing && !mLastIsDocked) && mLastGesturalNav;
|
||||
return (!keyguardShowing && !hideWhileDozing || mLastBouncerShowing
|
||||
|| mLastRemoteInputActive);
|
||||
|| mLastRemoteInputActive || keyguardWithGestureNav);
|
||||
}
|
||||
|
||||
public boolean shouldDismissOnMenuPressed() {
|
||||
|
||||
Reference in New Issue
Block a user