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

Commit bce711ea authored by Mark Lu's avatar Mark Lu
Browse files

Fix batterySendBroadcast not synchronized issue.

Symptom: system server crash.
Root Cause: batterySendBroadcast not sychrnized with AMS object,
caused system crash in broadcastIntentLocked()
when 2 threads access mParallelBroadcasts.get(i).intent but get null
in BroadcastQueue.replaceParallelBroadcastLocked().
Solution: add sychronization object.

Change-Id: I99f751a2cd3e6fa1dbe2812f5f129525013d6a7f
parent 6fe06606
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -2614,10 +2614,12 @@ public final class ActivityManagerService extends ActivityManagerNative
    @Override
    public void batterySendBroadcast(Intent intent) {
        synchronized (this) {
            broadcastIntentLocked(null, null, intent, null, null, 0, null, null, null,
                    AppOpsManager.OP_NONE, null, false, false,
                    -1, Process.SYSTEM_UID, UserHandle.USER_ALL);
        }
    }
    /**
     * Initialize the application bind args. These are passed to each