OSDN Git Service

Temporary logging to debug ActivityStarter crash.
authorFilip Gruszczynski <gruszczy@google.com>
Sun, 17 Jan 2016 19:02:36 +0000 (11:02 -0800)
committerFilip Gruszczynski <gruszczy@google.com>
Sun, 17 Jan 2016 19:05:41 +0000 (11:05 -0800)
Bug: 26541093
Change-Id: Ia2887c1735ea6a5a964c01b63019288b96ef6172

services/core/java/com/android/server/am/ActivityStack.java
services/core/java/com/android/server/am/ActivityStarter.java
services/core/java/com/android/server/am/TaskRecord.java

index e3f4999..3d16141 100644 (file)
@@ -41,6 +41,7 @@ import android.graphics.Point;
 import android.graphics.Rect;
 import android.util.ArraySet;
 
+import android.util.Log;
 import com.android.internal.app.IVoiceInteractor;
 import com.android.internal.content.ReferrerIntent;
 import com.android.internal.os.BatteryStatsImpl;
@@ -4712,6 +4713,7 @@ final class ActivityStack {
         }
 
         task.stack = null;
+        task.lastStackClear = Log.getStackTraceString(new Throwable());
     }
 
     TaskRecord createTaskRecord(int taskId, ActivityInfo info, Intent intent,
index 58c14f1..15b7b64 100644 (file)
@@ -1280,6 +1280,10 @@ class ActivityStarter {
     }
 
     private ActivityRecord setTargetStackAndMoveToFrontIfNeeded(ActivityRecord intentActivity) {
+        if (intentActivity.task.stack == null) {
+            Slog.wtf(TAG, "Oops, the stack is null, we are about to crash. It was last cleared: "
+                    + intentActivity.task.lastStackClear);
+        }
         mTargetStack = intentActivity.task.stack;
         mTargetStack.mLastPausedActivity = null;
         // If the target task is not in the front, then we need to bring it to the front...
index be36f01..c6444bf 100644 (file)
@@ -245,6 +245,8 @@ final class TaskRecord {
     int mLayerRank = -1;
 
     Configuration mOverrideConfig = Configuration.EMPTY;
+    // STOPSHIP(b/26541093)
+    public String lastStackClear = "UNSET";
 
     TaskRecord(ActivityManagerService service, int _taskId, ActivityInfo info, Intent _intent,
             IVoiceInteractionSession _voiceSession, IVoiceInteractor _voiceInteractor) {