diff options
Diffstat (limited to 'packages/SystemUI/src/com/android')
15 files changed, 27 insertions, 25 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java index 452fd44..3b217df 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java @@ -24,6 +24,7 @@ import android.graphics.drawable.Drawable; import android.os.Handler; import android.os.Looper; import android.os.Message; +import android.text.TextUtils; import android.util.Log; import android.util.SparseArray; import android.view.View; @@ -67,6 +68,7 @@ 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); /** @@ -170,10 +172,6 @@ public abstract class QSTile<TState extends State> implements Listenable { handleRefreshState(null); } - protected void handleClick() { - MetricsLogger.action(mContext, getMetricsCategory(), getMetricsPackage()); - }; - protected void handleSecondaryClick() { // optional } @@ -182,10 +180,6 @@ 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 6744154..49f8d1c 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/AirplaneModeTile.java @@ -56,7 +56,7 @@ public class AirplaneModeTile extends QSTile<QSTile.BooleanState> { @Override public void handleClick() { - super.handleClick(); + MetricsLogger.action(mContext, getMetricsCategory(), !mState.value); setEnabled(!mState.value); mEnable.setAllowAnimation(true); mDisable.setAllowAnimation(true); 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 8eb624f..ed954bb 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/BluetoothTile.java @@ -75,8 +75,8 @@ public class BluetoothTile extends QSTile<QSTile.BooleanState> { @Override protected void handleClick() { - super.handleClick(); final boolean isEnabled = (Boolean)mState.value; + MetricsLogger.action(mContext, getMetricsCategory(), !isEnabled); mController.setBluetoothEnabled(!isEnabled); } @@ -184,6 +184,7 @@ public class BluetoothTile extends QSTile<QSTile.BooleanState> { @Override public void setToggleState(boolean state) { + MetricsLogger.action(mContext, MetricsLogger.QS_BLUETOOTH_TOGGLE, state); mController.setBluetoothEnabled(state); showDetail(false); } 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 a3d7bcc..c06ea66 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CastTile.java @@ -86,7 +86,7 @@ public class CastTile extends QSTile<QSTile.BooleanState> { @Override protected void handleClick() { - super.handleClick(); + MetricsLogger.action(mContext, getMetricsCategory()); showDetail(true); } @@ -246,6 +246,7 @@ public class CastTile extends QSTile<QSTile.BooleanState> { @Override public void onDetailItemClick(Item item) { if (item == null || item.tag == null) return; + MetricsLogger.action(mContext, MetricsLogger.QS_CAST_SELECT); final CastDevice device = (CastDevice) item.tag; mController.startCasting(device); } @@ -253,6 +254,7 @@ public class CastTile extends QSTile<QSTile.BooleanState> { @Override public void onDetailItemDisconnect(Item item) { if (item == null || item.tag == null) return; + MetricsLogger.action(mContext, MetricsLogger.QS_CAST_DISCONNECT); final CastDevice device = (CastDevice) item.tag; mController.stopCasting(device); } 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 0026141..1721335 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java @@ -76,7 +76,7 @@ public class CellularTile extends QSTile<QSTile.SignalState> { @Override protected void handleClick() { - super.handleClick(); + MetricsLogger.action(mContext, getMetricsCategory()); if (mDataController.isMobileDataSupported()) { showDetail(true); } else { @@ -230,6 +230,7 @@ public class CellularTile extends QSTile<QSTile.SignalState> { @Override public void setToggleState(boolean state) { + MetricsLogger.action(mContext, MetricsLogger.QS_CELLULAR_TOGGLE, state); mDataController.setMobileDataEnabled(state); } 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 6fa094e..c6fc6ff 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/ColorInversionTile.java @@ -87,7 +87,7 @@ public class ColorInversionTile extends QSTile<QSTile.BooleanState> { @Override protected void handleClick() { - super.handleClick(); + MetricsLogger.action(mContext, getMetricsCategory(), !mState.value); mSetting.setValue(mState.value ? 0 : 1); mEnable.setAllowAnimation(true); mDisable.setAllowAnimation(true); 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 e708a72..5e6083a 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/DndTile.java @@ -89,7 +89,7 @@ public class DndTile extends QSTile<QSTile.BooleanState> { @Override public void handleClick() { - super.handleClick(); + MetricsLogger.action(mContext, getMetricsCategory(), !mState.value); if (mState.value) { mController.setZen(Global.ZEN_MODE_OFF, null, TAG); } else { @@ -209,6 +209,7 @@ public class DndTile extends QSTile<QSTile.BooleanState> { @Override public void setToggleState(boolean state) { + MetricsLogger.action(mContext, MetricsLogger.QS_DND_TOGGLE, state); if (!state) { mController.setZen(Global.ZEN_MODE_OFF, null, TAG); showDetail(false); 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 a1f3cde..0369ab5 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/FlashlightTile.java @@ -60,10 +60,10 @@ public class FlashlightTile extends QSTile<QSTile.BooleanState> implements @Override protected void handleClick() { - super.handleClick(); if (ActivityManager.isUserAMonkey()) { return; } + MetricsLogger.action(mContext, getMetricsCategory(), !mState.value); boolean newState = !mState.value; refreshState(newState ? UserBoolean.USER_TRUE : UserBoolean.USER_FALSE); mFlashlightController.setFlashlight(newState); 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 b864ff4..f28a24b 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/HotspotTile.java @@ -69,8 +69,8 @@ public class HotspotTile extends QSTile<QSTile.BooleanState> { @Override protected void handleClick() { - super.handleClick(); final boolean isEnabled = (Boolean) mState.value; + MetricsLogger.action(mContext, getMetricsCategory(), !isEnabled); mController.setHotspotEnabled(!isEnabled); mEnable.setAllowAnimation(true); mDisable.setAllowAnimation(true); 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 20b5f04..19f4df6 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/IntentTile.java @@ -84,7 +84,7 @@ public class IntentTile extends QSTile<QSTile.State> { @Override protected void handleClick() { - super.handleClick(); + MetricsLogger.action(mContext, getMetricsCategory(), mIntentPackage); sendIntent("click", mOnClick, mOnClickUri); } @@ -137,6 +137,7 @@ public class IntentTile extends QSTile<QSTile.State> { mOnLongClick = intent.getParcelableExtra("onLongClick"); mOnLongClickUri = intent.getStringExtra("onLongClickUri"); mIntentPackage = intent.getStringExtra("package"); + mIntentPackage = mIntentPackage == null ? "" : mIntentPackage; } @Override @@ -144,11 +145,6 @@ public class IntentTile extends QSTile<QSTile.State> { return MetricsLogger.QS_INTENT; } - @Override - protected String getMetricsPackage() { - return mIntentPackage == null ? "" : mIntentPackage; - } - private final BroadcastReceiver mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { 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 ab22ada..e6fade4 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/LocationTile.java @@ -59,8 +59,8 @@ public class LocationTile extends QSTile<QSTile.BooleanState> { @Override protected void handleClick() { - super.handleClick(); final boolean wasEnabled = (Boolean) mState.value; + MetricsLogger.action(mContext, getMetricsCategory(), !wasEnabled); mController.setLocationEnabled(!wasEnabled); mEnable.setAllowAnimation(true); mDisable.setAllowAnimation(true); 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 7e3fe76..7c378f0 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/RotationLockTile.java @@ -59,8 +59,8 @@ public class RotationLockTile extends QSTile<QSTile.BooleanState> { @Override protected void handleClick() { - super.handleClick(); if (mController == null) return; + MetricsLogger.action(mContext, getMetricsCategory(), !mState.value); final boolean newState = !mState.value; mController.setRotationLocked(newState); refreshState(newState ? UserBoolean.USER_TRUE : UserBoolean.USER_FALSE); diff --git a/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailView.java b/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailView.java index 6bad652..d4f54b6 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailView.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/UserDetailView.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.PseudoGridView; import com.android.systemui.statusbar.policy.UserSwitcherController; @@ -84,6 +85,7 @@ public class UserDetailView extends PseudoGridView { public void onClick(View view) { UserSwitcherController.UserRecord tag = (UserSwitcherController.UserRecord) view.getTag(); + MetricsLogger.action(mContext, MetricsLogger.QS_SWITCH_USER); switchTo(tag); } } 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 228c293..c3f9e33 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java @@ -94,8 +94,8 @@ public class WifiTile extends QSTile<QSTile.SignalState> { @Override protected void handleClick() { - super.handleClick(); mState.copyTo(mStateBeforeClick); + MetricsLogger.action(mContext, getMetricsCategory(), !mState.enabled); mController.setWifiEnabled(!mState.enabled); } @@ -276,6 +276,7 @@ public class WifiTile extends QSTile<QSTile.SignalState> { @Override public void setToggleState(boolean state) { if (DEBUG) Log.d(TAG, "setToggleState " + state); + MetricsLogger.action(mContext, MetricsLogger.QS_WIFI_TOGGLE, state); mController.setWifiEnabled(state); showDetail(false); } diff --git a/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java b/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java index 9f9c9ac..b3b6725 100644 --- a/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java +++ b/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java @@ -48,6 +48,7 @@ import android.widget.LinearLayout; import android.widget.RadioButton; import android.widget.TextView; +import com.android.internal.logging.MetricsLogger; import com.android.systemui.Prefs; import com.android.systemui.R; import com.android.systemui.statusbar.policy.ZenModeController; @@ -598,6 +599,7 @@ public class ZenModePanel extends LinearLayout { if (childTag == null || childTag == tag) continue; childTag.rb.setChecked(false); } + MetricsLogger.action(mContext, MetricsLogger.QS_DND_CONDITION_SELECT); select(tag.condition); announceConditionSelection(tag); } @@ -700,6 +702,7 @@ public class ZenModePanel extends LinearLayout { } private void onClickTimeButton(View row, ConditionTag tag, boolean up) { + MetricsLogger.action(mContext, MetricsLogger.QS_DND_TIME, up); Condition newCondition = null; final int N = MINUTE_BUCKETS.length; if (mBucketIndex == -1) { @@ -907,6 +910,7 @@ public class ZenModePanel extends LinearLayout { public void onSelected(final Object value) { if (value != null && mZenButtons.isShown() && isAttachedToWindow()) { final int zen = (Integer) value; + MetricsLogger.action(mContext, MetricsLogger.QS_DND_ZEN_SELECT, zen); if (DEBUG) Log.d(mTag, "mZenButtonsCallback selected=" + zen); final Uri realConditionId = getRealConditionId(mSessionExitCondition); AsyncTask.execute(new Runnable() { |