diff options
author | Daniel Sandler <dsandler@android.com> | 2012-09-27 14:03:08 -0400 |
---|---|---|
committer | Daniel Sandler <dsandler@android.com> | 2012-09-27 14:03:08 -0400 |
commit | 11cf178100e71d3f9f34ab5865e03a277c5eadaa (patch) | |
tree | 1d150aa83ac276d99c9e9978118eadab94791c26 | |
parent | 7bb89cf1632da6dc236e6603c4245301500eeb39 (diff) | |
download | frameworks_base-11cf178100e71d3f9f34ab5865e03a277c5eadaa.zip frameworks_base-11cf178100e71d3f9f34ab5865e03a277c5eadaa.tar.gz frameworks_base-11cf178100e71d3f9f34ab5865e03a277c5eadaa.tar.bz2 |
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
17 files changed, 118 insertions, 151 deletions
diff --git a/core/java/android/app/StatusBarManager.java b/core/java/android/app/StatusBarManager.java index 1e61e10..3d656c7 100644 --- a/core/java/android/app/StatusBarManager.java +++ b/core/java/android/app/StatusBarManager.java @@ -97,13 +97,13 @@ public class StatusBarManager { } /** - * Expand the notifications. + * Expand the notifications panel. */ - public void expandNotifications() { + public void expandNotificationsPanel() { try { final IStatusBarService svc = getService(); if (svc != null) { - svc.expandNotifications(); + svc.expandNotificationsPanel(); } } catch (RemoteException ex) { // system process is dead anyway. @@ -112,13 +112,13 @@ public class StatusBarManager { } /** - * Collapse the notifications. + * Collapse the notifications and settings panels. */ - public void collapseNotifications() { + public void collapsePanels() { try { final IStatusBarService svc = getService(); if (svc != null) { - svc.collapseNotifications(); + svc.collapsePanels(); } } catch (RemoteException ex) { // system process is dead anyway. @@ -127,28 +127,13 @@ public class StatusBarManager { } /** - * Expand the quick settings. + * Expand the settings panel. */ - public void expandQuickSettings() { + public void expandSettingsPanel() { try { final IStatusBarService svc = getService(); if (svc != null) { - svc.expandQuickSettings(); - } - } catch (RemoteException ex) { - // system process is dead anyway. - throw new RuntimeException(ex); - } - } - - /** - * Collapse the quick settings. - */ - public void collapseQuickSettings() { - try { - final IStatusBarService svc = getService(); - if (svc != null) { - svc.collapseQuickSettings(); + svc.expandSettingsPanel(); } } catch (RemoteException ex) { // system process is dead anyway. diff --git a/core/java/com/android/internal/statusbar/IStatusBar.aidl b/core/java/com/android/internal/statusbar/IStatusBar.aidl index 0737b52..780f5b3 100644 --- a/core/java/com/android/internal/statusbar/IStatusBar.aidl +++ b/core/java/com/android/internal/statusbar/IStatusBar.aidl @@ -28,10 +28,9 @@ oneway interface IStatusBar void updateNotification(IBinder key, in StatusBarNotification notification); void removeNotification(IBinder key); void disable(int state); - void animateExpandNotifications(); - void animateCollapseNotifications(); - void animateExpandQuickSettings(); - void animateCollapseQuickSettings(); + void animateExpandNotificationsPanel(); + void animateExpandSettingsPanel(); + void animateCollapsePanels(); void setSystemUiVisibility(int vis, int mask); void topAppWindowChanged(boolean menuVisible); void setImeWindowStatus(in IBinder token, int vis, int backDisposition); diff --git a/core/java/com/android/internal/statusbar/IStatusBarService.aidl b/core/java/com/android/internal/statusbar/IStatusBarService.aidl index 60e2b34..600c27a 100644 --- a/core/java/com/android/internal/statusbar/IStatusBarService.aidl +++ b/core/java/com/android/internal/statusbar/IStatusBarService.aidl @@ -24,16 +24,15 @@ import com.android.internal.statusbar.StatusBarNotification; /** @hide */ interface IStatusBarService { - void expandNotifications(); - void collapseNotifications(); - void expandQuickSettings(); - void collapseQuickSettings(); + void expandNotificationsPanel(); + void collapsePanels(); void disable(int what, IBinder token, String pkg); void setIcon(String slot, String iconPackage, int iconId, int iconLevel, String contentDescription); void setIconVisibility(String slot, boolean visible); void removeIcon(String slot); void topAppWindowChanged(boolean menuVisible); void setImeWindowStatus(in IBinder token, int vis, int backDisposition); + void expandSettingsPanel(); // ---- Methods below are for use by the status bar policy services ---- // You need the STATUS_BAR_SERVICE permission 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 @@ public class SearchPanelView extends FrameLayout implements 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 class SearchPanelView extends FrameLayout implements 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 @@ public abstract class BaseStatusBar extends SystemUI implements 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 abstract class BaseStatusBar extends SystemUI implements 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 @@ public abstract class BaseStatusBar extends SystemUI implements } // 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 @@ public class CommandQueue extends IStatusBar.Stub { 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 class CommandQueue extends IStatusBar.Stub { 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 class CommandQueue extends IStatusBar.Stub { } } - 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 @@ public class CommandQueue extends IStatusBar.Stub { mCallbacks.disable(msg.arg1); break; case MSG_EXPAND_NOTIFICATIONS: - mCallbacks.animateExpandNotifications(); - break; - case MSG_COLLAPSE_NOTIFICATIONS: - mCallbacks.animateCollapseNotifications(0); + mCallbacks.animateExpandNotificationsPanel(); break; - case MSG_EXPAND_QUICK_SETTINGS: - mCallbacks.animateExpandQuickSettings(); + case MSG_COLLAPSE_PANELS: + mCallbacks.animateCollapsePanels(0); 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 @@ public class PhoneStatusBar extends BaseStatusBar { = "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 class PhoneStatusBar extends BaseStatusBar { 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 @@ public class PhoneStatusBar extends BaseStatusBar { } if (CLOSE_PANEL_WHEN_EMPTIED && mNotificationData.size() == 0 && !mAnimating) { - animateCollapseNotifications(); + animateCollapsePanels(); } } @@ -1051,7 +1052,7 @@ public class PhoneStatusBar extends BaseStatusBar { } if ((diff & StatusBarManager.DISABLE_EXPAND) != 0) { if ((state & StatusBarManager.DISABLE_EXPAND) != 0) { - animateCollapseNotifications(); + animateCollapsePanels(); } } @@ -1111,10 +1112,13 @@ public class PhoneStatusBar extends BaseStatusBar { 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 @@ public class PhoneStatusBar extends BaseStatusBar { 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 @@ public class PhoneStatusBar extends BaseStatusBar { } @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 @@ public class PhoneStatusBar extends BaseStatusBar { } @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 @@ public class PhoneStatusBar extends BaseStatusBar { 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 @@ public class PhoneStatusBar extends BaseStatusBar { } } if (snapshot.isEmpty()) { - animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE); + animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE); return; } new Thread(new Runnable() { @@ -1729,7 +1733,7 @@ public class PhoneStatusBar extends BaseStatusBar { mHandler.postDelayed(new Runnable() { @Override public void run() { - animateCollapseNotifications(CommandQueue.FLAG_EXCLUDE_NONE); + animateCollapsePanels(CommandQueue.FLAG_EXCLUDE_NONE); } }, totalDelay + 225); } @@ -1751,7 +1755,7 @@ public class PhoneStatusBar extends BaseStatusBar { 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 @@ public class PhoneStatusBar extends BaseStatusBar { flags |= CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL; } } - animateCollapseNotifications(flags); + animateCollapsePanels(flags); } else if (Intent.ACTION_SCREEN_OFF.equals(action)) { // no waiting! @@ -1792,7 +1796,7 @@ public class PhoneStatusBar extends BaseStatusBar { @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 @@ class QuickSettings { } 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 @@ public class StatusBarWindowView extends FrameLayout 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 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, // 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 @@ public class SettingsView extends LinearLayout implements View.OnClickListener { 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 @@ public class SettingsView extends LinearLayout implements View.OnClickListener { 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 @@ public class TabletStatusBar extends BaseStatusBar implements SharedPreferences.Editor editor = Prefs.edit(mContext); editor.putBoolean(Prefs.DO_NOT_DISTURB_PREF, false); editor.apply(); - animateCollapseNotifications(); + animateCollapsePanels(); visibilityChanged(false); } }); @@ -821,7 +821,7 @@ public class TabletStatusBar extends BaseStatusBar implements 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 @@ public class TabletStatusBar extends BaseStatusBar implements 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 @@ public class TabletStatusBar extends BaseStatusBar implements 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 @@ public class TabletStatusBar extends BaseStatusBar implements } @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 @@ public class TabletStatusBar extends BaseStatusBar implements 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 @@ public class TabletStatusBar extends BaseStatusBar implements && 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 @@ public class TabletStatusBar extends BaseStatusBar implements } catch (RemoteException ex) { // system process is dead if we're here. } - animateCollapseNotifications(); + animateCollapsePanels(); visibilityChanged(false); } @@ -1509,7 +1504,7 @@ public class TabletStatusBar extends BaseStatusBar implements 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 @@ public class TvStatusBar extends BaseStatusBar { } @Override - public void animateExpandNotifications() { + public void animateExpandNotificationsPanel() { } @Override - public void animateCollapseNotifications(int flags) { + public void animateCollapsePanels(int flags) { } @Override @@ -143,10 +143,6 @@ public class TvStatusBar extends BaseStatusBar { } @Override - public void animateExpandQuickSettings() { - } - - @Override - public void animateCollapseQuickSettings() { + public void animateExpandSettingsPanel() { } } diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 01b53e2..ca86e7d 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -2916,8 +2916,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { try { IStatusBarService statusbar = getStatusBarService(); if (statusbar != null) { - statusbar.collapseNotifications(); - statusbar.collapseQuickSettings(); + statusbar.collapsePanels(); } } catch (RemoteException ex) { // re-acquire status bar service next time it is needed. diff --git a/services/java/com/android/server/StatusBarManagerService.java b/services/java/com/android/server/StatusBarManagerService.java index b567992..87b0eb3 100644 --- a/services/java/com/android/server/StatusBarManagerService.java +++ b/services/java/com/android/server/StatusBarManagerService.java @@ -117,45 +117,34 @@ public class StatusBarManagerService extends IStatusBarService.Stub // ================================================================================ // From IStatusBarService // ================================================================================ - public void expandNotifications() { + public void expandNotificationsPanel() { enforceExpandStatusBar(); if (mBar != null) { try { - mBar.animateExpandNotifications(); + mBar.animateExpandNotificationsPanel(); } catch (RemoteException ex) { } } } - public void collapseNotifications() { + public void collapsePanels() { enforceExpandStatusBar(); if (mBar != null) { try { - mBar.animateCollapseNotifications(); + mBar.animateCollapsePanels(); } catch (RemoteException ex) { } } } - public void expandQuickSettings() { + public void expandSettingsPanel() { enforceExpandStatusBar(); if (mBar != null) { try { - mBar.animateExpandQuickSettings(); - } catch (RemoteException ex) { - } - } - } - - public void collapseQuickSettings() { - enforceExpandStatusBar(); - - if (mBar != null) { - try { - mBar.animateCollapseQuickSettings(); + mBar.animateExpandSettingsPanel(); } catch (RemoteException ex) { } } @@ -620,8 +609,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub String action = intent.getAction(); if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action) || Intent.ACTION_SCREEN_OFF.equals(action)) { - collapseNotifications(); - collapseQuickSettings(); + collapsePanels(); } /* else if (Telephony.Intents.SPN_STRINGS_UPDATED_ACTION.equals(action)) { diff --git a/services/java/com/android/server/accessibility/AccessibilityManagerService.java b/services/java/com/android/server/accessibility/AccessibilityManagerService.java index 25f98de..1c013bd 100644 --- a/services/java/com/android/server/accessibility/AccessibilityManagerService.java +++ b/services/java/com/android/server/accessibility/AccessibilityManagerService.java @@ -1940,7 +1940,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { StatusBarManager statusBarManager = (StatusBarManager) mContext.getSystemService( android.app.Service.STATUS_BAR_SERVICE); - statusBarManager.expandNotifications(); + statusBarManager.expandNotificationsPanel(); Binder.restoreCallingIdentity(token); } @@ -1950,7 +1950,7 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub { StatusBarManager statusBarManager = (StatusBarManager) mContext.getSystemService( android.app.Service.STATUS_BAR_SERVICE); - statusBarManager.expandQuickSettings(); + statusBarManager.expandSettingsPanel(); Binder.restoreCallingIdentity(token); } diff --git a/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java b/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java index 3b6e107..50f98b8 100644 --- a/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java +++ b/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java @@ -284,25 +284,39 @@ public class StatusBarTest extends TestActivity }, 3000); } }, - new Test("Expand") { + new Test("Expand notifications") { public void run() { - mStatusBarManager.expandNotifications(); + mStatusBarManager.expandNotificationsPanel(); } }, - new Test("Expand in 3 sec.") { + new Test(" ... in 3 sec.") { public void run() { mHandler.postDelayed(new Runnable() { public void run() { - mStatusBarManager.expandNotifications(); + mStatusBarManager.expandNotificationsPanel(); } }, 3000); } }, - new Test("Collapse in 3 sec.") { + new Test("Expand settings") { + public void run() { + mStatusBarManager.expandSettingsPanel(); + } + }, + new Test(" ... in 3 sec.") { + public void run() { + mHandler.postDelayed(new Runnable() { + public void run() { + mStatusBarManager.expandSettingsPanel(); + } + }, 3000); + } + }, + new Test("Collapse panels in 3 sec.") { public void run() { mHandler.postDelayed(new Runnable() { public void run() { - mStatusBarManager.collapseNotifications(); + mStatusBarManager.collapsePanels(); } }, 3000); } |