Execute getting battery info on the parallel executor
Getting battery info is time consuming and may block other tasks in the same background thread. Executing it on the parallel executor can improve app launch performance. Bug: 141694556 Test: robotest Change-Id: I55517e03961929c2b288e230ed474d45915d63fd
This commit is contained in:
@@ -160,7 +160,7 @@ public class BatteryInfo {
|
||||
callback.onBatteryInfoLoaded(batteryInfo);
|
||||
BatteryUtils.logRuntime(LOG_TAG, "time for callback", startTime);
|
||||
}
|
||||
}.execute();
|
||||
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}
|
||||
|
||||
public static BatteryInfo getBatteryInfo(final Context context,
|
||||
|
Reference in New Issue
Block a user