Details
-
Type:
Story
-
Status: Closed
-
Priority:
Medium
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: Release 9.3.0
-
Component/s: Android
-
Labels:
-
Epic Link:
-
Sprint:2020 Sprint 19, 2020 Sprint 20, 2020 Sprint 21, 2020 Sprint 22
Description
Summary:
Android 11 requires developers to add a new <query/> entries into the "AndroidManifest.xml" for all intents passed to the Java resolveActivity() and queryIntentActivities() methods or else they will return false or an empty collection respectively.
https://developer.android.com/preview/privacy/package-visibility
https://developer.android.com/preview/privacy/package-visibility-use-cases#open-a-file
Google lists which Java APIs are not affected below. The startActivity() and startActivityForResult() methods are not impacted. Intents referencing their own app are fine too.
https://developer.android.com/preview/privacy/package-visibility#use-cases-not-affected
Impact:
The following Titanium methods are impacted by this:
To-Do:
- Our openURL() method should not call the Java resolveActivity() anymore so that it won't require the <query/> block. However, our canOpenURL() should continue to use it and we'll need to document the need for this. (Note that iOS requires a "LSApplicationQueriesSchemes" plist setting for this method as well for the same reasons.)
- Ideally, our build system should auto-inject the <query/> block needed if the app's code contains a createEmailDialog() method call.
The canOpenURL() and openURL() methods should log an error if a <query/> entry is needed.
Test:
The below PR has test code for canOpenURL() and openURL() which tests several different URLs.
https://github.com/appcelerator/titanium_mobile/pull/10881
Attachments
Issue Links
- blocks
-
TIMOB-28182 Android: Only add WRITE_EXTERNAL_STORAGE permission when needed
-
- Closed
-