Chrome Version: 59
OS: Android
What steps will reproduce the problem?
(1) Have an Android app with application ID "com.example.x" and package name "com.example.y".
(2) Have a website with a manifest with related_applications including "com.example.x".
(3) navigator.getInstalledRelatedApps().
What is the expected result?
Returns the app com.example.x.
What happens instead?
Returns nothing.
According to this article:
https://developer.android.com/studio/build/application-id.html
there is a difference between an "application ID" and "package name", although they are almost always the same. The app ID is the source of truth name for an app; once deployed to the Play Store, the app ID can't change. Similarly, the app ID is the unique key for an app on the user's device (if you install an app with the same app ID as an existing one, it replaces that existing one, whereas you can have multiple apps with the same package name).
The package name is just a Java implementation detail (the Java class name of the top-level package).
We should match against the app ID, not package name.
I'm confused about this because the API we use to get the application info:
https://developer.android.com/reference/android/content/pm/PackageManager.html#getApplicationInfo(java.lang.String, int)
getApplicationInfo takes a package name, as if package names were unique IDs. Not sure what happens if multiple apps are installed with the same package name. Not sure how to look up an app by app ID.
#thisismadness
Comment 1 by mgiuca@chromium.org
, Apr 28 2017