1 /* 2 * Copyright (C) 2018 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.zen; 18 19 import android.app.settings.SettingsEnums; 20 import android.content.Context; 21 22 import com.android.settings.R; 23 import com.android.settingslib.core.AbstractPreferenceController; 24 import com.android.settingslib.core.lifecycle.Lifecycle; 25 import com.android.settingslib.search.Indexable; 26 27 import java.util.ArrayList; 28 import java.util.List; 29 30 /** 31 * Settings > Sound > Do Not Disturb > Alarms & Other Interruptions 32 */ 33 public class ZenModeSoundVibrationSettings extends ZenModeSettingsBase implements Indexable { 34 35 @Override createPreferenceControllers(Context context)36 protected List<AbstractPreferenceController> createPreferenceControllers(Context context) { 37 return buildPreferenceControllers(context, getSettingsLifecycle()); 38 } 39 buildPreferenceControllers(Context context, Lifecycle lifecycle)40 private static List<AbstractPreferenceController> buildPreferenceControllers(Context context, 41 Lifecycle lifecycle) { 42 List<AbstractPreferenceController> controllers = new ArrayList<>(); 43 controllers.add(new ZenModeAlarmsPreferenceController(context, lifecycle, 44 "zen_mode_alarms")); 45 controllers.add(new ZenModeMediaPreferenceController(context, lifecycle)); 46 controllers.add(new ZenModeSystemPreferenceController(context, lifecycle)); 47 controllers.add(new ZenModeRemindersPreferenceController(context, lifecycle)); 48 controllers.add(new ZenModeEventsPreferenceController(context, lifecycle)); 49 return controllers; 50 } 51 52 @Override getPreferenceScreenResId()53 protected int getPreferenceScreenResId() { 54 return R.xml.zen_mode_sound_vibration_settings; 55 } 56 57 @Override getMetricsCategory()58 public int getMetricsCategory() { 59 return SettingsEnums.NOTIFICATION_ZEN_MODE_PRIORITY; 60 } 61 } 62