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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user