Skip to content

Commit

Permalink
Merge pull request #1002 from ubports/timeout
Browse files Browse the repository at this point in the history
Timeout wait steps
  • Loading branch information
NeoTheThird authored Nov 6, 2019
2 parents 2f353aa + d416a31 commit 6cad2b9
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"jquery-i18next": "^1.2.0",
"mkdirp": "^0.5.1",
"popper.js": "^1.16.0",
"promise-android-tools": "^1.0.9",
"promise-android-tools": "^1.0.10",
"ps-tree": "^1.2.0",
"request": "^2.79.0",
"system-image-node-module": "^1.0.10",
Expand Down
47 changes: 46 additions & 1 deletion src/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,52 @@ function installStep(step) {
global.mainEvent.emit(
"user:action",
global.installConfig.user_actions[step.action],
resolve
() => {
switch (step.action) {
case "recovery":
case "system":
global.mainEvent.emit("user:write:working", "particles");
global.mainEvent.emit(
"user:write:status",
"Waiting for device",
true
);
global.mainEvent.emit(
"user:write:under",
"Adb is scanning for devices"
);
function adbWait() {
return adb
.waitForDevice()
.catch(() =>
mainEvent.emit("user:connection-lost", adbWait)
);
}
return adbWait();
case "bootloader":
global.mainEvent.emit("user:write:working", "particles");
global.mainEvent.emit(
"user:write:status",
"Waiting for device",
true
);
global.mainEvent.emit(
"user:write:under",
"Fastboot is scanning for devices"
);
function fastbootWait() {
return fastboot
.waitForDevice()
.catch(() =>
mainEvent.emit("user:connection-lost", fastbootWait)
);
}
return fastbootWait();
default:
resolve();
break;
}
}
);
});
default:
Expand Down

0 comments on commit 6cad2b9

Please sign in to comment.