Only show Bubbles link for messaging apps

Apps that have sent at least one valid conversation

Test: manual, atest
Fixes: 156033178
Change-Id: If4fff6810f2e390ba0ad0f7587b8d8c2d5819c93
This commit is contained in:
Julia Reynolds
2020-05-29 14:10:59 -04:00
parent ff35a3e641
commit 3d613bb6c9
6 changed files with 55 additions and 25 deletions

View File

@@ -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;
}