List of usage examples for android.os PowerManager PROXIMITY_SCREEN_OFF_WAKE_LOCK
int PROXIMITY_SCREEN_OFF_WAKE_LOCK
To view the source code for android.os PowerManager PROXIMITY_SCREEN_OFF_WAKE_LOCK.
Click Source Link
From source file:com.android.dialer.voicemail.VoicemailPlaybackPresenter.java
/** * Initialize variables which are activity-independent and state-independent. *//* w ww. j av a 2s. co m*/ protected VoicemailPlaybackPresenter(Activity activity) { Context context = activity.getApplicationContext(); mAsyncTaskExecutor = AsyncTaskExecutors.createAsyncTaskExecutor(); mVoicemailAudioManager = new VoicemailAudioManager(context, this); mVoicemailAsyncTaskUtil = new VoicemailAsyncTaskUtil(context.getContentResolver()); PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); if (powerManager.isWakeLockLevelSupported(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK)) { mProximityWakeLock = powerManager.newWakeLock(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK, TAG); } }
From source file:org.awokenwell.proximity.ProximitySensorListener.java
/** * *///from w ww . j a v a 2 s. c o m public void enableProximityScreenOff() { Log.d("ProximitySensorListener", "XXX enableProximityScreenOff"); if (wakeLock != null) { wakeLock.release(); } wakeLock = powerManager.newWakeLock(PowerManager.PROXIMITY_SCREEN_OFF_WAKE_LOCK, ProximitySensorListener.this.toString()); wakeLock.acquire(); }