Loading res/values/strings.xml +3 −3 Original line number Diff line number Diff line Loading @@ -2763,6 +2763,8 @@ <string name="brightness_summary">Adjust the brightness of the screen</string> <!-- Sound & display settings screen, setting option name to enable adaptive brightness [CHAR LIMIT=30] --> <string name="auto_brightness_title">Adaptive brightness</string> <!-- Summary about the feature adaptive brightness [CHAR LIMIT=NONE] --> <string name="auto_brightness_summary">Screen brightness adjusts to environment</string> <!-- Setting option summary when adaptive brightness is on [CHAR LIMIT=NONE] --> <string name="auto_brightness_summary_on">On</string> <!-- Setting option summary when adaptive brightness is off [CHAR LIMIT=NONE] --> Loading Loading @@ -7196,8 +7198,6 @@ <string name="keywords_wifi">wifi, wi-fi, network connection, internet, wireless, data, wi fi</string> <!-- Search keyword for "Open Network Notification" settings. [CHAR_LIMIT=NONE]--> <string name="keywords_wifi_notify_open_networks">Wi\u2011Fi notification, wifi notification</string> <!-- Search keyword for "Adaptive brightness" settings. [CHAR_LIMIT=NONE]--> <string name="keywords_auto_brightness">Auto brightness</string> <!-- Search keyword for "Vibrate on touch" settings. [CHAR_LIMIT=NONE]--> <string name="keywords_vibrate_on_touch">Stop vibration, tap, keyboard</string> <!-- Search keyword for "Time format" settings. [CHAR_LIMIT=NONE]--> Loading Loading @@ -7284,7 +7284,7 @@ <string name="keywords_fingerprint_settings">fingerprint, add fingerprint</string> <!-- Search keywords for adaptive brightness setting [CHAR LIMIT=NONE]--> <string name="keywords_display_auto_brightness">dim screen, touchscreen, battery, smart brightness, dynamic brightness</string> <string name="keywords_display_auto_brightness">dim screen, touchscreen, battery, smart brightness, dynamic brightness, Auto brightness</string> <!-- Search keywords for adaptive sleep setting [CHAR LIMIT=NONE]--> <string name="keywords_display_adaptive_sleep">dim screen, sleep, battery, timeout, attention, display, screen, inactivity</string> res/xml/auto_brightness_detail.xml +2 −1 Original line number Diff line number Diff line Loading @@ -32,8 +32,9 @@ <com.android.settingslib.RestrictedSwitchPreference android:key="auto_brightness" android:title="@string/auto_brightness_title" android:summary="@string/auto_brightness_summary" settings:keywords="@string/keywords_display_auto_brightness" settings:controller="com.android.settings.display.AutoBrightnessPreferenceController" settings:controller="com.android.settings.display.AutoBrightnessDetailPreferenceController" settings:useAdminDisabledSummary="true" settings:userRestriction="no_config_brightness" settings:allowDividerAbove="true" /> Loading res/xml/display_settings.xml +1 −2 Original line number Diff line number Diff line Loading @@ -44,8 +44,7 @@ android:title="@string/auto_brightness_title" android:summary="@string/summary_placeholder" android:fragment="com.android.settings.display.AutoBrightnessSettings" settings:controller="com.android.settings.display.AutoBrightnessPreferenceController" settings:keywords="@string/keywords_auto_brightness"/> settings:controller="com.android.settings.display.AutoBrightnessPreferenceController"/> <com.android.settingslib.RestrictedPreference android:key="wallpaper" Loading src/com/android/settings/display/AutoBrightnessDetailPreferenceController.java 0 → 100644 +39 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ package com.android.settings.display; import android.content.Context; public class AutoBrightnessDetailPreferenceController extends AutoBrightnessPreferenceController { public AutoBrightnessDetailPreferenceController(Context context, String key) { super(context, key); } @Override @AvailabilityStatus public int getAvailabilityStatus() { return mContext.getResources().getBoolean( com.android.internal.R.bool.config_automatic_brightness_available) ? AVAILABLE : UNSUPPORTED_ON_DEVICE; } @Override public boolean isSliceable() { return true; } } src/com/android/settings/display/AutoBrightnessPreferenceController.java +1 −7 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ import static android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL; import android.content.Context; import android.provider.Settings; import android.text.TextUtils; import com.android.settings.R; import com.android.settings.core.TogglePreferenceController; Loading Loading @@ -52,15 +51,10 @@ public class AutoBrightnessPreferenceController extends TogglePreferenceControll public int getAvailabilityStatus() { return mContext.getResources().getBoolean( com.android.internal.R.bool.config_automatic_brightness_available) ? AVAILABLE ? AVAILABLE_UNSEARCHABLE : UNSUPPORTED_ON_DEVICE; } @Override public boolean isSliceable() { return TextUtils.equals(getPreferenceKey(), "auto_brightness"); } @Override public CharSequence getSummary() { return mContext.getText(isChecked() Loading Loading
res/values/strings.xml +3 −3 Original line number Diff line number Diff line Loading @@ -2763,6 +2763,8 @@ <string name="brightness_summary">Adjust the brightness of the screen</string> <!-- Sound & display settings screen, setting option name to enable adaptive brightness [CHAR LIMIT=30] --> <string name="auto_brightness_title">Adaptive brightness</string> <!-- Summary about the feature adaptive brightness [CHAR LIMIT=NONE] --> <string name="auto_brightness_summary">Screen brightness adjusts to environment</string> <!-- Setting option summary when adaptive brightness is on [CHAR LIMIT=NONE] --> <string name="auto_brightness_summary_on">On</string> <!-- Setting option summary when adaptive brightness is off [CHAR LIMIT=NONE] --> Loading Loading @@ -7196,8 +7198,6 @@ <string name="keywords_wifi">wifi, wi-fi, network connection, internet, wireless, data, wi fi</string> <!-- Search keyword for "Open Network Notification" settings. [CHAR_LIMIT=NONE]--> <string name="keywords_wifi_notify_open_networks">Wi\u2011Fi notification, wifi notification</string> <!-- Search keyword for "Adaptive brightness" settings. [CHAR_LIMIT=NONE]--> <string name="keywords_auto_brightness">Auto brightness</string> <!-- Search keyword for "Vibrate on touch" settings. [CHAR_LIMIT=NONE]--> <string name="keywords_vibrate_on_touch">Stop vibration, tap, keyboard</string> <!-- Search keyword for "Time format" settings. [CHAR_LIMIT=NONE]--> Loading Loading @@ -7284,7 +7284,7 @@ <string name="keywords_fingerprint_settings">fingerprint, add fingerprint</string> <!-- Search keywords for adaptive brightness setting [CHAR LIMIT=NONE]--> <string name="keywords_display_auto_brightness">dim screen, touchscreen, battery, smart brightness, dynamic brightness</string> <string name="keywords_display_auto_brightness">dim screen, touchscreen, battery, smart brightness, dynamic brightness, Auto brightness</string> <!-- Search keywords for adaptive sleep setting [CHAR LIMIT=NONE]--> <string name="keywords_display_adaptive_sleep">dim screen, sleep, battery, timeout, attention, display, screen, inactivity</string>
res/xml/auto_brightness_detail.xml +2 −1 Original line number Diff line number Diff line Loading @@ -32,8 +32,9 @@ <com.android.settingslib.RestrictedSwitchPreference android:key="auto_brightness" android:title="@string/auto_brightness_title" android:summary="@string/auto_brightness_summary" settings:keywords="@string/keywords_display_auto_brightness" settings:controller="com.android.settings.display.AutoBrightnessPreferenceController" settings:controller="com.android.settings.display.AutoBrightnessDetailPreferenceController" settings:useAdminDisabledSummary="true" settings:userRestriction="no_config_brightness" settings:allowDividerAbove="true" /> Loading
res/xml/display_settings.xml +1 −2 Original line number Diff line number Diff line Loading @@ -44,8 +44,7 @@ android:title="@string/auto_brightness_title" android:summary="@string/summary_placeholder" android:fragment="com.android.settings.display.AutoBrightnessSettings" settings:controller="com.android.settings.display.AutoBrightnessPreferenceController" settings:keywords="@string/keywords_auto_brightness"/> settings:controller="com.android.settings.display.AutoBrightnessPreferenceController"/> <com.android.settingslib.RestrictedPreference android:key="wallpaper" Loading
src/com/android/settings/display/AutoBrightnessDetailPreferenceController.java 0 → 100644 +39 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ package com.android.settings.display; import android.content.Context; public class AutoBrightnessDetailPreferenceController extends AutoBrightnessPreferenceController { public AutoBrightnessDetailPreferenceController(Context context, String key) { super(context, key); } @Override @AvailabilityStatus public int getAvailabilityStatus() { return mContext.getResources().getBoolean( com.android.internal.R.bool.config_automatic_brightness_available) ? AVAILABLE : UNSUPPORTED_ON_DEVICE; } @Override public boolean isSliceable() { return true; } }
src/com/android/settings/display/AutoBrightnessPreferenceController.java +1 −7 Original line number Diff line number Diff line Loading @@ -19,7 +19,6 @@ import static android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL; import android.content.Context; import android.provider.Settings; import android.text.TextUtils; import com.android.settings.R; import com.android.settings.core.TogglePreferenceController; Loading Loading @@ -52,15 +51,10 @@ public class AutoBrightnessPreferenceController extends TogglePreferenceControll public int getAvailabilityStatus() { return mContext.getResources().getBoolean( com.android.internal.R.bool.config_automatic_brightness_available) ? AVAILABLE ? AVAILABLE_UNSEARCHABLE : UNSUPPORTED_ON_DEVICE; } @Override public boolean isSliceable() { return TextUtils.equals(getPreferenceKey(), "auto_brightness"); } @Override public CharSequence getSummary() { return mContext.getText(isChecked() Loading