Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3c728e1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes from topic "jr-blocker"

* changes:
  Initial notification blocker
  Provide more information to the noti asst
parents 80fc4df0 f8c53678
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -37618,8 +37618,12 @@ package android.service.notification {
    method public java.lang.String getOverrideGroupKey();
    method public int getRank();
    method public int getSuppressedVisualEffects();
    method public int getUserSentiment();
    method public boolean isAmbient();
    method public boolean matchesInterruptionFilter();
    field public static final int USER_SENTIMENT_NEGATIVE = -1; // 0xffffffff
    field public static final int USER_SENTIMENT_NEUTRAL = 0; // 0x0
    field public static final int USER_SENTIMENT_POSITIVE = 1; // 0x1
  }
  public static class NotificationListenerService.RankingMap implements android.os.Parcelable {
+32 −0
Original line number Diff line number Diff line
@@ -40602,6 +40602,7 @@ package android.service.notification {
    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_SNOOZE_CRITERIA = "key_snooze_criteria";
    field public static final java.lang.String KEY_USER_SENTIMENT = "key_user_sentiment";
  }
  public final class Condition implements android.os.Parcelable {
@@ -40656,6 +40657,7 @@ package android.service.notification {
    method public final void adjustNotifications(java.util.List<android.service.notification.Adjustment>);
    method public final android.os.IBinder onBind(android.content.Intent);
    method public abstract android.service.notification.Adjustment onNotificationEnqueued(android.service.notification.StatusBarNotification);
    method public void onNotificationRemoved(android.service.notification.StatusBarNotification, android.service.notification.NotificationListenerService.RankingMap, android.service.notification.NotificationStats, int);
    method public abstract void onNotificationSnoozedUntilContext(android.service.notification.StatusBarNotification, java.lang.String);
    method public final void unsnoozeNotification(java.lang.String);
    field public static final java.lang.String SERVICE_INTERFACE = "android.service.notification.NotificationAssistantService";
@@ -40740,8 +40742,12 @@ package android.service.notification {
    method public java.lang.String getOverrideGroupKey();
    method public int getRank();
    method public int getSuppressedVisualEffects();
    method public int getUserSentiment();
    method public boolean isAmbient();
    method public boolean matchesInterruptionFilter();
    field public static final int USER_SENTIMENT_NEGATIVE = -1; // 0xffffffff
    field public static final int USER_SENTIMENT_NEUTRAL = 0; // 0x0
    field public static final int USER_SENTIMENT_POSITIVE = 1; // 0x1
  }
  public static class NotificationListenerService.RankingMap implements android.os.Parcelable {
@@ -40752,6 +40758,32 @@ package android.service.notification {
    field public static final android.os.Parcelable.Creator<android.service.notification.NotificationListenerService.RankingMap> CREATOR;
  }
  public final class NotificationStats implements android.os.Parcelable {
    ctor public NotificationStats();
    ctor protected NotificationStats(android.os.Parcel);
    method public int describeContents();
    method public int getDismissalSurface();
    method public boolean hasDirectReplied();
    method public boolean hasExpanded();
    method public boolean hasInteracted();
    method public boolean hasSeen();
    method public boolean hasSnoozed();
    method public boolean hasViewedSettings();
    method public void setDirectReplied();
    method public void setDismissalSurface(int);
    method public void setExpanded();
    method public void setSeen();
    method public void setSnoozed();
    method public void setViewedSettings();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.notification.NotificationStats> CREATOR;
    field public static final int DISMISSAL_AOD = 2; // 0x2
    field public static final int DISMISSAL_NOT_DISMISSED = -1; // 0xffffffff
    field public static final int DISMISSAL_OTHER = 0; // 0x0
    field public static final int DISMISSAL_PEEK = 1; // 0x1
    field public static final int DISMISSAL_SHADE = 3; // 0x3
  }
  public final class SnoozeCriterion implements android.os.Parcelable {
    ctor public SnoozeCriterion(java.lang.String, java.lang.CharSequence, java.lang.CharSequence);
    ctor protected SnoozeCriterion(android.os.Parcel);
+32 −0
Original line number Diff line number Diff line
@@ -37805,6 +37805,7 @@ package android.service.notification {
    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_SNOOZE_CRITERIA = "key_snooze_criteria";
    field public static final java.lang.String KEY_USER_SENTIMENT = "key_user_sentiment";
  }
  public final class Condition implements android.os.Parcelable {
@@ -37891,6 +37892,7 @@ package android.service.notification {
    method public void onNotificationRemoved(android.service.notification.StatusBarNotification);
    method public void onNotificationRemoved(android.service.notification.StatusBarNotification, android.service.notification.NotificationListenerService.RankingMap);
    method public void onNotificationRemoved(android.service.notification.StatusBarNotification, android.service.notification.NotificationListenerService.RankingMap, int);
    method public void onNotificationRemoved(android.service.notification.StatusBarNotification, android.service.notification.NotificationListenerService.RankingMap, android.service.notification.NotificationStats, int);
    method public final void requestInterruptionFilter(int);
    method public final void requestListenerHints(int);
    method public static void requestRebind(android.content.ComponentName);
@@ -37943,8 +37945,12 @@ package android.service.notification {
    method public java.lang.String getOverrideGroupKey();
    method public int getRank();
    method public int getSuppressedVisualEffects();
    method public int getUserSentiment();
    method public boolean isAmbient();
    method public boolean matchesInterruptionFilter();
    field public static final int USER_SENTIMENT_NEGATIVE = -1; // 0xffffffff
    field public static final int USER_SENTIMENT_NEUTRAL = 0; // 0x0
    field public static final int USER_SENTIMENT_POSITIVE = 1; // 0x1
  }
  public static class NotificationListenerService.RankingMap implements android.os.Parcelable {
@@ -37955,6 +37961,32 @@ package android.service.notification {
    field public static final android.os.Parcelable.Creator<android.service.notification.NotificationListenerService.RankingMap> CREATOR;
  }
  public final class NotificationStats implements android.os.Parcelable {
    ctor public NotificationStats();
    ctor protected NotificationStats(android.os.Parcel);
    method public int describeContents();
    method public int getDismissalSurface();
    method public boolean hasDirectReplied();
    method public boolean hasExpanded();
    method public boolean hasInteracted();
    method public boolean hasSeen();
    method public boolean hasSnoozed();
    method public boolean hasViewedSettings();
    method public void setDirectReplied();
    method public void setDismissalSurface(int);
    method public void setExpanded();
    method public void setSeen();
    method public void setSnoozed();
    method public void setViewedSettings();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.notification.NotificationStats> CREATOR;
    field public static final int DISMISSAL_AOD = 2; // 0x2
    field public static final int DISMISSAL_NOT_DISMISSED = -1; // 0xffffffff
    field public static final int DISMISSAL_OTHER = 0; // 0x0
    field public static final int DISMISSAL_PEEK = 1; // 0x1
    field public static final int DISMISSAL_SHADE = 3; // 0x3
  }
  public final class SnoozeCriterion implements android.os.Parcelable {
    ctor public SnoozeCriterion(java.lang.String, java.lang.CharSequence, java.lang.CharSequence);
    ctor protected SnoozeCriterion(android.os.Parcel);
+9 −0
Original line number Diff line number Diff line
@@ -55,6 +55,15 @@ public final class Adjustment implements Parcelable {
     */
    public static final String KEY_GROUP_KEY = "key_group_key";

    /**
     * Data type: int, one of {@link NotificationListenerService.Ranking#USER_SENTIMENT_POSITIVE},
     * {@link NotificationListenerService.Ranking#USER_SENTIMENT_NEUTRAL},
     * {@link NotificationListenerService.Ranking#USER_SENTIMENT_NEGATIVE}. Used to express how
     * a user feels about notifications in the same {@link android.app.NotificationChannel} as
     * the notification represented by {@link #getKey()}.
     */
    public static final String KEY_USER_SENTIMENT = "key_user_sentiment";

    /**
     * Create a notification adjustment.
     *
+5 −3
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package android.service.notification;
import android.app.NotificationChannel;
import android.app.NotificationChannelGroup;
import android.os.UserHandle;
import android.service.notification.NotificationStats;
import android.service.notification.IStatusBarNotificationHolder;
import android.service.notification.StatusBarNotification;
import android.service.notification.NotificationRankingUpdate;
@@ -26,12 +27,13 @@ import android.service.notification.NotificationRankingUpdate;
/** @hide */
oneway interface INotificationListener
{
    // listeners and rankers
    // listeners and assistant
    void onListenerConnected(in NotificationRankingUpdate update);
    void onNotificationPosted(in IStatusBarNotificationHolder notificationHolder,
            in NotificationRankingUpdate update);
    // stats only for assistant
    void onNotificationRemoved(in IStatusBarNotificationHolder notificationHolder,
            in NotificationRankingUpdate update, int reason);
            in NotificationRankingUpdate update, in NotificationStats stats, int reason);
    void onNotificationRankingUpdate(in NotificationRankingUpdate update);
    void onListenerHintsChanged(int hints);
    void onInterruptionFilterChanged(int interruptionFilter);
@@ -40,7 +42,7 @@ oneway interface INotificationListener
    void onNotificationChannelModification(String pkgName, in UserHandle user, in NotificationChannel channel, int modificationType);
    void onNotificationChannelGroupModification(String pkgName, in UserHandle user, in NotificationChannelGroup group, int modificationType);

    // rankers only
    // assistants only
    void onNotificationEnqueued(in IStatusBarNotificationHolder notificationHolder);
    void onNotificationSnoozedUntilContext(in IStatusBarNotificationHolder notificationHolder, String snoozeCriterionId);
}
Loading