Loading core/java/com/android/internal/statusbar/IStatusBar.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,11 @@ oneway interface IStatusBar */ void showGlobalActionsMenu(); /** * Notifies the status bar that a new rotation suggestion is available. */ void onProposedRotationChanged(int rotation); /** * Set whether the top app currently hides the statusbar. * Loading packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java +17 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ public class CommandQueue extends IStatusBar.Stub { private static final int MSG_TOGGLE_PANEL = 35 << MSG_SHIFT; private static final int MSG_SHOW_SHUTDOWN_UI = 36 << MSG_SHIFT; private static final int MSG_SET_TOP_APP_HIDES_STATUS_BAR = 37 << MSG_SHIFT; private static final int MSG_ROTATION_PROPOSAL = 38 << MSG_SHIFT; public static final int FLAG_EXCLUDE_NONE = 0; public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0; Loading Loading @@ -142,6 +143,8 @@ public class CommandQueue extends IStatusBar.Stub { default void handleSystemKey(int arg1) { } default void handleShowGlobalActionsMenu() { } default void handleShowShutdownUi(boolean isReboot, String reason) { } default void onRotationProposal(int rotation) { } } @VisibleForTesting Loading Loading @@ -458,6 +461,15 @@ public class CommandQueue extends IStatusBar.Stub { } } @Override public void onProposedRotationChanged(int rotation) { synchronized (mLock) { mHandler.removeMessages(MSG_ROTATION_PROPOSAL); mHandler.obtainMessage(MSG_ROTATION_PROPOSAL, rotation, 0, null).sendToTarget(); } } private final class H extends Handler { private H(Looper l) { super(l); Loading Loading @@ -654,6 +666,11 @@ public class CommandQueue extends IStatusBar.Stub { mCallbacks.get(i).setTopAppHidesStatusBar(msg.arg1 != 0); } break; case MSG_ROTATION_PROPOSAL: for (int i = 0; i < mCallbacks.size(); i++) { mCallbacks.get(i).onRotationProposal(msg.arg1); } break; } } } Loading services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java +7 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,13 @@ public interface StatusBarManagerInternal { boolean showShutdownUi(boolean isReboot, String requestString); /** * Show a rotation suggestion that a user may approve to rotate the screen. * * @param rotation rotation suggestion */ void onProposedRotationChanged(int rotation); public interface GlobalActionsListener { /** * Called when sysui starts and connects its status bar, or when the status bar binder Loading services/core/java/com/android/server/statusbar/StatusBarManagerService.java +9 −0 Original line number Diff line number Diff line Loading @@ -406,6 +406,15 @@ public class StatusBarManagerService extends IStatusBarService.Stub { } return false; } @Override public void onProposedRotationChanged(int rotation) { if (mBar != null){ try { mBar.onProposedRotationChanged(rotation); } catch (RemoteException ex) {} } } }; // ================================================================================ Loading Loading
core/java/com/android/internal/statusbar/IStatusBar.aidl +5 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,11 @@ oneway interface IStatusBar */ void showGlobalActionsMenu(); /** * Notifies the status bar that a new rotation suggestion is available. */ void onProposedRotationChanged(int rotation); /** * Set whether the top app currently hides the statusbar. * Loading
packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java +17 −0 Original line number Diff line number Diff line Loading @@ -82,6 +82,7 @@ public class CommandQueue extends IStatusBar.Stub { private static final int MSG_TOGGLE_PANEL = 35 << MSG_SHIFT; private static final int MSG_SHOW_SHUTDOWN_UI = 36 << MSG_SHIFT; private static final int MSG_SET_TOP_APP_HIDES_STATUS_BAR = 37 << MSG_SHIFT; private static final int MSG_ROTATION_PROPOSAL = 38 << MSG_SHIFT; public static final int FLAG_EXCLUDE_NONE = 0; public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0; Loading Loading @@ -142,6 +143,8 @@ public class CommandQueue extends IStatusBar.Stub { default void handleSystemKey(int arg1) { } default void handleShowGlobalActionsMenu() { } default void handleShowShutdownUi(boolean isReboot, String reason) { } default void onRotationProposal(int rotation) { } } @VisibleForTesting Loading Loading @@ -458,6 +461,15 @@ public class CommandQueue extends IStatusBar.Stub { } } @Override public void onProposedRotationChanged(int rotation) { synchronized (mLock) { mHandler.removeMessages(MSG_ROTATION_PROPOSAL); mHandler.obtainMessage(MSG_ROTATION_PROPOSAL, rotation, 0, null).sendToTarget(); } } private final class H extends Handler { private H(Looper l) { super(l); Loading Loading @@ -654,6 +666,11 @@ public class CommandQueue extends IStatusBar.Stub { mCallbacks.get(i).setTopAppHidesStatusBar(msg.arg1 != 0); } break; case MSG_ROTATION_PROPOSAL: for (int i = 0; i < mCallbacks.size(); i++) { mCallbacks.get(i).onRotationProposal(msg.arg1); } break; } } } Loading
services/core/java/com/android/server/statusbar/StatusBarManagerInternal.java +7 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,13 @@ public interface StatusBarManagerInternal { boolean showShutdownUi(boolean isReboot, String requestString); /** * Show a rotation suggestion that a user may approve to rotate the screen. * * @param rotation rotation suggestion */ void onProposedRotationChanged(int rotation); public interface GlobalActionsListener { /** * Called when sysui starts and connects its status bar, or when the status bar binder Loading
services/core/java/com/android/server/statusbar/StatusBarManagerService.java +9 −0 Original line number Diff line number Diff line Loading @@ -406,6 +406,15 @@ public class StatusBarManagerService extends IStatusBarService.Stub { } return false; } @Override public void onProposedRotationChanged(int rotation) { if (mBar != null){ try { mBar.onProposedRotationChanged(rotation); } catch (RemoteException ex) {} } } }; // ================================================================================ Loading