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
- 下一篇: 设计一个健壮的大型文件下载系统