标签:
} else if (!isTelephonyCalling(context)) { android.util.Log.e("zhangshuli", "2"); PowerManager powerManager = (PowerManager) (context.getSystemService(Context.POWER_SERVICE)); PowerManager.WakeLock wakeLock = null; wakeLock = powerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE, "MMS_wake_lock"); long wakeUpTime = 0; try { ContentResolver cr = context.getContentResolver(); wakeUpTime = android.provider.Settings.System.getInt(cr, Settings.System.SCREEN_OFF_TIMEOUT); } catch (SettingNotFoundException e) { MmsLog.e(TAG, "Exception occured in wakeupScreen()"); } wakeLock.acquire(wakeUpTime); if (wakeLock != null) { wakeLock.release(); } } else if (NotificationPreferenceActivity.isPowerNotificationEnable()) { PowerManager powerManager = (PowerManager) (context.getSystemService(Context.POWER_SERVICE)); PowerManager.WakeLock wakeLock = null; wakeLock = powerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE, "MMS_wake_lock"); android.util.Log.e("zhangshuli", "3"); wakeLock.acquire(); if (wakeLock != null) { wakeLock.release(); } }
标签:
原文地址:http://www.cnblogs.com/zhangshuli-1989/p/4429052.html