Loading api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -4664,6 +4664,7 @@ package android.service.notification { method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.service.notification.Adjustment> CREATOR; field public static final java.lang.String KEY_PEOPLE = "key_people"; field public static final java.lang.String KEY_SMART_ACTIONS = "key_smart_actions"; field public static final java.lang.String KEY_SNOOZE_CRITERIA = "key_snooze_criteria"; field public static final java.lang.String KEY_USER_SENTIMENT = "key_user_sentiment"; } Loading api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -1043,6 +1043,7 @@ package android.service.notification { method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.service.notification.Adjustment> CREATOR; field public static final java.lang.String KEY_PEOPLE = "key_people"; field public static final java.lang.String KEY_SMART_ACTIONS = "key_smart_actions"; field public static final java.lang.String KEY_SNOOZE_CRITERIA = "key_snooze_criteria"; field public static final java.lang.String KEY_USER_SENTIMENT = "key_user_sentiment"; } Loading core/java/android/service/notification/Adjustment.java +6 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,12 @@ public final class Adjustment implements Parcelable { */ public static final String KEY_USER_SENTIMENT = "key_user_sentiment"; /** * Data type: ArrayList of {@link android.app.Notification.Action}. * Used to suggest extra actions for a notification. */ public static final String KEY_SMART_ACTIONS = "key_smart_actions"; /** * Create a notification adjustment. * Loading core/java/android/service/notification/NotificationListenerService.java +30 −2 Original line number Diff line number Diff line Loading @@ -1426,6 +1426,7 @@ public abstract class NotificationListenerService extends Service { private boolean mShowBadge; private @UserSentiment int mUserSentiment = USER_SENTIMENT_NEUTRAL; private boolean mHidden; private ArrayList<Notification.Action> mSmartActions; public Ranking() {} Loading Loading @@ -1555,6 +1556,13 @@ public abstract class NotificationListenerService extends Service { return mSnoozeCriteria; } /** * @hide */ public List<Notification.Action> getSmartActions() { return mSmartActions; } /** * Returns whether this notification can be displayed as a badge. * Loading Loading @@ -1583,7 +1591,7 @@ public abstract class NotificationListenerService extends Service { CharSequence explanation, String overrideGroupKey, NotificationChannel channel, ArrayList<String> overridePeople, ArrayList<SnoozeCriterion> snoozeCriteria, boolean showBadge, int userSentiment, boolean hidden) { int userSentiment, boolean hidden, ArrayList<Notification.Action> smartActions) { mKey = key; mRank = rank; mIsAmbient = importance < NotificationManager.IMPORTANCE_LOW; Loading @@ -1599,6 +1607,7 @@ public abstract class NotificationListenerService extends Service { mShowBadge = showBadge; mUserSentiment = userSentiment; mHidden = hidden; mSmartActions = smartActions; } /** Loading Loading @@ -1648,6 +1657,7 @@ public abstract class NotificationListenerService extends Service { private ArrayMap<String, Boolean> mShowBadge; private ArrayMap<String, Integer> mUserSentiment; private ArrayMap<String, Boolean> mHidden; private ArrayMap<String, ArrayList<Notification.Action>> mSmartActions; private RankingMap(NotificationRankingUpdate rankingUpdate) { mRankingUpdate = rankingUpdate; Loading Loading @@ -1676,7 +1686,7 @@ public abstract class NotificationListenerService extends Service { getVisibilityOverride(key), getSuppressedVisualEffects(key), getImportance(key), getImportanceExplanation(key), getOverrideGroupKey(key), getChannel(key), getOverridePeople(key), getSnoozeCriteria(key), getShowBadge(key), getUserSentiment(key), getHidden(key)); getShowBadge(key), getUserSentiment(key), getHidden(key), getSmartActions(key)); return rank >= 0; } Loading Loading @@ -1814,6 +1824,15 @@ public abstract class NotificationListenerService extends Service { return hidden == null ? false : hidden.booleanValue(); } private ArrayList<Notification.Action> getSmartActions(String key) { synchronized (this) { if (mSmartActions == null) { buildSmartActions(); } } return mSmartActions.get(key); } // Locked by 'this' private void buildRanksLocked() { String[] orderedKeys = mRankingUpdate.getOrderedKeys(); Loading Loading @@ -1931,6 +1950,15 @@ public abstract class NotificationListenerService extends Service { } } // Locked by 'this' private void buildSmartActions() { Bundle smartActions = mRankingUpdate.getSmartActions(); mSmartActions = new ArrayMap<>(smartActions.size()); for (String key : smartActions.keySet()) { mSmartActions.put(key, smartActions.getParcelableArrayList(key)); } } // ----------- Parcelable @Override Loading core/java/android/service/notification/NotificationRankingUpdate.java +9 −1 Original line number Diff line number Diff line Loading @@ -37,12 +37,13 @@ public class NotificationRankingUpdate implements Parcelable { private final Bundle mShowBadge; private final Bundle mUserSentiment; private final Bundle mHidden; private final Bundle mSmartActions; public NotificationRankingUpdate(String[] keys, String[] interceptedKeys, Bundle visibilityOverrides, Bundle suppressedVisualEffects, int[] importance, Bundle explanation, Bundle overrideGroupKeys, Bundle channels, Bundle overridePeople, Bundle snoozeCriteria, Bundle showBadge, Bundle userSentiment, Bundle hidden) { Bundle showBadge, Bundle userSentiment, Bundle hidden, Bundle smartActions) { mKeys = keys; mInterceptedKeys = interceptedKeys; mVisibilityOverrides = visibilityOverrides; Loading @@ -56,6 +57,7 @@ public class NotificationRankingUpdate implements Parcelable { mShowBadge = showBadge; mUserSentiment = userSentiment; mHidden = hidden; mSmartActions = smartActions; } public NotificationRankingUpdate(Parcel in) { Loading @@ -73,6 +75,7 @@ public class NotificationRankingUpdate implements Parcelable { mShowBadge = in.readBundle(); mUserSentiment = in.readBundle(); mHidden = in.readBundle(); mSmartActions = in.readBundle(); } @Override Loading @@ -95,6 +98,7 @@ public class NotificationRankingUpdate implements Parcelable { out.writeBundle(mShowBadge); out.writeBundle(mUserSentiment); out.writeBundle(mHidden); out.writeBundle(mSmartActions); } public static final Parcelable.Creator<NotificationRankingUpdate> CREATOR Loading Loading @@ -159,4 +163,8 @@ public class NotificationRankingUpdate implements Parcelable { public Bundle getHidden() { return mHidden; } public Bundle getSmartActions() { return mSmartActions; } } Loading
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -4664,6 +4664,7 @@ package android.service.notification { method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.service.notification.Adjustment> CREATOR; field public static final java.lang.String KEY_PEOPLE = "key_people"; field public static final java.lang.String KEY_SMART_ACTIONS = "key_smart_actions"; field public static final java.lang.String KEY_SNOOZE_CRITERIA = "key_snooze_criteria"; field public static final java.lang.String KEY_USER_SENTIMENT = "key_user_sentiment"; } Loading
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -1043,6 +1043,7 @@ package android.service.notification { method public void writeToParcel(android.os.Parcel, int); field public static final android.os.Parcelable.Creator<android.service.notification.Adjustment> CREATOR; field public static final java.lang.String KEY_PEOPLE = "key_people"; field public static final java.lang.String KEY_SMART_ACTIONS = "key_smart_actions"; field public static final java.lang.String KEY_SNOOZE_CRITERIA = "key_snooze_criteria"; field public static final java.lang.String KEY_USER_SENTIMENT = "key_user_sentiment"; } Loading
core/java/android/service/notification/Adjustment.java +6 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,12 @@ public final class Adjustment implements Parcelable { */ public static final String KEY_USER_SENTIMENT = "key_user_sentiment"; /** * Data type: ArrayList of {@link android.app.Notification.Action}. * Used to suggest extra actions for a notification. */ public static final String KEY_SMART_ACTIONS = "key_smart_actions"; /** * Create a notification adjustment. * Loading
core/java/android/service/notification/NotificationListenerService.java +30 −2 Original line number Diff line number Diff line Loading @@ -1426,6 +1426,7 @@ public abstract class NotificationListenerService extends Service { private boolean mShowBadge; private @UserSentiment int mUserSentiment = USER_SENTIMENT_NEUTRAL; private boolean mHidden; private ArrayList<Notification.Action> mSmartActions; public Ranking() {} Loading Loading @@ -1555,6 +1556,13 @@ public abstract class NotificationListenerService extends Service { return mSnoozeCriteria; } /** * @hide */ public List<Notification.Action> getSmartActions() { return mSmartActions; } /** * Returns whether this notification can be displayed as a badge. * Loading Loading @@ -1583,7 +1591,7 @@ public abstract class NotificationListenerService extends Service { CharSequence explanation, String overrideGroupKey, NotificationChannel channel, ArrayList<String> overridePeople, ArrayList<SnoozeCriterion> snoozeCriteria, boolean showBadge, int userSentiment, boolean hidden) { int userSentiment, boolean hidden, ArrayList<Notification.Action> smartActions) { mKey = key; mRank = rank; mIsAmbient = importance < NotificationManager.IMPORTANCE_LOW; Loading @@ -1599,6 +1607,7 @@ public abstract class NotificationListenerService extends Service { mShowBadge = showBadge; mUserSentiment = userSentiment; mHidden = hidden; mSmartActions = smartActions; } /** Loading Loading @@ -1648,6 +1657,7 @@ public abstract class NotificationListenerService extends Service { private ArrayMap<String, Boolean> mShowBadge; private ArrayMap<String, Integer> mUserSentiment; private ArrayMap<String, Boolean> mHidden; private ArrayMap<String, ArrayList<Notification.Action>> mSmartActions; private RankingMap(NotificationRankingUpdate rankingUpdate) { mRankingUpdate = rankingUpdate; Loading Loading @@ -1676,7 +1686,7 @@ public abstract class NotificationListenerService extends Service { getVisibilityOverride(key), getSuppressedVisualEffects(key), getImportance(key), getImportanceExplanation(key), getOverrideGroupKey(key), getChannel(key), getOverridePeople(key), getSnoozeCriteria(key), getShowBadge(key), getUserSentiment(key), getHidden(key)); getShowBadge(key), getUserSentiment(key), getHidden(key), getSmartActions(key)); return rank >= 0; } Loading Loading @@ -1814,6 +1824,15 @@ public abstract class NotificationListenerService extends Service { return hidden == null ? false : hidden.booleanValue(); } private ArrayList<Notification.Action> getSmartActions(String key) { synchronized (this) { if (mSmartActions == null) { buildSmartActions(); } } return mSmartActions.get(key); } // Locked by 'this' private void buildRanksLocked() { String[] orderedKeys = mRankingUpdate.getOrderedKeys(); Loading Loading @@ -1931,6 +1950,15 @@ public abstract class NotificationListenerService extends Service { } } // Locked by 'this' private void buildSmartActions() { Bundle smartActions = mRankingUpdate.getSmartActions(); mSmartActions = new ArrayMap<>(smartActions.size()); for (String key : smartActions.keySet()) { mSmartActions.put(key, smartActions.getParcelableArrayList(key)); } } // ----------- Parcelable @Override Loading
core/java/android/service/notification/NotificationRankingUpdate.java +9 −1 Original line number Diff line number Diff line Loading @@ -37,12 +37,13 @@ public class NotificationRankingUpdate implements Parcelable { private final Bundle mShowBadge; private final Bundle mUserSentiment; private final Bundle mHidden; private final Bundle mSmartActions; public NotificationRankingUpdate(String[] keys, String[] interceptedKeys, Bundle visibilityOverrides, Bundle suppressedVisualEffects, int[] importance, Bundle explanation, Bundle overrideGroupKeys, Bundle channels, Bundle overridePeople, Bundle snoozeCriteria, Bundle showBadge, Bundle userSentiment, Bundle hidden) { Bundle showBadge, Bundle userSentiment, Bundle hidden, Bundle smartActions) { mKeys = keys; mInterceptedKeys = interceptedKeys; mVisibilityOverrides = visibilityOverrides; Loading @@ -56,6 +57,7 @@ public class NotificationRankingUpdate implements Parcelable { mShowBadge = showBadge; mUserSentiment = userSentiment; mHidden = hidden; mSmartActions = smartActions; } public NotificationRankingUpdate(Parcel in) { Loading @@ -73,6 +75,7 @@ public class NotificationRankingUpdate implements Parcelable { mShowBadge = in.readBundle(); mUserSentiment = in.readBundle(); mHidden = in.readBundle(); mSmartActions = in.readBundle(); } @Override Loading @@ -95,6 +98,7 @@ public class NotificationRankingUpdate implements Parcelable { out.writeBundle(mShowBadge); out.writeBundle(mUserSentiment); out.writeBundle(mHidden); out.writeBundle(mSmartActions); } public static final Parcelable.Creator<NotificationRankingUpdate> CREATOR Loading Loading @@ -159,4 +163,8 @@ public class NotificationRankingUpdate implements Parcelable { public Bundle getHidden() { return mHidden; } public Bundle getSmartActions() { return mSmartActions; } }