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 {