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

Commit f8cc3c16 authored by Chloris Kuo's avatar Chloris Kuo Committed by Android (Google) Code Review
Browse files

Merge "NAS Feedback API Change" into sc-dev

parents 45cbe9b7 02450554
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5556,6 +5556,7 @@ package android.app {
    method public android.graphics.drawable.Icon getSmallIcon();
    method public String getSortKey();
    method public long getTimeoutAfter();
    method public boolean hasImage();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.media.AudioAttributes AUDIO_ATTRIBUTES_DEFAULT;
    field public static final int BADGE_ICON_LARGE = 2; // 0x2
+2 −0
Original line number Diff line number Diff line
@@ -10180,6 +10180,7 @@ package android.service.notification {
    method @Nullable public android.service.notification.Adjustment onNotificationEnqueued(@NonNull android.service.notification.StatusBarNotification, @NonNull android.app.NotificationChannel);
    method @Nullable public android.service.notification.Adjustment onNotificationEnqueued(@NonNull android.service.notification.StatusBarNotification, @NonNull android.app.NotificationChannel, @NonNull android.service.notification.NotificationListenerService.RankingMap);
    method public void onNotificationExpansionChanged(@NonNull String, boolean, boolean);
    method public void onNotificationFeedbackReceived(@NonNull String, @NonNull android.service.notification.NotificationListenerService.RankingMap, @NonNull android.os.Bundle);
    method public abstract void onNotificationSnoozedUntilContext(@NonNull android.service.notification.StatusBarNotification, @NonNull String);
    method public void onNotificationVisibilityChanged(@NonNull String, boolean);
    method public void onNotificationsSeen(@NonNull java.util.List<java.lang.String>);
@@ -10187,6 +10188,7 @@ package android.service.notification {
    method public void onPanelRevealed(int);
    method public void onSuggestedReplySent(@NonNull String, @NonNull CharSequence, int);
    method public final void unsnoozeNotification(@NonNull String);
    field public static final String FEEDBACK_RATING = "feedback.rating";
    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
+1 −0
Original line number Diff line number Diff line
@@ -300,6 +300,7 @@ package android.app {
    method public void clickNotification(@Nullable String, int, int, boolean);
    method @RequiresPermission(android.Manifest.permission.STATUS_BAR) public void collapsePanels();
    method public void expandNotificationsPanel();
    method public void sendNotificationFeedback(@Nullable String, @Nullable android.os.Bundle);
    method @RequiresPermission(android.Manifest.permission.STATUS_BAR) public void setExpansionDisabledForSimNetworkLock(boolean);
  }

+25 −0
Original line number Diff line number Diff line
@@ -6766,6 +6766,31 @@ public class Notification implements Parcelable
        return when != 0 && extras.getBoolean(EXTRA_SHOW_CHRONOMETER);
    }

    /**
     * @return true if the notification has image
     */
    public boolean hasImage() {
        if (MessagingStyle.class.equals(getNotificationStyle()) && extras != null) {
            final Parcelable[] messages = extras.getParcelableArray(EXTRA_MESSAGES);
            if (!ArrayUtils.isEmpty(messages)) {
                for (MessagingStyle.Message m : MessagingStyle.Message
                        .getMessagesFromBundleArray(messages)) {
                    if (m.getDataUri() != null
                            && m.getDataMimeType() != null
                            && m.getDataMimeType().startsWith("image/")) {
                        return true;
                    }
                }
            }
        } else if (hasLargeIcon()) {
            return true;
        } else if (extras.containsKey(EXTRA_BACKGROUND_IMAGE_URI)) {
            return true;
        }
        return false;
    }


    /**
     * @removed
     */
+18 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
import android.os.ServiceManager;
@@ -285,6 +286,23 @@ public class StatusBarManager {
        }
    }

    /**
     * Simulate notification feedback for testing
     *
     * @hide
     */
    @TestApi
    public void sendNotificationFeedback(@Nullable String key, @Nullable Bundle feedback) {
        try {
            final IStatusBarService svc = getService();
            if (svc != null) {
                svc.onNotificationFeedbackReceived(key, feedback);
            }
        } catch (RemoteException ex) {
            throw ex.rethrowFromSystemServer();
        }
    }

    /**
     * Expand the notifications panel.
     *
Loading