Skip to content

Commit d6499dc

Browse files
Ethan1983Jean-Baptiste Queru
authored andcommitted
frameworks/base: Handle null from topRunningNonDelayedActivityLocked
startActivityUncheckedLocked tries to move the target task to front when it is not at front. topRunningNonDelayedActivityLocked is used to find the current task, however null value isn't handled. This null causes an unhandled exception leading to the android framework reboot. Change-Id: I2a43cda50483e28a4456846d8b3ccb30d7cf110e
1 parent e3cfd35 commit d6499dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

services/java/com/android/server/am/ActivityManagerService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3410,7 +3410,7 @@ private final int startActivityUncheckedLocked(HistoryRecord r,
34103410
// being started, which means not bringing it to the front
34113411
// if the caller is not itself in the front.
34123412
HistoryRecord curTop = topRunningNonDelayedActivityLocked(notTop);
3413-
if (curTop.task != taskTop.task) {
3413+
if (curTop != null && curTop.task != taskTop.task) {
34143414
r.intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
34153415
boolean callerAtFront = sourceRecord == null
34163416
|| curTop.task == sourceRecord.task;

0 commit comments

Comments
 (0)