Loading packages/SystemUI/src/com/android/systemui/statusbar/NotificationGuts.java +7 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ import android.widget.RadioButton; import android.widget.SeekBar; import android.widget.TextView; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsProto.MetricsEvent; import com.android.settingslib.Utils; import com.android.systemui.R; Loading @@ -51,6 +53,7 @@ public class NotificationGuts extends LinearLayout { private SeekBar mSeekBar; private Notification.Topic mTopic; private INotificationManager mINotificationManager; private int mStartingImportance; public NotificationGuts(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -103,6 +106,7 @@ public class NotificationGuts extends LinearLayout { void bindImportance(final StatusBarNotification sbn, final ExpandableNotificationRow row, final int importance) { mStartingImportance = importance; mINotificationManager = INotificationManager.Stub.asInterface( ServiceManager.getService(Context.NOTIFICATION_SERVICE)); mTopic = sbn.getNotification().getTopic() == null Loading Loading @@ -151,6 +155,7 @@ public class NotificationGuts extends LinearLayout { } updateTitleAndSummary(progress); if (fromUser) { MetricsLogger.action(mContext, MetricsEvent.ACTION_MODIFY_IMPORTANCE_SLIDER); if (appUsesTopics) { mApplyToTopic.setVisibility(View.VISIBLE); mApplyToTopic.setText( Loading Loading @@ -205,6 +210,8 @@ public class NotificationGuts extends LinearLayout { void saveImportance(final StatusBarNotification sbn) { int progress = mSeekBar.getProgress(); MetricsLogger.action(mContext, MetricsEvent.ACTION_SAVE_IMPORTANCE, progress - mStartingImportance); try { mINotificationManager.setImportance(sbn.getPackageName(), sbn.getUid(), mApplyToTopic.isChecked() ? mTopic : null, progress); Loading proto/src/metrics_constants.proto +7 −0 Original line number Diff line number Diff line Loading @@ -1762,5 +1762,12 @@ message MetricsEvent { // Logged when a user dismisses a task in overview OVERVIEW_DISMISS = 289; // Logged when the user modifying the notification importance slider. ACTION_MODIFY_IMPORTANCE_SLIDER = 290; // Logged when the user saves a modification to notification importance. Negative numbers // indicate the user lowered the importance; positive means they increased it. ACTION_SAVE_IMPORTANCE = 291; } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/NotificationGuts.java +7 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,8 @@ import android.widget.RadioButton; import android.widget.SeekBar; import android.widget.TextView; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.MetricsProto.MetricsEvent; import com.android.settingslib.Utils; import com.android.systemui.R; Loading @@ -51,6 +53,7 @@ public class NotificationGuts extends LinearLayout { private SeekBar mSeekBar; private Notification.Topic mTopic; private INotificationManager mINotificationManager; private int mStartingImportance; public NotificationGuts(Context context, AttributeSet attrs) { super(context, attrs); Loading Loading @@ -103,6 +106,7 @@ public class NotificationGuts extends LinearLayout { void bindImportance(final StatusBarNotification sbn, final ExpandableNotificationRow row, final int importance) { mStartingImportance = importance; mINotificationManager = INotificationManager.Stub.asInterface( ServiceManager.getService(Context.NOTIFICATION_SERVICE)); mTopic = sbn.getNotification().getTopic() == null Loading Loading @@ -151,6 +155,7 @@ public class NotificationGuts extends LinearLayout { } updateTitleAndSummary(progress); if (fromUser) { MetricsLogger.action(mContext, MetricsEvent.ACTION_MODIFY_IMPORTANCE_SLIDER); if (appUsesTopics) { mApplyToTopic.setVisibility(View.VISIBLE); mApplyToTopic.setText( Loading Loading @@ -205,6 +210,8 @@ public class NotificationGuts extends LinearLayout { void saveImportance(final StatusBarNotification sbn) { int progress = mSeekBar.getProgress(); MetricsLogger.action(mContext, MetricsEvent.ACTION_SAVE_IMPORTANCE, progress - mStartingImportance); try { mINotificationManager.setImportance(sbn.getPackageName(), sbn.getUid(), mApplyToTopic.isChecked() ? mTopic : null, progress); Loading
proto/src/metrics_constants.proto +7 −0 Original line number Diff line number Diff line Loading @@ -1762,5 +1762,12 @@ message MetricsEvent { // Logged when a user dismisses a task in overview OVERVIEW_DISMISS = 289; // Logged when the user modifying the notification importance slider. ACTION_MODIFY_IMPORTANCE_SLIDER = 290; // Logged when the user saves a modification to notification importance. Negative numbers // indicate the user lowered the importance; positive means they increased it. ACTION_SAVE_IMPORTANCE = 291; } }