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

Commit 31b15473 authored by Keun young Park's avatar Keun young Park
Browse files

bgdexopt: fix deadlock between dump and dexopt thread

- Calling JobScheduler API under mLock leads into accessing
  PMS lock which is held when dump is called from PMS.
  : This leads into deadlock.
- Call JobScheduler outside mLock as that is safe without
  mLock.

Bug: 213945104
Test: run bgdexopt CTS which runs dump and dexopt thread.
Change-Id: I3aabd18e6ec1ec7e158eb008b90dee90b8621c60
parent 6e1621b2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -896,10 +896,10 @@ public final class BackgroundDexOptService {
        synchronized (mLock) {
            if (!mFinishedPostBootUpdate) {
                mFinishedPostBootUpdate = true;
                JobScheduler js = mInjector.getJobScheduler();
                js.cancel(JOB_POST_BOOT_UPDATE);
            }
        }
        // Safe to do this outside lock.
        mInjector.getJobScheduler().cancel(JOB_POST_BOOT_UPDATE);
    }

    private void notifyPinService(ArraySet<String> updatedPackages) {