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

Commit 4b05276d authored by Louis Chang's avatar Louis Chang
Browse files

Fix NullPointerException on a null Application object

When process attached, the app process was set to active
earlier than binding to client application. So, it was
possible to start activities or notify client to handle
configuration changes before binding applications.

Bug: 119621502
Test: adb shell monkey 100000
Change-Id: I969705f01ae00ae41e9df85567484b4ae1363d4f
parent 1215943a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -4360,7 +4360,6 @@ public class ActivityManagerService extends IActivityManager.Stub
        EventLog.writeEvent(EventLogTags.AM_PROC_BOUND, app.userId, app.pid, app.processName);
        app.makeActive(thread, mProcessStats);
        app.curAdj = app.setAdj = app.verifiedAdj = ProcessList.INVALID_ADJ;
        app.setCurrentSchedulingGroup(app.setSchedGroup = ProcessList.SCHED_GROUP_DEFAULT);
        app.forcingToImportant = null;
@@ -4567,6 +4566,10 @@ public class ActivityManagerService extends IActivityManager.Stub
                profilerInfo.closeFd();
                profilerInfo = null;
            }
            // Make app active after binding application or client may be running requests (e.g
            // starting activities) before it is ready.
            app.makeActive(thread, mProcessStats);
            checkTime(startTime, "attachApplicationLocked: immediately after bindApplication");
            mProcessList.updateLruProcessLocked(app, false, null);
            checkTime(startTime, "attachApplicationLocked: after updateLruProcessLocked");