summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2015-12-28 18:11:24 +0100
committerArne Schwabe <arne@rfc2549.org>2015-12-28 18:11:33 +0100
commit8afd9adf13d659cc106093cb70945aa27b4a08de (patch)
treed00405b17fa628f3150e253f44cb0da85ddece72 /main
parentbcc52b962d0084e5666a9fb947a85708638883ac (diff)
Ignore Google TV Stub framework
Diffstat (limited to 'main')
-rw-r--r--main/src/main/java/de/blinkt/openvpn/fragments/Utils.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java b/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java
index d3c2bdcb..d2a73810 100644
--- a/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java
+++ b/main/src/main/java/de/blinkt/openvpn/fragments/Utils.java
@@ -117,7 +117,7 @@ public class Utils {
//noinspection ConstantConditions
if (!isIntentAvailable(c,i)) {
- i.setAction(Intent.ACTION_OPEN_DOCUMENT);
+ i.setAction(Intent.ACTION_OPEN_DOCUMENT);
i.setPackage(null);
// Check for really broken devices ... :(
@@ -144,7 +144,19 @@ public class Utils {
List<ResolveInfo> list =
packageManager.queryIntentActivities(i,
PackageManager.MATCH_DEFAULT_ONLY);
- return list.size() > 0;
+
+ // Ignore the Android TV framework app in the list
+ int size = list.size();
+ for (ResolveInfo ri: list)
+ {
+ // Ignore stub apps
+ if ("com.google.android.tv.frameworkpackagestubs".equals(ri.activityInfo.packageName))
+ {
+ size--;
+ }
+ }
+
+ return size > 0;
}