New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 716285 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Long OOO (go/where-is-mgiuca)
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

navigator.getInstalledRelatedApps should use Android app ID, not package name, to match native apps

Project Member Reported by mgiuca@chromium.org, Apr 28 2017

Issue description

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

Contradictory (and, I believe, wrong):
https://developer.android.com/guide/topics/manifest/manifest-element.html#package

"""
Caution: Once you publish your application, you cannot change the package name. The package name defines your application's identity, so if you change it, then it is considered to be a different application and users of the previous version cannot update to the new version.
"""

Wrong because if you change your package name but NOT the app id, it is considered to be the *same* application and you *can* update to a new version. Only the app id matters. Conversely, if you change the app id but not the package name, it is considered a different application, and has to have a different entry in the Play Store.

#absolutemadness
Components: UI>Browser>WebAppInstalls

Sign in to add a comment