Loading packages/SystemUI/src/com/android/systemui/qs/QSTile.java +3 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ import android.util.SparseArray; import android.view.View; import android.view.ViewGroup; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsProto.MetricsEvent; import com.android.settingslib.RestrictedLockUtils; import com.android.systemui.qs.QSTile.State; import com.android.systemui.qs.external.TileServices; Loading Loading @@ -217,6 +219,7 @@ public abstract class QSTile<TState extends State> implements Listenable { } protected void handleLongClick() { MetricsLogger.action(mContext, MetricsEvent.ACTION_QS_LONG_PRESS, getTileSpec()); mHost.startActivityDismissingKeyguard(getLongClickIntent()); } Loading packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java +5 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ import android.view.View; import android.widget.LinearLayout; import android.widget.Toolbar; import android.widget.Toolbar.OnMenuItemClickListener; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsProto; import com.android.systemui.R; import com.android.systemui.qs.QSContainer; import com.android.systemui.qs.QSDetailClipper; Loading Loading @@ -116,6 +118,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene public void show(int x, int y) { if (!isShown) { MetricsLogger.visible(getContext(), MetricsProto.MetricsEvent.QS_EDIT); isShown = true; setTileSpecs(); setVisibility(View.VISIBLE); Loading @@ -127,6 +130,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene public void hide(int x, int y) { if (isShown) { MetricsLogger.hidden(getContext(), MetricsProto.MetricsEvent.QS_EDIT); isShown = false; mToolbar.dismissPopupMenus(); setCustomizing(false); Loading @@ -149,6 +153,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { case MENU_RESET: MetricsLogger.action(getContext(), MetricsProto.MetricsEvent.ACTION_QS_EDIT_RESET); reset(); break; } Loading packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java +25 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.qs.customize; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; import android.graphics.Canvas; Loading @@ -36,12 +37,15 @@ import android.view.ViewGroup; import android.view.accessibility.AccessibilityManager; import android.widget.FrameLayout; import android.widget.TextView; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsProto; import com.android.systemui.R; import com.android.systemui.qs.QSIconView; import com.android.systemui.qs.QSTileView; import com.android.systemui.qs.customize.TileAdapter.Holder; import com.android.systemui.qs.customize.TileQueryHelper.TileInfo; import com.android.systemui.qs.customize.TileQueryHelper.TileStateListener; import com.android.systemui.qs.external.CustomTile; import com.android.systemui.statusbar.phone.QSTileHost; import com.android.systemui.statusbar.phone.SystemUIDialog; Loading Loading @@ -304,12 +308,24 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta notifyItemMoved(from, to); CharSequence announcement; if (to >= mDividerIndex) { MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_QS_EDIT_REMOVE_SPEC, strip(mTiles.get(to))); MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_QS_EDIT_REMOVE, from); announcement = mContext.getString(R.string.accessibility_qs_edit_tile_removed, fromLabel); } else if (from >= mDividerIndex) { MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_QS_EDIT_ADD_SPEC, strip(mTiles.get(to))); MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_QS_EDIT_ADD, to); announcement = mContext.getString(R.string.accessibility_qs_edit_tile_added, fromLabel, (to + 1)); } else { MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_QS_EDIT_MOVE_SPEC, strip(mTiles.get(to))); MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_QS_EDIT_MOVE, to); announcement = mContext.getString(R.string.accessibility_qs_edit_tile_moved, fromLabel, (to + 1)); } Loading @@ -317,6 +333,15 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta return true; } private String strip(TileInfo tileInfo) { String spec = tileInfo.spec; if (spec.startsWith(CustomTile.PREFIX)) { ComponentName component = CustomTile.getComponentFromSpec(spec); return component.getPackageName(); } return spec; } private <T> void move(int from, int to, List<T> list) { list.add(from > to ? to : to + 1, list.get(from)); list.remove(from > to ? from + 1 : from); Loading proto/src/metrics_constants.proto +27 −0 Original line number Diff line number Diff line Loading @@ -2020,6 +2020,33 @@ message MetricsEvent { // Logged when a user dismisses all task in overview OVERVIEW_DISMISS_ALL = 357; // Quick Settings -> Edit QS_EDIT = 358; // Quick Settings -> Edit -> Overflow -> Reset ACTION_QS_EDIT_RESET = 359; // QS -> Edit - Drag a tile out of the active tiles. // The _SPEC contains either the spec of the tile or // the package of the 3rd party app in the PKG field. ACTION_QS_EDIT_REMOVE_SPEC = 360; ACTION_QS_EDIT_REMOVE = 361; // QS -> Edit - Drag a tile into the active tiles. // The _SPEC contains either the spec of the tile or // the package of the 3rd party app in the PKG field. ACTION_QS_EDIT_ADD_SPEC = 362; ACTION_QS_EDIT_ADD = 363; // QS -> Edit - Drag a tile within the active tiles. // The _SPEC contains either the spec of the tile or // the package of the 3rd party app in the PKG field. ACTION_QS_EDIT_MOVE_SPEC = 364; ACTION_QS_EDIT_MOVE = 365; // Long-press on a QS tile. Tile spec in package field. ACTION_QS_LONG_PRESS = 366; // Add new aosp constants above this line. // END OF AOSP CONSTANTS } Loading Loading
packages/SystemUI/src/com/android/systemui/qs/QSTile.java +3 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ import android.util.SparseArray; import android.view.View; import android.view.ViewGroup; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsProto.MetricsEvent; import com.android.settingslib.RestrictedLockUtils; import com.android.systemui.qs.QSTile.State; import com.android.systemui.qs.external.TileServices; Loading Loading @@ -217,6 +219,7 @@ public abstract class QSTile<TState extends State> implements Listenable { } protected void handleLongClick() { MetricsLogger.action(mContext, MetricsEvent.ACTION_QS_LONG_PRESS, getTileSpec()); mHost.startActivityDismissingKeyguard(getLongClickIntent()); } Loading
packages/SystemUI/src/com/android/systemui/qs/customize/QSCustomizer.java +5 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,8 @@ import android.view.View; import android.widget.LinearLayout; import android.widget.Toolbar; import android.widget.Toolbar.OnMenuItemClickListener; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsProto; import com.android.systemui.R; import com.android.systemui.qs.QSContainer; import com.android.systemui.qs.QSDetailClipper; Loading Loading @@ -116,6 +118,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene public void show(int x, int y) { if (!isShown) { MetricsLogger.visible(getContext(), MetricsProto.MetricsEvent.QS_EDIT); isShown = true; setTileSpecs(); setVisibility(View.VISIBLE); Loading @@ -127,6 +130,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene public void hide(int x, int y) { if (isShown) { MetricsLogger.hidden(getContext(), MetricsProto.MetricsEvent.QS_EDIT); isShown = false; mToolbar.dismissPopupMenus(); setCustomizing(false); Loading @@ -149,6 +153,7 @@ public class QSCustomizer extends LinearLayout implements OnMenuItemClickListene public boolean onMenuItemClick(MenuItem item) { switch (item.getItemId()) { case MENU_RESET: MetricsLogger.action(getContext(), MetricsProto.MetricsEvent.ACTION_QS_EDIT_RESET); reset(); break; } Loading
packages/SystemUI/src/com/android/systemui/qs/customize/TileAdapter.java +25 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.qs.customize; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.ComponentName; import android.content.Context; import android.content.DialogInterface; import android.graphics.Canvas; Loading @@ -36,12 +37,15 @@ import android.view.ViewGroup; import android.view.accessibility.AccessibilityManager; import android.widget.FrameLayout; import android.widget.TextView; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsProto; import com.android.systemui.R; import com.android.systemui.qs.QSIconView; import com.android.systemui.qs.QSTileView; import com.android.systemui.qs.customize.TileAdapter.Holder; import com.android.systemui.qs.customize.TileQueryHelper.TileInfo; import com.android.systemui.qs.customize.TileQueryHelper.TileStateListener; import com.android.systemui.qs.external.CustomTile; import com.android.systemui.statusbar.phone.QSTileHost; import com.android.systemui.statusbar.phone.SystemUIDialog; Loading Loading @@ -304,12 +308,24 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta notifyItemMoved(from, to); CharSequence announcement; if (to >= mDividerIndex) { MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_QS_EDIT_REMOVE_SPEC, strip(mTiles.get(to))); MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_QS_EDIT_REMOVE, from); announcement = mContext.getString(R.string.accessibility_qs_edit_tile_removed, fromLabel); } else if (from >= mDividerIndex) { MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_QS_EDIT_ADD_SPEC, strip(mTiles.get(to))); MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_QS_EDIT_ADD, to); announcement = mContext.getString(R.string.accessibility_qs_edit_tile_added, fromLabel, (to + 1)); } else { MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_QS_EDIT_MOVE_SPEC, strip(mTiles.get(to))); MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_QS_EDIT_MOVE, to); announcement = mContext.getString(R.string.accessibility_qs_edit_tile_moved, fromLabel, (to + 1)); } Loading @@ -317,6 +333,15 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta return true; } private String strip(TileInfo tileInfo) { String spec = tileInfo.spec; if (spec.startsWith(CustomTile.PREFIX)) { ComponentName component = CustomTile.getComponentFromSpec(spec); return component.getPackageName(); } return spec; } private <T> void move(int from, int to, List<T> list) { list.add(from > to ? to : to + 1, list.get(from)); list.remove(from > to ? from + 1 : from); Loading
proto/src/metrics_constants.proto +27 −0 Original line number Diff line number Diff line Loading @@ -2020,6 +2020,33 @@ message MetricsEvent { // Logged when a user dismisses all task in overview OVERVIEW_DISMISS_ALL = 357; // Quick Settings -> Edit QS_EDIT = 358; // Quick Settings -> Edit -> Overflow -> Reset ACTION_QS_EDIT_RESET = 359; // QS -> Edit - Drag a tile out of the active tiles. // The _SPEC contains either the spec of the tile or // the package of the 3rd party app in the PKG field. ACTION_QS_EDIT_REMOVE_SPEC = 360; ACTION_QS_EDIT_REMOVE = 361; // QS -> Edit - Drag a tile into the active tiles. // The _SPEC contains either the spec of the tile or // the package of the 3rd party app in the PKG field. ACTION_QS_EDIT_ADD_SPEC = 362; ACTION_QS_EDIT_ADD = 363; // QS -> Edit - Drag a tile within the active tiles. // The _SPEC contains either the spec of the tile or // the package of the 3rd party app in the PKG field. ACTION_QS_EDIT_MOVE_SPEC = 364; ACTION_QS_EDIT_MOVE = 365; // Long-press on a QS tile. Tile spec in package field. ACTION_QS_LONG_PRESS = 366; // Add new aosp constants above this line. // END OF AOSP CONSTANTS } Loading