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

Commit fd2ec469 authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge "Fix API errors"

parents 3614fbd0 79f0277f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -41588,6 +41588,7 @@ package android.service.notification {
    field public static final android.os.Parcelable.Creator<android.service.notification.Adjustment> CREATOR;
    field public static final String KEY_CONTEXTUAL_ACTIONS = "key_contextual_actions";
    field public static final String KEY_IMPORTANCE = "key_importance";
    field public static final String KEY_SNOOZE_CRITERIA = "key_snooze_criteria";
    field public static final String KEY_TEXT_REPLIES = "key_text_replies";
    field public static final String KEY_USER_SENTIMENT = "key_user_sentiment";
  }
@@ -41645,12 +41646,14 @@ package android.service.notification {
    method public void onActionInvoked(@NonNull String, @NonNull android.app.Notification.Action, int);
    method public final android.os.IBinder onBind(android.content.Intent);
    method public void onNotificationDirectReplied(@NonNull String);
    method public android.service.notification.Adjustment onNotificationEnqueued(android.service.notification.StatusBarNotification);
    method public abstract android.service.notification.Adjustment onNotificationEnqueued(android.service.notification.StatusBarNotification);
    method public android.service.notification.Adjustment onNotificationEnqueued(android.service.notification.StatusBarNotification, android.app.NotificationChannel);
    method public void onNotificationExpansionChanged(@NonNull String, boolean, boolean);
    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, String);
    method public void onNotificationsSeen(java.util.List<java.lang.String>);
    method public void onSuggestedReplySent(@NonNull String, @NonNull CharSequence, int);
    method public final void unsnoozeNotification(String);
    field public static final String SERVICE_INTERFACE = "android.service.notification.NotificationAssistantService";
    field public static final int SOURCE_FROM_APP = 0; // 0x0
    field public static final int SOURCE_FROM_ASSISTANT = 1; // 0x1
+9 −0
Original line number Diff line number Diff line
@@ -6522,6 +6522,15 @@ package android.service.euicc {
package android.service.notification {
  public final class Adjustment implements android.os.Parcelable {
    ctor protected Adjustment(android.os.Parcel);
    field public static final String KEY_PEOPLE = "key_people";
  }
  public final class NotificationStats implements android.os.Parcelable {
    ctor protected NotificationStats(android.os.Parcel);
  }
  public final class SnoozeCriterion implements android.os.Parcelable {
    ctor public SnoozeCriterion(String, CharSequence, CharSequence);
    ctor protected SnoozeCriterion(android.os.Parcel);
+7 −2
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package android.service.notification;

import android.annotation.SystemApi;
import android.app.Notification;
import android.os.Bundle;
import android.os.Parcel;
@@ -36,13 +37,13 @@ public final class Adjustment implements Parcelable {
     * See {@link android.app.Notification.Builder#addPerson(String)}.
     * @hide
     */
    @SystemApi
    public static final String KEY_PEOPLE = "key_people";
    /**
     * Parcelable {@code ArrayList} of {@link SnoozeCriterion}. These criteria may be visible to
     * users. If a user chooses to snooze a notification until one of these criterion, the
     * assistant will be notified via
     * {@link NotificationAssistantService#onNotificationSnoozedUntilContext}.
     * @hide
     */
    public static final String KEY_SNOOZE_CRITERIA = "key_snooze_criteria";
    /**
@@ -111,7 +112,11 @@ public final class Adjustment implements Parcelable {
        mUser = user;
    }

    private Adjustment(Parcel in) {
    /**
     * @hide
     */
    @SystemApi
    protected Adjustment(Parcel in) {
        if (in.readInt() == 1) {
            mPackage = in.readString();
        } else {
+7 −7
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import static java.lang.annotation.RetentionPolicy.SOURCE;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.SdkConstant;
import android.annotation.SystemApi;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.admin.DevicePolicyManager;
@@ -103,7 +104,6 @@ public abstract class NotificationAssistantService extends NotificationListenerS
     *
     * @param sbn the notification to snooze
     * @param snoozeCriterionId the {@link SnoozeCriterion#getId()} representing a device context.
     * @hide
     */
    abstract public void onNotificationSnoozedUntilContext(StatusBarNotification sbn,
            String snoozeCriterionId);
@@ -111,12 +111,13 @@ public abstract class NotificationAssistantService extends NotificationListenerS
    /**
     * A notification was posted by an app. Called before post.
     *
     * <p>Note: this method is only called if you don't override
     * {@link #onNotificationEnqueued(StatusBarNotification, NotificationChannel)}.</p>
     *
     * @param sbn the new notification
     * @return an adjustment or null to take no action, within 100ms.
     */
    public Adjustment onNotificationEnqueued(StatusBarNotification sbn) {
        return null;
    }
    abstract public Adjustment onNotificationEnqueued(StatusBarNotification sbn);

    /**
     * A notification was posted by an app. Called before post.
@@ -240,12 +241,11 @@ public abstract class NotificationAssistantService extends NotificationListenerS
    /**
     * Inform the notification manager about un-snoozing a specific notification.
     * <p>
     * This should only be used for notifications snoozed by this listener using
     * {@link #snoozeNotification(String, String)}. Once un-snoozed, you will get a
     * This should only be used for notifications snoozed because of a contextual snooze suggestion
     * you provided via {@link Adjustment#KEY_SNOOZE_CRITERIA}. Once un-snoozed, you will get a
     * {@link #onNotificationPosted(StatusBarNotification, RankingMap)} callback for the
     * notification.
     * @param key The key of the notification to snooze
     * @hide
     */
    public final void unsnoozeNotification(String key) {
        if (!isBound()) return;
+6 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
package android.service.notification;

import android.annotation.IntDef;
import android.annotation.SystemApi;
import android.app.RemoteInput;
import android.os.Parcel;
import android.os.Parcelable;
@@ -98,7 +99,11 @@ public final class NotificationStats implements Parcelable {
    public NotificationStats() {
    }

    private NotificationStats(Parcel in) {
    /**
     * @hide
     */
    @SystemApi
    protected NotificationStats(Parcel in) {
        mSeen = in.readByte() != 0;
        mExpanded = in.readByte() != 0;
        mDirectReplied = in.readByte() != 0;
Loading