[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [orbot/master] don't show app vpn selection for devices that don't support it



commit 93e6cf3e560211cab453558f2f0ca5a5b970e2bf
Author: n8fr8 <nathan@xxxxxxxxxxx>
Date:   Wed May 9 13:32:20 2018 -0400

    don't show app vpn selection for devices that don't support it
---
 .../android/ui/onboarding/OnboardingActivity.java  | 26 ++++++++++++----------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/app/src/main/java/org/torproject/android/ui/onboarding/OnboardingActivity.java b/app/src/main/java/org/torproject/android/ui/onboarding/OnboardingActivity.java
index dbe329a4..a8bad692 100644
--- a/app/src/main/java/org/torproject/android/ui/onboarding/OnboardingActivity.java
+++ b/app/src/main/java/org/torproject/android/ui/onboarding/OnboardingActivity.java
@@ -17,6 +17,7 @@ import com.github.paolorotolo.appintro.AppIntro;
 import org.torproject.android.R;
 import org.torproject.android.settings.LocaleHelper;
 import org.torproject.android.ui.AppManagerActivity;
+import org.torproject.android.ui.hiddenservices.permissions.PermissionManager;
 import org.torproject.android.vpn.VPNEnableActivity;
 
 import java.util.List;
@@ -49,21 +50,22 @@ public class OnboardingActivity extends AppIntro {
         });
         addSlide(cs2);
 
-        CustomSlideBigText cs3 = CustomSlideBigText.newInstance(R.layout.custom_slide_big_text);
-        cs3.setTitle(getString(R.string.vpn_setup));
-        cs3.setSubTitle(getString(R.string.vpn_setup_sub));
-        cs3.showButton(getString(R.string.action_vpn_choose), new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                startActivity(new Intent(OnboardingActivity.this, VPNEnableActivity.class));
-                startActivityForResult(new Intent(OnboardingActivity.this, AppManagerActivity.class), 9999);
-
-            }
-        });
-        addSlide(cs3);
+        if (PermissionManager.isLollipopOrHigher()) {
 
+            CustomSlideBigText cs3 = CustomSlideBigText.newInstance(R.layout.custom_slide_big_text);
+            cs3.setTitle(getString(R.string.vpn_setup));
+            cs3.setSubTitle(getString(R.string.vpn_setup_sub));
+            cs3.showButton(getString(R.string.action_vpn_choose), new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    startActivity(new Intent(OnboardingActivity.this, VPNEnableActivity.class));
+                    startActivityForResult(new Intent(OnboardingActivity.this, AppManagerActivity.class), 9999);
 
+                }
+            });
+            addSlide(cs3);
 
+        }
 
         // OPTIONAL METHODS
         // Override bar/separator color.



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits