Merge "Fix toggle button is enabled state but can't click" into qt-dev

This commit is contained in:
TreeHugger Robot
2019-04-26 20:00:48 +00:00
committed by Android (Google) Code Review

View File

@@ -214,7 +214,7 @@ public class RecentNotifyingAppsPreferenceController extends AbstractPreferenceC
.setSourceMetricsCategory( .setSourceMetricsCategory(
SettingsEnums.MANAGE_APPLICATIONS_NOTIFICATIONS) SettingsEnums.MANAGE_APPLICATIONS_NOTIFICATIONS)
.toIntent()); .toIntent());
pref.setEnabled(mNotificationBackend.isBlockable(mContext, appEntry.info)); pref.setSwitchEnabled(mNotificationBackend.isBlockable(mContext, appEntry.info));
pref.setOnPreferenceChangeListener((preference, newValue) -> { pref.setOnPreferenceChangeListener((preference, newValue) -> {
boolean blocked = !(Boolean) newValue; boolean blocked = !(Boolean) newValue;
mNotificationBackend.setNotificationsEnabledForPackage( mNotificationBackend.setNotificationsEnabledForPackage(