1.现象:
2.分析方法:
- 使用移动热点+Wireshark实时查看第三方应用联网状态;
- NetLog+BugReport 查看唤醒异常
3.功耗异常点:
QQ
、微信等即时通讯应用,实际抓包和对比华为,依旧存在待机耗电,但是考虑消息即时性不进行任何省电管控;
针对灭屏后台启动透明activity类型,导致原生
doze误判加入 temp-power-save whitelist 的管控
11-08 20:13:19.157391 1199 2422 I
am_finish_activity: [0,73220790,224,com.jingdong.app.mall/com.igexin.sdk.GActivity,startActivity]
11-08 20:13:19.157500 1199 2422 I
am_destroy_activity: [0,73220790,224,com.jingdong.app.mall/com.igexin.sdk.GActivity,finish-imm:finishActivityLocked]
temp-power-save whitelist for 10175(com.jingdong.app.mall)
changed to: true
针对deep idle 下,通知栏应用或前台服务进程,可以被NetworkPolicyManagerService豁免现象
例如淘宝、百度搜索、网易新闻
Proc #25:
fore F/ /TOP trm: 5 0:com.netease.newsreader.activity/u0a191
(vis-activity)
com.fadi.android.launcher
oom: max=1001 curRaw=250 setRaw=250 cur=250 set=250
com.fadi.logger
oom: max=1001 curRaw=200 setRaw=200 cur=200 set=200
com.baidu.appsearch.AppSearch
oom: max=1001 curRaw=100 setRaw=100 cur=100 set=100
com.taobao.taobao
oom: max=1001 curRaw=200 setRaw=200 cur=200 set=200
/**
* Returns true
if {@param procState} is considered foreground and as such will be allowed
* to access
network when the device is idle or in battery saver mode. Otherwise, false.
*/
public static boolean isProcStateAllowedWhileIdleOrPowerSaveMode(int
procState) {
return procState <=
FOREGROUND_THRESHOLD_STATE;
}
4.解决方案:
针对灭屏后台启动透明activity类型,导致原生
doze误判加入 temp-power-save whitelist 的管控
针对deep idle 下,通知栏应用或前台服务进程,可以被NetworkPolicyManagerService豁免现象