Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +11 −0 Original line number Original line Diff line number Diff line Loading @@ -44,6 +44,8 @@ import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.ProgressBar; import android.widget.TextView; 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.R; import com.android.systemui.statusbar.NotificationData; import com.android.systemui.statusbar.NotificationData; import com.android.systemui.statusbar.RemoteInputController; import com.android.systemui.statusbar.RemoteInputController; Loading Loading @@ -127,10 +129,14 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene mEditText.mShowImeOnInputConnection = false; mEditText.mShowImeOnInputConnection = false; mController.remoteInputSent(mEntry); mController.remoteInputSent(mEntry); MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_REMOTE_INPUT_SEND, mEntry.notification.getPackageName()); try { try { mPendingIntent.send(mContext, 0, fillInIntent); mPendingIntent.send(mContext, 0, fillInIntent); } catch (PendingIntent.CanceledException e) { } catch (PendingIntent.CanceledException e) { Log.i(TAG, "Unable to send remote input result", e); Log.i(TAG, "Unable to send remote input result", e); MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_REMOTE_INPUT_FAIL, mEntry.notification.getPackageName()); } } } } Loading Loading @@ -165,6 +171,8 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene mController.removeRemoteInput(mEntry); mController.removeRemoteInput(mEntry); mEntry.remoteInputText = mEditText.getText(); mEntry.remoteInputText = mEditText.getText(); setVisibility(INVISIBLE); setVisibility(INVISIBLE); MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_REMOTE_INPUT_CLOSE, mEntry.notification.getPackageName()); } } @Override @Override Loading Loading @@ -198,6 +206,9 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene } } public void focus() { public void focus() { MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_REMOTE_INPUT_OPEN, mEntry.notification.getPackageName()); setVisibility(VISIBLE); setVisibility(VISIBLE); mController.addRemoteInput(mEntry); mController.addRemoteInput(mEntry); mEditText.setInnerFocusable(true); mEditText.setInnerFocusable(true); Loading proto/src/metrics_constants.proto +18 −0 Original line number Original line Diff line number Diff line Loading @@ -2169,6 +2169,24 @@ message MetricsEvent { // User blacklisted an app for Data Saver mode; action pass package name of app. // User blacklisted an app for Data Saver mode; action pass package name of app. ACTION_DATA_SAVER_BLACKLIST = 396; ACTION_DATA_SAVER_BLACKLIST = 396; // User opened a remote input view associated with a notification. Passes package name of app // that posted the notification. Note that this can also happen transiently during notification // reinflation. ACTION_REMOTE_INPUT_OPEN = 397; // User attempt to send data through a remote input view associated with a notification. // Passes package name of app that posted the notification. May succeed or fail. ACTION_REMOTE_INPUT_SEND = 398; // Failed attempt to send data through a remote input view associated with a // notification. Passes package name of app that posted the notification. ACTION_REMOTE_INPUT_FAIL = 399; // User closed a remote input view associated with a notification. Passes package name of app // that posted the notification. Note that this can also happen transiently during notification // reinflation. ACTION_REMOTE_INPUT_CLOSE = 400; // Add new aosp constants above this line. // Add new aosp constants above this line. // END OF AOSP CONSTANTS // END OF AOSP CONSTANTS } } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/RemoteInputView.java +11 −0 Original line number Original line Diff line number Diff line Loading @@ -44,6 +44,8 @@ import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.ProgressBar; import android.widget.TextView; 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.R; import com.android.systemui.statusbar.NotificationData; import com.android.systemui.statusbar.NotificationData; import com.android.systemui.statusbar.RemoteInputController; import com.android.systemui.statusbar.RemoteInputController; Loading Loading @@ -127,10 +129,14 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene mEditText.mShowImeOnInputConnection = false; mEditText.mShowImeOnInputConnection = false; mController.remoteInputSent(mEntry); mController.remoteInputSent(mEntry); MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_REMOTE_INPUT_SEND, mEntry.notification.getPackageName()); try { try { mPendingIntent.send(mContext, 0, fillInIntent); mPendingIntent.send(mContext, 0, fillInIntent); } catch (PendingIntent.CanceledException e) { } catch (PendingIntent.CanceledException e) { Log.i(TAG, "Unable to send remote input result", e); Log.i(TAG, "Unable to send remote input result", e); MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_REMOTE_INPUT_FAIL, mEntry.notification.getPackageName()); } } } } Loading Loading @@ -165,6 +171,8 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene mController.removeRemoteInput(mEntry); mController.removeRemoteInput(mEntry); mEntry.remoteInputText = mEditText.getText(); mEntry.remoteInputText = mEditText.getText(); setVisibility(INVISIBLE); setVisibility(INVISIBLE); MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_REMOTE_INPUT_CLOSE, mEntry.notification.getPackageName()); } } @Override @Override Loading Loading @@ -198,6 +206,9 @@ public class RemoteInputView extends LinearLayout implements View.OnClickListene } } public void focus() { public void focus() { MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_REMOTE_INPUT_OPEN, mEntry.notification.getPackageName()); setVisibility(VISIBLE); setVisibility(VISIBLE); mController.addRemoteInput(mEntry); mController.addRemoteInput(mEntry); mEditText.setInnerFocusable(true); mEditText.setInnerFocusable(true); Loading
proto/src/metrics_constants.proto +18 −0 Original line number Original line Diff line number Diff line Loading @@ -2169,6 +2169,24 @@ message MetricsEvent { // User blacklisted an app for Data Saver mode; action pass package name of app. // User blacklisted an app for Data Saver mode; action pass package name of app. ACTION_DATA_SAVER_BLACKLIST = 396; ACTION_DATA_SAVER_BLACKLIST = 396; // User opened a remote input view associated with a notification. Passes package name of app // that posted the notification. Note that this can also happen transiently during notification // reinflation. ACTION_REMOTE_INPUT_OPEN = 397; // User attempt to send data through a remote input view associated with a notification. // Passes package name of app that posted the notification. May succeed or fail. ACTION_REMOTE_INPUT_SEND = 398; // Failed attempt to send data through a remote input view associated with a // notification. Passes package name of app that posted the notification. ACTION_REMOTE_INPUT_FAIL = 399; // User closed a remote input view associated with a notification. Passes package name of app // that posted the notification. Note that this can also happen transiently during notification // reinflation. ACTION_REMOTE_INPUT_CLOSE = 400; // Add new aosp constants above this line. // Add new aosp constants above this line. // END OF AOSP CONSTANTS // END OF AOSP CONSTANTS } } Loading