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

Commit b7ae7994 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 am: 9389805d

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



Change-Id: I33e1e95e9255fa73d14fad779387af957be3e0af
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 598c9b67 9389805d
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -1555,7 +1555,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())
@@ -1569,9 +1570,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);
        }
    }