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

Commit 8e20aba8 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Migrate to fixed permission checking

To move towards removing the role-based and allowlist methods
for preventing notification blocking

Test: atest ui services tests, cts NotificationChannelTest
Bug: 194833441
Change-Id: I91b0f87863229402a10d8b617502538bbe8686b4
parent 7d577739
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -6189,10 +6189,12 @@ package android.app {
    method public long[] getVibrationPattern();
    method public boolean hasUserSetImportance();
    method public boolean hasUserSetSound();
    method public boolean isBlockable();
    method public boolean isConversation();
    method public boolean isDemoted();
    method public boolean isImportantConversation();
    method public void setAllowBubbles(boolean);
    method public void setBlockable(boolean);
    method public void setBypassDnd(boolean);
    method public void setConversationId(@NonNull String, @NonNull String);
    method public void setDescription(String);
+0 −1
Original line number Diff line number Diff line
@@ -774,7 +774,6 @@ package android.app {
    method public int getUserLockedFields();
    method public boolean isDeleted();
    method public void populateFromXml(org.xmlpull.v1.XmlPullParser);
    method public void setBlockable(boolean);
    method public org.json.JSONObject toJson() throws org.json.JSONException;
    method public void writeXml(org.xmlpull.v1.XmlSerializer) throws java.io.IOException;
    field public static final int USER_LOCKED_SOUND = 32; // 0x20
+0 −1
Original line number Diff line number Diff line
@@ -282,7 +282,6 @@ package android.app {

  public final class NotificationChannel implements android.os.Parcelable {
    method public int getOriginalImportance();
    method public boolean isBlockable();
    method public boolean isImportanceLockedByCriticalDeviceFunction();
    method public boolean isImportanceLockedByOEM();
    method public void lockFields(int);
+1 −0
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@ interface INotificationManager
    ParceledListSlice getNotificationChannelsBypassingDnd(String pkg, int userId);
    boolean isPackagePaused(String pkg);
    void deleteNotificationHistoryItem(String pkg, int uid, long postedTime);
    boolean isPermissionFixed(String pkg, int userId);

    void silenceNotificationSound();

+4 −6
Original line number Diff line number Diff line
@@ -440,15 +440,13 @@ public final class NotificationChannel implements Parcelable {

    /**
     * Allows users to block notifications sent through this channel, if this channel belongs to
     * a package that is signed with the system signature.
     * a package that otherwise would have notifications "fixed" as enabled.
     *
     * If the channel does not belong to a package that is signed with the system signature, this
     * If the channel does not belong to a package that has a fixed notification permission, this
     * method does nothing, since such channels are blockable by default and cannot be set to be
     * unblockable.
     * @param blockable if {@code true}, allows users to block notifications on this channel.
     * @hide
     */
    @SystemApi
    public void setBlockable(boolean blockable) {
        mBlockableSystem = blockable;
    }
@@ -842,9 +840,9 @@ public final class NotificationChannel implements Parcelable {
    }

    /**
     * @hide
     * Returns whether this channel is always blockable, even if the app is 'fixed' as
     * non-blockable.
     */
    @TestApi
    public boolean isBlockable() {
        return mBlockableSystem;
    }
Loading