Manual 'cherry pick' to fix CTS tests for MediaControllerTest.

This is to manually apply a patch of code that should have
propagated to E, but hasn't and is breaking one of the CTS
tests for MediaControllerTest on Nemo.

The original reverted change can be found at ag/723643.

Bug: 24172957
Change-Id: I925ff561a56531ebf9f8d8b4ce56156ae7feb9fc
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 3b7f6aa..43c578f 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -7391,7 +7391,11 @@
      * @hide
      */
     public void getOutsets(Rect outOutsetRect) {
-        outOutsetRect.set(mAttachInfo.mOutsets);
+        if (mAttachInfo != null) {
+            outOutsetRect.set(mAttachInfo.mOutsets);
+        } else {
+            outOutsetRect.setEmpty();
+        }
     }
 
     /**