Loading packages/SystemUI/shared/src/com/android/systemui/shared/recents/IOverviewProxy.aidl +6 −1 Original line number Diff line number Diff line Loading @@ -124,9 +124,14 @@ oneway interface IOverviewProxy { */ void onAssistantVisibilityChanged(float visibility) = 14; /* /** * Sent when back is triggered. */ void onBackAction(boolean completed, int downX, int downY, boolean isButton, boolean gestureSwipeLeft) = 15; /** * Sent when some system ui state changes. */ void onSystemUiStateChanged(int stateFlags) = 16; } packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java +15 −0 Original line number Diff line number Diff line Loading @@ -20,12 +20,16 @@ import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_2BUTTON; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL; import android.annotation.IntDef; import android.content.Context; import android.content.res.Resources; import android.view.WindowManagerPolicyConstants; import com.android.internal.policy.ScreenDecorationsUtils; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * Various shared constants between Launcher and SysUI as part of quickstep */ Loading @@ -44,6 +48,17 @@ public class QuickStepContract { public static final String NAV_BAR_MODE_GESTURAL_OVERLAY = WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY; public static final int SYSUI_STATE_SCREEN_PINNING = 1 << 0; public static final int SYSUI_STATE_NAV_BAR_HIDDEN = 1 << 1; public static final int SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED = 1 << 2; @Retention(RetentionPolicy.SOURCE) @IntDef({SYSUI_STATE_SCREEN_PINNING, SYSUI_STATE_NAV_BAR_HIDDEN, SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED }) public @interface SystemUiStateFlags {} /** * Touch slopes and thresholds for quick step operations. Drag slop is the point where the * home button press/long press over are ignored and will start to drag when exceeded and the Loading packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +71 −10 Original line number Diff line number Diff line Loading @@ -28,6 +28,9 @@ import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_INP import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SUPPORTS_WINDOW_CORNERS; 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.SYSUI_STATE_NAV_BAR_HIDDEN; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING; import android.annotation.FloatRange; import android.content.BroadcastReceiver; Loading @@ -52,6 +55,7 @@ import android.view.InputMonitor; import android.view.MotionEvent; import com.android.internal.policy.ScreenDecorationsUtils; import com.android.systemui.Dependency; import com.android.systemui.Dumpable; import com.android.systemui.Prefs; import com.android.systemui.SysUiServiceProvider; Loading @@ -60,7 +64,10 @@ import com.android.systemui.shared.recents.IOverviewProxy; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags; import com.android.systemui.stackdivider.Divider; import com.android.systemui.statusbar.NavigationBarController; import com.android.systemui.statusbar.phone.NavigationBarFragment; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.policy.CallbackController; import com.android.systemui.statusbar.policy.DeviceProvisionedController; Loading Loading @@ -107,6 +114,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis private IOverviewProxy mOverviewProxy; private int mConnectionBackoffAttempts; private @InteractionType int mInteractionFlags; private @SystemUiStateFlags int mSysUiStateFlags; private boolean mBound; private boolean mIsEnabled; private int mCurrentBoundedUserId = -1; Loading Loading @@ -368,6 +376,9 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } dispatchNavButtonBounds(); // Update the systemui state flags updateSystemUiStateFlags(); notifyConnectionChanged(); } Loading @@ -394,6 +405,16 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis private final DeviceProvisionedListener mDeviceProvisionedCallback = new DeviceProvisionedListener() { @Override public void onDeviceProvisionedChanged() { /* on initialize, keep track of the previous gestural state (nothing is enabled by default) restore to a non gestural state if device is not provisioned once the device is provisioned, restore to the original state */ } @Override public void onUserSetupChanged() { if (mDeviceProvisionedController.isCurrentUserSetup()) { Loading Loading @@ -455,6 +476,45 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } } public void setSystemUiStateFlag(int flag, boolean enabled) { int newState = mSysUiStateFlags; if (enabled) { newState |= flag; } else { newState &= ~flag; } if (mSysUiStateFlags != newState) { mSysUiStateFlags = newState; notifySystemUiStateFlags(mSysUiStateFlags); } } private void updateSystemUiStateFlags() { final NavigationBarController navBar = Dependency.get(NavigationBarController.class); final NavigationBarFragment navBarFragment = navBar.getDefaultNavigationBarFragment(); final StatusBar statusBar = SysUiServiceProvider.getComponent(mContext, StatusBar.class); final boolean panelExpanded = statusBar != null && statusBar.getPanel() != null && statusBar.getPanel().isFullyExpanded(); mSysUiStateFlags = 0; mSysUiStateFlags |= ActivityManagerWrapper.getInstance().isScreenPinningActive() ? SYSUI_STATE_SCREEN_PINNING : 0; mSysUiStateFlags |= (navBarFragment == null || !navBarFragment.isNavBarWindowVisible()) ? SYSUI_STATE_NAV_BAR_HIDDEN : 0; mSysUiStateFlags |= panelExpanded ? SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED : 0; notifySystemUiStateFlags(mSysUiStateFlags); } private void notifySystemUiStateFlags(int flags) { try { if (mOverviewProxy != null) { mOverviewProxy.onSystemUiStateChanged(flags); } } catch (RemoteException e) { Log.e(TAG_OPS, "Failed to notify sysui state change", e); } } /** * Sets the navbar region which can receive touch inputs */ Loading Loading @@ -659,6 +719,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis pw.print(" quickStepIntentResolved="); pw.println(isEnabled()); pw.print(" navBarMode="); pw.println(QuickStepContract.getCurrentInteractionMode(mContext)); pw.print(" mSysUiStateFlags="); pw.println(mSysUiStateFlags); } public interface OverviewProxyListener { Loading packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java +5 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.recents; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING; import static com.android.systemui.util.leak.RotationUtils.ROTATION_LANDSCAPE; import static com.android.systemui.util.leak.RotationUtils.ROTATION_SEASCAPE; Loading Loading @@ -44,6 +45,7 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.SysUiServiceProvider; import com.android.systemui.shared.system.WindowManagerWrapper; Loading @@ -59,6 +61,7 @@ public class ScreenPinningRequest implements View.OnClickListener { private final AccessibilityManager mAccessibilityService; private final WindowManager mWindowManager; private final OverviewProxyService mOverviewProxyService; private RequestWindowView mRequestWindow; Loading @@ -71,6 +74,7 @@ public class ScreenPinningRequest implements View.OnClickListener { mContext.getSystemService(Context.ACCESSIBILITY_SERVICE); mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); mOverviewProxyService = Dependency.get(OverviewProxyService.class); } public void clearPrompt() { Loading Loading @@ -125,6 +129,7 @@ public class ScreenPinningRequest implements View.OnClickListener { if (v.getId() == R.id.screen_pinning_ok_button || mRequestWindow == v) { try { ActivityTaskManager.getService().startSystemLockTaskMode(taskId); mOverviewProxyService.setSystemUiStateFlag(SYSUI_STATE_SCREEN_PINNING, true); } catch (RemoteException e) {} } clearPrompt(); Loading packages/SystemUI/src/com/android/systemui/statusbar/NavigationBarController.java +9 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,10 @@ public class NavigationBarController implements Callbacks { mContext = context; mHandler = handler; mDisplayManager = (DisplayManager) mContext.getSystemService(Context.DISPLAY_SERVICE); getComponent(mContext, CommandQueue.class).addCallback(this); CommandQueue commandQueue = getComponent(mContext, CommandQueue.class); if (commandQueue != null) { commandQueue.addCallback(this); } } @Override Loading Loading @@ -206,4 +209,9 @@ public class NavigationBarController implements Callbacks { NavigationBarFragment navBar = mNavigationBars.get(DEFAULT_DISPLAY); return (navBar == null) ? null : (NavigationBarView) navBar.getView(); } /** @return {@link NavigationBarFragment} on the default display. */ public NavigationBarFragment getDefaultNavigationBarFragment() { return mNavigationBars.get(DEFAULT_DISPLAY); } } Loading
packages/SystemUI/shared/src/com/android/systemui/shared/recents/IOverviewProxy.aidl +6 −1 Original line number Diff line number Diff line Loading @@ -124,9 +124,14 @@ oneway interface IOverviewProxy { */ void onAssistantVisibilityChanged(float visibility) = 14; /* /** * Sent when back is triggered. */ void onBackAction(boolean completed, int downX, int downY, boolean isButton, boolean gestureSwipeLeft) = 15; /** * Sent when some system ui state changes. */ void onSystemUiStateChanged(int stateFlags) = 16; }
packages/SystemUI/shared/src/com/android/systemui/shared/system/QuickStepContract.java +15 −0 Original line number Diff line number Diff line Loading @@ -20,12 +20,16 @@ import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_2BUTTON; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON; import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL; import android.annotation.IntDef; import android.content.Context; import android.content.res.Resources; import android.view.WindowManagerPolicyConstants; import com.android.internal.policy.ScreenDecorationsUtils; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** * Various shared constants between Launcher and SysUI as part of quickstep */ Loading @@ -44,6 +48,17 @@ public class QuickStepContract { public static final String NAV_BAR_MODE_GESTURAL_OVERLAY = WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY; public static final int SYSUI_STATE_SCREEN_PINNING = 1 << 0; public static final int SYSUI_STATE_NAV_BAR_HIDDEN = 1 << 1; public static final int SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED = 1 << 2; @Retention(RetentionPolicy.SOURCE) @IntDef({SYSUI_STATE_SCREEN_PINNING, SYSUI_STATE_NAV_BAR_HIDDEN, SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED }) public @interface SystemUiStateFlags {} /** * Touch slopes and thresholds for quick step operations. Drag slop is the point where the * home button press/long press over are ignored and will start to drag when exceeded and the Loading
packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +71 −10 Original line number Diff line number Diff line Loading @@ -28,6 +28,9 @@ import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_INP import static com.android.systemui.shared.system.QuickStepContract.KEY_EXTRA_SUPPORTS_WINDOW_CORNERS; 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.SYSUI_STATE_NAV_BAR_HIDDEN; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING; import android.annotation.FloatRange; import android.content.BroadcastReceiver; Loading @@ -52,6 +55,7 @@ import android.view.InputMonitor; import android.view.MotionEvent; import com.android.internal.policy.ScreenDecorationsUtils; import com.android.systemui.Dependency; import com.android.systemui.Dumpable; import com.android.systemui.Prefs; import com.android.systemui.SysUiServiceProvider; Loading @@ -60,7 +64,10 @@ import com.android.systemui.shared.recents.IOverviewProxy; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.shared.system.QuickStepContract.SystemUiStateFlags; import com.android.systemui.stackdivider.Divider; import com.android.systemui.statusbar.NavigationBarController; import com.android.systemui.statusbar.phone.NavigationBarFragment; import com.android.systemui.statusbar.phone.StatusBar; import com.android.systemui.statusbar.policy.CallbackController; import com.android.systemui.statusbar.policy.DeviceProvisionedController; Loading Loading @@ -107,6 +114,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis private IOverviewProxy mOverviewProxy; private int mConnectionBackoffAttempts; private @InteractionType int mInteractionFlags; private @SystemUiStateFlags int mSysUiStateFlags; private boolean mBound; private boolean mIsEnabled; private int mCurrentBoundedUserId = -1; Loading Loading @@ -368,6 +376,9 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } dispatchNavButtonBounds(); // Update the systemui state flags updateSystemUiStateFlags(); notifyConnectionChanged(); } Loading @@ -394,6 +405,16 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis private final DeviceProvisionedListener mDeviceProvisionedCallback = new DeviceProvisionedListener() { @Override public void onDeviceProvisionedChanged() { /* on initialize, keep track of the previous gestural state (nothing is enabled by default) restore to a non gestural state if device is not provisioned once the device is provisioned, restore to the original state */ } @Override public void onUserSetupChanged() { if (mDeviceProvisionedController.isCurrentUserSetup()) { Loading Loading @@ -455,6 +476,45 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } } public void setSystemUiStateFlag(int flag, boolean enabled) { int newState = mSysUiStateFlags; if (enabled) { newState |= flag; } else { newState &= ~flag; } if (mSysUiStateFlags != newState) { mSysUiStateFlags = newState; notifySystemUiStateFlags(mSysUiStateFlags); } } private void updateSystemUiStateFlags() { final NavigationBarController navBar = Dependency.get(NavigationBarController.class); final NavigationBarFragment navBarFragment = navBar.getDefaultNavigationBarFragment(); final StatusBar statusBar = SysUiServiceProvider.getComponent(mContext, StatusBar.class); final boolean panelExpanded = statusBar != null && statusBar.getPanel() != null && statusBar.getPanel().isFullyExpanded(); mSysUiStateFlags = 0; mSysUiStateFlags |= ActivityManagerWrapper.getInstance().isScreenPinningActive() ? SYSUI_STATE_SCREEN_PINNING : 0; mSysUiStateFlags |= (navBarFragment == null || !navBarFragment.isNavBarWindowVisible()) ? SYSUI_STATE_NAV_BAR_HIDDEN : 0; mSysUiStateFlags |= panelExpanded ? SYSUI_STATE_NOTIFICATION_PANEL_EXPANDED : 0; notifySystemUiStateFlags(mSysUiStateFlags); } private void notifySystemUiStateFlags(int flags) { try { if (mOverviewProxy != null) { mOverviewProxy.onSystemUiStateChanged(flags); } } catch (RemoteException e) { Log.e(TAG_OPS, "Failed to notify sysui state change", e); } } /** * Sets the navbar region which can receive touch inputs */ Loading Loading @@ -659,6 +719,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis pw.print(" quickStepIntentResolved="); pw.println(isEnabled()); pw.print(" navBarMode="); pw.println(QuickStepContract.getCurrentInteractionMode(mContext)); pw.print(" mSysUiStateFlags="); pw.println(mSysUiStateFlags); } public interface OverviewProxyListener { Loading
packages/SystemUI/src/com/android/systemui/recents/ScreenPinningRequest.java +5 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.recents; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_SCREEN_PINNING; import static com.android.systemui.util.leak.RotationUtils.ROTATION_LANDSCAPE; import static com.android.systemui.util.leak.RotationUtils.ROTATION_SEASCAPE; Loading Loading @@ -44,6 +45,7 @@ import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.android.systemui.Dependency; import com.android.systemui.R; import com.android.systemui.SysUiServiceProvider; import com.android.systemui.shared.system.WindowManagerWrapper; Loading @@ -59,6 +61,7 @@ public class ScreenPinningRequest implements View.OnClickListener { private final AccessibilityManager mAccessibilityService; private final WindowManager mWindowManager; private final OverviewProxyService mOverviewProxyService; private RequestWindowView mRequestWindow; Loading @@ -71,6 +74,7 @@ public class ScreenPinningRequest implements View.OnClickListener { mContext.getSystemService(Context.ACCESSIBILITY_SERVICE); mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE); mOverviewProxyService = Dependency.get(OverviewProxyService.class); } public void clearPrompt() { Loading Loading @@ -125,6 +129,7 @@ public class ScreenPinningRequest implements View.OnClickListener { if (v.getId() == R.id.screen_pinning_ok_button || mRequestWindow == v) { try { ActivityTaskManager.getService().startSystemLockTaskMode(taskId); mOverviewProxyService.setSystemUiStateFlag(SYSUI_STATE_SCREEN_PINNING, true); } catch (RemoteException e) {} } clearPrompt(); Loading
packages/SystemUI/src/com/android/systemui/statusbar/NavigationBarController.java +9 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,10 @@ public class NavigationBarController implements Callbacks { mContext = context; mHandler = handler; mDisplayManager = (DisplayManager) mContext.getSystemService(Context.DISPLAY_SERVICE); getComponent(mContext, CommandQueue.class).addCallback(this); CommandQueue commandQueue = getComponent(mContext, CommandQueue.class); if (commandQueue != null) { commandQueue.addCallback(this); } } @Override Loading Loading @@ -206,4 +209,9 @@ public class NavigationBarController implements Callbacks { NavigationBarFragment navBar = mNavigationBars.get(DEFAULT_DISPLAY); return (navBar == null) ? null : (NavigationBarView) navBar.getView(); } /** @return {@link NavigationBarFragment} on the default display. */ public NavigationBarFragment getDefaultNavigationBarFragment() { return mNavigationBars.get(DEFAULT_DISPLAY); } }