android KK版本号收到短信后,点亮屏的操作
alps/packages/apps/mms/src/comandroid\mms\transation\MessagingNotification.java
private static void updateNotification()方法中
if (isNew) {
//MessageUtils.handleNewNotification(context, messageCount);
/// M: add for OP09 @{
if (MmsConfig.isSupportCTFeature()) {
wakeUpScreen(context);//这里事实上就是唤醒屏幕的方法,可是由于是依照OP09的需求做的,里面要求在插入耳机的状况下才会唤醒。假设能够接受,就请去掉上面的if推断,假设不接受,就在以下的else分支另外写方法
}
else{
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); }
}
/// @}
}
private static void updateNotification()方法中
if (isNew) {
//MessageUtils.handleNewNotification(context, messageCount);
/// M: add for OP09 @{
if (MmsConfig.isSupportCTFeature()) {
wakeUpScreen(context);//这里事实上就是唤醒屏幕的方法,可是由于是依照OP09的需求做的,里面要求在插入耳机的状况下才会唤醒。假设能够接受,就请去掉上面的if推断,假设不接受,就在以下的else分支另外写方法
}
else{
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); }
}
/// @}
}