Skip to content

Add missing XML documentation for android.hardware.camera #2889

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

IeuanWalker
Copy link

Copy link
Contributor

@adegeo adegeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of ordering them in the same way, but the XML comment isn't easily visible when reading the article. Restoring the XML comment above the setting helps readability. Maybe even adding a blank line in there between items.

Perhaps match the ordering in the block at the top of the article?

I also noticed that the linked issue doesn't seem to match what you're changing? In that you talk about the camera?

@IeuanWalker
Copy link
Author

@adegeo no prob, will take a look tomorrow.

The linked issue is about these 2 lines being missing, which have been added -
image

@IeuanWalker
Copy link
Author

I like the idea of ordering them in the same way, but the XML comment isn't easily visible when reading the article. Restoring the XML comment above the setting helps readability. Maybe even adding a blank line in there between items.

The block at the top of the article also be set to match.

I also noticed that the linked issue doesn't seem to match what you're changing? In that you talk about the camera?

@adegeo I've moved the comments back above each option.


I haven't added "a blank line in there between items", because currently the blank lines indicate the permission for the different features -
image

Not sure what you meant by "The block at the top of the article also be set to match"

@adegeo
Copy link
Contributor

adegeo commented May 9, 2025

Wow, I don't know how I ended up wording that sentence in that way. I think I spliced two sentences together while editing and didn't realize how awful it sounded. HA!

I edited my comment to fix the grammar. I was referencing the ordering in the article above where the change was made, that ordering could match the ordering in the xml:

image

EDIT:
After looking a bit more at this, and the published versions (original vs updated) I don't think I like this change because it makes it unclear what's required specifically for the picker. Sure, in your actual app you may want to structure the XML better than this sample, but this sample is really tuned to show that:

  • READ and WRITE are required for Android 12
  • The individual items are required for Android 13.

Having them all listed as the original version did, makes that clear.

@IeuanWalker
Copy link
Author

IeuanWalker commented May 16, 2025

But in that case shouldnt both assembly and manifest versions be laid out in the same way.

image

Personally i think the assembly is more clearly laid out compared to the manifest version, especially if your only using part of the feature and don't need all the permissions etc.

So this PR just updates the manifest to match the assembly version, and adds the missing XML, i.e. -

  <!-- Add these properties if you would like to filter out devices that do not have cameras, or set to false to make them optional -->
  <uses-feature android:name="android.hardware.camera" android:required="true"/>
  <uses-feature android:name="android.hardware.camera.autofocus" android:required="true"/>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants