Refactor preference controllers to receive and mutate ZenMode/ZenPolicy

Also fixed a handful of style issues / warnings along the way.

Fixes: 341950853
Fixes: 341910620
Test: atest com.android.settings.notification.modes
Flag: android.app.modes_ui
Change-Id: I65900941fcdf53824caf052fd0a24401c1bfb476
This commit is contained in:
Matías Hernández
2024-05-23 15:51:03 +00:00
parent 51dc721031
commit 43d67b0080
17 changed files with 213 additions and 199 deletions

View File

@@ -30,7 +30,6 @@ import static android.service.notification.ZenPolicy.PRIORITY_CATEGORY_MESSAGES;
import static android.service.notification.ZenPolicy.PRIORITY_CATEGORY_REMINDERS;
import static android.service.notification.ZenPolicy.PRIORITY_CATEGORY_REPEAT_CALLERS;
import static android.service.notification.ZenPolicy.PRIORITY_CATEGORY_SYSTEM;
import static android.service.notification.ZenPolicy.STATE_DISALLOW;
import static android.service.notification.ZenPolicy.VISUAL_EFFECT_AMBIENT;
import static android.service.notification.ZenPolicy.VISUAL_EFFECT_BADGE;
import static android.service.notification.ZenPolicy.VISUAL_EFFECT_FULL_SCREEN_INTENT;
@@ -44,7 +43,6 @@ import android.icu.text.MessageFormat;
import android.service.notification.ZenDeviceEffects;
import android.service.notification.ZenPolicy;
import android.util.SparseArray;
import com.android.settings.R;
import java.util.ArrayList;
@@ -54,10 +52,10 @@ import java.util.Locale;
import java.util.Map;
import java.util.function.Predicate;
public class ZenModeSummaryHelper {
class ZenModeSummaryHelper {
private Context mContext;
private ZenModesBackend mBackend;
private final Context mContext;
private final ZenModesBackend mBackend;
public ZenModeSummaryHelper(Context context, ZenModesBackend backend) {
mContext = context;