Merge "Improve requestPermissions API docs and throw correct exception." into nyc-dev am: 0f3431b616

am: 8a20395156

* commit '8a203951566e6e5df730c49fb35054a851eb8834':
  Improve requestPermissions API docs and throw correct exception.
This commit is contained in:
Svetoslav Ganov
2016-02-19 04:16:19 +00:00
committed by android-build-merger
3 changed files with 3 additions and 3 deletions

View File

@@ -4100,7 +4100,7 @@ public class Activity extends ContextThemeWrapper
* }
* </code></pre></p>
*
* @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 #onRequestPermissionsResult(int, String[], int[])}.
* Should be >= 0.

View File

@@ -1203,7 +1203,7 @@ public class Fragment implements ComponentCallbacks2, OnCreateContextMenuListene
* }
* </code></pre></p>
*
* @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 #onRequestPermissionsResult(int, String[], int[])}.
* Should be >= 0.

View File

@@ -3175,7 +3175,7 @@ public abstract class PackageManager {
*/
public Intent buildRequestPermissionsIntent(@NonNull String[] permissions) {
if (ArrayUtils.isEmpty(permissions)) {
throw new NullPointerException("permission cannot be null or empty");
throw new IllegalArgumentException("permission cannot be null or empty");
}
Intent intent = new Intent(ACTION_REQUEST_PERMISSIONS);
intent.putExtra(EXTRA_REQUEST_PERMISSIONS_NAMES, permissions);