Fix toggle button is enabled state but can't click

Fixes: 131197520
Test: manual
Change-Id: Id9f83b4abea55d2569049a48622d473d7f51042f
This commit is contained in:
Raff Tsai
2019-04-25 12:08:21 +08:00
parent 6cee809841
commit af4180cf24

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(