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

Commit 6976b913 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
parent 2ee99b92
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);
}
+13 −0
Original line number Diff line number Diff line
@@ -640,6 +640,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) {
        try {
            mService.wakeUpWithProximityCheck(time);
        } catch (RemoteException e) {
        }
    }

    /**
     * Forces the device to start napping.
     * <p>
+6 −0
Original line number Diff line number Diff line
@@ -2635,6 +2635,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
+6 −0
Original line number Diff line number Diff line
@@ -2068,4 +2068,10 @@
    <!-- set to false if we dont need to consider data
         service state to display signal strength bars -->
    <bool name="config_combined_signal">true</bool>

    <!-- 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>
</resources>
+5 −0
Original line number Diff line number Diff line
@@ -2192,4 +2192,9 @@
  <java-symbol type="string" name="privacy_guard_dialog_title" />
  <java-symbol type="string" name="privacy_guard_dialog_summary" />

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

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