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

Commit b29dcce6 authored by Mohammad Samiul Islam's avatar Mohammad Samiul Islam
Browse files

Move expensive code from BroadcastReceiver to background thread

Bug: 138460874
Test: atest apexservice_test
Test: atest CtsStagedInstallHostTestCases
Test: atest RollbackTest
Change-Id: I1cd7daa066f32832814c28423c5c30e39c230600
parent d8e20a80
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() {