diff options
-rw-r--r-- | AndroidManifest.xml | 1 | ||||
-rw-r--r-- | src/com/cyanogenmod/setupwizard/SetupWizardApp.java | 1 | ||||
-rw-r--r-- | src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java | 14 | ||||
-rw-r--r-- | src/com/cyanogenmod/setupwizard/setup/OtherSettingsPage.java | 15 |
4 files changed, 24 insertions, 7 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 7df896d..d4a7826 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -45,6 +45,7 @@ <uses-permission android:name="android.permission.BACKUP" /> <uses-permission android:name="org.whispersystems.whisperpush.permissions.REGISTER" /> <uses-permission android:name="cyanogenmod.permission.FINISH_SETUP" /> + <uses-permission android:name="cyanogenmod.permission.LEGALESE" /> <uses-permission android:name="com.cyngn.cmstats.SEND_ANALYTICS" /> <permission diff --git a/src/com/cyanogenmod/setupwizard/SetupWizardApp.java b/src/com/cyanogenmod/setupwizard/SetupWizardApp.java index 6c1dcbc..a1d644b 100644 --- a/src/com/cyanogenmod/setupwizard/SetupWizardApp.java +++ b/src/com/cyanogenmod/setupwizard/SetupWizardApp.java @@ -37,6 +37,7 @@ public class SetupWizardApp extends Application { public static final String ACCOUNT_TYPE_GMS = "com.google"; public static final String ACTION_SETUP_WIFI = "com.android.net.wifi.SETUP_WIFI_NETWORK"; + public static final String ACTION_VIEW_LEGAL = "cyanogenmod.intent.action.LEGALESE"; public static final String EXTRA_FIRST_RUN = "firstRun"; public static final String EXTRA_ALLOW_SKIP = "allowSkip"; 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, |