From d6499dc69fd54d3ec735e267410f832c302acc97 Mon Sep 17 00:00:00 2001 From: Vairavan Srinivasan Date: Thu, 7 Oct 2010 15:12:53 -0700 Subject: 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 --- services/java/com/android/server/am/ActivityManagerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services') diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index f5a8119..51ff959 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -3410,7 +3410,7 @@ public final class ActivityManagerService extends ActivityManagerNative implemen // being started, which means not bringing it to the front // if the caller is not itself in the front. HistoryRecord curTop = topRunningNonDelayedActivityLocked(notTop); - if (curTop.task != taskTop.task) { + if (curTop != null && curTop.task != taskTop.task) { r.intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT); boolean callerAtFront = sourceRecord == null || curTop.task == sourceRecord.task; -- cgit v1.1