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

Commit a9cebdb5 authored by Nikita Ioffe's avatar Nikita Ioffe Committed by Android (Google) Code Review
Browse files

Merge "ApexManager: Post populateAllPackagesCacheIfNeeded to a background thread"

parents 79a1f8e7 8d325359
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -261,11 +261,12 @@ abstract class ApexManager {
            mContext.registerReceiver(new BroadcastReceiver() {
            mContext.registerReceiver(new BroadcastReceiver() {
                @Override
                @Override
                public void onReceive(Context context, Intent intent) {
                public void onReceive(Context context, Intent intent) {
                    populateAllPackagesCacheIfNeeded();
                    // Post populateAllPackagesCacheIfNeeded to a background thread, since it's
                    // expensive to run it in broadcast handler thread.
                    BackgroundThread.getHandler().post(() -> populateAllPackagesCacheIfNeeded());
                    mContext.unregisterReceiver(this);
                    mContext.unregisterReceiver(this);
                }
                }
            }, new IntentFilter(Intent.ACTION_BOOT_COMPLETED), /* broadcastPermission */ null,
            }, new IntentFilter(Intent.ACTION_BOOT_COMPLETED));
                    BackgroundThread.getHandler());
        }
        }


        private void populateAllPackagesCacheIfNeeded() {
        private void populateAllPackagesCacheIfNeeded() {