File tree Expand file tree Collapse file tree
src/com/android/settings/display Expand file tree Collapse file tree Original file line number Diff line number Diff line change 104104 android : key =" cutout_settings"
105105 android : fragment =" com.android.settings.display.CutoutFragment"
106106 android : icon =" @drawable/ic_settings_notch_display"
107- android : title =" @string/cutout_main" />
107+ android : title =" @string/cutout_main"
108+ settings : controller =" com.android.settings.display.CutoutPreferenceController" />
108109
109110 <SwitchPreference
110111 android : key =" show_operator_name"
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (C) 2021 Wave-OS
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+ package com.android.settings.display
17+
18+ import android.content.Context
19+
20+ import com.android.settings.core.PreferenceControllerMixin
21+ import com.android.settingslib.core.AbstractPreferenceController
22+
23+ class CutoutPreferenceController (context : Context ? ) :
24+ AbstractPreferenceController (context), PreferenceControllerMixin {
25+
26+ override fun isAvailable (): Boolean {
27+ return mContext.getResources().getBoolean(
28+ com.android.internal.R .bool.config_fillMainBuiltInDisplayCutout
29+ )
30+ }
31+
32+ override fun getPreferenceKey (): String {
33+ return " cutout_settings"
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments