From b076a55991ee6e913b13ba1a16dd0c559a7eccce Mon Sep 17 00:00:00 2001 From: cretin45 Date: Tue, 5 May 2015 16:44:26 -0700 Subject: SetupWizard: Use new LegaleseViewer for privacy policy web views WebViews are no longer allowed in priv-apps. Change-Id: Iddf9c79d50ea9f9d9d32218342f9948a6cbf30ef --- .../setupwizard/setup/CyanogenSettingsPage.java | 14 +++++++++++--- .../cyanogenmod/setupwizard/setup/OtherSettingsPage.java | 15 +++++++++++---- 2 files changed, 22 insertions(+), 7 deletions(-) (limited to 'src/com/cyanogenmod/setupwizard/setup') diff --git a/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java b/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java index 7c75d10..bdc3076 100644 --- a/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java +++ b/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java @@ -18,12 +18,15 @@ package com.cyanogenmod.setupwizard.setup; import android.app.Fragment; import android.app.FragmentManager; +import android.content.ComponentName; import android.content.Context; +import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.ThemeUtils; import android.content.res.ThemeConfig; import android.content.res.ThemeManager; import android.hardware.CmHardwareManager; +import android.net.Uri; import android.os.Bundle; import android.os.RemoteException; import android.preference.PreferenceManager; @@ -42,6 +45,7 @@ import android.widget.CheckBox; import android.widget.TextView; import com.cyanogenmod.setupwizard.R; +import com.cyanogenmod.setupwizard.SetupWizardApp; import com.cyanogenmod.setupwizard.cmstats.SetupStats; import com.cyanogenmod.setupwizard.ui.SetupPageFragment; import com.cyanogenmod.setupwizard.ui.WebViewDialogFragment; @@ -267,9 +271,13 @@ public class CyanogenSettingsPage extends SetupPage { ClickableSpan clickableSpan = new ClickableSpan() { @Override public void onClick(View textView) { - WebViewDialogFragment.newInstance() - .setUri(PRIVACY_POLICY_URI) - .show(getActivity().getFragmentManager(), WebViewDialogFragment.TAG); + final Intent intent = new Intent(SetupWizardApp.ACTION_VIEW_LEGAL); + intent.setData(Uri.parse(PRIVACY_POLICY_URI)); + try { + getActivity().startActivity(intent); + } catch (Exception e) { + Log.e(TAG, "Unable to start activity " + intent.toString(), e); + } } }; ss.setSpan(clickableSpan, diff --git a/src/com/cyanogenmod/setupwizard/setup/OtherSettingsPage.java b/src/com/cyanogenmod/setupwizard/setup/OtherSettingsPage.java index e5029a6..1ebd161 100644 --- a/src/com/cyanogenmod/setupwizard/setup/OtherSettingsPage.java +++ b/src/com/cyanogenmod/setupwizard/setup/OtherSettingsPage.java @@ -19,11 +19,14 @@ package com.cyanogenmod.setupwizard.setup; import android.app.Fragment; import android.app.FragmentManager; import android.app.backup.IBackupManager; +import android.content.ComponentName; import android.content.ContentQueryMap; import android.content.ContentResolver; import android.content.Context; +import android.content.Intent; import android.database.Cursor; import android.location.LocationManager; +import android.net.Uri; import android.os.Bundle; import android.os.RemoteException; import android.os.ServiceManager; @@ -32,6 +35,7 @@ import android.text.SpannableString; import android.text.Spanned; import android.text.method.LinkMovementMethod; import android.text.style.ClickableSpan; +import android.util.Log; import android.view.View; import android.widget.CheckBox; import android.widget.TextView; @@ -151,10 +155,13 @@ public class OtherSettingsPage extends SetupPage { ClickableSpan clickableSpan = new ClickableSpan() { @Override public void onClick(View textView) { - WebViewDialogFragment.newInstance() - .setUri(PRIVACY_POLICY_URI) - .show(getActivity().getFragmentManager(), - WebViewDialogFragment.TAG); + final Intent intent = new Intent(SetupWizardApp.ACTION_VIEW_LEGAL); + intent.setData(Uri.parse(PRIVACY_POLICY_URI)); + try { + getActivity().startActivity(intent); + } catch (Exception e) { + Log.e(TAG, "Unable to start activity " + intent.toString()); + } } }; ss.setSpan(clickableSpan, -- cgit v1.1