summaryrefslogtreecommitdiff
path: root/InCallUI
diff options
context:
space:
mode:
Diffstat (limited to 'InCallUI')
-rw-r--r--InCallUI/src/com/android/incallui/InCallPresenter.java4
-rw-r--r--InCallUI/src/com/android/incallui/ProximitySensor.java10
2 files changed, 14 insertions, 0 deletions
diff --git a/InCallUI/src/com/android/incallui/InCallPresenter.java b/InCallUI/src/com/android/incallui/InCallPresenter.java
index 8c52aab2c..7678372fb 100644
--- a/InCallUI/src/com/android/incallui/InCallPresenter.java
+++ b/InCallUI/src/com/android/incallui/InCallPresenter.java
@@ -435,6 +435,10 @@ public class InCallPresenter implements CallList.Listener {
}
mContactInfoCache = null;
+ if (mProximitySensor != null) {
+ removeListener(mProximitySensor);
+ mProximitySensor.tearDown();
+ }
mProximitySensor = null;
mAudioModeProvider = null;
diff --git a/InCallUI/src/com/android/incallui/ProximitySensor.java b/InCallUI/src/com/android/incallui/ProximitySensor.java
index 0dc54dccb..5895c291c 100644
--- a/InCallUI/src/com/android/incallui/ProximitySensor.java
+++ b/InCallUI/src/com/android/incallui/ProximitySensor.java
@@ -68,6 +68,16 @@ public class ProximitySensor implements AccelerometerListener.OrientationListene
mAudioModeProvider.addListener(this);
}
+ public void tearDown() {
+ mAudioModeProvider.removeListener(this);
+
+ mAccelerometerListener.enable(false);
+
+ if (mProximityWakeLock.isHeld()) {
+ mProximityWakeLock.release();
+ }
+ }
+
/**
* Called to identify when the device is laid down flat.
*/