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

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

Merge cherrypicks of [15619363, 15619364, 15619365, 15619399, 15619400,...

Merge cherrypicks of [15619363, 15619364, 15619365, 15619399, 15619400, 15619401, 15619366, 15619367, 15619368, 15619369, 15619424, 15619425, 15619426, 15619427, 15619428, 15619402, 15619403, 15619404, 15619370, 15619371, 15619372, 15619373, 15618427, 15619429, 15619405, 15619406, 15619407, 15619408, 15619374, 15619375, 15619409] into sc-d1-release

Change-Id: I76a61c85dc38a6e519744479d8383b9fe7095d68
parents c16c910d d4f5def0
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -241,6 +241,12 @@
            settings:controller="com.android.settings.network.telephony.CarrierPreferenceController">
        </Preference>

        <SwitchPreference
            android:key="enable_2g"
            android:title="@string/enable_2g_title"
            android:summary="@string/enable_2g_summary"
            settings:controller="com.android.settings.network.telephony.Enable2gPreferenceController" />

    </PreferenceCategory>

    <Preference
@@ -265,10 +271,4 @@
        settings:allowDividerAbove="true"
        settings:searchable="false"
        settings:controller="com.android.settings.network.telephony.NrDisabledInDsdsFooterPreferenceController"/>

    <SwitchPreference
        android:key="enable_2g"
        android:title="@string/enable_2g_title"
        android:summary="@string/enable_2g_summary"
        settings:controller="com.android.settings.network.telephony.Enable2gPreferenceController" />
</PreferenceScreen>
+6 −4
Original line number Diff line number Diff line
@@ -179,16 +179,18 @@ public class LongPressPowerButtonPreferenceController extends TogglePreferenceCo
                    POWER_BUTTON_LONG_PRESS_SETTING, LONG_PRESS_POWER_ASSISTANT_VALUE);
        }

        // We need to determine the right disabled value - we set it to device default
        // if it's different than Assist, otherwise we fallback to either global actions or power
        // menu.
        // We need to determine the right disabled value based on the device default
        // for long-press power.

        // If the default is to start the assistant, then the fallback is GlobalActions.
        final int defaultPowerButtonValue = mContext.getResources().getInteger(
                POWER_BUTTON_LONG_PRESS_DEFAULT_VALUE_RESOURCE);
        if (defaultPowerButtonValue == LONG_PRESS_POWER_ASSISTANT_VALUE) {
            return Settings.Global.putInt(mContext.getContentResolver(),
                    POWER_BUTTON_LONG_PRESS_SETTING, LONG_PRESS_POWER_NO_ACTION);
                    POWER_BUTTON_LONG_PRESS_SETTING, LONG_PRESS_POWER_GLOBAL_ACTIONS);
        }

        // If the default is something different than Assist, we use that default.
        return Settings.Global.putInt(mContext.getContentResolver(),
                POWER_BUTTON_LONG_PRESS_SETTING, defaultPowerButtonValue);
    }
+4 −5
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ public class LongPressPowerButtonPreferenceControllerTest {

    @Test
    public void preferenceUnchecked_assistDefault_setNoAction() {
        // Value out of range chosen deliberately.
        // Ensure that the Assistant is the default behavior for LPP.
        when(mResources.getInteger(
                com.android.internal.R.integer.config_longPressOnPowerBehavior))
                .thenReturn(
@@ -209,13 +209,12 @@ public class LongPressPowerButtonPreferenceControllerTest {

        assertThat(Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.POWER_BUTTON_LONG_PRESS, -1)).isEqualTo(
                LongPressPowerButtonPreferenceController.LONG_PRESS_POWER_NO_ACTION);
                LongPressPowerButtonPreferenceController.LONG_PRESS_POWER_GLOBAL_ACTIONS);
        assertThat(Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.KEY_CHORD_POWER_VOLUME_UP, -1)).isEqualTo(
                LongPressPowerButtonPreferenceController.KEY_CHORD_POWER_VOLUME_UP_NO_ACTION);
        verify(mController.mAssistSwitch).setSummary(
                getString(
                        R.string.power_menu_summary_long_press_for_assist_disabled_no_action));
        verify(mController.mAssistSwitch).setSummary(getString(
                    R.string.power_menu_summary_long_press_for_assist_disabled_with_power_menu));
    }

    private String getString(@StringRes int id) {