Fix app filter not working when using exclusions

This commit is contained in:
emanuele-f 2021-06-11 15:28:30 +02:00
parent ffd9bb16a4
commit c190caadfd
3 changed files with 15 additions and 4 deletions

View File

@ -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();

View File

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

View File

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