Fixed
Status Update
Comments
je...@google.com <je...@google.com>
au...@google.com <au...@google.com>
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 785c136235bc035327d9d4acb8a75988d44e54b5
Author: Jeremy Woods <jbwoods@google.com>
Date: Fri May 08 13:37:56 2020
Add permissions validation for requestPermissions
Currently in ActivityCompat requestPermissions() it is possible to pass
in empty or null permissions. This fails deeper in the stack, and the
cause is unclear. We should do some validation up front and fail early
if needed.
Test: Added ActivityCompatTest
Bug: 122163323
Change-Id: I372cca80d7c0394f4478847ae122acbc29bbb697
M core/core/src/androidTest/java/androidx/core/app/ActivityCompatTest.java
M core/core/src/main/java/androidx/core/app/ActivityCompat.java
https://android-review.googlesource.com/1306698
Branch: androidx-master-dev
commit 785c136235bc035327d9d4acb8a75988d44e54b5
Author: Jeremy Woods <jbwoods@google.com>
Date: Fri May 08 13:37:56 2020
Add permissions validation for requestPermissions
Currently in ActivityCompat requestPermissions() it is possible to pass
in empty or null permissions. This fails deeper in the stack, and the
cause is unclear. We should do some validation up front and fail early
if needed.
Test: Added ActivityCompatTest
Bug: 122163323
Change-Id: I372cca80d7c0394f4478847ae122acbc29bbb697
M core/core/src/androidTest/java/androidx/core/app/ActivityCompatTest.java
M core/core/src/main/java/androidx/core/app/ActivityCompat.java
jb...@google.com <jb...@google.com> #3
This has been updated internally and will be available in the Core 1.4.0-alpha01 release.
Description
Version used: 1.0.1
Devices/Android versions reproduced on: n/a
Right now, AFAICT, ActivityCompat.requestPermissions() performs no validation on the parameters. Ideally, it would at least check the String[] of permissions to confirm that the elements are sane (i.e., not null, not empty).
Otherwise, failures happen deep in the system. For example, if you pass null in one of the array elements, the eventual NullPointerException actually occurs in com.android.packageinstaller.permission.ui.GrantPermissionsActivity. See
Thanks for considering this!