Merge "Pass nav button disable and AOD events to launcher" into sc-v2-dev
This commit is contained in:
@@ -114,6 +114,8 @@ public class QuickStepContract {
|
|||||||
public static final int SYSUI_STATE_MAGNIFICATION_OVERLAP = 1 << 19;
|
public static final int SYSUI_STATE_MAGNIFICATION_OVERLAP = 1 << 19;
|
||||||
// ImeSwitcher is showing
|
// ImeSwitcher is showing
|
||||||
public static final int SYSUI_STATE_IME_SWITCHER_SHOWING = 1 << 20;
|
public static final int SYSUI_STATE_IME_SWITCHER_SHOWING = 1 << 20;
|
||||||
|
// Device dozing/AOD state
|
||||||
|
public static final int SYSUI_STATE_DEVICE_DOZING = 1 << 21;
|
||||||
|
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@IntDef({SYSUI_STATE_SCREEN_PINNING,
|
@IntDef({SYSUI_STATE_SCREEN_PINNING,
|
||||||
@@ -136,7 +138,8 @@ public class QuickStepContract {
|
|||||||
SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY,
|
SYSUI_STATE_ALLOW_GESTURE_IGNORING_BAR_VISIBILITY,
|
||||||
SYSUI_STATE_IME_SHOWING,
|
SYSUI_STATE_IME_SHOWING,
|
||||||
SYSUI_STATE_MAGNIFICATION_OVERLAP,
|
SYSUI_STATE_MAGNIFICATION_OVERLAP,
|
||||||
SYSUI_STATE_IME_SWITCHER_SHOWING
|
SYSUI_STATE_IME_SWITCHER_SHOWING,
|
||||||
|
SYSUI_STATE_DEVICE_DOZING
|
||||||
})
|
})
|
||||||
public @interface SystemUiStateFlags {}
|
public @interface SystemUiStateFlags {}
|
||||||
|
|
||||||
@@ -166,6 +169,7 @@ public class QuickStepContract {
|
|||||||
str.add((flags & SYSUI_STATE_IME_SHOWING) != 0 ? "ime_visible" : "");
|
str.add((flags & SYSUI_STATE_IME_SHOWING) != 0 ? "ime_visible" : "");
|
||||||
str.add((flags & SYSUI_STATE_MAGNIFICATION_OVERLAP) != 0 ? "magnification_overlap" : "");
|
str.add((flags & SYSUI_STATE_MAGNIFICATION_OVERLAP) != 0 ? "magnification_overlap" : "");
|
||||||
str.add((flags & SYSUI_STATE_IME_SWITCHER_SHOWING) != 0 ? "ime_switcher_showing" : "");
|
str.add((flags & SYSUI_STATE_IME_SWITCHER_SHOWING) != 0 ? "ime_switcher_showing" : "");
|
||||||
|
str.add((flags & SYSUI_STATE_DEVICE_DOZING) != 0 ? "device_dozing" : "");
|
||||||
return str.toString();
|
return str.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ public class SystemActions extends SystemUI {
|
|||||||
mNotificationShadeController = notificationShadeController;
|
mNotificationShadeController = notificationShadeController;
|
||||||
// Saving in instance variable since to prevent GC since
|
// Saving in instance variable since to prevent GC since
|
||||||
// NotificationShadeWindowController.registerCallback() only keeps weak references.
|
// NotificationShadeWindowController.registerCallback() only keeps weak references.
|
||||||
mNotificationShadeCallback = (keyguardShowing, keyguardOccluded, bouncerShowing) ->
|
mNotificationShadeCallback = (keyguardShowing, keyguardOccluded, bouncerShowing, mDozing) ->
|
||||||
registerOrUnregisterDismissNotificationShadeAction();
|
registerOrUnregisterDismissNotificationShadeAction();
|
||||||
mStatusBar = statusBar;
|
mStatusBar = statusBar;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ import com.android.systemui.navigationbar.NavigationBarA11yHelper;
|
|||||||
import com.android.systemui.navigationbar.NavigationBarController;
|
import com.android.systemui.navigationbar.NavigationBarController;
|
||||||
import com.android.systemui.navigationbar.NavigationBarOverlayController;
|
import com.android.systemui.navigationbar.NavigationBarOverlayController;
|
||||||
import com.android.systemui.navigationbar.NavigationModeController;
|
import com.android.systemui.navigationbar.NavigationModeController;
|
||||||
|
import com.android.systemui.navigationbar.TaskbarDelegate;
|
||||||
import com.android.systemui.plugins.PluginInitializerImpl;
|
import com.android.systemui.plugins.PluginInitializerImpl;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
import com.android.systemui.qs.ReduceBrightColorsController;
|
import com.android.systemui.qs.ReduceBrightColorsController;
|
||||||
@@ -233,7 +234,8 @@ public class DependencyProvider {
|
|||||||
UiEventLogger uiEventLogger,
|
UiEventLogger uiEventLogger,
|
||||||
NavigationBarOverlayController navBarOverlayController,
|
NavigationBarOverlayController navBarOverlayController,
|
||||||
ConfigurationController configurationController,
|
ConfigurationController configurationController,
|
||||||
NavigationBarA11yHelper navigationBarA11yHelper) {
|
NavigationBarA11yHelper navigationBarA11yHelper,
|
||||||
|
TaskbarDelegate taskbarDelegate) {
|
||||||
return new NavigationBarController(context,
|
return new NavigationBarController(context,
|
||||||
windowManager,
|
windowManager,
|
||||||
assistManagerLazy,
|
assistManagerLazy,
|
||||||
@@ -259,7 +261,8 @@ public class DependencyProvider {
|
|||||||
uiEventLogger,
|
uiEventLogger,
|
||||||
navBarOverlayController,
|
navBarOverlayController,
|
||||||
configurationController,
|
configurationController,
|
||||||
navigationBarA11yHelper);
|
navigationBarA11yHelper,
|
||||||
|
taskbarDelegate);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
|
|||||||
@@ -153,7 +153,8 @@ public class NavigationBarController implements Callbacks,
|
|||||||
UiEventLogger uiEventLogger,
|
UiEventLogger uiEventLogger,
|
||||||
NavigationBarOverlayController navBarOverlayController,
|
NavigationBarOverlayController navBarOverlayController,
|
||||||
ConfigurationController configurationController,
|
ConfigurationController configurationController,
|
||||||
NavigationBarA11yHelper navigationBarA11yHelper) {
|
NavigationBarA11yHelper navigationBarA11yHelper,
|
||||||
|
TaskbarDelegate taskbarDelegate) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mWindowManager = windowManager;
|
mWindowManager = windowManager;
|
||||||
mAssistManagerLazy = assistManagerLazy;
|
mAssistManagerLazy = assistManagerLazy;
|
||||||
@@ -185,7 +186,8 @@ public class NavigationBarController implements Callbacks,
|
|||||||
mNavBarOverlayController = navBarOverlayController;
|
mNavBarOverlayController = navBarOverlayController;
|
||||||
mNavMode = mNavigationModeController.addListener(this);
|
mNavMode = mNavigationModeController.addListener(this);
|
||||||
mNavigationModeController.addListener(this);
|
mNavigationModeController.addListener(this);
|
||||||
mTaskbarDelegate = new TaskbarDelegate(mOverviewProxyService,
|
mTaskbarDelegate = taskbarDelegate;
|
||||||
|
mTaskbarDelegate.setOverviewProxyService(overviewProxyService,
|
||||||
navigationBarA11yHelper, mSysUiFlagsContainer);
|
navigationBarA11yHelper, mSysUiFlagsContainer);
|
||||||
mIsTablet = isTablet(mContext.getResources().getConfiguration());
|
mIsTablet = isTablet(mContext.getResources().getConfiguration());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,19 +33,26 @@ import com.android.systemui.recents.OverviewProxyService;
|
|||||||
import com.android.systemui.shared.recents.utilities.Utilities;
|
import com.android.systemui.shared.recents.utilities.Utilities;
|
||||||
import com.android.systemui.statusbar.CommandQueue;
|
import com.android.systemui.statusbar.CommandQueue;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
public class TaskbarDelegate implements CommandQueue.Callbacks {
|
public class TaskbarDelegate implements CommandQueue.Callbacks {
|
||||||
|
|
||||||
private final OverviewProxyService mOverviewProxyService;
|
private OverviewProxyService mOverviewProxyService;
|
||||||
private final NavigationBarA11yHelper mNavigationBarA11yHelper;
|
private NavigationBarA11yHelper mNavigationBarA11yHelper;
|
||||||
private final SysUiState mSysUiState;
|
private SysUiState mSysUiState;
|
||||||
private int mDisplayId;
|
private int mDisplayId;
|
||||||
private int mNavigationIconHints;
|
private int mNavigationIconHints;
|
||||||
private final NavigationBarA11yHelper.NavA11yEventListener mNavA11yEventListener =
|
private final NavigationBarA11yHelper.NavA11yEventListener mNavA11yEventListener =
|
||||||
this::updateSysuiFlags;
|
this::updateSysuiFlags;
|
||||||
|
@Inject
|
||||||
|
public TaskbarDelegate() { /* no-op */ }
|
||||||
|
|
||||||
public TaskbarDelegate(OverviewProxyService overviewProxyService,
|
public void setOverviewProxyService(OverviewProxyService overviewProxyService,
|
||||||
NavigationBarA11yHelper navigationBarA11yHelper,
|
NavigationBarA11yHelper navigationBarA11yHelper,
|
||||||
SysUiState sysUiState) {
|
SysUiState sysUiState) {
|
||||||
|
// TODO: adding this in the ctor results in a dagger dependency cycle :(
|
||||||
mOverviewProxyService = overviewProxyService;
|
mOverviewProxyService = overviewProxyService;
|
||||||
mNavigationBarA11yHelper = navigationBarA11yHelper;
|
mNavigationBarA11yHelper = navigationBarA11yHelper;
|
||||||
mSysUiState = sysUiState;
|
mSysUiState = sysUiState;
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SUP
|
|||||||
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYSUI_PROXY;
|
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SYSUI_PROXY;
|
||||||
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_WINDOW_CORNER_RADIUS;
|
import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_WINDOW_CORNER_RADIUS;
|
||||||
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BOUNCER_SHOWING;
|
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BOUNCER_SHOWING;
|
||||||
|
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_DEVICE_DOZING;
|
||||||
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING;
|
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING;
|
||||||
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED;
|
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED;
|
||||||
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_TRACING_ENABLED;
|
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_TRACING_ENABLED;
|
||||||
@@ -736,12 +737,13 @@ public class OverviewProxyService extends CurrentUserTracker implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void onStatusBarStateChanged(boolean keyguardShowing, boolean keyguardOccluded,
|
private void onStatusBarStateChanged(boolean keyguardShowing, boolean keyguardOccluded,
|
||||||
boolean bouncerShowing) {
|
boolean bouncerShowing, boolean isDozing) {
|
||||||
mSysUiState.setFlag(SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING,
|
mSysUiState.setFlag(SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING,
|
||||||
keyguardShowing && !keyguardOccluded)
|
keyguardShowing && !keyguardOccluded)
|
||||||
.setFlag(SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED,
|
.setFlag(SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED,
|
||||||
keyguardShowing && keyguardOccluded)
|
keyguardShowing && keyguardOccluded)
|
||||||
.setFlag(SYSUI_STATE_BOUNCER_SHOWING, bouncerShowing)
|
.setFlag(SYSUI_STATE_BOUNCER_SHOWING, bouncerShowing)
|
||||||
|
.setFlag(SYSUI_STATE_DEVICE_DOZING, isDozing)
|
||||||
.commitUpdate(mContext.getDisplayId());
|
.commitUpdate(mContext.getDisplayId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -967,18 +969,6 @@ public class OverviewProxyService extends CurrentUserTracker implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onRotationProposal(int rotation, boolean isValid) {
|
|
||||||
try {
|
|
||||||
if (mOverviewProxy != null) {
|
|
||||||
mOverviewProxy.onRotationProposal(rotation, isValid);
|
|
||||||
} else {
|
|
||||||
Log.e(TAG_OPS, "Failed to get overview proxy for proposing rotation.");
|
|
||||||
}
|
|
||||||
} catch (RemoteException e) {
|
|
||||||
Log.e(TAG_OPS, "Failed to call onRotationProposal()", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void disable(int displayId, int state1, int state2, boolean animate) {
|
public void disable(int displayId, int state1, int state2, boolean animate) {
|
||||||
try {
|
try {
|
||||||
if (mOverviewProxy != null) {
|
if (mOverviewProxy != null) {
|
||||||
@@ -991,6 +981,18 @@ public class OverviewProxyService extends CurrentUserTracker implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onRotationProposal(int rotation, boolean isValid) {
|
||||||
|
try {
|
||||||
|
if (mOverviewProxy != null) {
|
||||||
|
mOverviewProxy.onRotationProposal(rotation, isValid);
|
||||||
|
} else {
|
||||||
|
Log.e(TAG_OPS, "Failed to get overview proxy for proposing rotation.");
|
||||||
|
}
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
Log.e(TAG_OPS, "Failed to call onRotationProposal()", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void onSystemBarAttributesChanged(int displayId, int behavior) {
|
public void onSystemBarAttributesChanged(int displayId, int behavior) {
|
||||||
try {
|
try {
|
||||||
if (mOverviewProxy != null) {
|
if (mOverviewProxy != null) {
|
||||||
|
|||||||
@@ -435,7 +435,8 @@ public class NotificationShadeWindowControllerImpl implements NotificationShadeW
|
|||||||
if (cb != null) {
|
if (cb != null) {
|
||||||
cb.onStateChanged(mCurrentState.mKeyguardShowing,
|
cb.onStateChanged(mCurrentState.mKeyguardShowing,
|
||||||
mCurrentState.mKeyguardOccluded,
|
mCurrentState.mKeyguardOccluded,
|
||||||
mCurrentState.mBouncerShowing);
|
mCurrentState.mBouncerShowing,
|
||||||
|
mCurrentState.mDozing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,5 +16,6 @@
|
|||||||
package com.android.systemui.statusbar.phone;
|
package com.android.systemui.statusbar.phone;
|
||||||
|
|
||||||
public interface StatusBarWindowCallback {
|
public interface StatusBarWindowCallback {
|
||||||
void onStateChanged(boolean keyguardShowing, boolean keyguardOccluded, boolean bouncerShowing);
|
void onStateChanged(boolean keyguardShowing, boolean keyguardOccluded, boolean bouncerShowing,
|
||||||
|
boolean isDozing);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ public class NavigationBarControllerTest extends SysuiTestCase {
|
|||||||
private NavigationBar mDefaultNavBar;
|
private NavigationBar mDefaultNavBar;
|
||||||
private NavigationBar mSecondaryNavBar;
|
private NavigationBar mSecondaryNavBar;
|
||||||
|
|
||||||
|
private CommandQueue mCommandQueue = mock(CommandQueue.class);
|
||||||
|
|
||||||
private static final int SECONDARY_DISPLAY = 1;
|
private static final int SECONDARY_DISPLAY = 1;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
@@ -97,7 +99,7 @@ public class NavigationBarControllerTest extends SysuiTestCase {
|
|||||||
mock(StatusBarStateController.class),
|
mock(StatusBarStateController.class),
|
||||||
mock(SysUiState.class),
|
mock(SysUiState.class),
|
||||||
mock(BroadcastDispatcher.class),
|
mock(BroadcastDispatcher.class),
|
||||||
mock(CommandQueue.class),
|
mCommandQueue,
|
||||||
Optional.of(mock(Pip.class)),
|
Optional.of(mock(Pip.class)),
|
||||||
Optional.of(mock(LegacySplitScreen.class)),
|
Optional.of(mock(LegacySplitScreen.class)),
|
||||||
Optional.of(mock(Recents.class)),
|
Optional.of(mock(Recents.class)),
|
||||||
@@ -109,7 +111,8 @@ public class NavigationBarControllerTest extends SysuiTestCase {
|
|||||||
mock(UiEventLogger.class),
|
mock(UiEventLogger.class),
|
||||||
mock(NavigationBarOverlayController.class),
|
mock(NavigationBarOverlayController.class),
|
||||||
mock(ConfigurationController.class),
|
mock(ConfigurationController.class),
|
||||||
mock(NavigationBarA11yHelper.class)));
|
mock(NavigationBarA11yHelper.class),
|
||||||
|
mock(TaskbarDelegate.class)));
|
||||||
initializeNavigationBars();
|
initializeNavigationBars();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,4 +275,9 @@ public class NavigationBarControllerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
verify(mSecondaryNavBar).disableAnimationsDuringHide(eq(500L));
|
verify(mSecondaryNavBar).disableAnimationsDuringHide(eq(500L));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void test3ButtonTaskbarFlagDisabledNoRegister() {
|
||||||
|
verify(mCommandQueue, never()).addCallback(any(TaskbarDelegate.class));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user