Skip to content

Commit

Permalink
Merge pull request #292 from ivpn/task/split-tunnel-non-launchable-apps
Browse files Browse the repository at this point in the history
Add non-launchable user installed apps in Split tunneling list
  • Loading branch information
jurajhilje authored Nov 1, 2023
2 parents cb9dbff + 075176c commit 287857e
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,17 @@ protected void onPreExecute() {
@Override
protected List<ApplicationItem> doInBackground(Void... voids) {
List<ApplicationItem> items = new LinkedList<>();
Set<String> packageNames = new HashSet<>();
for (ApplicationInfo info : applicationInfoList) {
try {
if (null != packageManager.getLaunchIntentForPackage(info.packageName)) {
items.add(new ApplicationItem(info.loadLabel(packageManager).toString(), info.packageName,
info.loadIcon(packageManager)));
if (null != packageManager.getLaunchIntentForPackage(info.packageName) ||
null != packageManager.getLeanbackLaunchIntentForPackage(info.packageName) ||
null != packageManager.getInstallerPackageName(info.packageName)
) {
if (packageNames.add(info.loadLabel(packageManager).toString())) {
items.add(new ApplicationItem(info.loadLabel(packageManager).toString(), info.packageName,
info.loadIcon(packageManager)));
}
}
} catch (Exception e) {
e.printStackTrace();
Expand Down

0 comments on commit 287857e

Please sign in to comment.