Use the background thread instead ActivityManager to update CPU stats.
Updating the CPU stats can be quite slow and blocks the ActivityManager handler thread. Bug: 115506775 Change-Id: I9f67acfe2724c11d117703b2c4ccdbcc1f61c5ab Test: manual - dumpsys batterystats | grep CPU
This commit is contained in:
@@ -337,6 +337,9 @@ public class BatteryStatsImpl extends BatteryStats {
|
||||
|
||||
private final PlatformIdleStateCallback mPlatformIdleStateCallback;
|
||||
|
||||
/**
|
||||
* This handler is running on {@link BackgroundThread}.
|
||||
*/
|
||||
final class MyHandler extends Handler {
|
||||
public MyHandler(Looper looper) {
|
||||
super(looper, null, true);
|
||||
|
||||
Reference in New Issue
Block a user