summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src/com')
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSPanel.java18
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSTile.java20
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java14
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java28
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java17
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java6
18 files changed, 197 insertions, 11 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index b5c1ca8..f352849 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -33,6 +33,7 @@ import android.view.accessibility.AccessibilityEvent;
import android.widget.ImageView;
import android.widget.TextView;
+import com.android.internal.logging.MetricsLogger;
import com.android.systemui.FontSizeUtils;
import com.android.systemui.R;
import com.android.systemui.qs.QSTile.DetailAdapter;
@@ -182,8 +183,11 @@ public class QSPanel extends ViewGroup {
public void setExpanded(boolean expanded) {
if (mExpanded == expanded) return;
mExpanded = expanded;
+ MetricsLogger.visibility(mContext, MetricsLogger.QS_PANEL, mExpanded);
if (!mExpanded) {
closeDetail();
+ } else {
+ logTiles();
}
}
@@ -365,9 +369,11 @@ public class QSPanel extends ViewGroup {
mDetailContent.removeAllViews();
mDetail.bringToFront();
mDetailContent.addView(r.detailView);
+ MetricsLogger.visible(mContext, detailAdapter.getMetricsCategory());
setDetailRecord(r);
listener = mHideGridContentWhenDone;
} else {
+ MetricsLogger.hidden(mContext, mDetailRecord.detailAdapter.getMetricsCategory());
mClosingDetail = true;
setGridContentVisibility(true);
listener = mTeardownDetailWhenDone;
@@ -387,9 +393,21 @@ public class QSPanel extends ViewGroup {
}
}
mBrightnessView.setVisibility(newVis);
+ if (mGridContentVisible != visible) {
+ MetricsLogger.visibility(mContext, MetricsLogger.QS_PANEL, newVis);
+ }
mGridContentVisible = visible;
}
+ private void logTiles() {
+ for (int i = 0; i < mRecords.size(); i++) {
+ TileRecord tileRecord = mRecords.get(i);
+ if (tileRecord.tile.getState().visible) {
+ MetricsLogger.visible(mContext, tileRecord.tile.getMetricsCategory());
+ }
+ }
+ }
+
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
final int width = MeasureSpec.getSize(widthMeasureSpec);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
index b9574dc..452fd44 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
@@ -29,6 +29,7 @@ import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
+import com.android.internal.logging.MetricsLogger;
import com.android.systemui.qs.QSTile.State;
import com.android.systemui.statusbar.policy.BluetoothController;
import com.android.systemui.statusbar.policy.CastController;
@@ -66,9 +67,17 @@ public abstract class QSTile<TState extends State> implements Listenable {
private boolean mAnnounceNextStateChange;
abstract protected TState newTileState();
- abstract protected void handleClick();
abstract protected void handleUpdateState(TState state, Object arg);
+ /**
+ * Declare the category of this tile.
+ *
+ * Categories are defined in {@link com.android.internal.logging.MetricsLogger}
+ * or if there is no relevant existing category you may define one in
+ * {@link com.android.systemui.qs.QSTile}.
+ */
+ abstract public int getMetricsCategory();
+
protected QSTile(Host host) {
mHost = host;
mContext = host.getContext();
@@ -97,6 +106,7 @@ public abstract class QSTile<TState extends State> implements Listenable {
View createDetailView(Context context, View convertView, ViewGroup parent);
Intent getSettingsIntent();
void setToggleState(boolean state);
+ int getMetricsCategory();
}
// safe to call from any thread
@@ -160,6 +170,10 @@ public abstract class QSTile<TState extends State> implements Listenable {
handleRefreshState(null);
}
+ protected void handleClick() {
+ MetricsLogger.action(mContext, getMetricsCategory(), getMetricsPackage());
+ };
+
protected void handleSecondaryClick() {
// optional
}
@@ -168,6 +182,10 @@ public abstract class QSTile<TState extends State> implements Listenable {
// optional
}
+ protected String getMetricsPackage() {
+ return "";
+ }
+
protected void handleRefreshState(Object arg) {
handleUpdateState(mTmpState, arg);
final boolean changed = mTmpState.copyTo(mState);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java
index 2bc31fc..6744154 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java
@@ -23,6 +23,7 @@ import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.provider.Settings.Global;
+import com.android.internal.logging.MetricsLogger;
import com.android.systemui.R;
import com.android.systemui.qs.GlobalSetting;
import com.android.systemui.qs.QSTile;
@@ -55,6 +56,7 @@ public class AirplaneModeTile extends QSTile<QSTile.BooleanState> {
@Override
public void handleClick() {
+ super.handleClick();
setEnabled(!mState.value);
mEnable.setAllowAnimation(true);
mDisable.setAllowAnimation(true);
@@ -85,6 +87,11 @@ public class AirplaneModeTile extends QSTile<QSTile.BooleanState> {
}
@Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_AIRPLANEMODE;
+ }
+
+ @Override
protected String composeChangeAnnouncement() {
if (mState.value) {
return mContext.getString(R.string.accessibility_quick_settings_airplane_changed_on);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
index b42b5f6..8eb624f 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java
@@ -25,6 +25,7 @@ import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
+import com.android.internal.logging.MetricsLogger;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.systemui.R;
import com.android.systemui.qs.QSDetailItems;
@@ -74,6 +75,7 @@ public class BluetoothTile extends QSTile<QSTile.BooleanState> {
@Override
protected void handleClick() {
+ super.handleClick();
final boolean isEnabled = (Boolean)mState.value;
mController.setBluetoothEnabled(!isEnabled);
}
@@ -132,6 +134,11 @@ public class BluetoothTile extends QSTile<QSTile.BooleanState> {
}
@Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_BLUETOOTH;
+ }
+
+ @Override
protected String composeChangeAnnouncement() {
if (mState.value) {
return mContext.getString(R.string.accessibility_quick_settings_bluetooth_changed_on);
@@ -182,6 +189,11 @@ public class BluetoothTile extends QSTile<QSTile.BooleanState> {
}
@Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_BLUETOOTH_DETAILS;
+ }
+
+ @Override
public View createDetailView(Context context, View convertView, ViewGroup parent) {
mItems = QSDetailItems.convertOrInflate(context, convertView, parent);
mItems.setTagSuffix("Bluetooth");
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
index 5bf6fb5..a3d7bcc 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java
@@ -24,6 +24,7 @@ import android.view.View;
import android.view.View.OnAttachStateChangeListener;
import android.view.ViewGroup;
+import com.android.internal.logging.MetricsLogger;
import com.android.systemui.R;
import com.android.systemui.qs.QSDetailItems;
import com.android.systemui.qs.QSDetailItems.Item;
@@ -85,6 +86,7 @@ public class CastTile extends QSTile<QSTile.BooleanState> {
@Override
protected void handleClick() {
+ super.handleClick();
showDetail(true);
}
@@ -113,6 +115,11 @@ public class CastTile extends QSTile<QSTile.BooleanState> {
}
@Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_CAST;
+ }
+
+ @Override
protected String composeChangeAnnouncement() {
if (!mState.value) {
// We only announce when it's turned off to avoid vocal overflow.
@@ -164,6 +171,11 @@ public class CastTile extends QSTile<QSTile.BooleanState> {
}
@Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_CAST_DETAILS;
+ }
+
+ @Override
public View createDetailView(Context context, View convertView, ViewGroup parent) {
mItems = QSDetailItems.convertOrInflate(context, convertView, parent);
mItems.setTagSuffix("Cast");
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
index 30f92b9..0026141 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
@@ -24,6 +24,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import com.android.internal.logging.MetricsLogger;
import com.android.systemui.R;
import com.android.systemui.qs.QSTile;
import com.android.systemui.qs.QSTileView;
@@ -75,6 +76,7 @@ public class CellularTile extends QSTile<QSTile.SignalState> {
@Override
protected void handleClick() {
+ super.handleClick();
if (mDataController.isMobileDataSupported()) {
showDetail(true);
} else {
@@ -118,6 +120,11 @@ public class CellularTile extends QSTile<QSTile.SignalState> {
state.label);
}
+ @Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_CELLULAR;
+ }
+
// Remove the period from the network name
public static String removeTrailingPeriod(String string) {
if (string == null) return null;
@@ -227,6 +234,11 @@ public class CellularTile extends QSTile<QSTile.SignalState> {
}
@Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_DATAUSAGEDETAIL;
+ }
+
+ @Override
public View createDetailView(Context context, View convertView, ViewGroup parent) {
final DataUsageDetailView v = (DataUsageDetailView) (convertView != null
? convertView
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java
index 4a33f55..6fa094e 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java
@@ -18,6 +18,7 @@ package com.android.systemui.qs.tiles;
import android.provider.Settings.Secure;
+import com.android.internal.logging.MetricsLogger;
import com.android.systemui.Prefs;
import com.android.systemui.R;
import com.android.systemui.qs.QSTile;
@@ -86,6 +87,7 @@ public class ColorInversionTile extends QSTile<QSTile.BooleanState> {
@Override
protected void handleClick() {
+ super.handleClick();
mSetting.setValue(mState.value ? 0 : 1);
mEnable.setAllowAnimation(true);
mDisable.setAllowAnimation(true);
@@ -115,6 +117,11 @@ public class ColorInversionTile extends QSTile<QSTile.BooleanState> {
}
@Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_COLORINVERSION;
+ }
+
+ @Override
protected String composeChangeAnnouncement() {
if (mState.value) {
return mContext.getString(
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
index 5145bc7..e708a72 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java
@@ -29,6 +29,7 @@ import android.view.View;
import android.view.View.OnAttachStateChangeListener;
import android.view.ViewGroup;
+import com.android.internal.logging.MetricsLogger;
import com.android.systemui.Prefs;
import com.android.systemui.R;
import com.android.systemui.qs.QSTile;
@@ -88,6 +89,7 @@ public class DndTile extends QSTile<QSTile.BooleanState> {
@Override
public void handleClick() {
+ super.handleClick();
if (mState.value) {
mController.setZen(Global.ZEN_MODE_OFF, null, TAG);
} else {
@@ -135,6 +137,11 @@ public class DndTile extends QSTile<QSTile.BooleanState> {
}
@Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_DND;
+ }
+
+ @Override
protected String composeChangeAnnouncement() {
if (mState.value) {
return mContext.getString(R.string.accessibility_quick_settings_dnd_changed_on);
@@ -209,6 +216,11 @@ public class DndTile extends QSTile<QSTile.BooleanState> {
}
@Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_DND_DETAILS;
+ }
+
+ @Override
public View createDetailView(Context context, View convertView, ViewGroup parent) {
final ZenModePanel zmp = convertView != null ? (ZenModePanel) convertView
: (ZenModePanel) LayoutInflater.from(context).inflate(
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java
index cb78deb..a1f3cde 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java
@@ -18,6 +18,7 @@ package com.android.systemui.qs.tiles;
import android.app.ActivityManager;
+import com.android.internal.logging.MetricsLogger;
import com.android.systemui.R;
import com.android.systemui.qs.QSTile;
import com.android.systemui.statusbar.policy.FlashlightController;
@@ -59,6 +60,7 @@ public class FlashlightTile extends QSTile<QSTile.BooleanState> implements
@Override
protected void handleClick() {
+ super.handleClick();
if (ActivityManager.isUserAMonkey()) {
return;
}
@@ -84,6 +86,11 @@ public class FlashlightTile extends QSTile<QSTile.BooleanState> implements
}
@Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_FLASHLIGHT;
+ }
+
+ @Override
protected String composeChangeAnnouncement() {
if (mState.value) {
return mContext.getString(R.string.accessibility_quick_settings_flashlight_changed_on);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
index 6063f80..b864ff4 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java
@@ -20,6 +20,7 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
+import com.android.internal.logging.MetricsLogger;
import com.android.systemui.Prefs;
import com.android.systemui.R;
import com.android.systemui.qs.UsageTracker;
@@ -68,6 +69,7 @@ public class HotspotTile extends QSTile<QSTile.BooleanState> {
@Override
protected void handleClick() {
+ super.handleClick();
final boolean isEnabled = (Boolean) mState.value;
mController.setHotspotEnabled(!isEnabled);
mEnable.setAllowAnimation(true);
@@ -97,6 +99,11 @@ public class HotspotTile extends QSTile<QSTile.BooleanState> {
}
@Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_HOTSPOT;
+ }
+
+ @Override
protected String composeChangeAnnouncement() {
if (mState.value) {
return mContext.getString(R.string.accessibility_quick_settings_hotspot_changed_on);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java
index 2736530..20b5f04 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java
@@ -29,6 +29,7 @@ import android.os.UserHandle;
import android.text.TextUtils;
import android.util.Log;
+import com.android.internal.logging.MetricsLogger;
import com.android.systemui.qs.QSTile;
import java.util.Arrays;
@@ -42,6 +43,7 @@ public class IntentTile extends QSTile<QSTile.State> {
private PendingIntent mOnLongClick;
private String mOnLongClickUri;
private int mCurrentUserId;
+ private String mIntentPackage;
private IntentTile(Host host, String action) {
super(host);
@@ -82,6 +84,7 @@ public class IntentTile extends QSTile<QSTile.State> {
@Override
protected void handleClick() {
+ super.handleClick();
sendIntent("click", mOnClick, mOnClickUri);
}
@@ -133,6 +136,17 @@ public class IntentTile extends QSTile<QSTile.State> {
mOnClickUri = intent.getStringExtra("onClickUri");
mOnLongClick = intent.getParcelableExtra("onLongClick");
mOnLongClickUri = intent.getStringExtra("onLongClickUri");
+ mIntentPackage = intent.getStringExtra("package");
+ }
+
+ @Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_INTENT;
+ }
+
+ @Override
+ protected String getMetricsPackage() {
+ return mIntentPackage == null ? "" : mIntentPackage;
}
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java
index 11ec722..ab22ada 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java
@@ -16,6 +16,7 @@
package com.android.systemui.qs.tiles;
+import com.android.internal.logging.MetricsLogger;
import com.android.systemui.R;
import com.android.systemui.qs.QSTile;
import com.android.systemui.statusbar.policy.KeyguardMonitor;
@@ -58,6 +59,7 @@ public class LocationTile extends QSTile<QSTile.BooleanState> {
@Override
protected void handleClick() {
+ super.handleClick();
final boolean wasEnabled = (Boolean) mState.value;
mController.setLocationEnabled(!wasEnabled);
mEnable.setAllowAnimation(true);
@@ -87,6 +89,11 @@ public class LocationTile extends QSTile<QSTile.BooleanState> {
}
@Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_LOCATION;
+ }
+
+ @Override
protected String composeChangeAnnouncement() {
if (mState.value) {
return mContext.getString(R.string.accessibility_quick_settings_location_changed_on);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java
index f46b9a6..7e3fe76 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java
@@ -18,6 +18,7 @@ package com.android.systemui.qs.tiles;
import android.content.res.Configuration;
+import com.android.internal.logging.MetricsLogger;
import com.android.systemui.R;
import com.android.systemui.qs.QSTile;
import com.android.systemui.statusbar.policy.RotationLockController;
@@ -58,6 +59,7 @@ public class RotationLockTile extends QSTile<QSTile.BooleanState> {
@Override
protected void handleClick() {
+ super.handleClick();
if (mController == null) return;
final boolean newState = !mState.value;
mController.setRotationLocked(newState);
@@ -92,6 +94,11 @@ public class RotationLockTile extends QSTile<QSTile.BooleanState> {
R.string.accessibility_rotation_lock_off);
}
+ @Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_ROTATIONLOCK;
+ }
+
/**
* Get the correct accessibility string based on the state
*
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
index d589366..228c293 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java
@@ -26,6 +26,7 @@ import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
+import com.android.internal.logging.MetricsLogger;
import com.android.settingslib.wifi.AccessPoint;
import com.android.systemui.R;
import com.android.systemui.qs.QSDetailItems;
@@ -93,6 +94,7 @@ public class WifiTile extends QSTile<QSTile.SignalState> {
@Override
protected void handleClick() {
+ super.handleClick();
mState.copyTo(mStateBeforeClick);
mController.setWifiEnabled(!mState.enabled);
}
@@ -159,6 +161,11 @@ public class WifiTile extends QSTile<QSTile.SignalState> {
}
@Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_WIFI;
+ }
+
+ @Override
protected boolean shouldAnnouncementBeDelayed() {
return mStateBeforeClick.enabled == mState.enabled;
}
@@ -274,6 +281,11 @@ public class WifiTile extends QSTile<QSTile.SignalState> {
}
@Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_WIFI_DETAILS;
+ }
+
+ @Override
public View createDetailView(Context context, View convertView, ViewGroup parent) {
if (DEBUG) Log.d(TAG, "createDetailView convertView=" + (convertView != null));
mAccessPoints = null;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
index 4542054..80fdd28 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java
@@ -157,7 +157,8 @@ public class CommandQueue extends IStatusBar.Stub {
public void setSystemUiVisibility(int vis, int mask) {
synchronized (mList) {
- mHandler.removeMessages(MSG_SET_SYSTEMUI_VISIBILITY);
+ // Don't coalesce these, since it might have one time flags set such as
+ // STATUS_BAR_UNHIDE which might get lost.
mHandler.obtainMessage(MSG_SET_SYSTEMUI_VISIBILITY, vis, mask, null).sendToTarget();
}
}
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 351977b..471196c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -529,6 +529,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
= new HashMap<>();
private HashSet<Entry> mHeadsUpEntriesToRemoveOnSwitch = new HashSet<>();
private RankingMap mLatestRankingMap;
+ private boolean mNoAnimationOnNextBarModeChange;
@Override
public void start() {
@@ -1709,6 +1710,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
* State is one or more of the DISABLE constants from StatusBarManager.
*/
public void disable(int state1, int state2, boolean animate) {
+ animate &= mStatusBarWindowState != WINDOW_STATE_HIDDEN;
mDisabledUnmodified1 = state1;
mDisabledUnmodified2 = state2;
state1 = adjustDisableFlags(state1);
@@ -1868,6 +1870,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
public void onHeadsUpPinnedModeChanged(boolean inPinnedMode) {
if (inPinnedMode) {
mStatusBarWindowManager.setHeadsUpShowing(true);
+ mStatusBarWindowManager.setForceStatusBarVisible(true);
} else {
Runnable endRunnable = new Runnable() {
@Override
@@ -2132,6 +2135,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
// Shrink the window to the size of the status bar only
mStatusBarWindowManager.setStatusBarExpanded(false);
+ mStatusBarWindowManager.setForceStatusBarVisible(false);
mStatusBarView.setFocusable(true);
// Close any "App info" popups that might have snuck on-screen
@@ -2272,6 +2276,12 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
setAreThereNotifications();
}
+ // ready to unhide
+ if ((vis & View.STATUS_BAR_UNHIDE) != 0) {
+ mSystemUiVisibility &= ~View.STATUS_BAR_UNHIDE;
+ mNoAnimationOnNextBarModeChange = true;
+ }
+
// update status bar mode
final int sbMode = computeBarMode(oldVal, newVal, mStatusBarView.getBarTransitions(),
View.STATUS_BAR_TRANSIENT, View.STATUS_BAR_TRANSLUCENT);
@@ -2303,10 +2313,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
}
}
- // ready to unhide
- if ((vis & View.STATUS_BAR_UNHIDE) != 0) {
- mSystemUiVisibility &= ~View.STATUS_BAR_UNHIDE;
- }
if ((vis & View.NAVIGATION_BAR_UNHIDE) != 0) {
mSystemUiVisibility &= ~View.NAVIGATION_BAR_UNHIDE;
}
@@ -2351,17 +2357,21 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
private void checkBarModes() {
if (mDemoMode) return;
- checkBarMode(mStatusBarMode, mStatusBarWindowState, mStatusBarView.getBarTransitions());
+ checkBarMode(mStatusBarMode, mStatusBarWindowState, mStatusBarView.getBarTransitions(),
+ mNoAnimationOnNextBarModeChange);
if (mNavigationBarView != null) {
checkBarMode(mNavigationBarMode,
- mNavigationBarWindowState, mNavigationBarView.getBarTransitions());
+ mNavigationBarWindowState, mNavigationBarView.getBarTransitions(),
+ mNoAnimationOnNextBarModeChange);
}
+ mNoAnimationOnNextBarModeChange = false;
}
- private void checkBarMode(int mode, int windowState, BarTransitions transitions) {
+ private void checkBarMode(int mode, int windowState, BarTransitions transitions,
+ boolean noAnimation) {
final boolean powerSave = mBatteryController.isPowerSave();
- final boolean anim = (mScreenOn == null || mScreenOn) && windowState != WINDOW_STATE_HIDDEN
- && !powerSave;
+ final boolean anim = !noAnimation && (mScreenOn == null || mScreenOn)
+ && windowState != WINDOW_STATE_HIDDEN && !powerSave;
if (powerSave && getBarState() == StatusBarState.SHADE) {
mode = MODE_WARNING;
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java
index 84a9f64..e7e4384 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarWindowManager.java
@@ -166,6 +166,7 @@ public class StatusBarWindowManager {
private void apply(State state) {
applyKeyguardFlags(state);
+ applyForceStatusBarVisibleFlag(state);
applyFocusableFlag(state);
adjustScreenOrientation(state);
applyHeight(state);
@@ -178,6 +179,16 @@ public class StatusBarWindowManager {
}
}
+ private void applyForceStatusBarVisibleFlag(State state) {
+ if (state.forceStatusBarVisible) {
+ mLpChanged.privateFlags |= WindowManager
+ .LayoutParams.PRIVATE_FLAG_FORCE_STATUS_BAR_VISIBLE_TRANSPARENT;
+ } else {
+ mLpChanged.privateFlags &= ~WindowManager
+ .LayoutParams.PRIVATE_FLAG_FORCE_STATUS_BAR_VISIBLE_TRANSPARENT;
+ }
+ }
+
private void applyModalFlag(State state) {
if (state.headsUpShowing) {
mLpChanged.flags |= WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
@@ -240,6 +251,11 @@ public class StatusBarWindowManager {
apply(mCurrentState);
}
+ public void setForceStatusBarVisible(boolean forceStatusBarVisible) {
+ mCurrentState.forceStatusBarVisible = forceStatusBarVisible;
+ apply(mCurrentState);
+ }
+
private static class State {
boolean keyguardShowing;
boolean keyguardOccluded;
@@ -250,6 +266,7 @@ public class StatusBarWindowManager {
boolean keyguardFadingAway;
boolean qsExpanded;
boolean headsUpShowing;
+ boolean forceStatusBarVisible;
/**
* The {@link BaseStatusBar} state from the status bar.
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
index 194bcfa..ad27c6e 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java
@@ -43,6 +43,7 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
+import com.android.internal.logging.MetricsLogger;
import com.android.internal.util.UserIcons;
import com.android.systemui.BitmapHelper;
import com.android.systemui.GuestResumeSessionReceiver;
@@ -548,6 +549,11 @@ public class UserSwitcherController {
@Override
public void setToggleState(boolean state) {
}
+
+ @Override
+ public int getMetricsCategory() {
+ return MetricsLogger.QS_USERDETAIL;
+ }
};
private final KeyguardMonitor.Callback mCallback = new KeyguardMonitor.Callback() {