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:
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user