summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xAndroid.mk1
-rw-r--r--InCallUI/src/com/android/incallui/ProximitySensor.java14
2 files changed, 13 insertions, 2 deletions
diff --git a/Android.mk b/Android.mk
index ce49c46a3..71497ae4f 100755
--- a/Android.mk
+++ b/Android.mk
@@ -69,6 +69,7 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
ims-ext-common \
phonebook_wrapper \
telephony-common \
+ org.cyanogenmod.platform.internal \
org.cyanogenmod.platform.sdk
LOCAL_PACKAGE_NAME := Dialer
diff --git a/InCallUI/src/com/android/incallui/ProximitySensor.java b/InCallUI/src/com/android/incallui/ProximitySensor.java
index ae62a8e28..021070472 100644
--- a/InCallUI/src/com/android/incallui/ProximitySensor.java
+++ b/InCallUI/src/com/android/incallui/ProximitySensor.java
@@ -31,6 +31,8 @@ import com.android.incallui.AudioModeProvider.AudioModeListener;
import com.android.incallui.InCallPresenter.InCallState;
import com.android.incallui.InCallPresenter.InCallStateListener;
+import org.cyanogenmod.platform.internal.R;
+
/**
* Class manages the proximity sensor for the in-call UI.
* We enable the proximity sensor while the user in a phone call. The Proximity sensor turns off
@@ -55,6 +57,8 @@ public class ProximitySensor implements AccelerometerListener.OrientationListene
private boolean mIsPhoneOffhook = false;
private boolean mDialpadVisible;
private Context mContext;
+ private boolean mProximityWakeSupported;
+ private int mProximityWakeDefault;
// True if the keyboard is currently *not* hidden
// Gets updated whenever there is a Configuration change
@@ -80,6 +84,11 @@ public class ProximitySensor implements AccelerometerListener.OrientationListene
mAudioModeProvider = audioModeProvider;
mAudioModeProvider.addListener(this);
+
+ mProximityWakeSupported = context.getResources().getBoolean(
+ R.bool.config_proximityCheckOnWake);
+ mProximityWakeDefault = context.getResources().getBoolean(
+ R.bool.config_proximityCheckOnWakeEnabledByDefault) ? 1 : 0;
}
public void tearDown() {
@@ -266,8 +275,9 @@ public class ProximitySensor implements AccelerometerListener.OrientationListene
.add("aud", CallAudioState.audioRouteToString(audioMode))
.toString());
- final boolean proximityOnWake = CMSettings.System.getInt(mContext.getContentResolver(),
- CMSettings.System.PROXIMITY_ON_WAKE, 1) == 1;
+ final boolean proximityOnWake = mProximityWakeSupported &&
+ CMSettings.System.getInt(mContext.getContentResolver(),
+ CMSettings.System.PROXIMITY_ON_WAKE, mProximityWakeDefault) == 1;
if ((mIsPhoneOffhook || (mHasIncomingCall && proximityOnWake))
&& !screenOnImmediately) {