Prevent certain actions of app has revoked permissions
bug:21808294
Change-Id: I7214c1fe47c15fe185423a54a74b58caf8d82daa
diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java
index 5190037..83d6cb0 100644
--- a/core/java/android/content/Intent.java
+++ b/core/java/android/content/Intent.java
@@ -1020,6 +1020,11 @@
* <p>Note: this Intent <strong>cannot</strong> be used to call emergency
* numbers. Applications can <strong>dial</strong> emergency numbers using
* {@link #ACTION_DIAL}, however.
+ *
+ * <p>Note: if you app targets {@link android.os.Build.VERSION_CODES#MNC MNC}
+ * and above and declares as using the {@link android.Manifest.permission#CALL_PHONE}
+ * permission which is not granted, then atempting to use this action will
+ * result in a {@link java.lang.SecurityException}.
*/
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
public static final String ACTION_CALL = "android.intent.action.CALL";
diff --git a/core/java/android/provider/MediaStore.java b/core/java/android/provider/MediaStore.java
index 51dbdee..e63fb04 100644
--- a/core/java/android/provider/MediaStore.java
+++ b/core/java/android/provider/MediaStore.java
@@ -283,7 +283,13 @@
* supply the uri through the EXTRA_OUTPUT field for compatibility with old applications.
* If you don't set a ClipData, it will be copied there for you when calling
* {@link Context#startActivity(Intent)}.
- * @see #EXTRA_OUTPUT
+ *
+ * <p>Note: if you app targets {@link android.os.Build.VERSION_CODES#MNC MNC} and above
+ * and declares as using the {@link android.Manifest.permission#CAMERA} permission which
+ * is not granted, then atempting to use this action will result in a {@link
+ * java.lang.SecurityException}.
+ *
+ * @see #EXTRA_OUTPUT
*/
@SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
public final static String ACTION_IMAGE_CAPTURE = "android.media.action.IMAGE_CAPTURE";
@@ -331,6 +337,12 @@
* supply the uri through the EXTRA_OUTPUT field for compatibility with old applications.
* If you don't set a ClipData, it will be copied there for you when calling
* {@link Context#startActivity(Intent)}.
+ *
+ * <p>Note: if you app targets {@link android.os.Build.VERSION_CODES#MNC MNC} and above
+ * and declares as using the {@link android.Manifest.permission#CAMERA} permission which
+ * is not granted, then atempting to use this action will result in a {@link
+ * java.lang.SecurityException}.
+ *
* @see #EXTRA_OUTPUT
* @see #EXTRA_VIDEO_QUALITY
* @see #EXTRA_SIZE_LIMIT