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

Commit 1417ad4b authored by Josh Yang's avatar Josh Yang
Browse files

Use explicit executor when factory reset a device.

By default, AsyncTask uses a SerialExecutor which can be blocked by
other AsyncTask indefinitely. This sometimes can cause the factory reset
operation to be blocked for a long time. This change explicitly changes
the executor to THREAD_POOL_EXECUTOR so factory reset operation won't be
blocked.

Flag: EXEMPTED - small bug fix
Bug: 367798236
Fix: 367798236
Test: manual test factory reset flow
Change-Id: I99f5046cfc6d8a6c9a7be7bda950103b859f7489
parent 6d8ad4db
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ public class MasterClearReceiver extends BroadcastReceiver {
        if (mWipeExternalStorage) {
            // thr will be started at the end of this task.
            Slog.i(TAG, "Wiping external storage on async task");
            new WipeDataTask(context, thr).execute();
            new WipeDataTask(context, thr).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
        } else {
            Slog.i(TAG, "NOT wiping external storage; starting thread " + thr.getName());
            thr.start();