Merge "Cleanup internal status bar APIs." into jb-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
0dc2b81ce1
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -185,7 +185,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;
|
||||
@@ -357,7 +357,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;
|
||||
}
|
||||
@@ -789,7 +789,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
|
||||
|
||||
@@ -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();
|
||||
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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -235,7 +235,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) {
|
||||
|
||||
@@ -70,7 +70,7 @@ public class StatusBarWindowView extends FrameLayout
|
||||
switch (event.getKeyCode()) {
|
||||
case KeyEvent.KEYCODE_BACK:
|
||||
if (!down) {
|
||||
mService.animateCollapseNotifications();
|
||||
mService.animateCollapsePanels();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2936,8 +2936,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.
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -2028,7 +2028,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);
|
||||
}
|
||||
@@ -2038,7 +2038,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);
|
||||
}
|
||||
|
||||
@@ -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.collapseNotifications();
|
||||
mStatusBarManager.expandSettingsPanel();
|
||||
}
|
||||
}, 3000);
|
||||
}
|
||||
},
|
||||
new Test("Collapse panels in 3 sec.") {
|
||||
public void run() {
|
||||
mHandler.postDelayed(new Runnable() {
|
||||
public void run() {
|
||||
mStatusBarManager.collapsePanels();
|
||||
}
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user