diff options
| author | 2018-07-03 11:32:39 -0700 | |
|---|---|---|
| committer | 2018-07-09 10:18:56 -0700 | |
| commit | a485ec65b5ba947d69158ad90905abf3310655cf (patch) | |
| tree | fa80af99848ef9c249d4b021284bd12da2163bd6 | |
| parent | dbc26e0e9d9994d5b18ba1c6f062cc6b0fd45515 (diff) | |
Disable DND status change notification on watches.
Added a check to the showZenUpgradeNotification logic to detect the
presence of a watch.
Reupload of ag/4436427 which was reverted (ag/4466787) because I forgot to get
approvals from main Android team.
Bug: 74178001
Test: Flashed image to watch, saw expected behavior
Change-Id: If88df0fe2f3ecd0d6e075d56747ba32213bb2131
| -rw-r--r-- | services/core/java/com/android/server/notification/ZenModeHelper.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/notification/ZenModeHelper.java b/services/core/java/com/android/server/notification/ZenModeHelper.java index 669d5565534d..1954ed4bfa45 100644 --- a/services/core/java/com/android/server/notification/ZenModeHelper.java +++ b/services/core/java/com/android/server/notification/ZenModeHelper.java @@ -1182,11 +1182,19 @@ public class ZenModeHelper { } private void showZenUpgradeNotification(int zen) { + final boolean isWatch = mContext.getPackageManager().hasSystemFeature( + PackageManager.FEATURE_WATCH); final boolean showNotification = mIsBootComplete && zen != Global.ZEN_MODE_OFF + && !isWatch && Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.SHOW_ZEN_UPGRADE_NOTIFICATION, 0) != 0; + if (isWatch) { + Settings.Global.putInt(mContext.getContentResolver(), + Global.SHOW_ZEN_UPGRADE_NOTIFICATION, 0); + } + if (showNotification) { mNotificationManager.notify(TAG, SystemMessage.NOTE_ZEN_UPGRADE, createZenUpgradeNotification()); |