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版本号收到短信后,点亮屏的操作的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: C# WinForm 自定义控件,Dat
- 下一篇: eclipse git commit