Skip to content

Conversation

jewelshkjony
Copy link
Contributor

@jewelshkjony jewelshkjony commented Aug 22, 2025

General items:

If your code changes how something works on the device (i.e., it affects the companion):

  • I branched from ucr
  • My pull request has ucr as the base

Further, if you've changed the blocks language or another user-facing designer/blocks API (added a SimpleProperty, etc.):

  • I have updated the corresponding version number in appinventor/components/src/.../common/YaVersion.java
  • I have updated the corresponding upgrader in appinventor/appengine/src/.../client/youngandroid/YoungAndroidFormUpgrader.java (components only)
  • I have updated the corresponding entries in appinventor/blocklyeditor/src/versioning.js

For all other changes:

  • I branched from master
  • My pull request has master as the base

What does this PR accomplish?

Added the ability to declare <uses-feature> element in AndroidManifest.xml.

Example usage # .

@UsesFeatures(features = {
  @FeatureElement(name = "android.hardware.bluetooth", required = false),
  @FeatureElement(name = "android.hardware.wifi", required = true),
  @FeatureElement(name = "android.hardware.camera", required = false)
})

Resolves # .

@AppInventorWorkerBee
Copy link
Collaborator

Can one of the admins verify this patch?

1 similar comment
@AppInventorWorkerBee
Copy link
Collaborator

Can one of the admins verify this patch?

@jewelshkjony jewelshkjony marked this pull request as ready for review August 22, 2025 19:10
@jewelshkjony
Copy link
Contributor Author

@AppInventorWorkerBee ok to test

@ewpatton
Copy link
Member

@AppInventorWorkerBee ok to test

- If a duplicate is found, it only takes the required one.
@jewelshkjony
Copy link
Contributor Author

I tested with a dummy extension that has duplicate @UsesFeatures. And now it is successfully resolving duplicates by taking only the required one.

image

@jewelshkjony jewelshkjony requested a review from ewpatton August 28, 2025 13:42
@jisqyv jisqyv added the on ai2-test Code is deployed on ai2-test.appinventor.mit.edu label Sep 16, 2025
Copy link
Member

@ewpatton ewpatton left a comment

Choose a reason for hiding this comment

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

One minor change, otherwise LGTM.

@ewpatton
Copy link
Member

I had another thought, and this would be a breaking change so we may want it as a separate PR... but we may want to add the @UsesFeatures annotations to the appropriate core components and remove the code that unconditionally adds them in the CreateManifest build task. For example, an app that does drawing on a canvas won't need to declare Bluetooth as a feature but currently it does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants