OSDN Git Service

Fix NPE in ActivityManagerService
authorAdam Skory <skory@google.com>
Tue, 13 Aug 2013 20:32:31 +0000 (13:32 -0700)
committerAdam Skory <skory@google.com>
Tue, 13 Aug 2013 21:24:34 +0000 (14:24 -0700)
Bug: 10294281
Change-Id: Iaf608ae099b90fac8ad726285652b5c3e74e1632

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

index a6d7e3c..be6119d 100644 (file)
@@ -8062,12 +8062,10 @@ public final class ActivityManagerService extends ActivityManagerNative
             if (activity == null) {
                 Slog.w(TAG, "getAssistContextExtras error: no resumed activity");
                 validActivity = false;
-            }
-            if (activity.app == null || activity.app.thread == null) {
+            } else if (activity.app == null || activity.app.thread == null) {
                 Slog.w(TAG, "getAssistContextExtras error: no process for " + activity);
                 validActivity = false;
-            }
-            if (activity.app.pid == Binder.getCallingPid()) {
+            } else if (activity.app.pid == Binder.getCallingPid()) {
                 Slog.w(TAG, "getAssistContextExtras error: request process same as " + activity);
                 validActivity = false;
             }