Cleanup internal status bar APIs.
IStatusBarService.collapseQuickSettings is gone;
collapseNotifications is now collapsePanels, which does what
collapse() used to do. Similarly,
IStatusBar.animateCollapseQuickSettings is now simply
IStatusBar.animateCollapse().
Bug: 7245229
Change-Id: Id157d2fdf34926d3c85ffa8b81c741a5359aede4
diff --git a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
index b0879fc..f71f554 100644
--- a/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/SearchPanelView.java
@@ -72,7 +72,7 @@
private void startAssistActivity() {
// Close Recent Apps if needed
- mBar.animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_SEARCH_PANEL);
+ mBar.animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_SEARCH_PANEL);
// Launch Assist
Intent intent = ((SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE))
.getAssistIntent(mContext, UserHandle.USER_CURRENT);
@@ -220,7 +220,7 @@
public void hide(boolean animate) {
if (mBar != null) {
// This will indirectly cause show(false, ...) to get called
- mBar.animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE);
+ mBar.animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
} else {
setVisibility(View.INVISIBLE);
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index d8bbee9..73ed9e0 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -184,7 +184,7 @@
if (isActivity && handled) {
// close the shade if it was open
- animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE);
+ animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
visibilityChanged(false);
}
return handled;
@@ -361,7 +361,7 @@
public boolean onMenuItemClick(MenuItem item) {
if (item.getItemId() == R.id.notification_inspect_item) {
startApplicationDetailsActivity(packageNameF);
- animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE);
+ animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
} else {
return false;
}
@@ -793,7 +793,7 @@
}
// close the shade if it was open
- animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE);
+ animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
visibilityChanged(false);
// If this click was on the intruder alert, hide that instead
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
index 39e49b8..752bb0c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -46,17 +46,16 @@
private static final int MSG_REMOVE_NOTIFICATION = 4 << MSG_SHIFT;
private static final int MSG_DISABLE = 5 << MSG_SHIFT;
private static final int MSG_EXPAND_NOTIFICATIONS = 6 << MSG_SHIFT;
- private static final int MSG_COLLAPSE_NOTIFICATIONS = 7 << MSG_SHIFT;
- private static final int MSG_EXPAND_QUICK_SETTINGS = 8 << MSG_SHIFT;
- private static final int MSG_COLLAPSE_QUICK_SETTINGS = 9 << MSG_SHIFT;
- private static final int MSG_SET_SYSTEMUI_VISIBILITY = 10 << MSG_SHIFT;
- private static final int MSG_TOP_APP_WINDOW_CHANGED = 11 << MSG_SHIFT;
- private static final int MSG_SHOW_IME_BUTTON = 12 << MSG_SHIFT;
- private static final int MSG_SET_HARD_KEYBOARD_STATUS = 13 << MSG_SHIFT;
- private static final int MSG_TOGGLE_RECENT_APPS = 14 << MSG_SHIFT;
- private static final int MSG_PRELOAD_RECENT_APPS = 15 << MSG_SHIFT;
- private static final int MSG_CANCEL_PRELOAD_RECENT_APPS = 16 << MSG_SHIFT;
- private static final int MSG_SET_NAVIGATION_ICON_HINTS = 17 << MSG_SHIFT;
+ private static final int MSG_COLLAPSE_PANELS = 7 << MSG_SHIFT;
+ private static final int MSG_EXPAND_SETTINGS = 8 << MSG_SHIFT;
+ private static final int MSG_SET_SYSTEMUI_VISIBILITY = 9 << MSG_SHIFT;
+ private static final int MSG_TOP_APP_WINDOW_CHANGED = 10 << MSG_SHIFT;
+ private static final int MSG_SHOW_IME_BUTTON = 11 << MSG_SHIFT;
+ private static final int MSG_SET_HARD_KEYBOARD_STATUS = 12 << MSG_SHIFT;
+ private static final int MSG_TOGGLE_RECENT_APPS = 13 << MSG_SHIFT;
+ private static final int MSG_PRELOAD_RECENT_APPS = 14 << MSG_SHIFT;
+ private static final int MSG_CANCEL_PRELOAD_RECENT_APPS = 15 << MSG_SHIFT;
+ private static final int MSG_SET_NAVIGATION_ICON_HINTS = 16 << MSG_SHIFT;
public static final int FLAG_EXCLUDE_NONE = 0;
public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0;
@@ -86,10 +85,9 @@
public void updateNotification(IBinder key, StatusBarNotification notification);
public void removeNotification(IBinder key);
public void disable(int state);
- public void animateExpandNotifications();
- public void animateCollapseNotifications(int flags);
- public void animateExpandQuickSettings();
- public void animateCollapseQuickSettings();
+ public void animateExpandNotificationsPanel();
+ public void animateCollapsePanels(int flags);
+ public void animateExpandSettingsPanel();
public void setSystemUiVisibility(int vis, int mask);
public void topAppWindowChanged(boolean visible);
public void setImeWindowStatus(IBinder token, int vis, int backDisposition);
@@ -154,31 +152,24 @@
}
}
- public void animateExpandNotifications() {
+ public void animateExpandNotificationsPanel() {
synchronized (mList) {
mHandler.removeMessages(MSG_EXPAND_NOTIFICATIONS);
mHandler.sendEmptyMessage(MSG_EXPAND_NOTIFICATIONS);
}
}
- public void animateCollapseNotifications() {
+ public void animateCollapsePanels() {
synchronized (mList) {
- mHandler.removeMessages(MSG_COLLAPSE_NOTIFICATIONS);
- mHandler.sendEmptyMessage(MSG_COLLAPSE_NOTIFICATIONS);
+ mHandler.removeMessages(MSG_COLLAPSE_PANELS);
+ mHandler.sendEmptyMessage(MSG_COLLAPSE_PANELS);
}
}
- public void animateExpandQuickSettings() {
+ public void animateExpandSettingsPanel() {
synchronized (mList) {
- mHandler.removeMessages(MSG_EXPAND_QUICK_SETTINGS);
- mHandler.sendEmptyMessage(MSG_EXPAND_QUICK_SETTINGS);
- }
- }
-
- public void animateCollapseQuickSettings() {
- synchronized (mList) {
- mHandler.removeMessages(MSG_COLLAPSE_QUICK_SETTINGS);
- mHandler.sendEmptyMessage(MSG_COLLAPSE_QUICK_SETTINGS);
+ mHandler.removeMessages(MSG_EXPAND_SETTINGS);
+ mHandler.sendEmptyMessage(MSG_EXPAND_SETTINGS);
}
}
@@ -289,16 +280,13 @@
mCallbacks.disable(msg.arg1);
break;
case MSG_EXPAND_NOTIFICATIONS:
- mCallbacks.animateExpandNotifications();
+ mCallbacks.animateExpandNotificationsPanel();
break;
- case MSG_COLLAPSE_NOTIFICATIONS:
- mCallbacks.animateCollapseNotifications(0);
+ case MSG_COLLAPSE_PANELS:
+ mCallbacks.animateCollapsePanels(0);
break;
- case MSG_EXPAND_QUICK_SETTINGS:
- mCallbacks.animateExpandQuickSettings();
- break;
- case MSG_COLLAPSE_QUICK_SETTINGS:
- mCallbacks.animateCollapseQuickSettings();
+ case MSG_EXPAND_SETTINGS:
+ mCallbacks.animateExpandSettingsPanel();
break;
case MSG_SET_SYSTEMUI_VISIBILITY:
mCallbacks.setSystemUiVisibility(msg.arg1, msg.arg2);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index d72632f..508835f 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -104,7 +104,8 @@
= "com.android.internal.policy.statusbar.START";
private static final int MSG_OPEN_NOTIFICATION_PANEL = 1000;
- private static final int MSG_CLOSE_NOTIFICATION_PANEL = 1001;
+ private static final int MSG_CLOSE_PANELS = 1001;
+ private static final int MSG_OPEN_SETTINGS_PANEL = 1002;
// 1020-1030 reserved for BaseStatusBar
// will likely move to a resource or other tunable param at some point
@@ -296,7 +297,7 @@
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
if (mExpandedVisible && !mAnimating) {
- animateCollapseNotifications();
+ animateCollapsePanels();
}
}
return mStatusBarWindow.onTouchEvent(event);
@@ -778,7 +779,7 @@
}
if (CLOSE_PANEL_WHEN_EMPTIED && mNotificationData.size() == 0 && !mAnimating) {
- animateCollapseNotifications();
+ animateCollapsePanels();
}
}
@@ -1051,7 +1052,7 @@
}
if ((diff & StatusBarManager.DISABLE_EXPAND) != 0) {
if ((state & StatusBarManager.DISABLE_EXPAND) != 0) {
- animateCollapseNotifications();
+ animateCollapsePanels();
}
}
@@ -1111,10 +1112,13 @@
super.handleMessage(m);
switch (m.what) {
case MSG_OPEN_NOTIFICATION_PANEL:
- animateExpandNotifications();
+ animateExpandNotificationsPanel();
break;
- case MSG_CLOSE_NOTIFICATION_PANEL:
- animateCollapseNotifications();
+ case MSG_OPEN_SETTINGS_PANEL:
+ animateExpandSettingsPanel();
+ break;
+ case MSG_CLOSE_PANELS:
+ animateCollapsePanels();
break;
case MSG_SHOW_INTRUDER:
setIntruderAlertVisibility(true);
@@ -1167,11 +1171,11 @@
visibilityChanged(true);
}
- public void animateCollapseNotifications() {
- animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE);
+ public void animateCollapsePanels() {
+ animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
}
- public void animateCollapseNotifications(int flags) {
+ public void animateCollapsePanels(int flags) {
if (SPEW) {
Slog.d(TAG, "animateCollapse():"
+ " mExpandedVisible=" + mExpandedVisible
@@ -1196,7 +1200,7 @@
}
@Override
- public void animateExpandNotifications() {
+ public void animateExpandNotificationsPanel() {
if (SPEW) Slog.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible);
if ((mDisabled & StatusBarManager.DISABLE_EXPAND) != 0) {
return ;
@@ -1208,7 +1212,7 @@
}
@Override
- public void animateExpandQuickSettings() {
+ public void animateExpandSettingsPanel() {
if (SPEW) Slog.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible);
if ((mDisabled & StatusBarManager.DISABLE_EXPAND) != 0) {
return;
@@ -1352,7 +1356,7 @@
if (0 != (diff & View.SYSTEM_UI_FLAG_LOW_PROFILE)) {
final boolean lightsOut = (0 != (vis & View.SYSTEM_UI_FLAG_LOW_PROFILE));
if (lightsOut) {
- animateCollapseNotifications();
+ animateCollapsePanels();
if (mTicking) {
mTicker.halt();
}
@@ -1678,7 +1682,7 @@
}
}
if (snapshot.isEmpty()) {
- animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE);
+ animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
return;
}
new Thread(new Runnable() {
@@ -1729,7 +1733,7 @@
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
- animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE);
+ animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
}
}, totalDelay + 225);
}
@@ -1751,7 +1755,7 @@
v.getContext().startActivityAsUser(new Intent(Settings.ACTION_SETTINGS)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
new UserHandle(UserHandle.USER_CURRENT));
- animateCollapseNotifications();
+ animateCollapsePanels();
}
};
@@ -1767,7 +1771,7 @@
flags |= CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL;
}
}
- animateCollapseNotifications(flags);
+ animateCollapsePanels(flags);
}
else if (Intent.ACTION_SCREEN_OFF.equals(action)) {
// no waiting!
@@ -1792,7 +1796,7 @@
@Override
public void userSwitched(int newUserId) {
if (MULTIUSER_DEBUG) mNotificationPanelDebugText.setText("USER " + newUserId);
- animateCollapseNotifications();
+ animateCollapsePanels();
updateNotificationIcons();
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
index 7077018..940f787 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
@@ -228,7 +228,7 @@
}
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
mContext.startActivityAsUser(intent, new UserHandle(UserHandle.USER_CURRENT));
- getService().animateCollapseNotifications();
+ getService().animateCollapsePanels();
}
private void addUserTiles(ViewGroup parent, LayoutInflater inflater) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
index 85b91d1..0176f42 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowView.java
@@ -70,7 +70,7 @@
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_BACK:
if (!down) {
- mService.animateCollapseNotifications();
+ mService.animateCollapsePanels();
}
return true;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
index 73d1c7c..b431287 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java
@@ -204,14 +204,14 @@
// We exclusively handle the back key by hiding this panel.
case KeyEvent.KEYCODE_BACK: {
if (event.getAction() == KeyEvent.ACTION_UP) {
- mBar.animateCollapseNotifications();
+ mBar.animateCollapsePanels();
}
return true;
}
// We react to the home key but let the system handle it.
case KeyEvent.KEYCODE_HOME: {
if (event.getAction() == KeyEvent.ACTION_UP) {
- mBar.animateCollapseNotifications();
+ mBar.animateCollapsePanels();
}
} break;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java
index ab4ef75..194f1f6 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java
@@ -112,7 +112,7 @@
private void onClickNetwork() {
getContext().startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK));
- getStatusBarManager().collapseNotifications();
+ getStatusBarManager().collapsePanels();
}
// Settings
@@ -121,7 +121,7 @@
getContext().startActivityAsUser(new Intent(Settings.ACTION_SETTINGS)
.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK),
new UserHandle(UserHandle.USER_CURRENT));
- getStatusBarManager().collapseNotifications();
+ getStatusBarManager().collapsePanels();
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
index d1dd3c7..97451ae 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java
@@ -740,7 +740,7 @@
SharedPreferences.Editor editor = Prefs.edit(mContext);
editor.putBoolean(Prefs.DO_NOT_DISTURB_PREF, false);
editor.apply();
- animateCollapseNotifications();
+ animateCollapsePanels();
visibilityChanged(false);
}
});
@@ -821,7 +821,7 @@
break;
case MSG_HIDE_CHROME:
if (DEBUG) Slog.d(TAG, "showing shadows (lights out)");
- animateCollapseNotifications();
+ animateCollapsePanels();
visibilityChanged(false);
mBarContents.setVisibility(View.GONE);
mShadow.setVisibility(View.VISIBLE);
@@ -907,7 +907,7 @@
if ((diff & StatusBarManager.DISABLE_EXPAND) != 0) {
if ((state & StatusBarManager.DISABLE_EXPAND) != 0) {
Slog.i(TAG, "DISABLE_EXPAND: yes");
- animateCollapseNotifications();
+ animateCollapsePanels();
visibilityChanged(false);
}
}
@@ -988,16 +988,16 @@
mFeedbackIconArea.setVisibility(View.VISIBLE);
}
- public void animateExpandNotifications() {
+ public void animateExpandNotificationsPanel() {
mHandler.removeMessages(MSG_OPEN_NOTIFICATION_PANEL);
mHandler.sendEmptyMessage(MSG_OPEN_NOTIFICATION_PANEL);
}
- public void animateCollapseNotifications() {
- animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE);
+ public void animateCollapsePanels() {
+ animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE);
}
- public void animateCollapseNotifications(int flags) {
+ public void animateCollapsePanels(int flags) {
if ((flags & CommandQueue.FLAG_EXCLUDE_NOTIFICATION_PANEL) == 0) {
mHandler.removeMessages(MSG_CLOSE_NOTIFICATION_PANEL);
mHandler.sendEmptyMessage(MSG_CLOSE_NOTIFICATION_PANEL);
@@ -1022,12 +1022,7 @@
}
@Override
- public void animateExpandQuickSettings() {
- // TODO: Implement when TabletStatusBar begins to be used.
- }
-
- @Override
- public void animateCollapseQuickSettings() {
+ public void animateExpandSettingsPanel() {
// TODO: Implement when TabletStatusBar begins to be used.
}
@@ -1299,7 +1294,7 @@
mVT.computeCurrentVelocity(1000); // pixels per second
// require a little more oomph once we're already in peekaboo mode
if (mVT.getYVelocity() < -mNotificationFlingVelocity) {
- animateExpandNotifications();
+ animateExpandNotificationsPanel();
visibilityChanged(true);
hilite(false);
mVT.recycle();
@@ -1317,7 +1312,7 @@
&& Math.abs(event.getY() - mInitialTouchY) < (mTouchSlop / 3)
// dragging off the bottom doesn't count
&& (int)event.getY() < v.getBottom()) {
- animateExpandNotifications();
+ animateExpandNotificationsPanel();
visibilityChanged(true);
v.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);
v.playSoundEffect(SoundEffectConstants.CLICK);
@@ -1493,7 +1488,7 @@
} catch (RemoteException ex) {
// system process is dead if we're here.
}
- animateCollapseNotifications();
+ animateCollapsePanels();
visibilityChanged(false);
}
@@ -1509,7 +1504,7 @@
flags |= CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL;
}
}
- animateCollapseNotifications(flags);
+ animateCollapsePanels(flags);
}
}
};
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java
index fd2ee38..519d3c1 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/tv/TvStatusBar.java
@@ -61,11 +61,11 @@
}
@Override
- public void animateExpandNotifications() {
+ public void animateExpandNotificationsPanel() {
}
@Override
- public void animateCollapseNotifications(int flags) {
+ public void animateCollapsePanels(int flags) {
}
@Override
@@ -143,10 +143,6 @@
}
@Override
- public void animateExpandQuickSettings() {
- }
-
- @Override
- public void animateCollapseQuickSettings() {
+ public void animateExpandSettingsPanel() {
}
}