From 8dea5fdce9de4b18b75ccc51eb20f6de26106a98 Mon Sep 17 00:00:00 2001 From: Hoa Xuan Date: Fri, 27 Jan 2023 16:18:37 +0100 Subject: [PATCH] Fix test testZenUpgradeNotification on watch Commit a485ec65b5ba947d69158ad90905abf3310655cf disabled DND status change notification on watch. So, assume that the device is not watch to make the test pass. Bug: 266833455 Test: atest FrameworksUiServicesTests:com.android.server.\ notification.ZenModeHelperTest#testZenUpgradeNotification Change-Id: I94441c7172e55ed20add72b4558407fcc1a11fe6 (cherry picked from commit 6aa3b73ea5422cd057e3d58a61a3a013fd5b7f19) --- .../com/android/server/notification/ZenModeHelperTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/tests/uiservicestests/src/com/android/server/notification/ZenModeHelperTest.java b/services/tests/uiservicestests/src/com/android/server/notification/ZenModeHelperTest.java index 49edde585430c..12f124e385f3a 100644 --- a/services/tests/uiservicestests/src/com/android/server/notification/ZenModeHelperTest.java +++ b/services/tests/uiservicestests/src/com/android/server/notification/ZenModeHelperTest.java @@ -525,6 +525,13 @@ public class ZenModeHelperTest extends UiServiceTestCase { @Test public void testZenUpgradeNotification() { + /** + * Commit a485ec65b5ba947d69158ad90905abf3310655cf disabled DND status change + * notification on watches. So, assume that the device is not watch. + */ + when(mContext.getPackageManager()).thenReturn(mPackageManager); + when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_WATCH)).thenReturn(false); + // shows zen upgrade notification if stored settings says to shows, // zen has not been updated, boot is completed // and we're setting zen mode on