From 93b816f753b67157f14a8389dc63f32cff40c8d4 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Wed, 13 May 2015 12:23:35 -0700 Subject: Move proximity sensor logic into VM fragment. In preparation for moving it from the CallDetailActivity into the call log. Seems to make sense to consolidate this within the fragment in any case. Bug: 20433758 Change-Id: I1aa0cd9a766fac3e1eb9285d31df5ed90523b8ad --- src/com/android/dialer/CallDetailActivity.java | 45 +------------------------- 1 file changed, 1 insertion(+), 44 deletions(-) (limited to 'src/com/android/dialer/CallDetailActivity.java') diff --git a/src/com/android/dialer/CallDetailActivity.java b/src/com/android/dialer/CallDetailActivity.java index 0a295c4fe..536a97cca 100644 --- a/src/com/android/dialer/CallDetailActivity.java +++ b/src/com/android/dialer/CallDetailActivity.java @@ -80,7 +80,7 @@ import java.util.List; * This activity can be either started with the URI of a single call log entry, or with the * {@link #EXTRA_CALL_LOG_IDS} extra to specify a group of call log entries. */ -public class CallDetailActivity extends Activity implements ProximitySensorAware { +public class CallDetailActivity extends Activity { private static final String TAG = "CallDetail"; private static final char LEFT_TO_RIGHT_EMBEDDING = '\u202A'; @@ -142,8 +142,6 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware /** Whether we should show "remove from call log" in the options menu. */ private boolean mHasRemoveFromCallLogOption; - private PowerManager.WakeLock mProximityWakeLock; - static final String[] CALL_LOG_PROJECTION = new String[] { CallLog.Calls.DATE, CallLog.Calls.DURATION, @@ -197,13 +195,6 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware mAccountLabel = (TextView) findViewById(R.id.phone_account_label); mDefaultCountryIso = GeoUtil.getCurrentCountryIso(this); mContactPhotoManager = ContactPhotoManager.getInstance(this); - final PowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE); - if (powerManager.isWakeLockLevelSupported(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK)) { - mProximityWakeLock = powerManager.newWakeLock( - PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK, TAG); - } else { - mProximityWakeLock = null; - } mContactInfoHelper = new ContactInfoHelper(this, GeoUtil.getCurrentCountryIso(this)); getActionBar().setDisplayHomeAsUpEnabled(true); @@ -707,40 +698,6 @@ public class CallDetailActivity extends Activity implements ProximitySensorAware ); } - @Override - protected void onPause() { - // Immediately stop the proximity sensor. - disableProximitySensor(false); - super.onPause(); - } - - @Override - public void enableProximitySensor() { - if (mProximityWakeLock == null) { - return; - } - if (!mProximityWakeLock.isHeld()) { - Log.i(TAG, "Acquiring proximity wake lock"); - mProximityWakeLock.acquire(); - } else { - Log.i(TAG, "Proximity wake lock already acquired"); - } - } - - @Override - public void disableProximitySensor(boolean waitForFarState) { - if (mProximityWakeLock == null) { - return; - } - if (mProximityWakeLock.isHeld()) { - Log.i(TAG, "Releasing proximity wake lock"); - int flags = (waitForFarState ? PowerManager.RELEASE_FLAG_WAIT_FOR_NO_PROXIMITY : 0); - mProximityWakeLock.release(flags); - } else { - Log.i(TAG, "Proximity wake lock already released"); - } - } - private void closeSystemDialogs() { sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)); } -- cgit v1.2.3