Remove jank on DND schedule page
Only add/or remove preferences when absolutely needed. Also fix a 'load data from backend' method that wasn't. Fixes: 216747934 Test: ZenModeAutomaticRulesPreferenceControllerTest Test: view schedules page Test: add schedule Test: remove schedule Test: view schedule child page and return to schedules page Change-Id: I237c2ca7ea89ee6e42354470a76712068a7f4dd7
This commit is contained in:
@@ -22,7 +22,6 @@ import android.app.NotificationManager;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.service.notification.ConditionProviderService;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
@@ -59,10 +58,12 @@ public class ZenModeAutomationSettings extends ZenModeSettingsBase {
|
||||
|
||||
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context,
|
||||
Fragment parent, ZenServiceListing serviceListing, Lifecycle lifecycle) {
|
||||
ZenModeBackend backend = new ZenModeBackend(context);
|
||||
List<AbstractPreferenceController> controllers = new ArrayList<>();
|
||||
controllers.add(new ZenModeAddAutomaticRulePreferenceController(context, parent,
|
||||
serviceListing, lifecycle));
|
||||
controllers.add(new ZenModeAutomaticRulesPreferenceController(context, parent, lifecycle));
|
||||
controllers.add(new ZenModeAutomaticRulesPreferenceController(
|
||||
context, parent, lifecycle, backend));
|
||||
|
||||
return controllers;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user