SUW: remove privacy policy link on large-notouch
TV's don't have any way to open links. Change-Id: Ia7123e37668199b76e1e12803223b1cef4e25175
This commit is contained in:
committed by
Nolen Johnson
parent
161a3a68a6
commit
829c0d85c9
19
res/values-large-notouch/config.xml
Normal file
19
res/values-large-notouch/config.xml
Normal file
@@ -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>
|
@@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!--
|
<!--
|
||||||
Copyright (C) 2013 The CyanogenMod Project
|
Copyright (C) 2013 The CyanogenMod Project
|
||||||
|
2021 The LineageOS Project
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with 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>
|
<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_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>
|
<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>
|
</resources>
|
||||||
|
@@ -76,24 +76,26 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
|
|||||||
String privacy_policy = getString(R.string.services_privacy_policy);
|
String privacy_policy = getString(R.string.services_privacy_policy);
|
||||||
String policySummary = getString(R.string.services_explanation, os_name, privacy_policy);
|
String policySummary = getString(R.string.services_explanation, os_name, privacy_policy);
|
||||||
SpannableString ss = new SpannableString(policySummary);
|
SpannableString ss = new SpannableString(policySummary);
|
||||||
ClickableSpan clickableSpan = new ClickableSpan() {
|
if (!getResources().getBoolean(R.bool.config_isLargeNoTouch)) {
|
||||||
@Override
|
ClickableSpan clickableSpan = new ClickableSpan() {
|
||||||
public void onClick(View textView) {
|
@Override
|
||||||
// At this point of the setup, the device has already been unlocked (if frp
|
public void onClick(View textView) {
|
||||||
// had been enabled), so there should be no issues regarding security
|
// At this point of the setup, the device has already been unlocked (if frp
|
||||||
final Intent intent = new Intent(Intent.ACTION_VIEW,
|
// had been enabled), so there should be no issues regarding security
|
||||||
Uri.parse(PRIVACY_POLICY_URI));
|
final Intent intent = new Intent(Intent.ACTION_VIEW,
|
||||||
try {
|
Uri.parse(PRIVACY_POLICY_URI));
|
||||||
startActivity(intent);
|
try {
|
||||||
} catch (Exception e) {
|
startActivity(intent);
|
||||||
Log.e(TAG, "Unable to start activity " + intent.toString(), e);
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, "Unable to start activity " + intent.toString(), e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
};
|
int ppStartIndex = policySummary.indexOf(privacy_policy);
|
||||||
int ppStartIndex = policySummary.indexOf(privacy_policy);
|
ss.setSpan(clickableSpan,
|
||||||
ss.setSpan(clickableSpan,
|
ppStartIndex, ppStartIndex + privacy_policy.length(),
|
||||||
ppStartIndex, ppStartIndex + privacy_policy.length(),
|
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
}
|
||||||
TextView privacyPolicy = (TextView) findViewById(R.id.privacy_policy);
|
TextView privacyPolicy = (TextView) findViewById(R.id.privacy_policy);
|
||||||
privacyPolicy.setMovementMethod(LinkMovementMethod.getInstance());
|
privacyPolicy.setMovementMethod(LinkMovementMethod.getInstance());
|
||||||
privacyPolicy.setText(ss);
|
privacyPolicy.setText(ss);
|
||||||
|
Reference in New Issue
Block a user