Update docs for TextInputLayout and ActivityCompat

Accounts for TIL's FrameLayout injection and changes to framework docs
for Activity#requestPermissions.

Bug: 31804707
Bug: 31267563
Change-Id: If7c6a376ba0440146b13effe45bd36690c37796d
diff --git a/compat/java/android/support/v4/app/ActivityCompat.java b/compat/java/android/support/v4/app/ActivityCompat.java
index c30e49d..3888be9 100644
--- a/compat/java/android/support/v4/app/ActivityCompat.java
+++ b/compat/java/android/support/v4/app/ActivityCompat.java
@@ -29,6 +29,7 @@
 import android.os.Handler;
 import android.os.Looper;
 import android.os.Parcelable;
+import android.support.annotation.IntRange;
 import android.support.annotation.NonNull;
 import android.support.annotation.Nullable;
 import android.support.v4.content.ContextCompat;
@@ -330,8 +331,8 @@
      * to grant and which to reject. Hence, you should be prepared that your activity
      * may be paused and resumed. Further, granting some permissions may require
      * a restart of you application. In such a case, the system will recreate the
-     * activity stack before delivering the result to your onRequestPermissionsResult(
-     * int, String[], int[]).
+     * activity stack before delivering the result to your
+     * {@link OnRequestPermissionsResultCallback#onRequestPermissionsResult(int, String[], int[])}.
      * </p>
      * <p>
      * When checking whether you have a permission you should use {@link
@@ -343,18 +344,30 @@
      * can be useful if the way your app uses the data guarded by the permissions
      * changes significantly.
      * </p>
+     * <p>
+     * You cannot request a permission if your activity sets {@link
+     * android.R.attr#noHistory noHistory} to <code>true</code> in the manifest
+     * because in this case the activity would not receive result callbacks including
+     * {@link OnRequestPermissionsResultCallback#onRequestPermissionsResult(int, String[], int[])}.
+     * </p>
+     * <p>
+     * The <a href="http://developer.android.com/samples/RuntimePermissions/index.html">
+     * RuntimePermissions</a> sample app demonstrates how to use this method to
+     * request permissions at run time.
+     * </p>
      *
      * @param activity The target activity.
-     * @param permissions The requested permissions.
+     * @param permissions The requested permissions. Must me non-null and not empty.
      * @param requestCode Application specific request code to match with a result
-     *    reported to {@link OnRequestPermissionsResultCallback#onRequestPermissionsResult(
-     *    int, String[], int[])}.
+     *    reported to {@link OnRequestPermissionsResultCallback#onRequestPermissionsResult(int, String[], int[])}.
+     *    Should be >= 0.
      *
+     * @see OnRequestPermissionsResultCallback#onRequestPermissionsResult(int, String[], int[])
      * @see #checkSelfPermission(android.content.Context, String)
      * @see #shouldShowRequestPermissionRationale(android.app.Activity, String)
      */
     public static void requestPermissions(final @NonNull Activity activity,
-            final @NonNull String[] permissions, final int requestCode) {
+            final @NonNull String[] permissions, final @IntRange(from = 0) int requestCode) {
         if (Build.VERSION.SDK_INT >= 23) {
             ActivityCompatApi23.requestPermissions(activity, permissions, requestCode);
         } else if (activity instanceof OnRequestPermissionsResultCallback) {
diff --git a/design/src/android/support/design/widget/TextInputLayout.java b/design/src/android/support/design/widget/TextInputLayout.java
index 40adf2d..3355956 100644
--- a/design/src/android/support/design/widget/TextInputLayout.java
+++ b/design/src/android/support/design/widget/TextInputLayout.java
@@ -93,6 +93,12 @@
  *
  * &lt;/android.support.design.widget.TextInputLayout&gt;
  * </pre>
+ *
+ * <p><strong>Note:</strong> The actual view hierarchy present under TextInputLayout is
+ * <strong>NOT</strong> guaranteed to match the view hierarchy as written in XML. As a result,
+ * calls to getParent() on children of the TextInputLayout -- such as an TextInputEditText --
+ * may not return the TextInputLayout itself, but rather an intermediate View. If you need
+ * to access a View directly, set an {@code android:id} and use {@link View#findViewById(int)}.
  */
 public class TextInputLayout extends LinearLayout {