Only add NonClientDecorView when needed

We were previously adding it to all decor views because it was
required to be able to draw the resizing backdrop. We now manage
the resizing backdrop independently of the NonClientDecorView.

Bug: 25082500
Change-Id: Ib786d55eacd221e5d36a4afca9117d5409499674
diff --git a/core/java/com/android/internal/widget/NonClientDecorView.java b/core/java/com/android/internal/widget/NonClientDecorView.java
index 232e308..33b8e05 100644
--- a/core/java/com/android/internal/widget/NonClientDecorView.java
+++ b/core/java/com/android/internal/widget/NonClientDecorView.java
@@ -68,7 +68,7 @@
     private final int DECOR_SHADOW_UNFOCUSED_HEIGHT_IN_DIP = 5;
     private PhoneWindow mOwner = null;
     private boolean mWindowHasShadow = false;
-    public boolean mShowDecor = false;
+    private boolean mShowDecor = false;
 
     // True if the window is being dragged.
     private boolean mDragging = false;
@@ -298,4 +298,13 @@
             }
         }
     }
+
+    public boolean isShowingDecor() {
+        return mShowDecor;
+    }
+
+    public int getDecorCaptionHeight() {
+        final View caption = getChildAt(0);
+        return (caption != null) ? caption.getHeight() : 0;
+    }
 }