Skip to content

Commit

Permalink
Abort PCAP file loading on dialog cancel
Browse files Browse the repository at this point in the history
  • Loading branch information
emanuele-f committed Aug 18, 2023
1 parent 1463e16 commit 237a5af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,11 @@ private void pcapFileOpenResult(final ActivityResult result) {
mPcapLoadDialog.setOnCancelListener(dialogInterface -> {
Log.i(TAG, "Abort download");
executor.shutdownNow();

if (CaptureService.isServiceActive())
CaptureService.stopService();

Utils.showToastLong(this, R.string.pcap_file_load_aborted);
});
mPcapLoadDialog.setOnDismissListener(dialog -> mPcapLoadDialog = null);

Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -485,4 +485,5 @@
<string name="pcap_file_not_exists">The specified PCAP file does not exist</string>
<string name="root_capture_start_failed">Capture start failure. Ensure that the device is rooted with Magisk</string>
<string name="pcap_read_error">PCAP read error</string>
<string name="pcap_file_load_aborted">PCAP file loading aborted</string>
</resources>

0 comments on commit 237a5af

Please sign in to comment.