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

Commit 4221d79a authored by Louis Chang's avatar Louis Chang
Browse files

Fix NPE when scheduling transaction for null client

Application process was crash and the application thread was set
to null when obtaining the client transaction object. NPE was
thrown by using it to schedule transaction.

Bug: 130006936
Test: WindowProcessControllerTests
Test: ActivityStartControllerTests
Test: RootActivityContainerTests

Change-Id: I65ecb124e014e5d80ebc283884475619f95239fa
parent 6a4bf6a3
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio
    private final ActivityTaskManagerService mAtm;
    // The actual proc...  may be null only if 'persistent' is true (in which case we are in the
    // process of launching the app)
    private volatile IApplicationThread mThread;
    private IApplicationThread mThread;
    // Currently desired scheduling class
    private volatile int mCurSchedGroup;
    // Currently computed process state
@@ -192,9 +192,12 @@ public class WindowProcessController extends ConfigurationContainer<Configuratio
        return mPid;
    }

    @HotPath(caller = HotPath.PROCESS_CHANGE)
    public void setThread(IApplicationThread thread) {
        synchronized (mAtm.mGlobalLockWithoutBoost) {
            mThread = thread;
        }
    }

    IApplicationThread getThread() {
        return mThread;