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

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

Merge "Address api council feedback"

parents dea151c2 cbc45e71
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -4454,7 +4454,7 @@ package android.app {
    ctor public AutomaticZenRule(android.os.Parcel);
    ctor public AutomaticZenRule(android.os.Parcel);
    method public int describeContents();
    method public int describeContents();
    method public android.net.Uri getConditionId();
    method public android.net.Uri getConditionId();
    method public android.content.ComponentName getConfigurationActivity();
    method @Nullable public android.content.ComponentName getConfigurationActivity();
    method public long getCreationTime();
    method public long getCreationTime();
    method public int getInterruptionFilter();
    method public int getInterruptionFilter();
    method public String getName();
    method public String getName();
@@ -4462,7 +4462,7 @@ package android.app {
    method public android.service.notification.ZenPolicy getZenPolicy();
    method public android.service.notification.ZenPolicy getZenPolicy();
    method public boolean isEnabled();
    method public boolean isEnabled();
    method public void setConditionId(android.net.Uri);
    method public void setConditionId(android.net.Uri);
    method public void setConfigurationActivity(android.content.ComponentName);
    method public void setConfigurationActivity(@Nullable android.content.ComponentName);
    method public void setEnabled(boolean);
    method public void setEnabled(boolean);
    method public void setInterruptionFilter(int);
    method public void setInterruptionFilter(int);
    method public void setName(String);
    method public void setName(String);
@@ -5819,10 +5819,9 @@ package android.app {
    method public void notify(String, int, android.app.Notification);
    method public void notify(String, int, android.app.Notification);
    method public void notifyAsPackage(@NonNull String, @NonNull String, int, @NonNull android.app.Notification);
    method public void notifyAsPackage(@NonNull String, @NonNull String, int, @NonNull android.app.Notification);
    method public boolean removeAutomaticZenRule(String);
    method public boolean removeAutomaticZenRule(String);
    method public void revokeNotificationDelegate();
    method public void setAutomaticZenRuleState(@NonNull String, @NonNull android.service.notification.Condition);
    method public void setAutomaticZenRuleState(@NonNull String, @NonNull android.service.notification.Condition);
    method public final void setInterruptionFilter(int);
    method public final void setInterruptionFilter(int);
    method public void setNotificationDelegate(@NonNull String);
    method public void setNotificationDelegate(@Nullable String);
    method public void setNotificationPolicy(@NonNull android.app.NotificationManager.Policy);
    method public void setNotificationPolicy(@NonNull android.app.NotificationManager.Policy);
    method public boolean shouldHideSilentStatusBarIcons();
    method public boolean shouldHideSilentStatusBarIcons();
    method public boolean updateAutomaticZenRule(String, android.app.AutomaticZenRule);
    method public boolean updateAutomaticZenRule(String, android.app.AutomaticZenRule);
@@ -41763,7 +41762,7 @@ package android.service.notification {
    method public int getId();
    method public int getId();
    method public String getKey();
    method public String getKey();
    method public android.app.Notification getNotification();
    method public android.app.Notification getNotification();
    method public String getOpPkg();
    method @NonNull public String getOpPkg();
    method public String getOverrideGroupKey();
    method public String getOverrideGroupKey();
    method public String getPackageName();
    method public String getPackageName();
    method public long getPostTime();
    method public long getPostTime();
+4 −3
Original line number Original line Diff line number Diff line
@@ -136,7 +136,7 @@ public final class AutomaticZenRule implements Parcelable {
     * Returns the {@link ComponentName} of the activity that shows configuration options
     * Returns the {@link ComponentName} of the activity that shows configuration options
     * for this rule.
     * for this rule.
     */
     */
    public ComponentName getConfigurationActivity() {
    public @Nullable ComponentName getConfigurationActivity() {
        return configurationActivity;
        return configurationActivity;
    }
    }


@@ -237,9 +237,10 @@ public final class AutomaticZenRule implements Parcelable {
    /**
    /**
     * Sets the configuration activity - an activity that handles
     * Sets the configuration activity - an activity that handles
     * {@link NotificationManager#ACTION_AUTOMATIC_ZEN_RULE} that shows the user more information
     * {@link NotificationManager#ACTION_AUTOMATIC_ZEN_RULE} that shows the user more information
     * about this rule and/or allows them to configure it.
     * about this rule and/or allows them to configure it. This is required to be non-null for rules
     * that are not backed by {@link android.service.notification.ConditionProviderService}.
     */
     */
    public void setConfigurationActivity(ComponentName componentName) {
    public void setConfigurationActivity(@Nullable ComponentName componentName) {
        this.configurationActivity = componentName;
        this.configurationActivity = componentName;
    }
    }


+0 −1
Original line number Original line Diff line number Diff line
@@ -192,7 +192,6 @@ interface INotificationManager
    ParceledListSlice getAppActiveNotifications(String callingPkg, int userId);
    ParceledListSlice getAppActiveNotifications(String callingPkg, int userId);


    void setNotificationDelegate(String callingPkg, String delegate);
    void setNotificationDelegate(String callingPkg, String delegate);
    void revokeNotificationDelegate(String callingPkg);
    String getNotificationDelegate(String callingPkg);
    String getNotificationDelegate(String callingPkg);
    boolean canNotifyAsPackage(String callingPkg, String targetPkg);
    boolean canNotifyAsPackage(String callingPkg, String targetPkg);


+2 −16
Original line number Original line Diff line number Diff line
@@ -589,11 +589,11 @@ public class NotificationManager {
     * received on your behalf from the cloud, without your process having to wake up.
     * received on your behalf from the cloud, without your process having to wake up.
     *
     *
     * You can check if you have an allowed delegate with {@link #getNotificationDelegate()} and
     * You can check if you have an allowed delegate with {@link #getNotificationDelegate()} and
     * revoke your delegate with {@link #revokeNotificationDelegate()}.
     * revoke your delegate by passing null to this method.
     *
     *
     * @param delegate Package name of the app which can send notifications on your behalf.
     * @param delegate Package name of the app which can send notifications on your behalf.
     */
     */
    public void setNotificationDelegate(@NonNull String delegate) {
    public void setNotificationDelegate(@Nullable String delegate) {
        INotificationManager service = getService();
        INotificationManager service = getService();
        String pkg = mContext.getPackageName();
        String pkg = mContext.getPackageName();
        if (localLOGV) Log.v(TAG, pkg + ": cancelAll()");
        if (localLOGV) Log.v(TAG, pkg + ": cancelAll()");
@@ -604,20 +604,6 @@ public class NotificationManager {
        }
        }
    }
    }


    /**
     * Revokes permission for your {@link #setNotificationDelegate(String) notification delegate}
     * to post notifications on your behalf.
     */
    public void revokeNotificationDelegate() {
        INotificationManager service = getService();
        String pkg = mContext.getPackageName();
        try {
            service.revokeNotificationDelegate(pkg);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
    /**
     * Returns the {@link #setNotificationDelegate(String) delegate} that can post notifications on
     * Returns the {@link #setNotificationDelegate(String) delegate} that can post notifications on
     * your behalf, if there currently is one.
     * your behalf, if there currently is one.
+2 −1
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package android.service.notification;
package android.service.notification;


import android.annotation.NonNull;
import android.annotation.UnsupportedAppUsage;
import android.annotation.UnsupportedAppUsage;
import android.app.Notification;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.NotificationManager;
@@ -299,7 +300,7 @@ public class StatusBarNotification implements Parcelable {
     * Might be different from {@link #getPackageName()} if the app owning the notification has
     * Might be different from {@link #getPackageName()} if the app owning the notification has
     * a {@link NotificationManager#setNotificationDelegate(String) notification delegate}.
     * a {@link NotificationManager#setNotificationDelegate(String) notification delegate}.
     */
     */
    public String getOpPkg() {
    public @NonNull String getOpPkg() {
        return opPkg;
        return opPkg;
    }
    }


Loading