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

Commit 42d9ef1f authored by Scott Mertz's avatar Scott Mertz Committed by Danesh M
Browse files

add config for proximity check on screen on default value

issue-id: CYNGNOS-1223

Change-Id: I7e6ae08e23ee147a37986aa6aa9b3176b301a09e
parent 44f615c4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -173,6 +173,9 @@
    <!-- Proximity check timeout -->
    <java-symbol type="integer" name="config_proximityCheckTimeout" />

    <!-- Proximity check on screen on default -->
    <java-symbol type="bool" name="config_proximityCheckOnWakeEnabledByDefault" />

    <!-- Developer settings - Kill app back press -->
    <java-symbol type="string" name="app_killed_message" />

+1 −0
Original line number Diff line number Diff line
@@ -2269,6 +2269,7 @@
    -->
    <bool name="config_proximityCheckOnWake">false</bool>
    <integer name="config_proximityCheckTimeout">250</integer>
    <bool name="config_proximityCheckOnWakeEnabledByDefault">false</bool>

    <!-- Timeout in MS for how long you have to long-press the back key to
         kill the foreground app. -->
+6 −1
Original line number Diff line number Diff line
@@ -369,6 +369,9 @@ public final class PowerManagerService extends SystemService
    // Otherwise the user won't get much screen on time before dimming occurs.
    private float mMaximumScreenDimRatioConfig;

    // Default value for proximity prevent accidental wakeups
    private boolean mProximityWakeEnabledByDefaultConfig;

    // The screen off timeout setting value in milliseconds.
    private int mScreenOffTimeoutSetting;

@@ -705,6 +708,8 @@ public final class PowerManagerService extends SystemService
                com.android.internal.R.integer.config_proximityCheckTimeout);
        mProximityWakeSupported = resources.getBoolean(
                com.android.internal.R.bool.config_proximityCheckOnWake);
        mProximityWakeEnabledByDefaultConfig = resources.getBoolean(
                com.android.internal.R.bool.config_proximityCheckOnWakeEnabledByDefault);
        if (mProximityWakeSupported) {
            PowerManager powerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
            mProximityWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
@@ -742,7 +747,7 @@ public final class PowerManagerService extends SystemService
                Settings.Global.WAKE_WHEN_PLUGGED_OR_UNPLUGGED,
                (mWakeUpWhenPluggedOrUnpluggedConfig ? 1 : 0));
        mProximityWakeEnabled = Settings.System.getInt(resolver,
                Settings.System.PROXIMITY_ON_WAKE, 1) == 1;
                Settings.System.PROXIMITY_ON_WAKE, mProximityWakeEnabledByDefaultConfig ? 1 : 0) == 1;

        final int oldScreenBrightnessSetting = mScreenBrightnessSetting;
        mScreenBrightnessSetting = Settings.System.getIntForUser(resolver,