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

Commit 9389805d authored by Chris Li's avatar Chris Li Committed by Automerger Merge Worker
Browse files

Merge "ATMS: fix the NPE problem in case the dream activity fails to start."...

Merge "ATMS: fix the NPE problem in case the dream activity fails to start." into main am: 77b4da7b

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3385961



Change-Id: I95565d390ad7f52b46f6241622c9e98ac7d6d45f
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents aa53e081 77b4da7b
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -1534,7 +1534,8 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {


            final ActivityRecord[] outActivity = new ActivityRecord[1];
            getActivityStartController().obtainStarter(intent, "dream")
            final int res = getActivityStartController()
                    .obtainStarter(intent, "dream")
                    .setCallingUid(callingUid)
                    .setCallingPid(callingPid)
                    .setCallingPackage(intent.getPackage())
@@ -1548,9 +1549,11 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                    .execute();

            final ActivityRecord started = outActivity[0];
            final IAppTask appTask = started == null ? null :
                    new AppTaskImpl(this, started.getTask().mTaskId, callingUid);
            return appTask;
            if (started == null || !ActivityManager.isStartResultSuccessful(res)) {
                // start the dream activity failed.
                return null;
            }
            return new AppTaskImpl(this, started.getTask().mTaskId, callingUid);
        }
    }