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

Commit b65c68b5 authored by Kun Liang's avatar Kun Liang Committed by Linux Build Service Account
Browse files

QuickBoot: Don't handle specific broadcasts from QuickBoot

Don't process the BOOT_COMPLETED/SHUTDOWN broadcasts sent by
QuickBoot. They are only for apps.

Change-Id: I1551d0cd73d87b6780dcffd4c1ad5c54a7c76cc8
parent 2191ff96
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -62,6 +62,10 @@ public class BootReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(final Context context, Intent intent) {

        boolean fromQuickBoot = intent.getBooleanExtra("from_quickboot", false);
        if (fromQuickBoot) return;

        // Log boot events in the background to avoid blocking the main thread with I/O
        new Thread() {
            @Override
+6 −0
Original line number Diff line number Diff line
@@ -224,6 +224,9 @@ public class SyncManager {
    private BroadcastReceiver mBootCompletedReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            boolean fromQuickBoot = intent.getBooleanExtra("from_quickboot", false);
            if (fromQuickBoot) return;

            mSyncHandler.onBootCompleted();
        }
    };
@@ -328,6 +331,9 @@ public class SyncManager {
            new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            boolean fromQuickBoot = intent.getBooleanExtra("from_quickboot", false);
            if (fromQuickBoot) return;

            Log.w(TAG, "Writing sync state before shutdown...");
            getSyncStorageEngine().writeAllState();
        }
+3 −0
Original line number Diff line number Diff line
@@ -785,6 +785,9 @@ public class NetworkStatsService extends INetworkStatsService.Stub {
    private BroadcastReceiver mShutdownReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            boolean fromQuickBoot = intent.getBooleanExtra("from_quickboot", false);
            if (fromQuickBoot) return;

            // SHUTDOWN is protected broadcast.
            synchronized (mStatsLock) {
                shutdownLocked();