Updates for msg apps that don't use shortcuts

- Notice on app specific page
- No individual conversation bubble controls

Test: manual
Bug: 154814754
Change-Id: I74c291890ba6203e6a3a162fc0c0335ed5eba3d4
This commit is contained in:
Julia Reynolds
2020-04-26 19:14:31 -04:00
parent da9e2099de
commit 8fe4b28312
5 changed files with 37 additions and 2 deletions

View File

@@ -47,6 +47,8 @@ public class BubblePreferenceController extends NotificationPreferenceController
private FragmentManager mFragmentManager;
private boolean mIsAppPage;
private boolean mHasSentInvalidMsg;
private int mNumConversations;
public BubblePreferenceController(Context context, @Nullable FragmentManager fragmentManager,
NotificationBackend backend, boolean isAppPage) {
@@ -81,10 +83,14 @@ public class BubblePreferenceController extends NotificationPreferenceController
@Override
public void updateState(Preference preference) {
if (mIsAppPage && mAppRow != null) {
mHasSentInvalidMsg = mBackend.hasSentMessage(mAppRow.pkg, mAppRow.uid);
mNumConversations = mBackend.getConversations(
mAppRow.pkg, mAppRow.uid).getList().size();
// We're on the app specific bubble page which displays a tri-state
int backEndPref = mAppRow.bubblePreference;
BubblePreference pref = (BubblePreference) preference;
pref.setDisabledByAdmin(mAdmin);
pref.setSelectedVisibility(!mHasSentInvalidMsg || mNumConversations > 0);
if (!isGloballyEnabled()) {
pref.setSelectedPreference(BUBBLE_PREFERENCE_NONE);
} else {