diff options
author | Arne Schwabe <arne@rfc2549.org> | 2014-12-01 00:51:09 +0100 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2014-12-01 00:51:09 +0100 |
commit | 3a6855aff9aef5aef664ce56d8a930458474b88a (patch) | |
tree | 346b77dcdc3f6515081d52ffb31db9d6580873a4 /main | |
parent | c1059af0bc5589cc9afc20de2fab093a1cb5c1a5 (diff) |
Fine tune for next release, remove debug message, ignore apps with system id
--HG--
extra : rebase_source : b9f8135b8b98cb501f7ad548e22ae40b931b8de9
Diffstat (limited to 'main')
3 files changed, 24 insertions, 8 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java index f12d24a5..29009e5c 100644 --- a/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java +++ b/main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java @@ -267,8 +267,8 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac registerReceiver(mDeviceStateReceiver, filter); VpnStatus.addByteCountListener(mDeviceStateReceiver); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) - addLollipopCMListener(); + /*if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) + addLollipopCMListener(); */ } synchronized void unregisterDeviceStateReceiver() { @@ -284,8 +284,8 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac } mDeviceStateReceiver = null; - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) - removeLollipopCMListener(); + /*if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) + removeLollipopCMListener();*/ } diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Allowed_Apps.java b/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Allowed_Apps.java index 60b2a200..309f5447 100644 --- a/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Allowed_Apps.java +++ b/main/src/main/java/de/blinkt/openvpn/fragments/Settings_Allowed_Apps.java @@ -80,11 +80,10 @@ public class Settings_Allowed_Apps extends Fragment implements AdapterView.OnIte } - static class PackageAdapter extends BaseAdapter { + class PackageAdapter extends BaseAdapter { private final List<ApplicationInfo> mPackages; private final LayoutInflater mInflater; private final PackageManager mPm; - private final VpnProfile mProfile; PackageAdapter(Context c, VpnProfile vp) { mPm = c.getPackageManager(); @@ -94,13 +93,30 @@ public class Settings_Allowed_Apps extends Fragment implements AdapterView.OnIte // Remove apps not using Internet + int androidSystemUid=0; + ApplicationInfo system = null; Vector<ApplicationInfo> apps= new Vector<ApplicationInfo>(); + + try { + system = mPm.getApplicationInfo("android", PackageManager.GET_META_DATA); + androidSystemUid = system.uid; + apps.add(system); + } catch (PackageManager.NameNotFoundException e) { + } + + for (ApplicationInfo app:installedPackages) { - if (mPm.checkPermission(Manifest.permission.INTERNET, app.packageName) == PackageManager.PERMISSION_GRANTED) + + if (mPm.checkPermission(Manifest.permission.INTERNET, app.packageName) == PackageManager.PERMISSION_GRANTED && + app.uid != androidSystemUid) { + apps.add(app); + } } + + Collections.sort(apps, new ApplicationInfo.DisplayNameComparator(mPm)); mPackages=apps; diff --git a/main/src/main/res/layout/vpn_profile_list.xml b/main/src/main/res/layout/vpn_profile_list.xml index 3ea89bdd..082ffd77 100644 --- a/main/src/main/res/layout/vpn_profile_list.xml +++ b/main/src/main/res/layout/vpn_profile_list.xml @@ -74,6 +74,6 @@ </LinearLayout> - <include layout="@layout/profile_list_fabs" /> + <!-- <include layout="@layout/profile_list_fabs" /> --> </FrameLayout> |