Closed Bug 1220773 Opened 9 years ago Closed 8 years ago

Expose Android getInstallerPackageName within Fennec

Categories

(Firefox for Android Graveyard :: General, defect, P1)

All
Android
defect

Tracking

(firefox45 affected, firefox50 fixed)

RESOLVED FIXED
Firefox 50
Tracking Status
firefox45 --- affected
firefox50 --- fixed

People

(Reporter: rnewman, Assigned: sebastian)

References

Details

(Whiteboard: [MobileAS])

Attachments

(1 file)

PackageManager.getInstallerPackageName returns the package that installed us. We can use this to determine if we were sideloaded or installed via Play (or Amazon, or F-Droid, or…).

This will allow us to tailor our updater behavior, amongst other things.

Things to check:

* Do we always get a package name on all Android versions?
* What happens when we're preinstalled but expect to be updated via Play?
* Does the package change each time an APK is installed? For example, is it null for the preinstall, then change to com.android.vending after the first Play update?
* Can it change back to null if a user sideloads after installing via Play?

We might consider exposing this value literally to Balrog in update checks.
Summary: Expose Android install location within Fennec → Expose Android getInstallerPackageName within Fennec
Blocks: 1221646
Blocks: 1223534
Blocks: 1226206
I wonder if we could use Telemetry to get an idea of what getInstallerPackageName() returns for devices in the wild. Is this feasible?

(In reply to Richard Newman [:rnewman] from comment #0)
> We might consider exposing this value literally to Balrog in update checks.

Could we use this to get the same statistics?
(In reply to Sebastian Kaspari (:sebastian) from comment #1)
> I wonder if we could use Telemetry to get an idea of what
> getInstallerPackageName() returns for devices in the wild. Is this feasible?

Seems like rnewman already filed this: bug 1221646
Assignee: nobody → s.kaspari
Status: NEW → ASSIGNED
I still need to test this extensively (I'll probably have to fake some of the data) but I already share the patch to get your feedback.
Attachment #8774689 - Flags: review?(esawin) → review+
Comment on attachment 8774689 [details]
Bug 1220773 - Do not run our updater if app was installed from Google Play.

https://reviewboard.mozilla.org/r/67134/#review63964

::: mobile/android/base/java/org/mozilla/gecko/updater/UpdateServiceHelper.java:135
(Diff revision 1)
>              Log.e(LOGTAG, "Failed to create update url: ", e);
>              return null;
>          }
>      }
>  
> -    public static boolean isUpdaterEnabled() {
> +    public static boolean isUpdaterEnabled(Context context) {

Can be final.
Depends on: 1289384
Depends on: 1289495
Comment on attachment 8774689 [details]
Bug 1220773 - Do not run our updater if app was installed from Google Play.

https://reviewboard.mozilla.org/r/67134/#review64120
Attachment #8774689 - Flags: review?(ahunt) → review+
Comment on attachment 8774689 [details]
Bug 1220773 - Do not run our updater if app was installed from Google Play.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/67134/diff/1-2/
Pushed by s.kaspari@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/64c473c3414f
Do not run our updater if app was installed from Google Play. r=ahunt,esawin
https://hg.mozilla.org/mozilla-central/rev/64c473c3414f
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 50
Whiteboard: [MobileAS s1.1]
Priority: -- → P1
Whiteboard: [MobileAS s1.1] → [MobileAS]
Iteration: --- → 1.1
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: