Don't show taskbar when keyguard occluded

* Show only back button in taskbar for 3
button nav.

Fixes: 199406716
Test: From lock screen view home controls
or double-tap camera, no taskbar shown.

Change-Id: Ia603c7dbe584e3fab62365de4fc5a790c48d1340
This commit is contained in:
Vinit Nayak
2021-09-23 15:32:38 -07:00
parent e37b51b30f
commit ea7e9a48fd
2 changed files with 18 additions and 10 deletions

View File

@@ -75,9 +75,10 @@ public class NavbarButtonsViewController {
private static final int FLAG_A11Y_VISIBLE = 1 << 3;
private static final int FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE = 1 << 4;
private static final int FLAG_KEYGUARD_VISIBLE = 1 << 5;
private static final int FLAG_DISABLE_HOME = 1 << 6;
private static final int FLAG_DISABLE_RECENTS = 1 << 7;
private static final int FLAG_DISABLE_BACK = 1 << 8;
private static final int FLAG_KEYGUARD_OCCLUDED = 1 << 6;
private static final int FLAG_DISABLE_HOME = 1 << 7;
private static final int FLAG_DISABLE_RECENTS = 1 << 8;
private static final int FLAG_DISABLE_BACK = 1 << 9;
private static final int MASK_IME_SWITCHER_VISIBLE = FLAG_SWITCHER_SUPPORTED | FLAG_IME_VISIBLE;
@@ -188,10 +189,11 @@ public class NavbarButtonsViewController {
mPropertyHolders.add(new StatePropertyHolder(
mBackButton, flags -> (flags & FLAG_IME_VISIBLE) != 0, View.ROTATION,
isRtl ? 90 : -90, 0));
// Hide when keyguard is showing, show when bouncer is showing
// Hide when keyguard is showing, show when bouncer or lock screen app is showing
mPropertyHolders.add(new StatePropertyHolder(mBackButton,
flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0 ||
(flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0));
(flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0 ||
(flags & FLAG_KEYGUARD_OCCLUDED) != 0));
// home and recents buttons
View homeButton = addButton(R.drawable.ic_sysbar_home, BUTTON_HOME, navContainer,
@@ -256,10 +258,12 @@ public class NavbarButtonsViewController {
}
/**
* Slightly misnamed, but should be called when keyguard OR AOD is showing
* Slightly misnamed, but should be called when keyguard OR AOD is showing.
* We consider keyguardVisible when it's showing bouncer OR is occlucded by another app
*/
public void setKeyguardVisible(boolean isKeyguardVisible) {
updateStateForFlag(FLAG_KEYGUARD_VISIBLE, isKeyguardVisible);
public void setKeyguardVisible(boolean isKeyguardVisible, boolean isKeyguardOccluded) {
updateStateForFlag(FLAG_KEYGUARD_VISIBLE, isKeyguardVisible || isKeyguardOccluded);
updateStateForFlag(FLAG_KEYGUARD_OCCLUDED, isKeyguardOccluded);
applyState();
}