summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2017-05-22 19:10:06 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2017-05-22 19:10:11 +0000
commit5c720a5f09d00819d1ffa5ccdb47478f9fb570b3 (patch)
tree347ef2c65798e5fc0eebea51c2d261c13c3f8ac0
parent1ba237d237830bf97b97b1cf1d7bd205b2c4fc90 (diff)
parent2486f89b1e12b469260ad19b479ad3f0a05a225a (diff)
Merge "Fix AppOps exception for notification channel toasts" into oc-dev
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java21
1 files changed, 10 insertions, 11 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 9cd0dff53991..904756bd4e3f 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -1521,15 +1521,13 @@ public class NotificationManagerService extends SystemService {
final boolean isPackageSuspended =
isPackageSuspendedForUser(pkg, Binder.getCallingUid());
- if (ENABLE_BLOCKED_TOASTS && (!noteNotificationOp(pkg, Binder.getCallingUid())
- || isPackageSuspended)) {
- if (!isSystemToast) {
- Slog.e(TAG, "Suppressing toast from package " + pkg
- + (isPackageSuspended
- ? " due to package suspended by administrator."
- : " by user request."));
- return;
- }
+ if (ENABLE_BLOCKED_TOASTS && !isSystemToast &&
+ (!noteNotificationOp(pkg, Binder.getCallingUid()) || isPackageSuspended)) {
+ Slog.e(TAG, "Suppressing toast from package " + pkg
+ + (isPackageSuspended
+ ? " due to package suspended by administrator."
+ : " by user request."));
+ return;
}
synchronized (mToastQueue) {
@@ -3282,10 +3280,11 @@ public class NotificationManagerService extends SystemService {
}
private void doChannelWarningToast(CharSequence toastText) {
- final boolean warningEnabled = Settings.System.getInt(getContext().getContentResolver(),
+ final boolean warningEnabled = Settings.Global.getInt(getContext().getContentResolver(),
Settings.Global.SHOW_NOTIFICATION_CHANNEL_WARNINGS, 0) != 0;
if (warningEnabled || Build.IS_DEBUGGABLE) {
- Toast toast = Toast.makeText(getContext(), mHandler.getLooper(), toastText, Toast.LENGTH_LONG);
+ Toast toast = Toast.makeText(getContext(), mHandler.getLooper(), toastText,
+ Toast.LENGTH_LONG);
toast.show();
}
}