Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1366027
  • 博文数量: 860
  • 博客积分: 425
  • 博客等级: 下士
  • 技术积分: 1464
  • 用 户 组: 普通用户
  • 注册时间: 2011-08-20 19:57
个人简介

对技术执着

文章分类

全部博文(860)

文章存档

2019年(16)

2018年(12)

2015年(732)

2013年(85)

2012年(15)

我的朋友

分类: LINUX

2015-07-08 17:22:33

--- a/packages/apps/Mms/src/com/android/mms/transaction/MmsSystemEventReceiver.java
+++ b/packages/apps/Mms/src/com/android/mms/transaction/MmsSystemEventReceiver.java
@@ -63,6 +63,7 @@ import android.provider.Telephony.Sms;
 import android.content.ContentResolver;
 import android.content.ContentValues;
 
+import android.os.PowerManager;
 /**
  * MmsSystemEventReceiver receives the
  * {@link android.content.intent.ACTION_BOOT_COMPLETED},
@@ -105,8 +106,23 @@ public class MmsSystemEventReceiver extends BroadcastReceiver {
         }
         Xlog.d(MmsApp.LOG_TAG, "onReceive(): intent=" + intent.toString());
         String action = intent.getAction();
+	  //modified for Mms Lighten start
+        PowerManager pm=(PowerManager)context.getSystemService(Context.POWER_SERVICE);//????????????????
+       final PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.SCREEN_DIM_WAKE_LOCK, "bright");
+        
         if (action.equals(Mms.Intents.CONTENT_CHANGED_ACTION)) {
             final Intent mIntent = intent;
+            wl.acquire();
+        	java.util.Timer timer = new java.util.Timer();
+        	java.util.TimerTask timeTask = new java.util.TimerTask(){
+				@Override
+				public void run() {
+					// TODO Auto-generated method stub
+				 wl.release();//release
+				}
+        	};
+            timer.schedule(timeTask, 8000);
             new Thread(new Runnable() {
                 @Override
                 public void run() {
@@ -115,6 +131,8 @@ public class MmsSystemEventReceiver extends BroadcastReceiver {
                     Xlog.d(MmsApp.TXN_TAG, "Mms.Intents.CONTENT_CHANGED_ACTION: " + changed);
                 }
             }).start();
+            
+            
         } else if (action.equals(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED)) {
             String state = intent.getStringExtra(Phone.STATE_KEY);


 


阅读(805) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~