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

Commit 2ecce34f authored by Josh Bartel's avatar Josh Bartel Committed by Garmin Android technology group
Browse files

Synchronize access to *Locked() functions

Several places were calling *Locked() functions without properly
synchronizing.

Change-Id: Ie39b6592da8bb5f4a5a1e738c45f228256116ec4
parent 7f208743
Loading
Loading
Loading
Loading
+22 −9
Original line number Diff line number Diff line
@@ -4931,9 +4931,11 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
                Intent intent = new Intent(Intent.ACTION_PACKAGE_DATA_CLEARED,
                        Uri.fromParts("package", packageName, null));
                intent.putExtra(Intent.EXTRA_UID, pkgUid);
                synchronized (this) {
                    broadcastIntentLocked(null, null, intent,
                            null, null, 0, null, null, null,
                            false, false, MY_PID, Process.SYSTEM_UID);
                }
            } catch (RemoteException e) {
            }
        } finally {
@@ -5668,9 +5670,11 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
            ArrayList<ProcessRecord> procs =
                new ArrayList<ProcessRecord>(mProcessesOnHold);
            for (int ip=0; ip<NP; ip++) {
                synchronized (this) {
                    this.startProcessLocked(procs.get(ip), "on-hold", null);
                }
            }
        }
        if (mFactoryTest != SystemServer.FACTORY_TEST_LOW_LEVEL) {
            // Tell anyone interested that we are done booting!
            synchronized (this) {
@@ -7879,10 +7883,15 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
    }
    public static final void installSystemProviders() {
        List providers = null;
        synchronized (mSelf) {
            ProcessRecord app = mSelf.mProcessNames.get("system", Process.SYSTEM_UID);
        List providers = mSelf.generateApplicationProvidersLocked(app);
            providers = mSelf.generateApplicationProvidersLocked(app);
        }
        if (providers != null) {
            mSystemThread.installSystemProviders(providers);
        }
    }
    // =========================================================
    // GLOBAL MANAGEMENT
@@ -8156,12 +8165,16 @@ public final class ActivityManagerService extends ActivityManagerNative implemen
    }
    public void registerActivityWatcher(IActivityWatcher watcher) {
        synchronized (this) {
            mWatchers.register(watcher);
        }
    }
    public void unregisterActivityWatcher(IActivityWatcher watcher) {
        synchronized (this) {
            mWatchers.unregister(watcher);
        }
    }
    public final void enterSafeMode() {
        synchronized(this) {