Loading src/com/android/settings/notification/AppBubbleListPreferenceController.java +7 −7 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ public class AppBubbleListPreferenceController extends AppConversationListPrefer private static final String KEY = "bubble_conversations"; public AppBubbleListPreferenceController(Context context, NotificationBackend backend) { super(context, backend); super(context, backend, KEY); } @Override Loading Loading @@ -80,25 +80,25 @@ public class AppBubbleListPreferenceController extends AppConversationListPrefer } @Override public boolean isAvailable() { public int getAvailabilityStatus() { // copy rather than inherit super's isAvailable because apps can link to this page // as part of onboarding, before they send a valid conversation notification if (mAppRow == null) { return false; return CONDITIONALLY_UNAVAILABLE; } if (mAppRow.banned) { return false; return CONDITIONALLY_UNAVAILABLE; } if (mChannel != null) { if (mBackend.onlyHasDefaultChannel(mAppRow.pkg, mAppRow.uid) || NotificationChannel.DEFAULT_CHANNEL_ID.equals(mChannel.getId())) { return false; return CONDITIONALLY_UNAVAILABLE; } } if (mAppRow.bubblePreference == BUBBLE_PREFERENCE_NONE) { return false; return CONDITIONALLY_UNAVAILABLE; } return true; return AVAILABLE; } @VisibleForTesting Loading src/com/android/settings/notification/app/AddToHomeScreenPreferenceController.java +5 −5 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ public class AddToHomeScreenPreferenceController extends NotificationPreferenceC private static final String KEY = "add_to_home"; public AddToHomeScreenPreferenceController(Context context, NotificationBackend backend) { super(context, backend); super(context, backend, KEY); } @Override Loading @@ -41,11 +41,11 @@ public class AddToHomeScreenPreferenceController extends NotificationPreferenceC } @Override public boolean isAvailable() { if (!super.isAvailable()) { return false; public int getAvailabilityStatus() { if (super.getAvailabilityStatus() == CONDITIONALLY_UNAVAILABLE) { return CONDITIONALLY_UNAVAILABLE; } return mConversationInfo != null; return mConversationInfo != null ? AVAILABLE : CONDITIONALLY_UNAVAILABLE; } @Override Loading src/com/android/settings/notification/app/AllowSoundPreferenceController.java +8 −5 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ public class AllowSoundPreferenceController extends NotificationPreferenceContro public AllowSoundPreferenceController(Context context, NotificationSettings.DependentFieldListener dependentFieldListener, NotificationBackend backend) { super(context, backend); super(context, backend, KEY_IMPORTANCE); mDependentFieldListener = dependentFieldListener; } Loading @@ -50,11 +50,14 @@ public class AllowSoundPreferenceController extends NotificationPreferenceContro } @Override public boolean isAvailable() { if (!super.isAvailable()) { return false; public int getAvailabilityStatus() { if (super.getAvailabilityStatus() == CONDITIONALLY_UNAVAILABLE) { return CONDITIONALLY_UNAVAILABLE; } return mChannel != null && NotificationChannel.DEFAULT_CHANNEL_ID.equals(mChannel.getId()); if (mChannel != null && NotificationChannel.DEFAULT_CHANNEL_ID.equals(mChannel.getId())) { return AVAILABLE; } return CONDITIONALLY_UNAVAILABLE; } Loading src/com/android/settings/notification/app/AppChannelsBypassingDndPreferenceController.java +3 −3 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ public class AppChannelsBypassingDndPreferenceController extends NotificationPre public AppChannelsBypassingDndPreferenceController( Context context, NotificationBackend backend) { super(context, backend); super(context, backend, KEY); } @Override Loading Loading @@ -110,8 +110,8 @@ public class AppChannelsBypassingDndPreferenceController extends NotificationPre } @Override public boolean isAvailable() { return mAppRow != null; public int getAvailabilityStatus() { return mAppRow != null ? AVAILABLE : CONDITIONALLY_UNAVAILABLE; } @Override Loading src/com/android/settings/notification/app/AppConversationListPreferenceController.java +15 −7 Original line number Diff line number Diff line Loading @@ -49,7 +49,12 @@ public class AppConversationListPreferenceController extends NotificationPrefere protected PreferenceCategory mPreference; public AppConversationListPreferenceController(Context context, NotificationBackend backend) { super(context, backend); this(context, backend, KEY); } public AppConversationListPreferenceController(Context context, NotificationBackend backend, String key) { super(context, backend, key); } @Override Loading @@ -58,21 +63,24 @@ public class AppConversationListPreferenceController extends NotificationPrefere } @Override public boolean isAvailable() { public int getAvailabilityStatus() { if (mAppRow == null) { return false; return CONDITIONALLY_UNAVAILABLE; } if (mAppRow.banned) { return false; return CONDITIONALLY_UNAVAILABLE; } if (mChannel != null) { if (mBackend.onlyHasDefaultChannel(mAppRow.pkg, mAppRow.uid) || NotificationChannel.DEFAULT_CHANNEL_ID.equals(mChannel.getId())) { return false; return CONDITIONALLY_UNAVAILABLE; } } if (mBackend.hasSentValidMsg(mAppRow.pkg, mAppRow.uid) || mBackend.isInInvalidMsgState( mAppRow.pkg, mAppRow.uid)) { return AVAILABLE; } return mBackend.hasSentValidMsg(mAppRow.pkg, mAppRow.uid) || mBackend.isInInvalidMsgState( mAppRow.pkg, mAppRow.uid); return CONDITIONALLY_UNAVAILABLE; } @Override Loading Loading
src/com/android/settings/notification/AppBubbleListPreferenceController.java +7 −7 Original line number Diff line number Diff line Loading @@ -51,7 +51,7 @@ public class AppBubbleListPreferenceController extends AppConversationListPrefer private static final String KEY = "bubble_conversations"; public AppBubbleListPreferenceController(Context context, NotificationBackend backend) { super(context, backend); super(context, backend, KEY); } @Override Loading Loading @@ -80,25 +80,25 @@ public class AppBubbleListPreferenceController extends AppConversationListPrefer } @Override public boolean isAvailable() { public int getAvailabilityStatus() { // copy rather than inherit super's isAvailable because apps can link to this page // as part of onboarding, before they send a valid conversation notification if (mAppRow == null) { return false; return CONDITIONALLY_UNAVAILABLE; } if (mAppRow.banned) { return false; return CONDITIONALLY_UNAVAILABLE; } if (mChannel != null) { if (mBackend.onlyHasDefaultChannel(mAppRow.pkg, mAppRow.uid) || NotificationChannel.DEFAULT_CHANNEL_ID.equals(mChannel.getId())) { return false; return CONDITIONALLY_UNAVAILABLE; } } if (mAppRow.bubblePreference == BUBBLE_PREFERENCE_NONE) { return false; return CONDITIONALLY_UNAVAILABLE; } return true; return AVAILABLE; } @VisibleForTesting Loading
src/com/android/settings/notification/app/AddToHomeScreenPreferenceController.java +5 −5 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ public class AddToHomeScreenPreferenceController extends NotificationPreferenceC private static final String KEY = "add_to_home"; public AddToHomeScreenPreferenceController(Context context, NotificationBackend backend) { super(context, backend); super(context, backend, KEY); } @Override Loading @@ -41,11 +41,11 @@ public class AddToHomeScreenPreferenceController extends NotificationPreferenceC } @Override public boolean isAvailable() { if (!super.isAvailable()) { return false; public int getAvailabilityStatus() { if (super.getAvailabilityStatus() == CONDITIONALLY_UNAVAILABLE) { return CONDITIONALLY_UNAVAILABLE; } return mConversationInfo != null; return mConversationInfo != null ? AVAILABLE : CONDITIONALLY_UNAVAILABLE; } @Override Loading
src/com/android/settings/notification/app/AllowSoundPreferenceController.java +8 −5 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ public class AllowSoundPreferenceController extends NotificationPreferenceContro public AllowSoundPreferenceController(Context context, NotificationSettings.DependentFieldListener dependentFieldListener, NotificationBackend backend) { super(context, backend); super(context, backend, KEY_IMPORTANCE); mDependentFieldListener = dependentFieldListener; } Loading @@ -50,11 +50,14 @@ public class AllowSoundPreferenceController extends NotificationPreferenceContro } @Override public boolean isAvailable() { if (!super.isAvailable()) { return false; public int getAvailabilityStatus() { if (super.getAvailabilityStatus() == CONDITIONALLY_UNAVAILABLE) { return CONDITIONALLY_UNAVAILABLE; } return mChannel != null && NotificationChannel.DEFAULT_CHANNEL_ID.equals(mChannel.getId()); if (mChannel != null && NotificationChannel.DEFAULT_CHANNEL_ID.equals(mChannel.getId())) { return AVAILABLE; } return CONDITIONALLY_UNAVAILABLE; } Loading
src/com/android/settings/notification/app/AppChannelsBypassingDndPreferenceController.java +3 −3 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ public class AppChannelsBypassingDndPreferenceController extends NotificationPre public AppChannelsBypassingDndPreferenceController( Context context, NotificationBackend backend) { super(context, backend); super(context, backend, KEY); } @Override Loading Loading @@ -110,8 +110,8 @@ public class AppChannelsBypassingDndPreferenceController extends NotificationPre } @Override public boolean isAvailable() { return mAppRow != null; public int getAvailabilityStatus() { return mAppRow != null ? AVAILABLE : CONDITIONALLY_UNAVAILABLE; } @Override Loading
src/com/android/settings/notification/app/AppConversationListPreferenceController.java +15 −7 Original line number Diff line number Diff line Loading @@ -49,7 +49,12 @@ public class AppConversationListPreferenceController extends NotificationPrefere protected PreferenceCategory mPreference; public AppConversationListPreferenceController(Context context, NotificationBackend backend) { super(context, backend); this(context, backend, KEY); } public AppConversationListPreferenceController(Context context, NotificationBackend backend, String key) { super(context, backend, key); } @Override Loading @@ -58,21 +63,24 @@ public class AppConversationListPreferenceController extends NotificationPrefere } @Override public boolean isAvailable() { public int getAvailabilityStatus() { if (mAppRow == null) { return false; return CONDITIONALLY_UNAVAILABLE; } if (mAppRow.banned) { return false; return CONDITIONALLY_UNAVAILABLE; } if (mChannel != null) { if (mBackend.onlyHasDefaultChannel(mAppRow.pkg, mAppRow.uid) || NotificationChannel.DEFAULT_CHANNEL_ID.equals(mChannel.getId())) { return false; return CONDITIONALLY_UNAVAILABLE; } } if (mBackend.hasSentValidMsg(mAppRow.pkg, mAppRow.uid) || mBackend.isInInvalidMsgState( mAppRow.pkg, mAppRow.uid)) { return AVAILABLE; } return mBackend.hasSentValidMsg(mAppRow.pkg, mAppRow.uid) || mBackend.isInInvalidMsgState( mAppRow.pkg, mAppRow.uid); return CONDITIONALLY_UNAVAILABLE; } @Override Loading