1 /* 2 * Copyright (C) 2024 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.settings.notification.modes; 18 19 import static android.service.notification.ZenPolicy.PRIORITY_CATEGORY_ALARMS; 20 import static android.service.notification.ZenPolicy.PRIORITY_CATEGORY_EVENTS; 21 import static android.service.notification.ZenPolicy.PRIORITY_CATEGORY_MEDIA; 22 import static android.service.notification.ZenPolicy.PRIORITY_CATEGORY_REMINDERS; 23 import static android.service.notification.ZenPolicy.PRIORITY_CATEGORY_SYSTEM; 24 25 import android.app.settings.SettingsEnums; 26 import android.content.Context; 27 import com.android.settings.R; 28 import com.android.settingslib.core.AbstractPreferenceController; 29 30 import java.util.ArrayList; 31 import java.util.List; 32 33 /** 34 * Mode > Alarms & Other Interruptions 35 */ 36 public class ZenModeOtherFragment extends ZenModeFragmentBase { 37 38 @Override createPreferenceControllers(Context context)39 protected List<AbstractPreferenceController> createPreferenceControllers(Context context) { 40 List<AbstractPreferenceController> controllers = new ArrayList<>(); 41 controllers.add(new ZenModeOtherPreferenceController( 42 context, "modes_category_alarm", mBackend)); 43 controllers.add(new ZenModeOtherPreferenceController( 44 context, "modes_category_media", mBackend)); 45 controllers.add(new ZenModeOtherPreferenceController( 46 context, "modes_category_system", mBackend)); 47 controllers.add(new ZenModeOtherPreferenceController( 48 context, "modes_category_reminders", mBackend)); 49 controllers.add(new ZenModeOtherPreferenceController( 50 context, "modes_category_events", mBackend)); 51 return controllers; 52 } 53 54 @Override getPreferenceScreenResId()55 protected int getPreferenceScreenResId() { 56 return R.xml.modes_other_settings; 57 } 58 59 @Override getMetricsCategory()60 public int getMetricsCategory() { 61 // TODO: b/332937635 - make this the correct metrics category 62 return SettingsEnums.NOTIFICATION_ZEN_MODE_PRIORITY; 63 } 64 } 65