Loading res/layout/vpn_dialog.xml +19 −35 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:theme="@style/Theme.Material3.DynamicColors.DayNight" android:theme="@style/Theme.Network" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" Loading Loading @@ -49,13 +49,12 @@ android:visibility="gone"> <com.google.android.material.textfield.TextInputLayout style="@style/vpn_label" style="@style/vpn_input_label" android:id="@+id/name_layout" android:hint="@string/vpn_name" app:endIconMode="clear_text" app:helperTextEnabled="true" app:helperText="@string/vpn_required" app:errorEnabled="true"> app:helperText="@string/vpn_field_required"> <com.google.android.material.textfield.TextInputEditText style="@style/vpn_value" android:id="@+id/name" Loading @@ -71,13 +70,12 @@ android:entries="@array/vpn_types"/> <com.google.android.material.textfield.TextInputLayout style="@style/vpn_label" style="@style/vpn_input_label" android:id="@+id/server_layout" android:hint="@string/vpn_server" app:endIconMode="clear_text" app:helperTextEnabled="true" app:helperText="@string/vpn_required" app:errorEnabled="true"> app:helperText="@string/vpn_field_required"> <com.google.android.material.textfield.TextInputEditText style="@style/vpn_value" android:id="@+id/server"/> Loading @@ -89,13 +87,12 @@ android:orientation="vertical" android:visibility="gone"> <com.google.android.material.textfield.TextInputLayout style="@style/vpn_label" style="@style/vpn_input_label" android:id="@+id/ipsec_identifier_layout" android:hint="@string/vpn_ipsec_identifier" app:endIconMode="clear_text" app:helperTextEnabled="true" app:helperText="@string/vpn_required" app:errorEnabled="true"> app:helperText="@string/vpn_field_required"> <com.google.android.material.textfield.TextInputEditText style="@style/vpn_value" android:id="@+id/ipsec_identifier"/> Loading @@ -108,13 +105,12 @@ android:orientation="vertical" android:visibility="gone"> <com.google.android.material.textfield.TextInputLayout style="@style/vpn_label" style="@style/vpn_input_label" android:id="@+id/ipsec_secret_layout" android:hint="@string/vpn_ipsec_secret" app:endIconMode="password_toggle" app:helperTextEnabled="true" app:helperText="@string/vpn_required" app:errorEnabled="true"> app:helperText="@string/vpn_field_required"> <com.google.android.material.textfield.TextInputEditText style="@style/vpn_value" android:id="@+id/ipsec_secret" Loading Loading @@ -184,13 +180,10 @@ android:visibility="gone" > <com.google.android.material.textfield.TextInputLayout style="@style/vpn_label" style="@style/vpn_input_label" android:id="@+id/vpn_proxy_host_layout" android:hint="@string/proxy_hostname_label" app:endIconMode="clear_text" app:helperTextEnabled="true" app:helperText="@string/vpn_optional" app:errorEnabled="true"> app:endIconMode="clear_text"> <com.google.android.material.textfield.TextInputEditText style="@style/vpn_value" android:id="@+id/vpn_proxy_host" Loading @@ -198,13 +191,10 @@ </com.google.android.material.textfield.TextInputLayout> <com.google.android.material.textfield.TextInputLayout style="@style/vpn_label" style="@style/vpn_input_label" android:id="@+id/vpn_proxy_port_layout" android:hint="@string/proxy_port_label" app:endIconMode="clear_text" app:helperTextEnabled="true" app:helperText="@string/vpn_optional" app:errorEnabled="true"> app:endIconMode="clear_text"> <com.google.android.material.textfield.TextInputEditText style="@style/vpn_value" android:id="@+id/vpn_proxy_port" Loading @@ -219,26 +209,20 @@ android:orientation="vertical"> <com.google.android.material.textfield.TextInputLayout style="@style/vpn_label" style="@style/vpn_input_label" android:id="@+id/username_layout" android:hint="@string/vpn_username" app:endIconMode="clear_text" app:helperTextEnabled="true" app:helperText="@string/vpn_optional" app:errorEnabled="true"> android:hint="@string/vpn_username_optional" app:endIconMode="clear_text"> <com.google.android.material.textfield.TextInputEditText style="@style/vpn_value" android:id="@+id/username"/> </com.google.android.material.textfield.TextInputLayout> <com.google.android.material.textfield.TextInputLayout style="@style/vpn_label" style="@style/vpn_input_label" android:id="@+id/password_layout" android:hint="@string/vpn_password" app:endIconMode="password_toggle" app:helperTextEnabled="true" app:helperText="@string/vpn_optional" app:errorEnabled="true"> android:hint="@string/vpn_password_optional" app:endIconMode="password_toggle"> <com.google.android.material.textfield.TextInputEditText style="@style/vpn_value" android:id="@+id/password" Loading res/values/strings.xml +15 −14 Original line number Diff line number Diff line Loading @@ -364,7 +364,7 @@ <!-- HTTP proxy settings. Button to clear the proxy box. --> <string name="proxy_clear_text">Clear</string> <!-- HTTP proxy settings. The port number label. --> <string name="proxy_port_label">Proxy port</string> <string name="proxy_port_label">Proxy port (optional)</string> <!-- HTTP proxy settings. The exclusion list label. --> <string name="proxy_exclusionlist_label">Bypass proxy for</string> <!-- HTTP proxy settings. The button to restore the defaults. --> Loading @@ -372,7 +372,7 @@ <!-- HTTP proxy settings. The button to save. --> <string name="proxy_action_text">Done</string> <!-- HTTP proxy settings. The text field for the hostname --> <string name="proxy_hostname_label">Proxy hostname</string> <string name="proxy_hostname_label">Proxy hostname (optional)</string> <!-- HTTP proxy settings. Title if there is an error--> <string name="proxy_error">Attention</string> <!-- HTTP proxy settings. Button to get rid of error box--> Loading Loading @@ -7262,15 +7262,15 @@ Data usage charges may apply.</string> <string name="data_usage_metered_yes">Metered</string> <!-- Input label for the name of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_name">Name</string> <string name="vpn_name">Name*</string> <!-- Input label for the type of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_type">Type</string> <!-- Input label for the server address of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_server">Server address</string> <string name="vpn_server">Server address*</string> <!-- Input label for the IPSec identifier of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_ipsec_identifier">IPSec identifier</string> <string name="vpn_ipsec_identifier">IPSec identifier*</string> <!-- Input label for the IPSec pre-shared key of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_ipsec_secret">IPSec pre-shared key</string> <string name="vpn_ipsec_secret">IPSec pre-shared key*</string> <!-- Selection label for the IPSec user certificate of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_ipsec_user_cert">IPSec user certificate</string> <!-- Selection label for the IPSec CA certificate of a VPN profile. [CHAR LIMIT=40] --> Loading @@ -7279,10 +7279,14 @@ Data usage charges may apply.</string> <string name="vpn_ipsec_server_cert">IPSec server certificate</string> <!-- Checkbox label to show advanced options of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_show_options">Show advanced options</string> <!-- Input label for the username of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_username">Username</string> <!-- Input label for the password of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_password">Password</string> <!-- Input label for the optional username of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_username_optional">Username (optional)</string> <!-- Input label for the optional password of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_password_optional">Password (optional)</string> <!-- Input label for the required username of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_username_required">Username*</string> <!-- Input label for the required password of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_password_required">Password*</string> <!-- Checkbox label to save the username and the password in a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_save_login">Save account information</string> <!-- Hint for not using an optional feature in a VPN profile. [CHAR LIMIT=40] --> Loading @@ -7295,12 +7299,9 @@ Data usage charges may apply.</string> generic error. [CHAR LIMIT=120] --> <string name="vpn_always_on_invalid_reason_other">The information entered doesn\'t support always-on VPN</string> <!-- Hint for an optional field in a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_optional">(optional)</string> <!-- Hint for a required field in a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_required">(required)</string> <!-- Error message displayed below the VPN EditText when the filed is required. [CHAR LIMIT=NONE] --> <string name="vpn_field_required">The field is required</string> <string name="vpn_field_required">*required</string> <!-- Button label to cancel changing a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_cancel">Cancel</string> res/values/styles.xml +4 −0 Original line number Diff line number Diff line Loading @@ -207,6 +207,10 @@ <item name="android:textColorHint">?android:attr/textColorSecondary</item> </style> <style name="vpn_input_label" parent="vpn_label"> <item name="android:paddingBottom">8dp</item> </style> <style name="vpn_warning"> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">wrap_content</item> Loading src/com/android/settings/accessibility/VibrationMainSwitchPreferenceController.java +17 −3 Original line number Diff line number Diff line Loading @@ -28,8 +28,13 @@ import android.os.VibrationAttributes; import android.os.Vibrator; import android.provider.Settings; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.preference.Preference; import androidx.preference.PreferenceScreen; import com.android.settings.R; import com.android.settings.widget.SettingsMainSwitchPreferenceController; import com.android.settings.core.TogglePreferenceController; import com.android.settingslib.core.lifecycle.LifecycleObserver; import com.android.settingslib.core.lifecycle.events.OnStart; import com.android.settingslib.core.lifecycle.events.OnStop; Loading @@ -42,11 +47,12 @@ import com.android.settingslib.core.lifecycle.events.OnStop; * be disabled by this setting, except the flagged alerts and accessibility touch feedback. */ // LINT.IfChange public class VibrationMainSwitchPreferenceController extends SettingsMainSwitchPreferenceController public class VibrationMainSwitchPreferenceController extends TogglePreferenceController implements LifecycleObserver, OnStart, OnStop { private final ContentObserver mSettingObserver; private final Vibrator mVibrator; private @Nullable Preference mPreference; public VibrationMainSwitchPreferenceController(Context context, String preferenceKey) { super(context, preferenceKey); Loading @@ -55,7 +61,9 @@ public class VibrationMainSwitchPreferenceController extends SettingsMainSwitchP mSettingObserver = new ContentObserver(handler) { @Override public void onChange(boolean selfChange, Uri uri) { updateState(mSwitchPreference); if (mPreference != null) { updateState(mPreference); } } }; } Loading @@ -65,6 +73,12 @@ public class VibrationMainSwitchPreferenceController extends SettingsMainSwitchP return AVAILABLE; } @Override public void displayPreference(@NonNull PreferenceScreen screen) { super.displayPreference(screen); mPreference = screen.findPreference(getPreferenceKey()); } @Override public void onStart() { mContext.getContentResolver().registerContentObserver( Loading src/com/android/settings/display/AutoBrightnessScreen.kt +1 −12 Original line number Diff line number Diff line Loading @@ -21,8 +21,6 @@ import android.os.UserManager import android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE import android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC import android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL import androidx.preference.Preference import androidx.preference.PreferenceScreen import com.android.settings.R import com.android.settings.contract.KEY_ADAPTIVE_BRIGHTNESS import com.android.settings.flags.Flags Loading @@ -37,19 +35,16 @@ import com.android.settingslib.datastore.SettingsStore import com.android.settingslib.datastore.SettingsSystemStore import com.android.settingslib.metadata.BooleanValuePreference import com.android.settingslib.metadata.PreferenceAvailabilityProvider import com.android.settingslib.metadata.PreferenceMetadata import com.android.settingslib.metadata.ProvidePreferenceScreen import com.android.settingslib.metadata.ReadWritePermit import com.android.settingslib.metadata.SensitivityLevel import com.android.settingslib.metadata.preferenceHierarchy import com.android.settingslib.preference.PreferenceScreenBinding import com.android.settingslib.preference.PreferenceScreenCreator @ProvidePreferenceScreen(AutoBrightnessScreen.KEY) class AutoBrightnessScreen : PreferenceScreenCreator, PreferenceScreenBinding, // binding for screen page PrimarySwitchPreferenceBinding, // binding for screen entry point widget PrimarySwitchPreferenceBinding, PreferenceActionMetricsProvider, PreferenceAvailabilityProvider, PreferenceRestrictionMixin, Loading Loading @@ -106,12 +101,6 @@ class AutoBrightnessScreen : override val useAdminDisabledSummary: Boolean get() = true override fun bind(preference: Preference, metadata: PreferenceMetadata) = when (preference) { is PreferenceScreen -> super<PreferenceScreenBinding>.bind(preference, metadata) else -> super<PrimarySwitchPreferenceBinding>.bind(preference, metadata) } /** * The datastore for brightness, which is persisted as integer but the external type is boolean. */ Loading Loading
res/layout/vpn_dialog.xml +19 −35 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:theme="@style/Theme.Material3.DynamicColors.DayNight" android:theme="@style/Theme.Network" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" Loading Loading @@ -49,13 +49,12 @@ android:visibility="gone"> <com.google.android.material.textfield.TextInputLayout style="@style/vpn_label" style="@style/vpn_input_label" android:id="@+id/name_layout" android:hint="@string/vpn_name" app:endIconMode="clear_text" app:helperTextEnabled="true" app:helperText="@string/vpn_required" app:errorEnabled="true"> app:helperText="@string/vpn_field_required"> <com.google.android.material.textfield.TextInputEditText style="@style/vpn_value" android:id="@+id/name" Loading @@ -71,13 +70,12 @@ android:entries="@array/vpn_types"/> <com.google.android.material.textfield.TextInputLayout style="@style/vpn_label" style="@style/vpn_input_label" android:id="@+id/server_layout" android:hint="@string/vpn_server" app:endIconMode="clear_text" app:helperTextEnabled="true" app:helperText="@string/vpn_required" app:errorEnabled="true"> app:helperText="@string/vpn_field_required"> <com.google.android.material.textfield.TextInputEditText style="@style/vpn_value" android:id="@+id/server"/> Loading @@ -89,13 +87,12 @@ android:orientation="vertical" android:visibility="gone"> <com.google.android.material.textfield.TextInputLayout style="@style/vpn_label" style="@style/vpn_input_label" android:id="@+id/ipsec_identifier_layout" android:hint="@string/vpn_ipsec_identifier" app:endIconMode="clear_text" app:helperTextEnabled="true" app:helperText="@string/vpn_required" app:errorEnabled="true"> app:helperText="@string/vpn_field_required"> <com.google.android.material.textfield.TextInputEditText style="@style/vpn_value" android:id="@+id/ipsec_identifier"/> Loading @@ -108,13 +105,12 @@ android:orientation="vertical" android:visibility="gone"> <com.google.android.material.textfield.TextInputLayout style="@style/vpn_label" style="@style/vpn_input_label" android:id="@+id/ipsec_secret_layout" android:hint="@string/vpn_ipsec_secret" app:endIconMode="password_toggle" app:helperTextEnabled="true" app:helperText="@string/vpn_required" app:errorEnabled="true"> app:helperText="@string/vpn_field_required"> <com.google.android.material.textfield.TextInputEditText style="@style/vpn_value" android:id="@+id/ipsec_secret" Loading Loading @@ -184,13 +180,10 @@ android:visibility="gone" > <com.google.android.material.textfield.TextInputLayout style="@style/vpn_label" style="@style/vpn_input_label" android:id="@+id/vpn_proxy_host_layout" android:hint="@string/proxy_hostname_label" app:endIconMode="clear_text" app:helperTextEnabled="true" app:helperText="@string/vpn_optional" app:errorEnabled="true"> app:endIconMode="clear_text"> <com.google.android.material.textfield.TextInputEditText style="@style/vpn_value" android:id="@+id/vpn_proxy_host" Loading @@ -198,13 +191,10 @@ </com.google.android.material.textfield.TextInputLayout> <com.google.android.material.textfield.TextInputLayout style="@style/vpn_label" style="@style/vpn_input_label" android:id="@+id/vpn_proxy_port_layout" android:hint="@string/proxy_port_label" app:endIconMode="clear_text" app:helperTextEnabled="true" app:helperText="@string/vpn_optional" app:errorEnabled="true"> app:endIconMode="clear_text"> <com.google.android.material.textfield.TextInputEditText style="@style/vpn_value" android:id="@+id/vpn_proxy_port" Loading @@ -219,26 +209,20 @@ android:orientation="vertical"> <com.google.android.material.textfield.TextInputLayout style="@style/vpn_label" style="@style/vpn_input_label" android:id="@+id/username_layout" android:hint="@string/vpn_username" app:endIconMode="clear_text" app:helperTextEnabled="true" app:helperText="@string/vpn_optional" app:errorEnabled="true"> android:hint="@string/vpn_username_optional" app:endIconMode="clear_text"> <com.google.android.material.textfield.TextInputEditText style="@style/vpn_value" android:id="@+id/username"/> </com.google.android.material.textfield.TextInputLayout> <com.google.android.material.textfield.TextInputLayout style="@style/vpn_label" style="@style/vpn_input_label" android:id="@+id/password_layout" android:hint="@string/vpn_password" app:endIconMode="password_toggle" app:helperTextEnabled="true" app:helperText="@string/vpn_optional" app:errorEnabled="true"> android:hint="@string/vpn_password_optional" app:endIconMode="password_toggle"> <com.google.android.material.textfield.TextInputEditText style="@style/vpn_value" android:id="@+id/password" Loading
res/values/strings.xml +15 −14 Original line number Diff line number Diff line Loading @@ -364,7 +364,7 @@ <!-- HTTP proxy settings. Button to clear the proxy box. --> <string name="proxy_clear_text">Clear</string> <!-- HTTP proxy settings. The port number label. --> <string name="proxy_port_label">Proxy port</string> <string name="proxy_port_label">Proxy port (optional)</string> <!-- HTTP proxy settings. The exclusion list label. --> <string name="proxy_exclusionlist_label">Bypass proxy for</string> <!-- HTTP proxy settings. The button to restore the defaults. --> Loading @@ -372,7 +372,7 @@ <!-- HTTP proxy settings. The button to save. --> <string name="proxy_action_text">Done</string> <!-- HTTP proxy settings. The text field for the hostname --> <string name="proxy_hostname_label">Proxy hostname</string> <string name="proxy_hostname_label">Proxy hostname (optional)</string> <!-- HTTP proxy settings. Title if there is an error--> <string name="proxy_error">Attention</string> <!-- HTTP proxy settings. Button to get rid of error box--> Loading Loading @@ -7262,15 +7262,15 @@ Data usage charges may apply.</string> <string name="data_usage_metered_yes">Metered</string> <!-- Input label for the name of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_name">Name</string> <string name="vpn_name">Name*</string> <!-- Input label for the type of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_type">Type</string> <!-- Input label for the server address of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_server">Server address</string> <string name="vpn_server">Server address*</string> <!-- Input label for the IPSec identifier of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_ipsec_identifier">IPSec identifier</string> <string name="vpn_ipsec_identifier">IPSec identifier*</string> <!-- Input label for the IPSec pre-shared key of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_ipsec_secret">IPSec pre-shared key</string> <string name="vpn_ipsec_secret">IPSec pre-shared key*</string> <!-- Selection label for the IPSec user certificate of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_ipsec_user_cert">IPSec user certificate</string> <!-- Selection label for the IPSec CA certificate of a VPN profile. [CHAR LIMIT=40] --> Loading @@ -7279,10 +7279,14 @@ Data usage charges may apply.</string> <string name="vpn_ipsec_server_cert">IPSec server certificate</string> <!-- Checkbox label to show advanced options of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_show_options">Show advanced options</string> <!-- Input label for the username of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_username">Username</string> <!-- Input label for the password of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_password">Password</string> <!-- Input label for the optional username of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_username_optional">Username (optional)</string> <!-- Input label for the optional password of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_password_optional">Password (optional)</string> <!-- Input label for the required username of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_username_required">Username*</string> <!-- Input label for the required password of a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_password_required">Password*</string> <!-- Checkbox label to save the username and the password in a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_save_login">Save account information</string> <!-- Hint for not using an optional feature in a VPN profile. [CHAR LIMIT=40] --> Loading @@ -7295,12 +7299,9 @@ Data usage charges may apply.</string> generic error. [CHAR LIMIT=120] --> <string name="vpn_always_on_invalid_reason_other">The information entered doesn\'t support always-on VPN</string> <!-- Hint for an optional field in a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_optional">(optional)</string> <!-- Hint for a required field in a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_required">(required)</string> <!-- Error message displayed below the VPN EditText when the filed is required. [CHAR LIMIT=NONE] --> <string name="vpn_field_required">The field is required</string> <string name="vpn_field_required">*required</string> <!-- Button label to cancel changing a VPN profile. [CHAR LIMIT=40] --> <string name="vpn_cancel">Cancel</string>
res/values/styles.xml +4 −0 Original line number Diff line number Diff line Loading @@ -207,6 +207,10 @@ <item name="android:textColorHint">?android:attr/textColorSecondary</item> </style> <style name="vpn_input_label" parent="vpn_label"> <item name="android:paddingBottom">8dp</item> </style> <style name="vpn_warning"> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">wrap_content</item> Loading
src/com/android/settings/accessibility/VibrationMainSwitchPreferenceController.java +17 −3 Original line number Diff line number Diff line Loading @@ -28,8 +28,13 @@ import android.os.VibrationAttributes; import android.os.Vibrator; import android.provider.Settings; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.preference.Preference; import androidx.preference.PreferenceScreen; import com.android.settings.R; import com.android.settings.widget.SettingsMainSwitchPreferenceController; import com.android.settings.core.TogglePreferenceController; import com.android.settingslib.core.lifecycle.LifecycleObserver; import com.android.settingslib.core.lifecycle.events.OnStart; import com.android.settingslib.core.lifecycle.events.OnStop; Loading @@ -42,11 +47,12 @@ import com.android.settingslib.core.lifecycle.events.OnStop; * be disabled by this setting, except the flagged alerts and accessibility touch feedback. */ // LINT.IfChange public class VibrationMainSwitchPreferenceController extends SettingsMainSwitchPreferenceController public class VibrationMainSwitchPreferenceController extends TogglePreferenceController implements LifecycleObserver, OnStart, OnStop { private final ContentObserver mSettingObserver; private final Vibrator mVibrator; private @Nullable Preference mPreference; public VibrationMainSwitchPreferenceController(Context context, String preferenceKey) { super(context, preferenceKey); Loading @@ -55,7 +61,9 @@ public class VibrationMainSwitchPreferenceController extends SettingsMainSwitchP mSettingObserver = new ContentObserver(handler) { @Override public void onChange(boolean selfChange, Uri uri) { updateState(mSwitchPreference); if (mPreference != null) { updateState(mPreference); } } }; } Loading @@ -65,6 +73,12 @@ public class VibrationMainSwitchPreferenceController extends SettingsMainSwitchP return AVAILABLE; } @Override public void displayPreference(@NonNull PreferenceScreen screen) { super.displayPreference(screen); mPreference = screen.findPreference(getPreferenceKey()); } @Override public void onStart() { mContext.getContentResolver().registerContentObserver( Loading
src/com/android/settings/display/AutoBrightnessScreen.kt +1 −12 Original line number Diff line number Diff line Loading @@ -21,8 +21,6 @@ import android.os.UserManager import android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE import android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE_AUTOMATIC import android.provider.Settings.System.SCREEN_BRIGHTNESS_MODE_MANUAL import androidx.preference.Preference import androidx.preference.PreferenceScreen import com.android.settings.R import com.android.settings.contract.KEY_ADAPTIVE_BRIGHTNESS import com.android.settings.flags.Flags Loading @@ -37,19 +35,16 @@ import com.android.settingslib.datastore.SettingsStore import com.android.settingslib.datastore.SettingsSystemStore import com.android.settingslib.metadata.BooleanValuePreference import com.android.settingslib.metadata.PreferenceAvailabilityProvider import com.android.settingslib.metadata.PreferenceMetadata import com.android.settingslib.metadata.ProvidePreferenceScreen import com.android.settingslib.metadata.ReadWritePermit import com.android.settingslib.metadata.SensitivityLevel import com.android.settingslib.metadata.preferenceHierarchy import com.android.settingslib.preference.PreferenceScreenBinding import com.android.settingslib.preference.PreferenceScreenCreator @ProvidePreferenceScreen(AutoBrightnessScreen.KEY) class AutoBrightnessScreen : PreferenceScreenCreator, PreferenceScreenBinding, // binding for screen page PrimarySwitchPreferenceBinding, // binding for screen entry point widget PrimarySwitchPreferenceBinding, PreferenceActionMetricsProvider, PreferenceAvailabilityProvider, PreferenceRestrictionMixin, Loading Loading @@ -106,12 +101,6 @@ class AutoBrightnessScreen : override val useAdminDisabledSummary: Boolean get() = true override fun bind(preference: Preference, metadata: PreferenceMetadata) = when (preference) { is PreferenceScreen -> super<PreferenceScreenBinding>.bind(preference, metadata) else -> super<PrimarySwitchPreferenceBinding>.bind(preference, metadata) } /** * The datastore for brightness, which is persisted as integer but the external type is boolean. */ Loading