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

Commit 52782aa4 authored by Adnan Begovic's avatar Adnan Begovic Committed by Gerrit Code Review
Browse files

fw: Move proximitycheck to CMSettings.

Change-Id: Ie80166c990363d3846925b189a1f7001a7fd56f8
parent 3ae55e3d
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -3329,12 +3329,6 @@ public final class Settings {
        public static final String NOTIFICATION_LIGHT_PULSE_CUSTOM_VALUES =
                "notification_light_pulse_custom_values";

        /**
         * Sprint MWI Quirk: Show message wait indicator notifications
         * @hide
         */
        public static final String ENABLE_MWI_NOTIFICATION = "enable_mwi_notification";

        /**
         * Show pointer location on screen?
         * 0 = no
@@ -3387,12 +3381,6 @@ public final class Settings {
        @Deprecated
        public static final String DOCK_SOUNDS_ENABLED = Global.DOCK_SOUNDS_ENABLED;

        /**
         * Check the proximity sensor during wakeup
         * @hide
         */
        public static final String PROXIMITY_ON_WAKE = "proximity_on_wake";

        /**
         * Whether to play sounds when the keyguard is shown and dismissed.
         * @hide
+0 −9
Original line number Diff line number Diff line
@@ -31,15 +31,6 @@
    <java-symbol type="integer" name="config_longPressOnMenuBehavior" />
    <java-symbol type="integer" name="config_longPressOnAppSwitchBehavior" />

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

    <!-- Proximity check timeout -->
    <java-symbol type="integer" name="config_proximityCheckTimeout" />

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

    <!-- Notification and battery light -->
    <java-symbol type="bool" name="config_adjustableNotificationLedBrightness" />
    <java-symbol type="bool" name="config_intrusiveNotificationLed" />
+0 −7
Original line number Diff line number Diff line
@@ -2463,13 +2463,6 @@
    <integer name="config_nightColorTemperature">4500</integer>
    <integer name="config_outdoorAmbientLux">9000</integer>

    <!-- Default value for proximity check on screen wake
         NOTE ! - Enable for devices that have a fast response proximity sensor (ideally < 300ms)
    -->
    <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. -->
    <integer name="config_backKillTimeout">2000</integer>
+1 −1
Original line number Diff line number Diff line
@@ -14,6 +14,6 @@ LOCAL_STATIC_JAVA_LIBRARIES := tzdata_update

LOCAL_JAVA_LIBRARIES += services.accessibility

LOCAL_JAVA_LIBRARIES += org.cyanogenmod.platform.sdk
LOCAL_JAVA_LIBRARIES += org.cyanogenmod.platform.internal

include $(BUILD_STATIC_JAVA_LIBRARY)
+8 −7
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;

import cyanogenmod.providers.CMSettings;
import libcore.util.Objects;

import static android.os.PowerManagerInternal.POWER_HINT_INTERACTION;
@@ -683,8 +684,8 @@ public final class PowerManagerService extends SystemService
            resolver.registerContentObserver(Settings.Secure.getUriFor(
                    Settings.Secure.BUTTON_BACKLIGHT_TIMEOUT),
                    false, mSettingsObserver, UserHandle.USER_ALL);
            resolver.registerContentObserver(Settings.System.getUriFor(
                    Settings.System.PROXIMITY_ON_WAKE),
            resolver.registerContentObserver(CMSettings.System.getUriFor(
                    CMSettings.System.PROXIMITY_ON_WAKE),
                    false, mSettingsObserver, UserHandle.USER_ALL);
            resolver.registerContentObserver(Settings.Global.getUriFor(
                    Settings.Global.WAKE_WHEN_PLUGGED_OR_UNPLUGGED),
@@ -738,11 +739,11 @@ public final class PowerManagerService extends SystemService
        mSupportsDoubleTapWakeConfig = resources.getBoolean(
                com.android.internal.R.bool.config_supportDoubleTapWake);
        mProximityTimeOut = resources.getInteger(
                com.android.internal.R.integer.config_proximityCheckTimeout);
                org.cyanogenmod.platform.internal.R.integer.config_proximityCheckTimeout);
        mProximityWakeSupported = resources.getBoolean(
                com.android.internal.R.bool.config_proximityCheckOnWake);
                org.cyanogenmod.platform.internal.R.bool.config_proximityCheckOnWake);
        mProximityWakeEnabledByDefaultConfig = resources.getBoolean(
                com.android.internal.R.bool.config_proximityCheckOnWakeEnabledByDefault);
                org.cyanogenmod.platform.internal.R.bool.config_proximityCheckOnWakeEnabledByDefault);
        if (mProximityWakeSupported) {
            PowerManager powerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
            mProximityWakeLock = powerManager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
@@ -778,8 +779,8 @@ public final class PowerManagerService extends SystemService
        mWakeUpWhenPluggedOrUnpluggedSetting = Settings.Global.getInt(resolver,
                Settings.Global.WAKE_WHEN_PLUGGED_OR_UNPLUGGED,
                (mWakeUpWhenPluggedOrUnpluggedConfig ? 1 : 0));
        mProximityWakeEnabled = Settings.System.getInt(resolver,
                Settings.System.PROXIMITY_ON_WAKE, mProximityWakeEnabledByDefaultConfig ? 1 : 0) == 1;
        mProximityWakeEnabled = CMSettings.System.getInt(resolver,
                CMSettings.System.PROXIMITY_ON_WAKE, mProximityWakeEnabledByDefaultConfig ? 1 : 0) == 1;

        if (mSupportsDoubleTapWakeConfig) {
            boolean doubleTapWakeEnabled = Settings.Secure.getIntForUser(resolver,