summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSvet Ganov <svetoslavganov@google.com>2015-07-03 16:03:53 -0700
committerSvet Ganov <svetoslavganov@google.com>2015-07-03 16:04:00 -0700
commit255aece7def117c825b928f87da4cfd2d0975f0a (patch)
treee8582b84778449403c5c0e30d187d042ed1f1c86
parenta7bdb6c99b7ddb6e17f9c939c138686e0bfdbbc4 (diff)
downloadframeworks_base-255aece7def117c825b928f87da4cfd2d0975f0a.zip
frameworks_base-255aece7def117c825b928f87da4cfd2d0975f0a.tar.gz
frameworks_base-255aece7def117c825b928f87da4cfd2d0975f0a.tar.bz2
Improve request permission docs
bug:22252258 Change-Id: Ife19eb6b1e17b43a824379d2a039ff1c441bebdd
-rw-r--r--core/java/android/app/Activity.java7
-rw-r--r--core/java/android/app/Fragment.java7
2 files changed, 14 insertions, 0 deletions
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 9c2e208..d07238a 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -3723,6 +3723,12 @@ public class Activity extends ContextThemeWrapper
* #checkSelfPermission(String)}.
* </p>
* <p>
+ * You cannot request a permission if your activity sets {@link
+ * android.R.styleable#AndroidManifestActivity_noHistory noHistory} to
+ * <code>true</code> because in this case the activity would not receive
+ * result callbacks including {@link #onRequestPermissionsResult(int, String[], int[])}.
+ * </p>
+ * <p>
* A sample permissions request looks like this:
* </p>
* <code><pre><p>
@@ -3749,6 +3755,7 @@ public class Activity extends ContextThemeWrapper
* @param permissions The requested permissions.
* @param requestCode Application specific request code to match with a result
* reported to {@link #onRequestPermissionsResult(int, String[], int[])}.
+ * Should be >= 0.
*
* @see #onRequestPermissionsResult(int, String[], int[])
* @see #checkSelfPermission(String)
diff --git a/core/java/android/app/Fragment.java b/core/java/android/app/Fragment.java
index 95b3b8e..5490fe7 100644
--- a/core/java/android/app/Fragment.java
+++ b/core/java/android/app/Fragment.java
@@ -1166,6 +1166,12 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
* android.content.Context#checkSelfPermission(String)}.
* </p>
* <p>
+ * You cannot request a permission if your activity sets {@link
+ * android.R.styleable#AndroidManifestActivity_noHistory noHistory} to
+ * <code>true</code> because in this case the activity would not receive
+ * result callbacks including {@link #onRequestPermissionsResult(int, String[], int[])}.
+ * </p>
+ * <p>
* A sample permissions request looks like this:
* </p>
* <code><pre><p>
@@ -1192,6 +1198,7 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
* @param permissions The requested permissions.
* @param requestCode Application specific request code to match with a result
* reported to {@link #onRequestPermissionsResult(int, String[], int[])}.
+ * Should be >= 0.
*
* @see #onRequestPermissionsResult(int, String[], int[])
* @see android.content.Context#checkSelfPermission(String)