Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b374d04d authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 13190096 from c847dc7e to 25Q2-release

Change-Id: Iac3bcc01420bf43f3b967b3ce77d984a741fbe55
parents b1a9d4e8 c847dc7e
Loading
Loading
Loading
Loading
+19 −35
Original line number Diff line number Diff line
@@ -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"
@@ -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"
@@ -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"/>
@@ -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"/>
@@ -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"
@@ -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"
@@ -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"
@@ -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"
+15 −14
Original line number Diff line number Diff line
@@ -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. -->
@@ -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-->
@@ -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] -->
@@ -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] -->
@@ -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>
+4 −0
Original line number Diff line number Diff line
@@ -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>
+17 −3
Original line number Diff line number Diff line
@@ -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;
@@ -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);
@@ -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);
                }
            }
        };
    }
@@ -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(
+1 −12
Original line number Diff line number Diff line
@@ -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
@@ -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,
@@ -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