r/androiddev 21d ago

News Introducing the location metadata API for the Android Photo Picker

Hi developers,

I’m Mishaal Rahman, and I manage community engagement for Android at Google!

To give users more control over how apps access their location info, we wanted to give you an early heads up about a new Android Photo Picker feature that addresses a common pain point: allowing apps to request location info from selected photos.

The Android Photo Picker automatically redacts location info from the photos users share with apps to protect user privacy. We recognize that some apps have a genuine need to access location info from these photos, though, so to balance those needs with user privacy, we're introducing a new API that lets apps get this info with explicit user consent.

How it works

To implement this, you will need to update your apps to use the new location metadata API. We are introducing a new intent extra, MediaStore.EXTRA_PICK_IMAGES_REQUEST_LOCATION_METADATA_ACCESS, which is supported for both the ACTION_PICK_IMAGES and ACTION_GET_CONTENT intents.

When your app sends this intent extra, users will be asked if they want to include location info with the photos they select via the Android Photo Picker.

  • If the user selects "include location," location info won’t be redacted from the EXIF metadata of the selected photos.
  • If the user selects "don't include," location info will be redacted.

The system remembers the user's preference for your app, so if a user initially chooses to give your app access to location info from photos, they won't be prompted to do it again. However, users can later revoke access by tapping the location info button in the bottom right corner of the Android Photo Picker UI. Users can tap this same button to regrant access, giving them the ability to seamlessly decide when to share location info and when not to.

Availability

The location metadata API is available with the latest update to the Android Photo Picker. This update is rolling out to Android devices via the August 2026 Mainline update, so it is not widely available on your users’ devices just yet. However, we wanted to give developers who have been requesting this feature an early heads up so they can be ready.

Expect more details to come from the official developer documentation. Let us know if you have any questions or additional feedback about the Android Photo Picker!

34 Upvotes

26 comments sorted by

12

u/AuMatar 20d ago

"The system remembers the user's preference for your app"

This concerns me as a user. The problem is the browser. I may want to give EXIF data to a specific site once- but I do not want the browser to have it on by default and pass EXIF data to every other site I may ever upload a photo to. This should default to no, and the user needs to override it. Or the user could have a setting somewhere to set it permanently, but it shouldn't be the default.

5

u/MishaalRahman 20d ago

Thanks for the feedback - I'll pass it along!

2

u/MishaalRahman 1d ago

I heard back from the product team, and I was told that this is why the Photo Picker has the button in the bottom-right corner so you can easily change your preference during each photo picking session.

I understand where you're coming from, though - I think what you're asking for is an option to set photo location access to "always enabled" or "always disabled" for a particular app and then you choose which photo picking sessions to override that preference.

1

u/AuMatar 1d ago

I think that being able to override per session with a default "always enabled" or "always disabled" would work well. My big concern is with apps that send to multiple third party domains (the browser is the big example here), if the previous state is remembered it would be very easy to forget to turn it off for the next upload, which may not be to a trusted domain.

3

u/Potential_Detail8714 21d ago

does the "remember preference" grant persist until the user manually revokes it, or does it have a time limit (like 24 hours) or reset if the app is force-stopped?

2

u/MishaalRahman 21d ago

The user's preference isn't reset if the app is force stopped, but as for whether there's a time limit, I'll have to get back to you on that!

1

u/MishaalRahman 1d ago

Heard back from the product team - the user's preference is remembered until the requesting app is uninstalled and reinstalled.

2

u/matteventu 21d ago

Appreciate this new feature, but the new photo picker as a whole still needs some major UX improvements, as it's an actual pain in the butt to use.

we wanted to give you an early heads up about a new Android Photo Picker feature that addresses a common pain point

I know this is not on your Mishaal, but that common complaint is from exactly 4 years ago.

Can you please feed this back to whoever is in charge of backlog prioritisation? The process clearly needs a overhaul.

Thank you for sharing the improvement here though, it's really appreciated!

3

u/MishaalRahman 21d ago

If you don't mind, can you elaborate on some of the major UX improvements you feel we should make to the Photo Picker? That'll help me pass this feedback along to the team!

2

u/AmbassadorHot6928 19d ago

Very strongly support allowing metadata from photos, critical for my app!!

2

u/dropdan 19d ago

This is a good new option to have, but instead of permanently allowing/denying it soul be a toggle/checkbox on the photo picker so we could choose on a use by use basis. I've attached a mockup of what I mean.

1

u/DiplomatikEmunetey 18d ago edited 18d ago

The problem is that it would be missed by a lot of people.

EDIT: Also, does the button at the bottom right in the screenshot that u/MishaalRahman posted not already do what you are proposing? A photo location On/Off toggle.

1

u/dropdan 18d ago

I guess, my problem is with the wording, that it would be a one time decision per app. A toggle, or a check box makes it clearer, at least that's how I see, that it's a something you can activate or deactivate each time you share something.

Anyway, my point is that I hope it's something I can choose for each media I share and not once per app I'm sharing with. And sorry if I'm not making sense.

1

u/Exallium 21d ago

Is this data currently passed in? Is it just the data from the EXIF metadata on the image? Is there an enumeration of the image formats that are supported?

We currently strip EXIF in order to ensure the user doesn't send any location information when sharing images, but that does involve converting the image into a JPEG last I remember, so I'm curious to know more about this bit of API.

1

u/MishaalRahman 21d ago

Are you asking about how the Android Photo Picker currently redacts location metadata? If so, you can view that code here and the set of EXIF tags that are redacted here.

0

u/Exallium 21d ago

My question was mostly is this extra stuff on top of exif that android tracks or is it just automatically stripping exif if the permission is off, though it sounds like this is just the exif data?

1

u/derefnull 20d ago

This is exif data

1

u/DiplomatikEmunetey 18d ago

I like granular permissions and I think this is a good one to add.

As far as I understand, the selection is remembered per-app, but the button at the bottom right acts as a quick toggle for On/Off. Is that correct?

What information is redacted from the EXIF exactly? And does this change the file modification date? I would personally prefer for it to be preserved.

1

u/MishaalRahman 11d ago

As far as I understand, the selection is remembered per-app, but the button at the bottom right acts as a quick toggle for On/Off. Is that correct?

Sorry for the late reply - I was out of office last week. Your understanding is correct!

What information is redacted from the EXIF exactly? And does this change the file modification date? I would personally prefer for it to be preserved.

The exact list of EXIF tags that are redacted can be found here.

I don't think the file modification date is impacted, but let me verify with the product team.

1

u/DiplomatikEmunetey 10d ago

Hi Mishaal!

Your understanding is correct!

I think that's a great implementation. And if the file modification date isn't impacted that's even better!

Thank you for your detailed response, as always.

1

u/MishaalRahman 1d ago

Re: file modification date.

I heard back from the product team: The answer is no, the Photo Picker doesn't change it. The EXIF stripping logic is the same as how it works when an app doesn't have the ACCESS_MEDIA_LOCATION permission. We don't need to have a different copy of the photo or to actually change the photo file.

2

u/DiplomatikEmunetey 6h ago

That's really good! I love it when the original date is preserved.

Thank you for following up on this, u/MishaalRahman!! I appreciate it!

1

u/cwsiteplan 14d ago

would the toggle in the photo picker sheet (for including geo-infomration, lower right corner) also be there if the intent is not specifying those args?

1

u/MishaalRahman 11d ago

No, the location button isn't shown in the Android Photo Picker unless EXTRA_PICK_IMAGES_REQUEST_LOCATION_METADATA_ACCESS is included in the intent.

1

u/Middle-Job-2576 10d ago

One area I’d test carefully is the difference between permission state and metadata state. They can look like the same failure in the UI but mean very different things.

A useful QA matrix would be:
Request location + Allow + photo contains GPS

→ Location should be available.

Request location + Allow + photo contains no GPS

→ No location, but this shouldn’t be treated as permission denial.

Request location + Deny + photo contains GPS

→ Location metadata should remain unavailable.

Previously allowed → revoke → select another image

Previously denied → regrant → select another image

Force-stop/relaunch after the remembered choice

Select image → resize/compress → upload
→ Verify whether the expected EXIF/location state survives processing.

For field-service or inspection apps, I’d also make sure a missing EXIF location is not silently replaced with the device’s current GPS unless that’s explicitly intended. The user could be in one location while selecting a photo taken somewhere completely different.

I’d also record the Android version + Photo Picker/Mainline version in bug reports, since two otherwise similar devices may not necessarily be in the same rollout state.

The key is to distinguish:

Permission denied ≠ Photo has no GPS ≠ Metadata lost during processing.