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

Commit 86e53119 authored by Mohammad Samiul Islam's avatar Mohammad Samiul Islam Committed by Bill Lin
Browse files

Move expensive code from BroadcastReceiver to background thread

Bug: 138460874
Test: atest apexservice_test
Test: atest CtsStagedInstallHostTestCases
Test: atest RollbackTest
Change-Id: I32fdd0fdadf14bc66b5587d03ccf5e82d0d56d52
Merged-In: I1cd7daa066f32832814c28423c5c30e39c230600
parent 1138012b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.sysprop.ApexProperties;
import android.util.Slog;

import com.android.internal.annotations.GuardedBy;
import com.android.internal.os.BackgroundThread;
import com.android.internal.util.IndentingPrintWriter;

import java.io.File;
@@ -263,7 +264,8 @@ abstract class ApexManager {
                    populateAllPackagesCacheIfNeeded();
                    mContext.unregisterReceiver(this);
                }
            }, new IntentFilter(Intent.ACTION_BOOT_COMPLETED));
            }, new IntentFilter(Intent.ACTION_BOOT_COMPLETED), /* broadcastPermission */ null,
                    BackgroundThread.getHandler());
        }

        private void populateAllPackagesCacheIfNeeded() {