Track immersive mode via a new SysUI state.
Test: manual Bug: 203748818 Change-Id: Iae29044fd1962391a6bd0390dcb7870ced2b3efb
This commit is contained in:
@@ -120,6 +120,8 @@ public class QuickStepContract {
|
||||
public static final int SYSUI_STATE_BACK_DISABLED = 1 << 22;
|
||||
// The bubble stack is expanded AND the mange menu for bubbles is expanded on top of it.
|
||||
public static final int SYSUI_STATE_BUBBLES_MANAGE_MENU_EXPANDED = 1 << 23;
|
||||
// The current app is in immersive mode
|
||||
public static final int SYSUI_STATE_IMMERSIVE_MODE = 1 << 24;
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({SYSUI_STATE_SCREEN_PINNING,
|
||||
@@ -145,7 +147,8 @@ public class QuickStepContract {
|
||||
SYSUI_STATE_IME_SWITCHER_SHOWING,
|
||||
SYSUI_STATE_DEVICE_DOZING,
|
||||
SYSUI_STATE_BACK_DISABLED,
|
||||
SYSUI_STATE_BUBBLES_MANAGE_MENU_EXPANDED
|
||||
SYSUI_STATE_BUBBLES_MANAGE_MENU_EXPANDED,
|
||||
SYSUI_STATE_IMMERSIVE_MODE
|
||||
})
|
||||
public @interface SystemUiStateFlags {}
|
||||
|
||||
@@ -179,6 +182,7 @@ public class QuickStepContract {
|
||||
str.add((flags & SYSUI_STATE_BACK_DISABLED) != 0 ? "back_disabled" : "");
|
||||
str.add((flags & SYSUI_STATE_BUBBLES_MANAGE_MENU_EXPANDED) != 0
|
||||
? "bubbles_mange_menu_expanded" : "");
|
||||
str.add((flags & SYSUI_STATE_IMMERSIVE_MODE) != 0 ? "immersive_mode" : "");
|
||||
return str.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_B
|
||||
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_HOME_DISABLED;
|
||||
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING;
|
||||
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SWITCHER_SHOWING;
|
||||
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IMMERSIVE_MODE;
|
||||
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NAV_BAR_HIDDEN;
|
||||
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED;
|
||||
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING;
|
||||
@@ -304,6 +305,7 @@ public class TaskbarDelegate implements CommandQueue.Callbacks,
|
||||
allowSystemGestureIgnoringBarVisibility())
|
||||
.setFlag(SYSUI_STATE_SCREEN_PINNING,
|
||||
ActivityManagerWrapper.getInstance().isScreenPinningActive())
|
||||
.setFlag(SYSUI_STATE_IMMERSIVE_MODE, isImmersiveMode())
|
||||
.commitUpdate(mDisplayId);
|
||||
}
|
||||
|
||||
@@ -445,6 +447,10 @@ public class TaskbarDelegate implements CommandQueue.Callbacks,
|
||||
return mBehavior != BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE;
|
||||
}
|
||||
|
||||
private boolean isImmersiveMode() {
|
||||
return mBehavior == BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfigurationChanged(Configuration configuration) {
|
||||
mEdgeBackGestureHandler.onConfigurationChanged(configuration);
|
||||
|
||||
Reference in New Issue
Block a user