wifi连接热点后,待机功耗高 -问题解决思路

来源:互联网 发布:轰趴馆 知乎 编辑:程序博客网 时间:2024/05/17 04:34

[FAQ71498] :wifi连接热点后,待机功耗高

            
                             
 

[QUESTION]
wifi连接热点后,待机功耗高

[ANSWER]

根据log发现电流平稳期间,有micromax跳起

 

08-21 15:12:00.687 <4>[ 1508.464935] c0 wake up by ana rtc gms com.google.android.intent.action.GCM_RECONNECT

08-21 15:13:00.670 <4>[ 1511.144958] c0 wake up by ana rtc  com.micromax

08-21 15:14:00.673 <4>[ 1513.474975] c0 wake up by ana rtc  ALARM_TEST_ACTION com.micromax

08-21 15:18:34.671 <4>[ 1525.344970] c0 wake up by ana rtc

08-21 15:19:20.686 <4>[ 1527.675018] c0 wake up by ana rtc  ALARM_TEST_ACTION com.micromax

08-21 15:19:54.683 <4>[ 1539.725036] c0 wake up by ana rtc  ACTION_BATTERY_CHANGED

08-21 15:23:34.674 <4>[ 1542.079589] c0 wake up by ana rtc

08-21 15:24:19.670 <4>[ 1544.699767] c0 wake up by ana rtc  com.micromax

08-21 15:28:34.671 <4>[ 1556.895049] c0 wake up by ana rtc

08-21 15:29:19.670 <4>[ 1559.609832] c0 wake up by ana rtc  com.micromax

08-21 15:29:54.670 <4>[ 1571.805114] c0 wake up by ana rtc  ACTION_BATTERY_CHANGED

08-21 15:30:25.678 <4>[ 1573.816375] c0 wake up by ana rtc  android.content.syncmanager.SYNC_ALARM

08-21 15:33:34.674 <4>[ 1576.495117] c0 wake up by ana rtc

08-21 15:34:20.676 <4>[ 1578.506317] c0 wake up by ana rtc  com.micromax  android.net.ConnectivityService.action.PKT_CNT_SAMPLE_INTERVAL_ELAPSED

08-21 15:36:00.670 <4>[ 1604.095184] c0 wake up by ana rtc gms

 

此应用是第三方应用,经过长时间实验证实,该应用确实存在在系统深睡时频繁唤醒系统。于是这里将其强制睡眠时无法唤醒系统,修改方案如下:

 

AlarmManagerService.java

/*add begin for CQ SPCSS00201759, force com.micromax nerver wakeup system when system fall in sleep */

private final String[] AlarmsWakeupToNonwakeup = new String[] { 
      "com.micromax" 
   };

/*add end for CQ SPCSS00201759*/

void setImpl(int type, long triggerAtTime, long windowLength, long interval, 
            PendingIntent operation, boolean isStandalone, WorkSource workSource, 
            AlarmManager.AlarmClockInfo alarmClock) { 
        if (operation == null) { 
            Slog.w(TAG, "set/setRepeating ignored because there is no intent"); 
            return; 
        }

/* add begin for SPCSS00201759, force com.micromax nerver wakeup system when system fall in sleep*/
        for(String s : AlarmsWakeupToNonwakeup){ 
        Slog.w(TAG,"alarm package name "+operation.getTargetPackage()); 
           if(s != null && s.equals(operation.getTargetPackage())){ 
      if(type == AlarmManager.RTC_WAKEUP || type == AlarmManager.ELAPSED_REALTIME_WAKEUP){ 
                type += 1; 
                  Slog.w(TAG,"com.micromax  change type ok"); 
                } 
            } 
        }

       /*add end for CQ SPCSS00201759*/

      …..

}

0 0
原创粉丝点击