Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-28050

Android: Investigate "package visibility" handling on Android 11

    Details

      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

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                jquick Joshua Quick
                Reviewer:
                Gary Mathews
                Tester:
                Samir Mohammed
              • Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration