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

Commit 3eec7cc4 authored by Danesh M's avatar Danesh M Committed by Steve Kondik
Browse files

ProximityWake : Add support for checking proximity when waking device

Change-Id: Ia5ff446d88435773acccc7467e66009000dc20cb

Be sure to shutdown the proximity sensor after display wake

This fixes:
http://review.cyanogenmod.org/#/c/66657/

Change-Id: I1768f13cb48c3e056d0e137642690fc3d650c4ab

PowerManager : Make proximity check opt-in

Change-Id: I7cf64a82530da2e655018e43683ba7a5584d54f8

Framework : Fix proximity wakeup reference

Change-Id: Ia40ca6fbf6e37fbb3996f2384f725c30b88c2131

[1/2] Frameworks: let InCallUI handle proximity sensor for incoming calls

Fixes "while 'prevent accidental wake-up' is on, proximity sensor
doesn't control screen state on incoming call. Must manually
turn on screen to see who's calling."

Change-Id: I738b3bbd328992c8a8010a0c8d9aa1e444cfa9f9

power: Fix locking for wakeup proximity check

 * Often I'm noticing high power consumption due to the proximity sensor
   never turning off. Add synchronization around this code to ensure
   ordering.

Change-Id: I8ccf3152166cd896e0ce2551c01b8ac8f501d782

add config for proximity check on screen on default value

Change-Id: I7e6ae08e23ee147a37986aa6aa9b3176b301a09e

Services : Ensure proximity check is taken into consideration

Only do the proximity check if explicitly being asked to do so.
This is a patch that was never ported from cm-11.0 :
2293e60c

issue-id: CYNGNOS-1223

Change-Id: Id1be619e638de6a45252d8390eab6e38bd5de5a7

services: button brightness should check proximity

Change-Id: I10a72fa6d8b520e86cfef3d7ded489fd7fa936d2
parent 86113371
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -67,4 +67,5 @@ interface IPowerManager

    void setKeyboardLight(boolean on, int key);

	void wakeUpWithProximityCheck(long time, String reason, String opPackageName);
}
+13 −0
Original line number Diff line number Diff line
@@ -673,6 +673,19 @@ public final class PowerManager {
        }
    }

    /**
     * Forces the device to wake up from sleep only if
     * nothing is blocking the proximity sensor
     * @see #wakeUp
     * @hide
     */
    public void wakeUpWithProximityCheck(long time, String reason) {
        try {
            mService.wakeUpWithProximityCheck(time, reason, mContext.getOpPackageName());
        } catch (RemoteException e) {
        }
    }

    /**
     * Forces the device to start napping.
     * <p>
+6 −0
Original line number Diff line number Diff line
@@ -3266,6 +3266,12 @@ 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
+11 −1
Original line number Diff line number Diff line
@@ -26,6 +26,16 @@
    -->
    <!-- External CM specific core services -->
    <java-symbol type="array" name="config_externalCMServices" />

    <!-- 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" />

    <!-- LiveDisplay -->
    <java-symbol type="string" name="live_display_title" />
    <java-symbol type="string" name="live_display_hint" />
+7 −0
Original line number Diff line number Diff line
@@ -2396,4 +2396,11 @@
    <integer name="config_dayColorTemperature">6500</integer>
    <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>
</resources>
Loading