Suppress empty access notifications

This commit is contained in:
M66B 2023-09-27 07:27:13 +02:00
parent ae21985d6b
commit 2a3b35cf96
2 changed files with 5 additions and 4 deletions

View File

@ -3089,7 +3089,10 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
}
private void showAccessNotification(int uid) {
String name = TextUtils.join(", ", Util.getApplicationNames(uid, ServiceSinkhole.this));
List<String> apps = Util.getApplicationNames(uid, ServiceSinkhole.this);
if (apps.size() == 0)
return;
String name = TextUtils.join(", ", apps);
Intent main = new Intent(ServiceSinkhole.this, ActivityMain.class);
main.putExtra(ActivityMain.EXTRA_SEARCH, Integer.toString(uid));

View File

@ -406,9 +406,7 @@ public class Util {
else {
PackageManager pm = context.getPackageManager();
String[] pkgs = pm.getPackagesForUid(uid);
if (pkgs == null)
listResult.add(Integer.toString(uid));
else
if (pkgs != null)
for (String pkg : pkgs)
try {
ApplicationInfo info = pm.getApplicationInfo(pkg, 0);