mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1105590 - Wait for distribution intent to arrive. r=mfinkle
This commit is contained in:
parent
2bbd5309a6
commit
2514ee07ae
@ -104,6 +104,8 @@ public class Distribution {
|
||||
// Corresponds to the high value in Histograms.json.
|
||||
private static final long MAX_DOWNLOAD_TIME_MSEC = 40000; // 40 seconds.
|
||||
|
||||
// Wait just a little while for the system to send a referrer intent after install.
|
||||
private static final long DELAY_WAIT_FOR_REFERRER_MSEC = 400;
|
||||
|
||||
|
||||
/**
|
||||
@ -385,7 +387,16 @@ public class Distribution {
|
||||
*/
|
||||
private boolean checkIntentDistribution() {
|
||||
if (referrer == null) {
|
||||
return false;
|
||||
// Wait a predetermined time and try again.
|
||||
// Just block the thread, because it's the simplest solution.
|
||||
try {
|
||||
Thread.sleep(DELAY_WAIT_FOR_REFERRER_MSEC);
|
||||
} catch (InterruptedException e) {
|
||||
// Good enough.
|
||||
}
|
||||
if (referrer == null) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
URI uri = getReferredDistribution(referrer);
|
||||
|
Loading…
Reference in New Issue
Block a user