Loading core/java/android/service/notification/Adjustment.java +0 −14 Original line number Original line Diff line number Diff line Loading @@ -16,7 +16,6 @@ package android.service.notification; package android.service.notification; import android.annotation.NonNull; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.StringDef; import android.annotation.StringDef; import android.annotation.SystemApi; import android.annotation.SystemApi; import android.annotation.TestApi; import android.annotation.TestApi; Loading Loading @@ -49,7 +48,6 @@ public final class Adjustment implements Parcelable { private final CharSequence mExplanation; private final CharSequence mExplanation; private final Bundle mSignals; private final Bundle mSignals; private final int mUser; private final int mUser; @Nullable private String mIssuer; /** @hide */ /** @hide */ @StringDef (prefix = { "KEY_" }, value = { @StringDef (prefix = { "KEY_" }, value = { Loading Loading @@ -185,7 +183,6 @@ public final class Adjustment implements Parcelable { } } mSignals = in.readBundle(); mSignals = in.readBundle(); mUser = in.readInt(); mUser = in.readInt(); mIssuer = in.readString(); } } public static final @android.annotation.NonNull Creator<Adjustment> CREATOR = new Creator<Adjustment>() { public static final @android.annotation.NonNull Creator<Adjustment> CREATOR = new Creator<Adjustment>() { Loading Loading @@ -254,7 +251,6 @@ public final class Adjustment implements Parcelable { } } dest.writeBundle(mSignals); dest.writeBundle(mSignals); dest.writeInt(mUser); dest.writeInt(mUser); dest.writeString(mIssuer); } } @Override @Override Loading @@ -263,14 +259,4 @@ public final class Adjustment implements Parcelable { + "mSignals=" + mSignals + "mSignals=" + mSignals + '}'; + '}'; } } /** @hide */ public void setIssuer(@Nullable String issuer) { mIssuer = issuer; } /** @hide */ public @Nullable String getIssuer() { return mIssuer; } } } core/java/android/service/notification/NotificationAssistantService.java +0 −9 Original line number Original line Diff line number Diff line Loading @@ -236,7 +236,6 @@ public abstract class NotificationAssistantService extends NotificationListenerS public final void adjustNotification(@NonNull Adjustment adjustment) { public final void adjustNotification(@NonNull Adjustment adjustment) { if (!isBound()) return; if (!isBound()) return; try { try { setAdjustmentIssuer(adjustment); getNotificationInterface().applyEnqueuedAdjustmentFromAssistant(mWrapper, adjustment); getNotificationInterface().applyEnqueuedAdjustmentFromAssistant(mWrapper, adjustment); } catch (android.os.RemoteException ex) { } catch (android.os.RemoteException ex) { Log.v(TAG, "Unable to contact notification manager", ex); Log.v(TAG, "Unable to contact notification manager", ex); Loading @@ -254,9 +253,6 @@ public abstract class NotificationAssistantService extends NotificationListenerS public final void adjustNotifications(@NonNull List<Adjustment> adjustments) { public final void adjustNotifications(@NonNull List<Adjustment> adjustments) { if (!isBound()) return; if (!isBound()) return; try { try { for (Adjustment adjustment : adjustments) { setAdjustmentIssuer(adjustment); } getNotificationInterface().applyAdjustmentsFromAssistant(mWrapper, adjustments); getNotificationInterface().applyAdjustmentsFromAssistant(mWrapper, adjustments); } catch (android.os.RemoteException ex) { } catch (android.os.RemoteException ex) { Log.v(TAG, "Unable to contact notification manager", ex); Log.v(TAG, "Unable to contact notification manager", ex); Loading Loading @@ -370,10 +366,6 @@ public abstract class NotificationAssistantService extends NotificationListenerS } } } } private void setAdjustmentIssuer(Adjustment adjustment) { adjustment.setIssuer(getOpPackageName() + "/" + getClass().getName()); } private final class MyHandler extends Handler { private final class MyHandler extends Handler { public static final int MSG_ON_NOTIFICATION_ENQUEUED = 1; public static final int MSG_ON_NOTIFICATION_ENQUEUED = 1; public static final int MSG_ON_NOTIFICATION_SNOOZED = 2; public static final int MSG_ON_NOTIFICATION_SNOOZED = 2; Loading @@ -397,7 +389,6 @@ public abstract class NotificationAssistantService extends NotificationListenerS NotificationChannel channel = (NotificationChannel) args.arg2; NotificationChannel channel = (NotificationChannel) args.arg2; args.recycle(); args.recycle(); Adjustment adjustment = onNotificationEnqueued(sbn, channel); Adjustment adjustment = onNotificationEnqueued(sbn, channel); setAdjustmentIssuer(adjustment); if (adjustment != null) { if (adjustment != null) { if (!isBound()) { if (!isBound()) { Log.w(TAG, "MSG_ON_NOTIFICATION_ENQUEUED: service not bound, skip."); Log.w(TAG, "MSG_ON_NOTIFICATION_ENQUEUED: service not bound, skip."); Loading proto/src/metrics_constants/metrics_constants.proto +0 −3 Original line number Original line Diff line number Diff line Loading @@ -7365,9 +7365,6 @@ message MetricsEvent { // OS: Q // OS: Q FIELD_EMERGENCY_DIALER_DISCONNECT_CAUSE = 1739; FIELD_EMERGENCY_DIALER_DISCONNECT_CAUSE = 1739; // Custom tag for NotificationItem. Hash of the NAS that made adjustments. FIELD_NOTIFICATION_ASSISTANT_SERVICE_HASH = 1740; // ---- Skipping ahead to avoid conflicts between master and release branches. // ---- Skipping ahead to avoid conflicts between master and release branches. // ---- End Q Constants, all Q constants go above this line ---- // ---- End Q Constants, all Q constants go above this line ---- Loading services/core/java/com/android/server/notification/NotificationRecord.java +0 −24 Original line number Original line Diff line number Diff line Loading @@ -1268,22 +1268,6 @@ public final class NotificationRecord { } } } } // Returns the name of the NAS that made adjustments. By policy, there must only ever be one. // If this is violated, the NAS that first sent an adjustment is returned. private @Nullable String getAdjustmentIssuer() { synchronized (mAdjustments) { for (Adjustment adjustment : mAdjustments) { if (adjustment.getSignals().isEmpty()) { continue; } if (adjustment.getIssuer() != null) { return adjustment.getIssuer(); } } } return null; } public LogMaker getLogMaker(long now) { public LogMaker getLogMaker(long now) { LogMaker lm = sbn.getLogMaker() LogMaker lm = sbn.getLogMaker() .addTaggedData(MetricsEvent.FIELD_NOTIFICATION_CHANNEL_IMPORTANCE, mImportance) .addTaggedData(MetricsEvent.FIELD_NOTIFICATION_CHANNEL_IMPORTANCE, mImportance) Loading Loading @@ -1313,14 +1297,6 @@ public final class NotificationRecord { lm.addTaggedData(MetricsEvent.FIELD_NOTIFICATION_IMPORTANCE_ASST, lm.addTaggedData(MetricsEvent.FIELD_NOTIFICATION_IMPORTANCE_ASST, mAssistantImportance); mAssistantImportance); } } // Log the issuer of any adjustments that may have affected this notification. We only log // the hash here as NotificationItem events are frequent, and the number of NAS // implementations (and hence the chance of collisions) is low. String adjustmentIssuer = getAdjustmentIssuer(); if (adjustmentIssuer != null) { lm.addTaggedData(MetricsEvent.FIELD_NOTIFICATION_ASSISTANT_SERVICE_HASH, adjustmentIssuer.hashCode()); } return lm; return lm; } } Loading Loading
core/java/android/service/notification/Adjustment.java +0 −14 Original line number Original line Diff line number Diff line Loading @@ -16,7 +16,6 @@ package android.service.notification; package android.service.notification; import android.annotation.NonNull; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.StringDef; import android.annotation.StringDef; import android.annotation.SystemApi; import android.annotation.SystemApi; import android.annotation.TestApi; import android.annotation.TestApi; Loading Loading @@ -49,7 +48,6 @@ public final class Adjustment implements Parcelable { private final CharSequence mExplanation; private final CharSequence mExplanation; private final Bundle mSignals; private final Bundle mSignals; private final int mUser; private final int mUser; @Nullable private String mIssuer; /** @hide */ /** @hide */ @StringDef (prefix = { "KEY_" }, value = { @StringDef (prefix = { "KEY_" }, value = { Loading Loading @@ -185,7 +183,6 @@ public final class Adjustment implements Parcelable { } } mSignals = in.readBundle(); mSignals = in.readBundle(); mUser = in.readInt(); mUser = in.readInt(); mIssuer = in.readString(); } } public static final @android.annotation.NonNull Creator<Adjustment> CREATOR = new Creator<Adjustment>() { public static final @android.annotation.NonNull Creator<Adjustment> CREATOR = new Creator<Adjustment>() { Loading Loading @@ -254,7 +251,6 @@ public final class Adjustment implements Parcelable { } } dest.writeBundle(mSignals); dest.writeBundle(mSignals); dest.writeInt(mUser); dest.writeInt(mUser); dest.writeString(mIssuer); } } @Override @Override Loading @@ -263,14 +259,4 @@ public final class Adjustment implements Parcelable { + "mSignals=" + mSignals + "mSignals=" + mSignals + '}'; + '}'; } } /** @hide */ public void setIssuer(@Nullable String issuer) { mIssuer = issuer; } /** @hide */ public @Nullable String getIssuer() { return mIssuer; } } }
core/java/android/service/notification/NotificationAssistantService.java +0 −9 Original line number Original line Diff line number Diff line Loading @@ -236,7 +236,6 @@ public abstract class NotificationAssistantService extends NotificationListenerS public final void adjustNotification(@NonNull Adjustment adjustment) { public final void adjustNotification(@NonNull Adjustment adjustment) { if (!isBound()) return; if (!isBound()) return; try { try { setAdjustmentIssuer(adjustment); getNotificationInterface().applyEnqueuedAdjustmentFromAssistant(mWrapper, adjustment); getNotificationInterface().applyEnqueuedAdjustmentFromAssistant(mWrapper, adjustment); } catch (android.os.RemoteException ex) { } catch (android.os.RemoteException ex) { Log.v(TAG, "Unable to contact notification manager", ex); Log.v(TAG, "Unable to contact notification manager", ex); Loading @@ -254,9 +253,6 @@ public abstract class NotificationAssistantService extends NotificationListenerS public final void adjustNotifications(@NonNull List<Adjustment> adjustments) { public final void adjustNotifications(@NonNull List<Adjustment> adjustments) { if (!isBound()) return; if (!isBound()) return; try { try { for (Adjustment adjustment : adjustments) { setAdjustmentIssuer(adjustment); } getNotificationInterface().applyAdjustmentsFromAssistant(mWrapper, adjustments); getNotificationInterface().applyAdjustmentsFromAssistant(mWrapper, adjustments); } catch (android.os.RemoteException ex) { } catch (android.os.RemoteException ex) { Log.v(TAG, "Unable to contact notification manager", ex); Log.v(TAG, "Unable to contact notification manager", ex); Loading Loading @@ -370,10 +366,6 @@ public abstract class NotificationAssistantService extends NotificationListenerS } } } } private void setAdjustmentIssuer(Adjustment adjustment) { adjustment.setIssuer(getOpPackageName() + "/" + getClass().getName()); } private final class MyHandler extends Handler { private final class MyHandler extends Handler { public static final int MSG_ON_NOTIFICATION_ENQUEUED = 1; public static final int MSG_ON_NOTIFICATION_ENQUEUED = 1; public static final int MSG_ON_NOTIFICATION_SNOOZED = 2; public static final int MSG_ON_NOTIFICATION_SNOOZED = 2; Loading @@ -397,7 +389,6 @@ public abstract class NotificationAssistantService extends NotificationListenerS NotificationChannel channel = (NotificationChannel) args.arg2; NotificationChannel channel = (NotificationChannel) args.arg2; args.recycle(); args.recycle(); Adjustment adjustment = onNotificationEnqueued(sbn, channel); Adjustment adjustment = onNotificationEnqueued(sbn, channel); setAdjustmentIssuer(adjustment); if (adjustment != null) { if (adjustment != null) { if (!isBound()) { if (!isBound()) { Log.w(TAG, "MSG_ON_NOTIFICATION_ENQUEUED: service not bound, skip."); Log.w(TAG, "MSG_ON_NOTIFICATION_ENQUEUED: service not bound, skip."); Loading
proto/src/metrics_constants/metrics_constants.proto +0 −3 Original line number Original line Diff line number Diff line Loading @@ -7365,9 +7365,6 @@ message MetricsEvent { // OS: Q // OS: Q FIELD_EMERGENCY_DIALER_DISCONNECT_CAUSE = 1739; FIELD_EMERGENCY_DIALER_DISCONNECT_CAUSE = 1739; // Custom tag for NotificationItem. Hash of the NAS that made adjustments. FIELD_NOTIFICATION_ASSISTANT_SERVICE_HASH = 1740; // ---- Skipping ahead to avoid conflicts between master and release branches. // ---- Skipping ahead to avoid conflicts between master and release branches. // ---- End Q Constants, all Q constants go above this line ---- // ---- End Q Constants, all Q constants go above this line ---- Loading
services/core/java/com/android/server/notification/NotificationRecord.java +0 −24 Original line number Original line Diff line number Diff line Loading @@ -1268,22 +1268,6 @@ public final class NotificationRecord { } } } } // Returns the name of the NAS that made adjustments. By policy, there must only ever be one. // If this is violated, the NAS that first sent an adjustment is returned. private @Nullable String getAdjustmentIssuer() { synchronized (mAdjustments) { for (Adjustment adjustment : mAdjustments) { if (adjustment.getSignals().isEmpty()) { continue; } if (adjustment.getIssuer() != null) { return adjustment.getIssuer(); } } } return null; } public LogMaker getLogMaker(long now) { public LogMaker getLogMaker(long now) { LogMaker lm = sbn.getLogMaker() LogMaker lm = sbn.getLogMaker() .addTaggedData(MetricsEvent.FIELD_NOTIFICATION_CHANNEL_IMPORTANCE, mImportance) .addTaggedData(MetricsEvent.FIELD_NOTIFICATION_CHANNEL_IMPORTANCE, mImportance) Loading Loading @@ -1313,14 +1297,6 @@ public final class NotificationRecord { lm.addTaggedData(MetricsEvent.FIELD_NOTIFICATION_IMPORTANCE_ASST, lm.addTaggedData(MetricsEvent.FIELD_NOTIFICATION_IMPORTANCE_ASST, mAssistantImportance); mAssistantImportance); } } // Log the issuer of any adjustments that may have affected this notification. We only log // the hash here as NotificationItem events are frequent, and the number of NAS // implementations (and hence the chance of collisions) is low. String adjustmentIssuer = getAdjustmentIssuer(); if (adjustmentIssuer != null) { lm.addTaggedData(MetricsEvent.FIELD_NOTIFICATION_ASSISTANT_SERVICE_HASH, adjustmentIssuer.hashCode()); } return lm; return lm; } } Loading