summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorJulia Reynolds <juliacr@google.com>2021-11-02 20:47:57 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2021-11-02 20:47:57 +0000
commit0eb5b7e8e97032f1a7fdf402a5a82dbfcab6edf3 (patch)
tree3e3f24ecdb054c653fbd617ae524c3fc0f7a55a2 /core/java
parent8b0a6fa7c20d775173dd1a64c7cdd213bc6215fd (diff)
parent8e20aba8c1a6364ede7f402b841a8ac1b25a7748 (diff)
Merge "Migrate to fixed permission checking"
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/INotificationManager.aidl1
-rw-r--r--core/java/android/app/NotificationChannel.java10
2 files changed, 5 insertions, 6 deletions
diff --git a/core/java/android/app/INotificationManager.aidl b/core/java/android/app/INotificationManager.aidl
index 131245458bb2..fdcf99d164cc 100644
--- a/core/java/android/app/INotificationManager.aidl
+++ b/core/java/android/app/INotificationManager.aidl
@@ -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();
diff --git a/core/java/android/app/NotificationChannel.java b/core/java/android/app/NotificationChannel.java
index 6553b61ebbc2..91ab19b9e44a 100644
--- a/core/java/android/app/NotificationChannel.java
+++ b/core/java/android/app/NotificationChannel.java
@@ -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;
}