Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 86e98bf4 authored by Jason Chiu's avatar Jason Chiu
Browse files

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
parent 6472d299
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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,