Revert^3 "Improve App notification loading"

33710fd9e2

Change-Id: Ifb45f949c28bff04f8abfe3e1a73628f2e407241
This commit is contained in:
Michael Wright
2022-08-24 12:22:12 +00:00
parent 33710fd9e2
commit 475632c4fe
34 changed files with 272 additions and 318 deletions

View File

@@ -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, KEY);
super(context, backend);
}
@Override
@@ -80,25 +80,25 @@ public class AppBubbleListPreferenceController extends AppConversationListPrefer
}
@Override
public int getAvailabilityStatus() {
public boolean 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 CONDITIONALLY_UNAVAILABLE;
return false;
}
if (mAppRow.banned) {
return CONDITIONALLY_UNAVAILABLE;
return false;
}
if (mChannel != null) {
if (mBackend.onlyHasDefaultChannel(mAppRow.pkg, mAppRow.uid)
|| NotificationChannel.DEFAULT_CHANNEL_ID.equals(mChannel.getId())) {
return CONDITIONALLY_UNAVAILABLE;
return false;
}
}
if (mAppRow.bubblePreference == BUBBLE_PREFERENCE_NONE) {
return CONDITIONALLY_UNAVAILABLE;
return false;
}
return AVAILABLE;
return true;
}
@VisibleForTesting