mirror of
https://github.com/M66B/NetGuard.git
synced 2024-12-21 23:33:21 +00:00
Skip new app notifications without names
This commit is contained in:
parent
1b344292f3
commit
336c5d67d9
2 changed files with 5 additions and 2 deletions
|
@ -2398,7 +2398,9 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
try {
|
||||
// Get application name
|
||||
List<String> names = Util.getApplicationNames(uid, this);
|
||||
String name = (names.size() == 0 ? Integer.toString(uid) : TextUtils.join(", ", names));
|
||||
if (names.size() == 0)
|
||||
return;
|
||||
String name = TextUtils.join(", ", names);
|
||||
|
||||
// Get application info
|
||||
PackageManager pm = getPackageManager();
|
||||
|
|
|
@ -402,7 +402,8 @@ public class Util {
|
|||
try {
|
||||
ApplicationInfo info = pm.getApplicationInfo(pkg, 0);
|
||||
String name = pm.getApplicationLabel(info).toString();
|
||||
listResult.add(TextUtils.isEmpty(name) ? pkg : name);
|
||||
if (!TextUtils.isEmpty(name))
|
||||
listResult.add(name);
|
||||
} catch (PackageManager.NameNotFoundException ignored) {
|
||||
}
|
||||
Collections.sort(listResult);
|
||||
|
|
Loading…
Reference in a new issue