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

Commit 42a13f29 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Undeprecate allowed adjustments methods

Test: NotificationAssistantsTest
Test: NotificationAssistantServiceTest
Fixes: 372697063
Flag: android.service.notification.notification_classification

Change-Id: I9759a2a2b8cab694126479b458cb1518d0145630
parent f613f7fe
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13104,7 +13104,7 @@ package android.service.notification {
    method public final void adjustNotification(@NonNull android.service.notification.Adjustment);
    method public final void adjustNotifications(@NonNull java.util.List<android.service.notification.Adjustment>);
    method public void onActionInvoked(@NonNull String, @NonNull android.app.Notification.Action, int);
    method @Deprecated public void onAllowedAdjustmentsChanged();
    method public void onAllowedAdjustmentsChanged();
    method @NonNull public final android.os.IBinder onBind(@Nullable android.content.Intent);
    method public void onNotificationClicked(@NonNull String);
    method public void onNotificationDirectReplied(@NonNull String);
+2 −0
Original line number Diff line number Diff line
@@ -393,7 +393,9 @@ package android.app {

  public class NotificationManager {
    method @FlaggedApi("android.app.modes_api") @NonNull public String addAutomaticZenRule(@NonNull android.app.AutomaticZenRule, boolean);
    method @FlaggedApi("android.service.notification.notification_classification") public void allowAssistantAdjustment(@NonNull String);
    method public void cleanUpCallersAfter(long);
    method @FlaggedApi("android.service.notification.notification_classification") public void disallowAssistantAdjustment(@NonNull String);
    method @FlaggedApi("android.app.modes_api") @NonNull public android.service.notification.ZenPolicy getDefaultZenPolicy();
    method public android.content.ComponentName getEffectsSuppressor();
    method @FlaggedApi("android.service.notification.notification_classification") @NonNull public java.util.Set<java.lang.String> getUnsupportedAdjustmentTypes();
+2 −0
Original line number Diff line number Diff line
@@ -84,6 +84,8 @@ interface INotificationManager
    boolean isImportanceLocked(String pkg, int uid);

    List<String> getAllowedAssistantAdjustments(String pkg);
    void allowAssistantAdjustment(String adjustmentType);
    void disallowAssistantAdjustment(String adjustmentType);

    boolean shouldHideSilentStatusIcons(String callingPkg);
    void setHideSilentStatusIcons(boolean hide);
+28 −0
Original line number Diff line number Diff line
@@ -1790,6 +1790,34 @@ public class NotificationManager {
        }
    }

    /**
     * @hide
     */
    @TestApi
    @FlaggedApi(android.service.notification.Flags.FLAG_NOTIFICATION_CLASSIFICATION)
    public void allowAssistantAdjustment(@NonNull String capability) {
        INotificationManager service = getService();
        try {
            service.allowAssistantAdjustment(capability);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * @hide
     */
    @TestApi
    @FlaggedApi(android.service.notification.Flags.FLAG_NOTIFICATION_CLASSIFICATION)
    public void disallowAssistantAdjustment(@NonNull String capability) {
        INotificationManager service = getService();
        try {
            service.disallowAssistantAdjustment(capability);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /** @hide */
    @TestApi
    public boolean isNotificationPolicyAccessGrantedForPackage(@NonNull String pkg) {
+0 −1
Original line number Diff line number Diff line
@@ -58,7 +58,6 @@ oneway interface INotificationListener
    void onSuggestedReplySent(String key, in CharSequence reply, int source);
    void onActionClicked(String key, in Notification.Action action, int source);
    void onNotificationClicked(String key);
    // @deprecated changing allowed adjustments is no longer supported.
    void onAllowedAdjustmentsChanged();
    void onNotificationFeedbackReceived(String key, in NotificationRankingUpdate update, in Bundle feedback);
}
Loading