Reset relaunching count is app dies during re-launch

WindowManager keeps a count of how many relaunches an app is told
to do so that it can defer app transtions until the relaunches are
done. If the app porcess is killed during one of the relaunches
the app will never report back that it is done relaunching, so
app transtions into the app will not happen until will timeout
from waiting for the app.
We now notify WM of this situation so it can clear the relaunching
count for the app.

Bug: 29551109
Change-Id: Ibadba9f73e6e1bde141385aa8a0e066fbc0c5764
diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java
index b907da6..531146e 100644
--- a/services/core/java/com/android/server/wm/AppWindowToken.java
+++ b/services/core/java/com/android/server/wm/AppWindowToken.java
@@ -625,6 +625,13 @@
         }
     }
 
+    void clearRelaunching() {
+        if (canFreezeBounds()) {
+            unfreezeBounds();
+        }
+        mPendingRelaunchCount = 0;
+    }
+
     void addWindow(WindowState w) {
         for (int i = allAppWindows.size() - 1; i >= 0; i--) {
             WindowState candidate = allAppWindows.get(i);