Revert^2 "Improve App notification loading"

c5f1cb11e0

Change-Id: I5a6d39e0a5f2b7bd30bcc12e207b8bb23857c6d8
This commit is contained in:
Julia Reynolds
2022-08-10 17:40:20 +00:00
parent b132484ead
commit 33710fd9e2
34 changed files with 318 additions and 272 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);
super(context, backend, KEY);
}
@Override
@@ -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