From 1da873b9b92fedf84cfaacc47f27797abeb7492a Mon Sep 17 00:00:00 2001 From: Nihar Thakkar Date: Fri, 14 Jun 2019 04:31:18 +0000 Subject: [PATCH 01/13] Add /e/ legal and contributors strings --- res/values/cm_strings.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml index 353cd2655e1..5334888f6ad 100644 --- a/res/values/cm_strings.xml +++ b/res/values/cm_strings.xml @@ -270,6 +270,13 @@ LineageOS legal + + + /e/ legal + + + /e/ contributors + LineageOS contributors Tap to sleep -- GitLab From 3e956c0cf7100fab590d969c17b60a1b9c684026 Mon Sep 17 00:00:00 2001 From: Nihar Thakkar Date: Fri, 14 Jun 2019 04:33:26 +0000 Subject: [PATCH 02/13] Add e Foundation Licence information preference --- res/xml/about_legal.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/res/xml/about_legal.xml b/res/xml/about_legal.xml index ee3bc635bb9..d4185c7d9de 100644 --- a/res/xml/about_legal.xml +++ b/res/xml/about_legal.xml @@ -36,6 +36,11 @@ android:title="@string/license_title"> + + + Date: Fri, 14 Jun 2019 04:36:04 +0000 Subject: [PATCH 03/13] Create /e/ contributors preference --- res/xml/contributors.xml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 res/xml/contributors.xml diff --git a/res/xml/contributors.xml b/res/xml/contributors.xml new file mode 100644 index 00000000000..06d0c10cb6f --- /dev/null +++ b/res/xml/contributors.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + -- GitLab From b81ba531f5600d5b30e00b413ef07d7edcefa6f5 Mon Sep 17 00:00:00 2001 From: Nihar Thakkar Date: Fri, 14 Jun 2019 04:54:11 +0000 Subject: [PATCH 04/13] Add contributors preference --- res/xml/device_info_settings.xml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/res/xml/device_info_settings.xml b/res/xml/device_info_settings.xml index 8aa4d060d58..ebec83550d6 100644 --- a/res/xml/device_info_settings.xml +++ b/res/xml/device_info_settings.xml @@ -90,19 +90,27 @@ android:title="@string/legal_information" android:fragment="com.android.settings.LegalSettings" settings:allowDividerAbove="true"/> + + + + android:order="39" + android:title="@string/regulatory_labels" + settings:allowDividerAbove="true"> @@ -110,7 +118,7 @@ @@ -118,20 +126,20 @@ -- GitLab From 82f278a4ebdd8911be6ddda74ea36ddd7a7de91a Mon Sep 17 00:00:00 2001 From: Nihar Thakkar Date: Fri, 14 Jun 2019 04:56:07 +0000 Subject: [PATCH 05/13] Create contributors fragment --- src/com/android/settings/Contributors.java | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/com/android/settings/Contributors.java diff --git a/src/com/android/settings/Contributors.java b/src/com/android/settings/Contributors.java new file mode 100644 index 00000000000..2b1c1de9f23 --- /dev/null +++ b/src/com/android/settings/Contributors.java @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2015 The Android Open Source 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. + */ + +package com.android.settings; + +import android.content.Intent; +import android.app.Activity; +import android.net.Uri; +import android.util.Log; +import android.os.Bundle; +import android.support.v7.preference.Preference; +import android.support.v7.preference.PreferenceGroup; + +import com.android.internal.logging.nano.MetricsProto.MetricsEvent; + +public class Contributors extends SettingsPreferenceFragment { + + private static final String LOG_TAG = "Contributors"; + private static final String URL_E_CONTRIBUTORS = "https://e.foundation/support-us/#halloffame"; + private static final String KEY_E_CONTRIBUTORS = "e_contributors"; + + public void onCreate(Bundle icicle) { + super.onCreate(icicle); + addPreferencesFromResource(R.xml.contributors); + } + + @Override + public int getMetricsCategory() { + return MetricsEvent.CONTRIBUTORS; + } + + @Override + public boolean onPreferenceTreeClick(Preference preference) { + if (preference.getKey().equals(KEY_E_CONTRIBUTORS)) { + final Intent intent = new Intent(Intent.ACTION_VIEW); + intent.addCategory(Intent.CATEGORY_DEFAULT); + intent.setData(Uri.parse(URL_E_CONTRIBUTORS)); + try { + startActivity(intent); + } catch (Exception e) { + Log.e(LOG_TAG, "Unable to start activity " + intent.toString()); + } + } + return super.onPreferenceTreeClick(preference); + } +} -- GitLab From a98c44f6977abfa441b571d54fbcd35bfe9d83c9 Mon Sep 17 00:00:00 2001 From: Nihar Thakkar Date: Fri, 14 Jun 2019 04:59:29 +0000 Subject: [PATCH 06/13] Handle /e/ licence preference click --- src/com/android/settings/LegalSettings.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/com/android/settings/LegalSettings.java b/src/com/android/settings/LegalSettings.java index 398dc95af81..aeb4462226d 100644 --- a/src/com/android/settings/LegalSettings.java +++ b/src/com/android/settings/LegalSettings.java @@ -50,6 +50,8 @@ public class LegalSettings extends SettingsPreferenceFragment implements Indexab @VisibleForTesting static final String KEY_WALLPAPER_ATTRIBUTIONS = "wallpaper_attributions"; private static final String PROPERTY_LINEAGELICENSE_URL = "ro.lineagelegal.url"; private static final String KEY_LINEAGE_LICENSE = "lineagelicense"; + private static final String PROPERTY_ELICENSE_URL = "ro.elegal.url"; + private static final String KEY_E_LICENSE = "elicense"; public void onCreate(Bundle icicle) { super.onCreate(icicle); @@ -72,17 +74,23 @@ public class LegalSettings extends SettingsPreferenceFragment implements Indexab @Override public boolean onPreferenceTreeClick(Preference preference) { - if (preference.getKey().equals(KEY_LINEAGE_LICENSE)) { - String userLineageLicenseUrl = SystemProperties.get(PROPERTY_LINEAGELICENSE_URL); - final Intent intent = new Intent(Intent.ACTION_VIEW); + String userLicenseUrl = ""; + if (preference.getKey().equals(KEY_E_LICENSE)) { + userLicenseUrl = SystemProperties.get(PROPERTY_ELICENSE_URL); + } else if (preference.getKey().equals(KEY_LINEAGE_LICENSE)) { + userLicenseUrl = SystemProperties.get(PROPERTY_LINEAGELICENSE_URL); + } + + if (userLicenseUrl != null && userLicenseUrl.length() > 0) { + final Intent intent = new Intent(Intent.ACTION_VIEW); intent.addCategory(Intent.CATEGORY_DEFAULT); - intent.setData(Uri.parse(userLineageLicenseUrl)); + intent.setData(Uri.parse(userLicenseUrl)); try { startActivity(intent); } catch (Exception e) { Log.e(LOG_TAG, "Unable to start activity " + intent.toString()); } - } + } return super.onPreferenceTreeClick(preference); } -- GitLab From e25248a126f552719d880cce6526071eae53938d Mon Sep 17 00:00:00 2001 From: Nihar Thakkar Date: Fri, 28 Jun 2019 03:57:20 +0000 Subject: [PATCH 07/13] Revert "Add contributors preference" --- res/xml/device_info_settings.xml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/res/xml/device_info_settings.xml b/res/xml/device_info_settings.xml index ebec83550d6..8ce6342db5b 100644 --- a/res/xml/device_info_settings.xml +++ b/res/xml/device_info_settings.xml @@ -90,18 +90,11 @@ android:title="@string/legal_information" android:fragment="com.android.settings.LegalSettings" settings:allowDividerAbove="true"/> - - - @@ -110,7 +103,7 @@ @@ -118,7 +111,7 @@ @@ -126,20 +119,20 @@ -- GitLab From a82087312f51a08126641903de8d92f20bc5b92e Mon Sep 17 00:00:00 2001 From: Nihar Thakkar Date: Fri, 28 Jun 2019 04:00:00 +0000 Subject: [PATCH 08/13] Don't show divider --- res/xml/device_info_settings.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/res/xml/device_info_settings.xml b/res/xml/device_info_settings.xml index 8ce6342db5b..8aa4d060d58 100644 --- a/res/xml/device_info_settings.xml +++ b/res/xml/device_info_settings.xml @@ -95,8 +95,7 @@ + android:title="@string/regulatory_labels"> -- GitLab From 0c17db511555d1fa107c3b13fa0efb6956e7deb7 Mon Sep 17 00:00:00 2001 From: Nihar Thakkar Date: Fri, 28 Jun 2019 04:07:24 +0000 Subject: [PATCH 09/13] Add contributors preference --- res/xml/my_device_info.xml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/res/xml/my_device_info.xml b/res/xml/my_device_info.xml index d0efac2f075..cfbcb11617b 100644 --- a/res/xml/my_device_info.xml +++ b/res/xml/my_device_info.xml @@ -63,10 +63,14 @@ android:fragment="com.android.settings.LegalSettings" settings:allowDividerAbove="true"/> - - + + android:title="@string/contributors_title" + android:fragment="com.android.settings.Contributors" > + + Date: Tue, 2 Jul 2019 09:39:32 +0530 Subject: [PATCH 10/13] Change LineageOS contributors preference title --- res/xml/contributors.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/res/xml/contributors.xml b/res/xml/contributors.xml index 06d0c10cb6f..5543320e096 100644 --- a/res/xml/contributors.xml +++ b/res/xml/contributors.xml @@ -5,7 +5,8 @@ + android:key="contributors" + android:title="@string/lineageos_contributors_title" /> Date: Tue, 2 Jul 2019 09:43:19 +0530 Subject: [PATCH 11/13] Change /e/ contributors URL --- src/com/android/settings/Contributors.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/Contributors.java b/src/com/android/settings/Contributors.java index 2b1c1de9f23..5503e5c464a 100644 --- a/src/com/android/settings/Contributors.java +++ b/src/com/android/settings/Contributors.java @@ -29,7 +29,7 @@ import com.android.internal.logging.nano.MetricsProto.MetricsEvent; public class Contributors extends SettingsPreferenceFragment { private static final String LOG_TAG = "Contributors"; - private static final String URL_E_CONTRIBUTORS = "https://e.foundation/support-us/#halloffame"; + private static final String URL_E_CONTRIBUTORS = "https://e.foundation/about-e/#people"; private static final String KEY_E_CONTRIBUTORS = "e_contributors"; public void onCreate(Bundle icicle) { -- GitLab From 1f75ead60d962c054dcb0265c07cffd8f4bf0e30 Mon Sep 17 00:00:00 2001 From: Nihar Thakkar Date: Tue, 2 Jul 2019 09:59:12 +0530 Subject: [PATCH 12/13] Add /e/ contributors preference --- res/values/cm_strings.xml | 3 ++- res/xml/contributors.xml | 5 ++++ src/com/android/settings/Contributors.java | 29 ++++++++-------------- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml index 5334888f6ad..e9ad3a67f52 100644 --- a/res/values/cm_strings.xml +++ b/res/values/cm_strings.xml @@ -270,12 +270,13 @@ LineageOS legal - + /e/ legal /e/ contributors + /e/ supporters LineageOS contributors diff --git a/res/xml/contributors.xml b/res/xml/contributors.xml index 5543320e096..7624cad3847 100644 --- a/res/xml/contributors.xml +++ b/res/xml/contributors.xml @@ -13,4 +13,9 @@ android:key="e_contributors" android:title="@string/e_contributors_title" /> + + + diff --git a/src/com/android/settings/Contributors.java b/src/com/android/settings/Contributors.java index 5503e5c464a..19c651d19a3 100644 --- a/src/com/android/settings/Contributors.java +++ b/src/com/android/settings/Contributors.java @@ -1,19 +1,3 @@ -/* - * Copyright (C) 2015 The Android Open Source 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. - */ - package com.android.settings; import android.content.Intent; @@ -23,7 +7,6 @@ import android.util.Log; import android.os.Bundle; import android.support.v7.preference.Preference; import android.support.v7.preference.PreferenceGroup; - import com.android.internal.logging.nano.MetricsProto.MetricsEvent; public class Contributors extends SettingsPreferenceFragment { @@ -31,6 +14,8 @@ public class Contributors extends SettingsPreferenceFragment { private static final String LOG_TAG = "Contributors"; private static final String URL_E_CONTRIBUTORS = "https://e.foundation/about-e/#people"; private static final String KEY_E_CONTRIBUTORS = "e_contributors"; + private static final String URL_E_SUPPORTERS = "https://e.foundation/support-us/#halloffame"; + private static final String KEY_E_SUPPORTERS = "e_supporters"; public void onCreate(Bundle icicle) { super.onCreate(icicle); @@ -44,10 +29,16 @@ public class Contributors extends SettingsPreferenceFragment { @Override public boolean onPreferenceTreeClick(Preference preference) { - if (preference.getKey().equals(KEY_E_CONTRIBUTORS)) { + if (preference.getKey().equals(KEY_E_CONTRIBUTORS) + || preference.getKey().equals(KEY_E_SUPPORTERS)) { final Intent intent = new Intent(Intent.ACTION_VIEW); intent.addCategory(Intent.CATEGORY_DEFAULT); - intent.setData(Uri.parse(URL_E_CONTRIBUTORS)); + if (preference.getKey().equals(KEY_E_CONTRIBUTORS)) { + intent.setData(Uri.parse(URL_E_CONTRIBUTORS)); + } else if (preference.getKey().equals(KEY_E_SUPPORTERS)) { + intent.setData(Uri.parse(URL_E_SUPPORTERS)); + } + try { startActivity(intent); } catch (Exception e) { -- GitLab From fb88448b818543ee86ba27077c0d399a3220c911 Mon Sep 17 00:00:00 2001 From: Nihar Thakkar Date: Tue, 2 Jul 2019 10:06:16 +0530 Subject: [PATCH 13/13] Change /e/ supporters URL --- src/com/android/settings/Contributors.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/Contributors.java b/src/com/android/settings/Contributors.java index 19c651d19a3..75b6110acd2 100644 --- a/src/com/android/settings/Contributors.java +++ b/src/com/android/settings/Contributors.java @@ -14,7 +14,7 @@ public class Contributors extends SettingsPreferenceFragment { private static final String LOG_TAG = "Contributors"; private static final String URL_E_CONTRIBUTORS = "https://e.foundation/about-e/#people"; private static final String KEY_E_CONTRIBUTORS = "e_contributors"; - private static final String URL_E_SUPPORTERS = "https://e.foundation/support-us/#halloffame"; + private static final String URL_E_SUPPORTERS = "https://e.foundation/donate/#earlybackers"; private static final String KEY_E_SUPPORTERS = "e_supporters"; public void onCreate(Bundle icicle) { -- GitLab