From 241a192a10473ace0658597fe627b69b86a372fb Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Tue, 21 Aug 2018 10:39:07 -0400 Subject: [PATCH] Fix notifications crash Change-Id: I75a34beb124de92c0d7d9033e3fe21dbdeb67ed3 Fixes: 112656503 Test: manual --- .../android/settings/notification/AppNotificationSettings.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/notification/AppNotificationSettings.java b/src/com/android/settings/notification/AppNotificationSettings.java index 9d8f6f65c0..cbb50433fd 100644 --- a/src/com/android/settings/notification/AppNotificationSettings.java +++ b/src/com/android/settings/notification/AppNotificationSettings.java @@ -67,12 +67,18 @@ public class AppNotificationSettings extends NotificationSettingsBase { // if showing legacy settings, pull advanced settings out of the advanced category Preference badge = findPreference(KEY_BADGE); Preference appLink = findPreference(KEY_APP_LINK); + PreferenceGroup advanced = (PreferenceGroup) findPreference(KEY_ADVANCED_CATEGORY); removePreference(KEY_ADVANCED_CATEGORY); if (badge != null) { + if (advanced != null) { + advanced.removePreference(badge); + } screen.addPreference(badge); - } if (appLink != null) { + if (advanced != null) { + advanced.removePreference(appLink); + } screen.addPreference(appLink); } } -- 2.11.0