diff --git a/res/drawable/logo.xml b/res/drawable/logo.xml index b2ce0d3..a17c0dd 100644 --- a/res/drawable/logo.xml +++ b/res/drawable/logo.xml @@ -1,14 +1,12 @@ + android:width="512dp" + android:height="320dp" + android:viewportWidth="512" + android:viewportHeight="320"> + android:fillColor="@color/accent" + android:pathData="M157.89,271.64a1.83,1.83,0,0,1-1.89-1.89V248.42h4.65v19.32H171v3.9Z" /> + android:fillColor="@color/accent" + android:pathData="M185,271.64V248.42h4.68v23.22Z" /> + android:fillColor="@color/accent" + android:pathData="M221.17,248.42h4.26v22a1.23,1.23,0,0,1-.67,1.09,3.17,3.17,0,0,1-1.67 .41 +,4,4,0,0,1-1.71-.29,3.11,3.11,0,0,1-1.12-1L210,256v15.61h-4.32v-21.5a1.56,1.56,0,0,1,.68-1.4,3.18,3.18,0,0,1,1.79-.46,3.59,3.59,0,0,1,1.9 +.39 ,5.91,5.91,0,0,1,1.41,1.56l9.72,13.59Z" /> + android:fillColor="@color/accent" + android:pathData="M256.9,252.36H246.2v5.5h9.63v3.93H246.2v5.89H256.6v4H241.51V250.31a1.74,1.74,0,0,1,.59-1.37,2,2,0,0,1,1.4-.52h13.4Z" /> + android:fillColor="@color/accent" + android:pathData="M286.38,271.64l-2-5.76h-8.49l-2,5.76h-4.85l7.87-21.5q.68-1.85,3.15-1.85t3.19,1.89l7.87,21.46ZM277.27,262h5.82l-2.93-8.62Z" /> + android:fillColor="@color/accent" + android:pathData="M314.33,272a11,11,0,0,1-8.36-3.19,11.93,11.93,0,0,1-3.06-8.62,12.12,12.12,0,0,1,3.25-8.89,11.56,11.56,0,0,1,8.62-3.3,11.44,11.44,0,0,1,6,1.5,9,9,0,0,1,3.63,3.93l-3.74,2q-1.69-3.41-6-3.41a6.53,6.53,0,0,0-5.14,2.16,8.58,8.58,0,0,0-1.92,5.9,8.67,8.67,0,0,0,1.79,5.8,6.11,6.11,0,0,0,4.91,2.1,6.74,6.74,0,0,0,4.6-1.58,5.26,5.26,0,0,0,1.87-4h-5.89v-3.67h10.5v2.57a10.19,10.19,0,0,1-3.12,7.72A11.12,11.12,0,0,1,314.33,272Z" /> + android:fillColor="@color/accent" + android:pathData="M356,252.36H345.3v5.5h9.63v3.93H345.3v5.89h10.41v4H340.62V250.31a1.74,1.74,0,0,1,.59-1.37,2,2,0,0,1,1.4-.52H356Z" /> - - - - - - - - + android:fillColor="@color/accent" + android:pathData="M416,128a39.92,39.92,0,0,0-31.11,14.87l-1.5-.6A294.79,294.79,0,0,0,336,128.14s0-.09,0-.14a80,80,0,1,0-160,0s0,.09,0,.13l-1.72 +.38 a293.48,293.48,0,0,0-45.67,13.76l-1.5 .6 +a40,40,0,1,0,7.39,14.28h0a277.33,277.33,0,0,1,43.1-13,80,80,0,0,0,156.73,0,277.3,277.3,0,0,1,43.11,13h0A40,40,0,1,0,416,128ZM96,192a24,24,0,1,1,24-24A24,24,0,0,1,96,192Zm160,0a64,64,0,1,1,64-64A64.07,64.07,0,0,1,256,192Zm160,0a24,24,0,1,1,24-24A24,24,0,0,1,416,192ZM288,128a32,32,0,1,1-32-32A32,32,0,0,1,288,128Z" /> diff --git a/res/layout/setup_cyanogen_services.xml b/res/layout/setup_cyanogen_services.xml index 9547afc..203376a 100644 --- a/res/layout/setup_cyanogen_services.xml +++ b/res/layout/setup_cyanogen_services.xml @@ -38,6 +38,18 @@ android:layout_height="match_parent" style="@style/PageContent"> + + + + + + + + + + + + Setup Wizard cyanogenmod - Replicant + LineageOS Material Next @@ -68,7 +68,7 @@ Emergency call - Replicant features + LineageOS features These services work for you to extend the capabilities of your tablet. Data will be used in accordance with LineageOS\'s %s. These services work for you to extend the capabilities of your phone. Data will be used in accordance with LineageOS\'s %s. Privacy Policy diff --git a/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java b/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java index da86a23..5c90b4e 100644 --- a/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java +++ b/src/com/cyanogenmod/setupwizard/setup/CMSetupWizardData.java @@ -55,6 +55,9 @@ public class CMSetupWizardData extends AbstractSetupData { pages.add(new WelcomePage(mContext, this)); pages.add(new LocalePage(mContext, this)); pages.add(new DateTimePage(mContext, this)); + if (SetupWizardUtils.hasWifi(mContext)) { + pages.add(new WifiSetupPage(mContext, this)); + } if (SetupWizardUtils.hasTelephony(mContext)) { pages.add(new SimCardMissingPage(mContext, this) .setHidden(isSimInserted())); diff --git a/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java b/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java index a52925f..866371d 100644 --- a/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java +++ b/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java @@ -55,6 +55,7 @@ public class CyanogenSettingsPage extends SetupPage { public static final String TAG = "CyanogenSettingsPage"; + public static final String KEY_SEND_METRICS = "send_metrics"; public static final String DISABLE_NAV_KEYS = "disable_nav_keys"; public static final String KEY_APPLY_DEFAULT_THEME = "apply_default_theme"; public static final String KEY_BUTTON_BACKLIGHT = "pre_navbar_button_backlight"; @@ -130,10 +131,21 @@ public class CyanogenSettingsPage extends SetupPage { } } }); + handleEnableMetrics(); handleDefaultThemeSetup(); handlePrivacyGuard(); } + private void handleEnableMetrics() { + Bundle privacyData = getData(); + if (privacyData != null + && privacyData.containsKey(KEY_SEND_METRICS)) { + CMSettings.Secure.putInt(mContext.getContentResolver(), + CMSettings.Secure.STATS_COLLECTION, privacyData.getBoolean(KEY_SEND_METRICS) + ? 1 : 0); + } + } + private void handleDefaultThemeSetup() { Bundle privacyData = getData(); if (!SetupWizardUtils.getDefaultThemePackageName(mContext).equals( @@ -181,9 +193,11 @@ public class CyanogenSettingsPage extends SetupPage { private View mKillSwitchView; private TextView mKillSwitchTitle; private ImageView mKillSwitchStatus; + private View mMetricsRow; private View mDefaultThemeRow; private View mNavKeysRow; private View mPrivacyGuardRow; + private CheckBox mMetrics; private CheckBox mDefaultTheme; private CheckBox mNavKeys; private CheckBox mPrivacyGuard; @@ -192,6 +206,15 @@ public class CyanogenSettingsPage extends SetupPage { private boolean mHideThemeRow = false; + private View.OnClickListener mMetricsClickListener = new View.OnClickListener() { + @Override + public void onClick(View view) { + boolean checked = !mMetrics.isChecked(); + mMetrics.setChecked(checked); + mPage.getData().putBoolean(KEY_SEND_METRICS, checked); + } + }; + private View.OnClickListener mDefaultThemeClickListener = new View.OnClickListener() { @Override public void onClick(View view) { @@ -221,6 +244,30 @@ public class CyanogenSettingsPage extends SetupPage { @Override protected void initializePage() { + String privacy_policy = getString(R.string.services_privacy_policy); + String policySummary = getString(R.string.services_explanation, 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 { + getActivity().startActivity(intent); + } catch (Exception e) { + Log.e(TAG, "Unable to start activity " + intent.toString(), e); + } + } + }; + ss.setSpan(clickableSpan, + policySummary.length() - privacy_policy.length() - 1, + policySummary.length() - 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + TextView privacyPolicy = (TextView) mRootView.findViewById(R.id.privacy_policy); + privacyPolicy.setMovementMethod(LinkMovementMethod.getInstance()); + privacyPolicy.setText(ss); + mKillSwitchView = mRootView.findViewById(R.id.killswitch); mKillSwitchTitle = (TextView)mRootView.findViewById(R.id.killswitch_title); mKillSwitchStatus = (ImageView)mRootView.findViewById(R.id.killswitch_check); @@ -236,6 +283,19 @@ public class CyanogenSettingsPage extends SetupPage { } } + mMetricsRow = mRootView.findViewById(R.id.metrics); + mMetricsRow.setOnClickListener(mMetricsClickListener); + String metricsHelpImproveCM = + getString(R.string.services_help_improve_cm, getString(R.string.os_name)); + String metricsSummary = getString(R.string.services_metrics_label, + metricsHelpImproveCM, getString(R.string.os_name)); + final SpannableStringBuilder metricsSpan = new SpannableStringBuilder(metricsSummary); + metricsSpan.setSpan(new android.text.style.StyleSpan(android.graphics.Typeface.BOLD), + 0, metricsHelpImproveCM.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); + TextView metrics = (TextView) mRootView.findViewById(R.id.enable_metrics_summary); + metrics.setText(metricsSpan); + mMetrics = (CheckBox) mRootView.findViewById(R.id.enable_metrics_checkbox); + mDefaultThemeRow = mRootView.findViewById(R.id.theme); mHideThemeRow = hideThemeSwitch(getActivity()); if (mHideThemeRow) { @@ -290,9 +350,19 @@ public class CyanogenSettingsPage extends SetupPage { public void onResume() { super.onResume(); updateDisableNavkeysOption(); + updateMetricsOption(); updateThemeOption(); } + private void updateMetricsOption() { + final Bundle myPageBundle = mPage.getData(); + boolean metricsChecked = + !myPageBundle.containsKey(KEY_SEND_METRICS) || myPageBundle + .getBoolean(KEY_SEND_METRICS); + mMetrics.setChecked(metricsChecked); + myPageBundle.putBoolean(KEY_SEND_METRICS, metricsChecked); + } + private void updateThemeOption() { if (!mHideThemeRow) { final Bundle myPageBundle = mPage.getData();