Loading res/xml/app_notification_settings.xml +5 −5 Original line number Diff line number Diff line Loading @@ -37,12 +37,12 @@ android:visibility="gone" settings:allowDividerAbove="false" settings:allowDividerBelow="false"> </PreferenceCategory> <com.android.settingslib.RestrictedSwitchPreference android:key="invalid_conversation_switch" android:title="@string/conversation_section_switch_title" /> <Preference android:key="invalid_conversation_info"/> </PreferenceCategory> <!--Bubbles --> <Preference Loading src/com/android/settings/notification/AppBubbleListPreferenceController.java +12 −1 Original line number Diff line number Diff line Loading @@ -72,9 +72,20 @@ public class AppBubbleListPreferenceController extends AppConversationListPrefer @Override public boolean isAvailable() { if (!super.isAvailable()) { // 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; } if (mAppRow.banned) { return false; } if (mChannel != null) { if (mBackend.onlyHasDefaultChannel(mAppRow.pkg, mAppRow.uid) || NotificationChannel.DEFAULT_CHANNEL_ID.equals(mChannel.getId())) { return false; } } if (mAppRow.bubblePreference == BUBBLE_PREFERENCE_NONE) { return false; } Loading src/com/android/settings/notification/NotificationBackend.java +9 −0 Original line number Diff line number Diff line Loading @@ -268,6 +268,15 @@ public class NotificationBackend { } } public boolean hasSentValidMsg(String pkg, int uid) { try { return sINM.hasSentValidMsg(pkg, uid); } catch (Exception e) { Log.w(TAG, "Error calling NoMan", e); return false; } } public boolean isInInvalidMsgState(String pkg, int uid) { try { return sINM.isInInvalidMsgState(pkg, uid); Loading src/com/android/settings/notification/app/AppConversationListPreferenceController.java +3 −4 Original line number Diff line number Diff line Loading @@ -46,7 +46,6 @@ public class AppConversationListPreferenceController extends NotificationPrefere protected List<ConversationChannelWrapper> mConversations = new ArrayList<>(); protected PreferenceCategory mPreference; private boolean mIsInInvalidMsgState; public AppConversationListPreferenceController(Context context, NotificationBackend backend) { super(context, backend); Loading @@ -71,7 +70,8 @@ public class AppConversationListPreferenceController extends NotificationPrefere return false; } } return true; return mBackend.hasSentValidMsg(mAppRow.pkg, mAppRow.uid) || mBackend.isInInvalidMsgState( mAppRow.pkg, mAppRow.uid); } @Override Loading @@ -88,7 +88,6 @@ public class AppConversationListPreferenceController extends NotificationPrefere new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... unused) { mIsInInvalidMsgState = mBackend.isInInvalidMsgState(mAppRow.pkg, mAppRow.uid); ParceledListSlice<ConversationChannelWrapper> list = mBackend.getConversations(mAppRow.pkg, mAppRow.uid); if (list != null) { Loading Loading @@ -122,7 +121,7 @@ public class AppConversationListPreferenceController extends NotificationPrefere return; } if (!mIsInInvalidMsgState && !mConversations.isEmpty()) { if (!mConversations.isEmpty()) { // TODO: if preference has children, compare with newly loaded list mPreference.removeAll(); mPreference.setTitle(getTitleResId()); Loading src/com/android/settings/notification/app/BubbleSummaryPreferenceController.java +2 −2 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ public class BubbleSummaryPreferenceController extends NotificationPreferenceCon if (!super.isAvailable()) { return false; } if (mAppRow == null && mChannel == null) { if (mAppRow == null) { return false; } if (mChannel != null) { Loading @@ -62,7 +62,7 @@ public class BubbleSummaryPreferenceController extends NotificationPreferenceCon return mAppRow != null; } } return isGloballyEnabled(); return isGloballyEnabled() && mBackend.hasSentValidMsg(mAppRow.pkg, mAppRow.uid); } @Override Loading Loading
res/xml/app_notification_settings.xml +5 −5 Original line number Diff line number Diff line Loading @@ -37,12 +37,12 @@ android:visibility="gone" settings:allowDividerAbove="false" settings:allowDividerBelow="false"> </PreferenceCategory> <com.android.settingslib.RestrictedSwitchPreference android:key="invalid_conversation_switch" android:title="@string/conversation_section_switch_title" /> <Preference android:key="invalid_conversation_info"/> </PreferenceCategory> <!--Bubbles --> <Preference Loading
src/com/android/settings/notification/AppBubbleListPreferenceController.java +12 −1 Original line number Diff line number Diff line Loading @@ -72,9 +72,20 @@ public class AppBubbleListPreferenceController extends AppConversationListPrefer @Override public boolean isAvailable() { if (!super.isAvailable()) { // 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; } if (mAppRow.banned) { return false; } if (mChannel != null) { if (mBackend.onlyHasDefaultChannel(mAppRow.pkg, mAppRow.uid) || NotificationChannel.DEFAULT_CHANNEL_ID.equals(mChannel.getId())) { return false; } } if (mAppRow.bubblePreference == BUBBLE_PREFERENCE_NONE) { return false; } Loading
src/com/android/settings/notification/NotificationBackend.java +9 −0 Original line number Diff line number Diff line Loading @@ -268,6 +268,15 @@ public class NotificationBackend { } } public boolean hasSentValidMsg(String pkg, int uid) { try { return sINM.hasSentValidMsg(pkg, uid); } catch (Exception e) { Log.w(TAG, "Error calling NoMan", e); return false; } } public boolean isInInvalidMsgState(String pkg, int uid) { try { return sINM.isInInvalidMsgState(pkg, uid); Loading
src/com/android/settings/notification/app/AppConversationListPreferenceController.java +3 −4 Original line number Diff line number Diff line Loading @@ -46,7 +46,6 @@ public class AppConversationListPreferenceController extends NotificationPrefere protected List<ConversationChannelWrapper> mConversations = new ArrayList<>(); protected PreferenceCategory mPreference; private boolean mIsInInvalidMsgState; public AppConversationListPreferenceController(Context context, NotificationBackend backend) { super(context, backend); Loading @@ -71,7 +70,8 @@ public class AppConversationListPreferenceController extends NotificationPrefere return false; } } return true; return mBackend.hasSentValidMsg(mAppRow.pkg, mAppRow.uid) || mBackend.isInInvalidMsgState( mAppRow.pkg, mAppRow.uid); } @Override Loading @@ -88,7 +88,6 @@ public class AppConversationListPreferenceController extends NotificationPrefere new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... unused) { mIsInInvalidMsgState = mBackend.isInInvalidMsgState(mAppRow.pkg, mAppRow.uid); ParceledListSlice<ConversationChannelWrapper> list = mBackend.getConversations(mAppRow.pkg, mAppRow.uid); if (list != null) { Loading Loading @@ -122,7 +121,7 @@ public class AppConversationListPreferenceController extends NotificationPrefere return; } if (!mIsInInvalidMsgState && !mConversations.isEmpty()) { if (!mConversations.isEmpty()) { // TODO: if preference has children, compare with newly loaded list mPreference.removeAll(); mPreference.setTitle(getTitleResId()); Loading
src/com/android/settings/notification/app/BubbleSummaryPreferenceController.java +2 −2 Original line number Diff line number Diff line Loading @@ -49,7 +49,7 @@ public class BubbleSummaryPreferenceController extends NotificationPreferenceCon if (!super.isAvailable()) { return false; } if (mAppRow == null && mChannel == null) { if (mAppRow == null) { return false; } if (mChannel != null) { Loading @@ -62,7 +62,7 @@ public class BubbleSummaryPreferenceController extends NotificationPreferenceCon return mAppRow != null; } } return isGloballyEnabled(); return isGloballyEnabled() && mBackend.hasSentValidMsg(mAppRow.pkg, mAppRow.uid); } @Override Loading