Fix issue #6319312: Consecutive call to Activity's onCreate()/onResume()...

...without onPause() in between

There was a bug in the handling of "always finish activities" where we
would go through destroying activities while in the middle of updating
the activity stack.  This would result in the activity behind the
non-full-screen activity being created and then immediately destroyed,
which things were not expecting.

Change-Id: Idaa89089f7b1af7eb747d7b8f9f394beeb2d23fa
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index b55ee26..314f5c2 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -136,7 +136,7 @@
     /** @hide */
     public static final boolean DEBUG_BROADCAST = false;
     private static final boolean DEBUG_RESULTS = false;
-    private static final boolean DEBUG_BACKUP = true;
+    private static final boolean DEBUG_BACKUP = false;
     private static final boolean DEBUG_CONFIGURATION = false;
     private static final boolean DEBUG_SERVICE = false;
     private static final boolean DEBUG_MEMORY_TRIM = false;
@@ -1172,10 +1172,10 @@
                     case DUMP_PROVIDER: return "DUMP_PROVIDER";
                 }
             }
-            return "(unknown)";
+            return Integer.toString(code);
         }
         public void handleMessage(Message msg) {
-            if (DEBUG_MESSAGES) Slog.v(TAG, ">>> handling: " + msg.what);
+            if (DEBUG_MESSAGES) Slog.v(TAG, ">>> handling: " + codeToString(msg.what));
             switch (msg.what) {
                 case LAUNCH_ACTIVITY: {
                     Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "activityStart");
@@ -1378,7 +1378,7 @@
                     Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
                     break;
             }
-            if (DEBUG_MESSAGES) Slog.v(TAG, "<<< done: " + msg.what);
+            if (DEBUG_MESSAGES) Slog.v(TAG, "<<< done: " + codeToString(msg.what));
         }
 
         private void maybeSnapshot() {