SUW: remove privacy policy link on large-notouch
TV's don't have any way to open links.
Change-Id: Ia7123e37668199b76e1e12803223b1cef4e25175
diff --git a/res/values-large-notouch/config.xml b/res/values-large-notouch/config.xml
new file mode 100644
index 0000000..24f6a1d
--- /dev/null
+++ b/res/values-large-notouch/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2021 The CyanogenMod Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+ <bool name="config_isLargeNoTouch">true</bool>
+</resources>
diff --git a/res/values/config.xml b/res/values/config.xml
index 88114e9..c9edc7e 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 The CyanogenMod Project
+ 2021 The LineageOS Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -22,5 +23,5 @@
<bool name="check_custom_theme_by_default">true</bool>
<string name="wizard_script_uri" translatable="false">android.resource://org.lineageos.setupwizard/raw/wizard_script</string>
<string name="wizard_script_user_uri" translatable="false">android.resource://org.lineageos.setupwizard/raw/wizard_script_user</string>
-
+ <bool name="config_isLargeNoTouch">false</bool>
</resources>
diff --git a/src/org/lineageos/setupwizard/LineageSettingsActivity.java b/src/org/lineageos/setupwizard/LineageSettingsActivity.java
index 4909073..1691bbf 100644
--- a/src/org/lineageos/setupwizard/LineageSettingsActivity.java
+++ b/src/org/lineageos/setupwizard/LineageSettingsActivity.java
@@ -76,24 +76,26 @@
String privacy_policy = getString(R.string.services_privacy_policy);
String policySummary = getString(R.string.services_explanation, os_name, privacy_policy);
SpannableString ss = new SpannableString(policySummary);
- ClickableSpan clickableSpan = new ClickableSpan() {
- @Override
- public void onClick(View textView) {
- // At this point of the setup, the device has already been unlocked (if frp
- // had been enabled), so there should be no issues regarding security
- final Intent intent = new Intent(Intent.ACTION_VIEW,
- Uri.parse(PRIVACY_POLICY_URI));
- try {
- startActivity(intent);
- } catch (Exception e) {
- Log.e(TAG, "Unable to start activity " + intent.toString(), e);
+ if (!getResources().getBoolean(R.bool.config_isLargeNoTouch)) {
+ ClickableSpan clickableSpan = new ClickableSpan() {
+ @Override
+ public void onClick(View textView) {
+ // At this point of the setup, the device has already been unlocked (if frp
+ // had been enabled), so there should be no issues regarding security
+ final Intent intent = new Intent(Intent.ACTION_VIEW,
+ Uri.parse(PRIVACY_POLICY_URI));
+ try {
+ startActivity(intent);
+ } catch (Exception e) {
+ Log.e(TAG, "Unable to start activity " + intent.toString(), e);
+ }
}
- }
- };
- int ppStartIndex = policySummary.indexOf(privacy_policy);
- ss.setSpan(clickableSpan,
- ppStartIndex, ppStartIndex + privacy_policy.length(),
- Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
+ };
+ int ppStartIndex = policySummary.indexOf(privacy_policy);
+ ss.setSpan(clickableSpan,
+ ppStartIndex, ppStartIndex + privacy_policy.length(),
+ Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
+ }
TextView privacyPolicy = (TextView) findViewById(R.id.privacy_policy);
privacyPolicy.setMovementMethod(LinkMovementMethod.getInstance());
privacyPolicy.setText(ss);