= "android.app.action.INTERRUPTION_FILTER_CHANGED";
/**
+ * Intent that is broadcast when the state of getCurrentInterruptionFilter() changes.
+ * @hide
+ */
+ @SdkConstant(SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION)
+ public static final String ACTION_INTERRUPTION_FILTER_CHANGED_INTERNAL
+ = "android.app.action.INTERRUPTION_FILTER_CHANGED_INTERNAL";
+
+ /**
* {@link #getCurrentInterruptionFilter() Interruption filter} constant -
* Normal interruption filter.
*/
* Expand the settings panel.
*/
public void expandSettingsPanel() {
+ expandSettingsPanel(null);
+ }
+
+ /**
+ * Expand the settings panel and open a subPanel, pass null to just open the settings panel.
+ */
+ public void expandSettingsPanel(String subPanel) {
try {
final IStatusBarService svc = getService();
if (svc != null) {
- svc.expandSettingsPanel();
+ svc.expandSettingsPanel(subPanel);
}
} catch (RemoteException ex) {
// system process is dead anyway.
void removeIcon(int index);
void disable(int state1, int state2);
void animateExpandNotificationsPanel();
- void animateExpandSettingsPanel();
+ void animateExpandSettingsPanel(String subPanel);
void animateCollapsePanels();
void setSystemUiVisibility(int vis, int mask);
void topAppWindowChanged(boolean menuVisible);
void topAppWindowChanged(boolean menuVisible);
void setImeWindowStatus(in IBinder token, int vis, int backDisposition,
boolean showImeSwitcher);
- void expandSettingsPanel();
+ void expandSettingsPanel(String subPanel);
void setCurrentUser(int newUserId);
// ---- Methods below are for use by the status bar policy services ----
}
}
+ public void openDetails(String subPanel) {
+ QSTile<?> tile = getTile(subPanel);
+ showDetailAdapter(true, tile.getDetailAdapter(), new int[] {getWidth() / 2, 0});
+ }
+
+ private QSTile<?> getTile(String subPanel) {
+ for (int i = 0; i < mRecords.size(); i++) {
+ if (subPanel.equals(mRecords.get(i).tile.getTileSpec())) {
+ return mRecords.get(i).tile;
+ }
+ }
+ return mHost.createTile(subPanel);
+ }
+
protected void createCustomizePanel() {
mCustomizePanel = (QSCustomizer) LayoutInflater.from(mContext)
.inflate(R.layout.qs_customize_panel, null);
public void disable(int state1, int state2, boolean animate);
public void animateExpandNotificationsPanel();
public void animateCollapsePanels(int flags);
- public void animateExpandSettingsPanel();
+ public void animateExpandSettingsPanel(String obj);
public void setSystemUiVisibility(int vis, int mask);
public void topAppWindowChanged(boolean visible);
public void setImeWindowStatus(IBinder token, int vis, int backDisposition,
}
}
- public void animateExpandSettingsPanel() {
+ public void animateExpandSettingsPanel(String subPanel) {
synchronized (mList) {
mHandler.removeMessages(MSG_EXPAND_SETTINGS);
- mHandler.sendEmptyMessage(MSG_EXPAND_SETTINGS);
+ mHandler.obtainMessage(MSG_EXPAND_SETTINGS, subPanel).sendToTarget();
}
}
mCallbacks.animateCollapsePanels(0);
break;
case MSG_EXPAND_SETTINGS:
- mCallbacks.animateExpandSettingsPanel();
+ mCallbacks.animateExpandSettingsPanel((String) msg.obj);
break;
case MSG_SET_SYSTEMUI_VISIBILITY:
mCallbacks.setSystemUiVisibility(msg.arg1, msg.arg2);
animateExpandNotificationsPanel();
break;
case MSG_OPEN_SETTINGS_PANEL:
- animateExpandSettingsPanel();
+ animateExpandSettingsPanel((String) m.obj);
break;
case MSG_CLOSE_PANELS:
animateCollapsePanels();
}
@Override
- public void animateExpandSettingsPanel() {
+ public void animateExpandSettingsPanel(String subPanel) {
if (SPEW) Log.d(TAG, "animateExpand: mExpandedVisible=" + mExpandedVisible);
if (!panelsEnabled()) {
return;
// Settings are not available in setup
if (!mUserSetup) return;
+
+ if (subPanel != null) {
+ mQSPanel.openDetails(subPanel);
+ }
mNotificationPanel.expandWithQs();
if (false) postStartTracing();
}
@Override
- public void animateExpandSettingsPanel() {
+ public void animateExpandSettingsPanel(String subPanel) {
}
@Override
@Override
void onZenModeChanged() {
sendRegisteredOnlyBroadcast(NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED);
+ getContext().sendBroadcastAsUser(
+ new Intent(NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED_INTERNAL),
+ UserHandle.ALL, android.Manifest.permission.MANAGE_NOTIFICATIONS);
synchronized(mNotificationList) {
updateInterruptionFilterLocked();
}
private boolean evaluateZenMode(String reason, boolean setRingerMode) {
if (DEBUG) Log.d(TAG, "evaluateZenMode");
+ final int zenBefore = mZenMode;
final int zen = computeZenMode();
ZenLog.traceSetZenMode(zen, reason);
mZenMode = zen;
applyZenToRingerMode();
}
applyRestrictions();
- if (zen != mZenMode) {
+ if (zen != zenBefore) {
mHandler.postDispatchOnZenModeChanged();
}
return true;
}
@Override
- public void expandSettingsPanel() {
+ public void expandSettingsPanel(String subPanel) {
enforceExpandStatusBar();
if (mBar != null) {
try {
- mBar.animateExpandSettingsPanel();
+ mBar.animateExpandSettingsPanel(subPanel);
} catch (RemoteException ex) {
}
}