diff options
author | Raff Tsai <rafftsai@google.com> | 2019-10-02 16:43:23 +0800 |
---|---|---|
committer | Raff Tsai <rafftsai@google.com> | 2019-10-03 15:04:36 +0800 |
commit | 6db277ebb7af2017df3d1ceb4da834230ceb764d (patch) | |
tree | e8e4edf29f092807d6082472390e35df35fbecbc /src/com/android/settings/notification/ConfigureNotificationSettings.java | |
parent | 9e3a9fd255d9cb84c582e8cf6fda6faccb1bbc07 (diff) | |
download | packages_apps_Settings-6db277ebb7af2017df3d1ceb4da834230ceb764d.tar.gz packages_apps_Settings-6db277ebb7af2017df3d1ceb4da834230ceb764d.tar.bz2 packages_apps_Settings-6db277ebb7af2017df3d1ceb4da834230ceb764d.zip |
Remove summary provider
- use SummaryProvider to provide the summary of UserSettings
- use WifiDisplayPreferenceController to replace the summary loader
in WifiDisplaySettings
- use ConfigureNotificationPreferernceController to replace the
sumary load in ConfigureNotificationSettings
Fixes: 141653158
Test: robolectric
Change-Id: Id5f5ed645707caa0b25ecae5252174cbf017651c
Diffstat (limited to 'src/com/android/settings/notification/ConfigureNotificationSettings.java')
-rw-r--r-- | src/com/android/settings/notification/ConfigureNotificationSettings.java | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/com/android/settings/notification/ConfigureNotificationSettings.java b/src/com/android/settings/notification/ConfigureNotificationSettings.java index ff8e94ad6e..abbd9a7899 100644 --- a/src/com/android/settings/notification/ConfigureNotificationSettings.java +++ b/src/com/android/settings/notification/ConfigureNotificationSettings.java @@ -40,7 +40,6 @@ import com.android.settings.R; import com.android.settings.RingtonePreference; import com.android.settings.core.OnActivityResultListener; import com.android.settings.dashboard.DashboardFragment; -import com.android.settings.dashboard.SummaryLoader; import com.android.settings.search.BaseSearchIndexProvider; import com.android.settingslib.core.AbstractPreferenceController; import com.android.settingslib.search.SearchIndexable; @@ -163,54 +162,6 @@ public class ConfigureNotificationSettings extends DashboardFragment implements } /** - * For summary - */ - static class SummaryProvider implements SummaryLoader.SummaryProvider { - - private final Context mContext; - private final SummaryLoader mSummaryLoader; - private NotificationBackend mBackend; - - public SummaryProvider(Context context, SummaryLoader summaryLoader) { - mContext = context; - mSummaryLoader = summaryLoader; - mBackend = new NotificationBackend(); - } - - @VisibleForTesting - protected void setBackend(NotificationBackend backend) { - mBackend = backend; - } - - @Override - public void setListening(boolean listening) { - if (!listening) { - return; - } - int blockedAppCount = mBackend.getBlockedAppCount(); - if (blockedAppCount == 0) { - mSummaryLoader.setSummary(this, - mContext.getText(R.string.app_notification_listing_summary_zero)); - } else { - mSummaryLoader.setSummary(this, - mContext.getResources().getQuantityString( - R.plurals.app_notification_listing_summary_others, - blockedAppCount, blockedAppCount)); - } - } - } - - public static final SummaryLoader.SummaryProviderFactory SUMMARY_PROVIDER_FACTORY = - new SummaryLoader.SummaryProviderFactory() { - @Override - public SummaryLoader.SummaryProvider createSummaryProvider(Activity activity, - SummaryLoader summaryLoader) { - return new ConfigureNotificationSettings.SummaryProvider( - activity, summaryLoader); - } - }; - - /** * For Search. */ public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER = |