mirror of
https://github.com/emanuele-f/PCAPdroid.git
synced 2026-07-03 21:21:12 +08:00
Abort PCAP file loading on dialog cancel
This commit is contained in:
parent
1463e1656f
commit
237a5af1d0
@ -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);
|
||||
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user