现象
轻颜相机(com.gorgeous.lite)后台Camera 使用2小时平均电流200mA(BugReport提供的电流参考数据),耗电量400mAh
即耗电占比(200mA*2h)/(12.83h*52.68mA )=400mAh/623mAh=62%
Camera
Oct 10 2023
21:03:08 - 23:03:37
+2h16m15s859ms to +4h16m44s984ms
active duration: 2h 0m 29s 125ms
1 occurences
分析
下一步:结合当前分析,目前怀疑是APP本身异常导致后台启动了,是否可以让第三方应用帮看下。初步评估是一个低概率的app本身异常的BUG。
备注:其中如果APP本身没有悬浮窗权限,即使出现异常,android原生也不会允许其后台启动。本题目是恰好这个APP有悬浮窗权限
// .gorgeous.lite应用本身相关异常 (开启AMS日志进行复测多次,但是无法复现了,故没有更详细的进程启动异常日志)
Line 1523: 10-10 21:03:07.024 22630 27898 D featurehub: epoll_wait...
Line 1571: 10-10 21:03:07.124 22630 25185 E m.gorgeous.lite: Timed out waiting for threads to suspend, waited for 620.300s
Line 1572: 10-10 21:03:07.124 22630 25185 E m.gorgeous.lite: Thread not suspended: Thread[206,tid=26845,Runnable,Thread*=0xb400007364b3b080,peer=0x18b7ec28,"gecko-check-update-internal-thread"]
Line 1573: 10-10 21:03:07.133 22630 25185 W m.gorgeous.lite: Suspending all threads took: 620.358s
Line 1583: 10-10 21:03:07.173 22630 25294 D SharedPreferencesImpl: Time required to fsync /data/user/0/com.gorgeous.lite/shared_prefs/SP_EXPERIMENT_EXPOSURE_CACHE.xml: [<1: 0, <2: 0, <4: 0, <8: 0, <16: 0, <32: 0, <64: 0, <128: 0, <256: 0, <512: 0, <1024: 0, <2048: 0, <4096: 0, <8192: 0, <16384: 0, >=16384: 1]
// com.gorgeous.lite 后台启动,随后启动了相机
2_2023-10-10_204501/system.txt:1789:10-10 21:03:08.451 1885 11905 W ActivityTaskManager: Background activity start for com.gorgeous.lite allowed because SYSTEM_ALERT_WINDOW permission is granted.
// 后台启动了相机
10-10 21:03:08.677 2068 3244 I CameraService: CameraService::connect call (PID 22630 "com.gorgeous.lite", camera ID 1) and Camera API version 2
10-10 23:03:37.545 2068 6789 I cameraserver: camera-EventTrack: total_usetime= 0_2_0_29
10-10 23:03:37.549 2068 6789 I CameraService: disconnect: Disconnected client for camera 1 for PID 0
10-10 21:03:08.677 2068 3244 I CameraService: CameraService::connect call (PID 22630 "com.gorgeous.lite", camera ID 1) and Camera API version 2
10-10 23:03:37.545 2068 6789 I cameraserver: camera-EventTrack: total_usetime= 0_2_0_29
10-10 23:03:37.549 2068 6789 I CameraService: disconnect: Disconnected client for camera 1 for PID 0
这种是三方apk的行为,cameraservice 是一个服务,逻辑是google原生流程, 不会去判断屏幕状态.
这个要对比看下, 同样都是轻颜相机,在对比机上面是不是也会出现这种情况. 或者是触发了这个apk的什么操作后就会有这个行为.
下一步:结合当前分析,目前怀疑是APP本身异常导致后台启动了,是否可以让第三方应用帮看下。初步评估是一个低概率的app本身异常的BUG。