Do not quit on cleanup configuration failure
Cleanup is used for some options like --show-touches to restore the state on exit. If the configuration fails, do not crash the whole process. Just log an error. PR #2802 <https://github.com/Genymobile/scrcpy/pull/2802>
This commit is contained in:
parent
411bb0d18e
commit
c29a0bf675
1 changed files with 6 additions and 2 deletions
|
@ -17,7 +17,7 @@ public final class Server {
|
||||||
// not instantiable
|
// not instantiable
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void initAndCleanUp(Options options) throws IOException {
|
private static void initAndCleanUp(Options options) {
|
||||||
boolean mustDisableShowTouchesOnCleanUp = false;
|
boolean mustDisableShowTouchesOnCleanUp = false;
|
||||||
int restoreStayOn = -1;
|
int restoreStayOn = -1;
|
||||||
if (options.getShowTouches() || options.getStayAwake()) {
|
if (options.getShowTouches() || options.getStayAwake()) {
|
||||||
|
@ -51,7 +51,11 @@ public final class Server {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CleanUp.configure(options.getDisplayId(), restoreStayOn, mustDisableShowTouchesOnCleanUp, true, options.getPowerOffScreenOnClose());
|
try {
|
||||||
|
CleanUp.configure(options.getDisplayId(), restoreStayOn, mustDisableShowTouchesOnCleanUp, true, options.getPowerOffScreenOnClose());
|
||||||
|
} catch (IOException e) {
|
||||||
|
Ln.e("Could not configure cleanup", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void scrcpy(Options options) throws IOException {
|
private static void scrcpy(Options options) throws IOException {
|
||||||
|
|
Loading…
Reference in a new issue