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

Commit ab8d05b7 authored by Shivangi Dubey's avatar Shivangi Dubey Committed by Android (Google) Code Review
Browse files

Merge "Refine fold setting" into main

parents 3d7d1ea3 3fbc9c34
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4871,13 +4871,13 @@ public final class Settings {
        public static final String PEAK_REFRESH_RATE = "peak_refresh_rate";
        /**
         * Control whether to stay awake on fold
         * Control lock behavior on fold
         *
         * If this isn't set, the system falls back to a device specific default.
         * @hide
         */
        @Readable
        public static final String STAY_AWAKE_ON_FOLD = "stay_awake_on_fold";
        public static final String FOLD_LOCK_BEHAVIOR = "fold_lock_behavior_setting";
        /**
         * The amount of time in milliseconds before the device goes to sleep or begins
+36 −0
Original line number Diff line number Diff line
@@ -14,35 +14,23 @@
 * limitations under the License.
 */

package com.android.server.utils;
package com.android.internal.util;

import android.content.ContentResolver;
import android.provider.Settings;

/**
 * A wrapper class for the {@link Settings.System#STAY_AWAKE_ON_FOLD} setting.
 *
 * This class provides a convenient way to access the {@link Settings.System#STAY_AWAKE_ON_FOLD}
 * setting for testing.
 * A wrapper class for accessing and modifying system settings that would help with testing.
 */
public class FoldSettingWrapper {
    private final ContentResolver mContentResolver;
public class SettingsWrapper {

    public FoldSettingWrapper(ContentResolver contentResolver) {
        mContentResolver = contentResolver;
    /** Retrieves the string value of a system setting */
    public String getStringForUser(ContentResolver contentResolver, String name, int userHandle) {
        return Settings.System.getStringForUser(contentResolver, name, userHandle);
    }

    /**
     * Returns whether the device should remain awake after folding.
     */
    public boolean shouldStayAwakeOnFold() {
        try {
            return (Settings.System.getIntForUser(
                    mContentResolver,
                    Settings.System.STAY_AWAKE_ON_FOLD,
                    0) == 1);
        } catch (Settings.SettingNotFoundException e) {
            return false;
        }
    /** Updates the string value of a system setting */
    public String putStringForUser(ContentResolver contentResolver, String name, int userHandle) {
        return Settings.System.getStringForUser(contentResolver, name, userHandle);
    }
}
+3 −0
Original line number Diff line number Diff line
@@ -935,6 +935,9 @@
         without impacting power, performance, and app compatibility (e.g. protected content). -->
    <bool name="config_reduceBrightColorsAvailable">@bool/config_setColorTransformAccelerated</bool>

    <!-- Whether to show Fold lock behavior setting feature in Settings App -->
    <bool name="config_fold_lock_behavior">false</bool>

    <string-array name="config_reduceBrightColorsCoefficientsNonlinear">
        <!-- a-coefficient --> <item>-0.4429953456</item>
        <!-- b-coefficient --> <item>-0.2434077725</item>
+1 −0
Original line number Diff line number Diff line
@@ -343,6 +343,7 @@
  <java-symbol type="string" name="config_defaultHealthConnectApp" />
  <java-symbol type="bool" name="config_sendAudioBecomingNoisy" />
  <java-symbol type="bool" name="config_enableScreenshotChord" />
  <java-symbol type="bool" name="config_fold_lock_behavior" />
  <java-symbol type="bool" name="config_enableWifiDisplay" />
  <java-symbol type="bool" name="config_allowAnimationsInLowPowerMode" />
  <java-symbol type="bool" name="config_useDevInputEventForAudioJack" />
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ public class SystemSettings {
        Settings.System.TTY_MODE,
        Settings.System.MASTER_MONO,
        Settings.System.MASTER_BALANCE,
        Settings.System.STAY_AWAKE_ON_FOLD,
        Settings.System.FOLD_LOCK_BEHAVIOR,
        Settings.System.SOUND_EFFECTS_ENABLED,
        Settings.System.HAPTIC_FEEDBACK_ENABLED,
        Settings.System.POWER_SOUNDS_ENABLED,       // moved to global
Loading