Abort PCAP file loading on dialog cancel

This commit is contained in:
emanuele-f 2023-08-18 21:19:04 +02:00
parent 1463e1656f
commit 237a5af1d0
2 changed files with 6 additions and 0 deletions

View File

@ -839,6 +839,11 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
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);

View File

@ -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>