summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
Diffstat (limited to 'main/src')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java8
-rw-r--r--main/src/main/java/de/blinkt/openvpn/fragments/Settings_Allowed_Apps.java22
-rw-r--r--main/src/main/res/layout/vpn_profile_list.xml2
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>