mirror of
https://github.com/emanuele-f/PCAPdroid.git
synced 2026-06-16 21:10:57 +08:00
Fix app filter not working when using exclusions
This commit is contained in:
parent
ffd9bb16a4
commit
c190caadfd
@ -112,6 +112,10 @@ public class ConnectionsFragment extends Fragment implements ConnectionsListener
|
||||
super.onResume();
|
||||
|
||||
registerConnsListener();
|
||||
|
||||
// reg.mExclusionsEnabled may have changed (e.g. when filtering from the AppsActivity
|
||||
if(mMenuItemExclusions != null)
|
||||
refreshExclusionsMenu();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -229,6 +233,12 @@ public class ConnectionsFragment extends Fragment implements ConnectionsListener
|
||||
if(uidFilter != Utils.UID_NO_FILTER) {
|
||||
// "consume" it
|
||||
intent.removeExtra(MainActivity.UID_FILTER_EXTRA);
|
||||
|
||||
// disable the exclusions to prevent an empty view
|
||||
ConnectionsRegister reg = CaptureService.getConnsRegister();
|
||||
|
||||
if(reg != null)
|
||||
reg.mExclusionsEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -507,7 +517,7 @@ public class ConnectionsFragment extends Fragment implements ConnectionsListener
|
||||
int id = item.getItemId();
|
||||
|
||||
if(id == R.id.action_show_app_filter) {
|
||||
if(hasConnectionFilter())
|
||||
if(mAdapter.getUidFilter() != Utils.UID_NO_FILTER)
|
||||
setUidFilter(Utils.UID_NO_FILTER);
|
||||
else
|
||||
openAppSelector();
|
||||
|
||||
@ -2,15 +2,15 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="12sp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_label"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
tools:text="App: example app"
|
||||
android:maxLines="1"
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp">
|
||||
|
||||
<ListView
|
||||
android:id="@+id/list"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user