Bug 1323759 - To ensure distribution is initialized
The referrer intent INSTALL_REFERRER comes after Fennec been installed.
On Android 5+ we might receive the referrer intent and never actually
launch the browser. Attempt to init here to handle that case.
MozReview-Commit-ID: 6kDeqnNT2pS
--- a/mobile/android/base/java/org/mozilla/gecko/distribution/Distribution.java
+++ b/mobile/android/base/java/org/mozilla/gecko/distribution/Distribution.java
@@ -292,16 +292,24 @@ public class Distribution {
ThreadUtils.postToBackgroundThread(new Runnable() {
@Override
public void run() {
final Distribution distribution = Distribution.getInstance(context);
// This will bail if we aren't delayed, or we already have a distribution.
distribution.processDelayedReferrer(ref);
+
+ // On Android 5+ we might receive the referrer intent
+ // and never actually launch the browser, which is the usual signal
+ // for the distribution init process to complete.
+ // Attempt to init here to handle that case.
+ // Profile setup that relies on the distribution will occur
+ // when the browser is eventually launched, via `addOnDistributionReadyCallback`.
+ distribution.doInit();
}
});
}
/**
* Handle a referrer intent that arrives after first use of the distribution.
*/
private void processDelayedReferrer(final ReferrerDescriptor ref) {