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

Commit a485ec65 authored by Nick's avatar Nick
Browse files

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
parent dbc26e0e
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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());