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

@@ -56,7 +56,7 @@ public class BubblePreferenceController extends NotificationPreferenceController
public BubblePreferenceController(Context context, @Nullable FragmentManager fragmentManager,
NotificationBackend backend, boolean isAppPage,
@Nullable NotificationSettings.DependentFieldListener listener) {
super(context, backend);
super(context, backend, KEY);
mFragmentManager = fragmentManager;
mIsAppPage = isAppPage;
mListener = listener;
@@ -68,21 +68,24 @@ public class BubblePreferenceController extends NotificationPreferenceController
}
@Override
public boolean isAvailable() {
if (!super.isAvailable()) {
return false;
public int getAvailabilityStatus() {
if (super.getAvailabilityStatus() == CONDITIONALLY_UNAVAILABLE) {
return CONDITIONALLY_UNAVAILABLE;
}
if (!mIsAppPage && !isEnabled()) {
return false;
return CONDITIONALLY_UNAVAILABLE;
}
if (mChannel != null) {
if (isDefaultChannel()) {
return true;
return AVAILABLE;
} else {
return mAppRow != null && mAppRow.bubblePreference != BUBBLE_PREFERENCE_NONE;
if (mAppRow != null && mAppRow.bubblePreference != BUBBLE_PREFERENCE_NONE) {
return AVAILABLE;
}
return CONDITIONALLY_UNAVAILABLE;
}
}
return true;
return AVAILABLE;
}
@Override