首页 > 代码库 > android KK版本收到短信后,点亮屏的操作
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); }
}
/// @}
}
android KK版本收到短信后,点亮屏的操作
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。