Skip to content

Commit

Permalink
Send a response to the caller in some failure cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Niels Becker committed Oct 18, 2024
1 parent ff16cf4 commit 12ecada
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/src/main/java/net/christianbeier/droidvnc_ng/MainService.java
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,10 @@ public int onStartCommand(Intent intent, int flags, int startId)
}).start();
} else {
stopSelfByUs();
Intent answer = new Intent(ACTION_CONNECT_REVERSE);
answer.putExtra(EXTRA_REQUEST_ID, intent.getStringExtra(EXTRA_REQUEST_ID));
answer.putExtra(EXTRA_REQUEST_SUCCESS, false);
sendBroadcastToOthersAndUs(answer);
}

return START_NOT_STICKY;
Expand Down Expand Up @@ -455,6 +459,10 @@ public int onStartCommand(Intent intent, int flags, int startId)
}).start();
} else {
stopSelfByUs();
Intent answer = new Intent(ACTION_CONNECT_REPEATER);
answer.putExtra(EXTRA_REQUEST_ID, intent.getStringExtra(EXTRA_REQUEST_ID));
answer.putExtra(EXTRA_REQUEST_SUCCESS, false);
sendBroadcastToOthersAndUs(answer);
}

return START_NOT_STICKY;
Expand All @@ -464,6 +472,10 @@ public int onStartCommand(Intent intent, int flags, int startId)
if (!vncIsActive()) {
stopSelfByUs();
}
Intent answer = new Intent(intent.getAction());
answer.putExtra(EXTRA_REQUEST_ID, intent.getStringExtra(EXTRA_REQUEST_ID));
answer.putExtra(EXTRA_REQUEST_SUCCESS, false);
sendBroadcastToOthersAndUs(answer);

return START_NOT_STICKY;
}
Expand Down

0 comments on commit 12ecada

Please sign in to comment.