diff options
author | Andrew Lee <anwlee@google.com> | 2015-05-13 12:23:35 -0700 |
---|---|---|
committer | Andrew Lee <anwlee@google.com> | 2015-05-13 12:29:11 -0700 |
commit | 93b816f753b67157f14a8389dc63f32cff40c8d4 (patch) | |
tree | 48d0c49acdbf729baa756bb02a59d780a3a76f97 /src/com/android/dialer/CallDetailActivity.java | |
parent | 91dc991cecfd283b2cf58dbe45dc7c6e6c58ed39 (diff) |
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
Diffstat (limited to 'src/com/android/dialer/CallDetailActivity.java')
-rw-r--r-- | src/com/android/dialer/CallDetailActivity.java | 45 |
1 files changed, 1 insertions, 44 deletions
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)); } |