diff options
| author | Jayant Chowdhary <jchowdhary@google.com> | 2020-03-16 23:59:37 -0700 |
|---|---|---|
| committer | Michael Bestas <mkbestas@lineageos.org> | 2020-05-23 19:41:09 +0300 |
| commit | 6a6983dee4ef807a92aa03e8dc25908da371366a (patch) | |
| tree | a6bd7701ee00cffe1980855538270508aa02a4a2 | |
| parent | acc37c52e52eb2b9b7193c2950cbc7fde32273d5 (diff) | |
| download | android_packages_apps_Camera2-lineage-17.1.tar.gz android_packages_apps_Camera2-lineage-17.1.tar.bz2 android_packages_apps_Camera2-lineage-17.1.zip | |
Camera2: Fix crash when app requesting intent has requested no permisions.lineage-17.1
Bug: 151290980
Test: Modify CtsVerifier app to request no permissions -> run intent test.
Without the change the app crashes.
With the change, the app can take a picture successfully.
Merged-In: Ib856174cf4815a8c50b9a3b5ab5caae4e7213b66
Change-Id: Ib856174cf4815a8c50b9a3b5ab5caae4e7213b66
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
(cherry picked from commit c8c0e25de22f7b81425b9ffe87ba42d319a5ba45)
| -rw-r--r-- | src/com/android/camera/CameraActivity.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java index cf88f920c..af64c1091 100644 --- a/src/com/android/camera/CameraActivity.java +++ b/src/com/android/camera/CameraActivity.java @@ -1771,6 +1771,10 @@ public class CameraActivity extends QuickActivity Log.w(TAG, "Unable to get PackageInfo for callingPackage " + callingPackage); } if (packageInfo != null) { + if (packageInfo.requestedPermissions == null) { + // No-permissions at all, were requested by the calling app. + return true; + } for (int i = 0; i < packageInfo.requestedPermissions.length; i++) { if (packageInfo.requestedPermissions[i].equals( Manifest.permission.ACCESS_FINE_LOCATION) && |
