Properly suppress zen mode entry from soundsetting page.
Change-Id: If2c033232b05753f3ba52bb986dd6c85cab6e452 Fixes: 72748524 Test: robotests
This commit is contained in:
@@ -27,10 +27,6 @@ import android.preference.SeekBarVolumizer;
|
||||
import android.provider.SearchIndexableResource;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.R;
|
||||
@@ -50,13 +46,16 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
import androidx.preference.ListPreference;
|
||||
import androidx.preference.Preference;
|
||||
|
||||
@SearchIndexable
|
||||
public class SoundSettings extends DashboardFragment {
|
||||
private static final String TAG = "SoundSettings";
|
||||
|
||||
private static final String SELECTED_PREFERENCE_KEY = "selected_preference";
|
||||
private static final int REQUEST_CODE = 200;
|
||||
private static final String KEY_ZEN_MODE = "zen_mode";
|
||||
private static final int SAMPLE_CUTOFF = 2000; // manually cap sample playback at 2 seconds
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -190,7 +189,7 @@ public class SoundSettings extends DashboardFragment {
|
||||
onPreferenceDataChanged(listPreference));
|
||||
mMediaOutputControllerKey = use(MediaOutputPreferenceController.class).getPreferenceKey();
|
||||
use(HandsFreeProfileOutputPreferenceController.class).setCallback(listPreference ->
|
||||
onPreferenceDataChanged(listPreference));
|
||||
onPreferenceDataChanged(listPreference));
|
||||
mHfpOutputControllerKey =
|
||||
use(HandsFreeProfileOutputPreferenceController.class).getPreferenceKey();
|
||||
|
||||
@@ -235,7 +234,6 @@ public class SoundSettings extends DashboardFragment {
|
||||
private static List<AbstractPreferenceController> buildPreferenceControllers(Context context,
|
||||
SoundSettings fragment, Lifecycle lifecycle) {
|
||||
final List<AbstractPreferenceController> controllers = new ArrayList<>();
|
||||
controllers.add(new ZenModePreferenceController(context, lifecycle, KEY_ZEN_MODE));
|
||||
|
||||
// Volumes are added via xml
|
||||
|
||||
@@ -309,15 +307,6 @@ public class SoundSettings extends DashboardFragment {
|
||||
return buildPreferenceControllers(context, null /* fragment */,
|
||||
null /* lifecycle */);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getNonIndexableKeys(Context context) {
|
||||
List<String> keys = super.getNonIndexableKeys(context);
|
||||
// Duplicate results
|
||||
keys.add((new ZenModePreferenceController(context, null, KEY_ZEN_MODE))
|
||||
.getPreferenceKey());
|
||||
return keys;
|
||||
}
|
||||
};
|
||||
|
||||
// === Work Sound Settings ===
|
||||
|
Reference in New Issue
Block a user