commit | 5c4c4b35754eef319dcd69c422f0b1ac0c823f6e | [log] [tgz] |
---|---|---|
author | Shuzhen Wang <shuzhenwang@google.com> | Fri Oct 27 16:08:05 2023 -0700 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Nov 10 18:30:37 2023 +0000 |
tree | 042a1484342bfedcf4a0951d90e06b9b0ad9df6c | |
parent | 7b81661a5c5a0e36e90cc70447f633d8fe3fb4d4 [diff] |
Camera2: Do not pass location info for startActivity case If the Camera2 activity is started by startActivity, we shouldn't unconditionally grant location. Test: Use Camera2 app both independently and with INTENT Bug: 285142084 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3c097bb0e516b1d071f00ac99a8f29f4a72579ff) Merged-In: I3b78840f9b0fefeadea44150ea319886f06c1485 Change-Id: I3b78840f9b0fefeadea44150ea319886f06c1485
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java index 82b0953..701d86d 100644 --- a/src/com/android/camera/CameraActivity.java +++ b/src/com/android/camera/CameraActivity.java
@@ -1735,8 +1735,12 @@ private boolean shouldUseNoOpLocation () { String callingPackage = getCallingPackage(); if (callingPackage == null) { - // Activity not started through startActivityForResult. - return false; + if (isCaptureIntent()) { + // Activity not started through startActivityForResult. + return true; + } else { + callingPackage = mAppContext.getPackageName(); + } } PackageInfo packageInfo = null; try {