diff options
| author | 2017-05-26 14:43:47 -0400 | |
|---|---|---|
| committer | 2017-05-26 20:35:16 +0000 | |
| commit | 745c15477b22f88af303065e18025af386582736 (patch) | |
| tree | cbc7fd0dfc1efb04f67f2ec02e58c94e01627954 | |
| parent | 76926df97e407bf1df2373ac9c9a1e579e9dd46a (diff) | |
Properly read vibration setting on boot.
Test: runtest systemui-notification
Change-Id: I400bc3df441524abe4973d4d6bccc7ef30a2e1c7
Fixes: 37865035
| -rw-r--r-- | core/java/android/app/NotificationChannel.java | 2 | ||||
| -rw-r--r-- | services/tests/notification/src/com/android/server/notification/RankingHelperTest.java | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/core/java/android/app/NotificationChannel.java b/core/java/android/app/NotificationChannel.java index c076e5e3c117..143d147ab4e7 100644 --- a/core/java/android/app/NotificationChannel.java +++ b/core/java/android/app/NotificationChannel.java @@ -575,8 +575,8 @@ public final class NotificationChannel implements Parcelable { setSound(safeUri(parser, ATT_SOUND), safeAudioAttributes(parser)); enableLights(safeBool(parser, ATT_LIGHTS, false)); setLightColor(safeInt(parser, ATT_LIGHT_COLOR, DEFAULT_LIGHT_COLOR)); - enableVibration(safeBool(parser, ATT_VIBRATION_ENABLED, false)); setVibrationPattern(safeLongArray(parser, ATT_VIBRATION, null)); + enableVibration(safeBool(parser, ATT_VIBRATION_ENABLED, false)); setShowBadge(safeBool(parser, ATT_SHOW_BADGE, false)); setDeleted(safeBool(parser, ATT_DELETED, false)); setGroup(parser.getAttributeValue(null, ATT_GROUP)); diff --git a/services/tests/notification/src/com/android/server/notification/RankingHelperTest.java b/services/tests/notification/src/com/android/server/notification/RankingHelperTest.java index 41da88f45152..5a72e6ba665a 100644 --- a/services/tests/notification/src/com/android/server/notification/RankingHelperTest.java +++ b/services/tests/notification/src/com/android/server/notification/RankingHelperTest.java @@ -364,11 +364,14 @@ public class RankingHelperTest extends NotificationTestCase { channel2.enableVibration(false); channel2.setGroup(ncg.getId()); channel2.setLightColor(Color.BLUE); + NotificationChannel channel3 = new NotificationChannel("id3", "NAM3", IMPORTANCE_HIGH); + channel3.enableVibration(true); mHelper.createNotificationChannelGroup(PKG, UID, ncg, true); mHelper.createNotificationChannelGroup(PKG, UID, ncg2, true); mHelper.createNotificationChannel(PKG, UID, channel1, true); mHelper.createNotificationChannel(PKG, UID, channel2, false); + mHelper.createNotificationChannel(PKG, UID, channel3, false); mHelper.createNotificationChannel(UPDATED_PKG, UID2, getChannel(), true); mHelper.setShowBadge(PKG, UID, true); @@ -376,8 +379,9 @@ public class RankingHelperTest extends NotificationTestCase { mHelper.setImportance(UPDATED_PKG, UID2, IMPORTANCE_NONE); ByteArrayOutputStream baos = writeXmlAndPurge(PKG, UID, true, channel1.getId(), - channel2.getId(), NotificationChannel.DEFAULT_CHANNEL_ID); - mHelper.onPackagesChanged(true, UserHandle.myUserId(), new String[]{PKG, UPDATED_PKG}, new int[]{UID, UID2}); + channel2.getId(), channel3.getId(), NotificationChannel.DEFAULT_CHANNEL_ID); + mHelper.onPackagesChanged(true, UserHandle.myUserId(), new String[]{PKG, UPDATED_PKG}, + new int[]{UID, UID2}); mHelper.setShowBadge(UPDATED_PKG, UID2, true); @@ -388,6 +392,8 @@ public class RankingHelperTest extends NotificationTestCase { assertEquals(channel1, mHelper.getNotificationChannel(PKG, UID, channel1.getId(), false)); compareChannels(channel2, mHelper.getNotificationChannel(PKG, UID, channel2.getId(), false)); + compareChannels(channel3, + mHelper.getNotificationChannel(PKG, UID, channel3.getId(), false)); List<NotificationChannelGroup> actualGroups = mHelper.getNotificationChannelGroups(PKG, UID, false).getList(); |