Loading res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -7966,4 +7966,6 @@ <string name="e_contributors_title">/e/ contributors</string> <string name="lineageos_contributors_title">LineageOS contributors</string> <string name="elicense_title">/e/ legal</string> </resources> res/xml/about_legal.xml +5 −1 Original line number Diff line number Diff line Loading @@ -36,6 +36,11 @@ <intent android:action="android.settings.LICENSE" /> </PreferenceScreen> <!-- eFoundation License information --> <PreferenceScreen android:key="elicense" android:title="@string/elicense_title" /> <!-- CM License information --> <PreferenceScreen android:key="cmlicense" Loading @@ -56,4 +61,3 @@ </PreferenceScreen> </PreferenceScreen> src/com/android/settings/LegalSettings.java +17 −3 Original line number Diff line number Diff line Loading @@ -47,7 +47,9 @@ public class LegalSettings extends SettingsPreferenceFragment implements Indexab private static final String KEY_COPYRIGHT = "copyright"; private static final String KEY_WEBVIEW_LICENSE = "webview_license"; private static final String PROPERTY_CMLICENSE_URL = "ro.cmlegal.url"; private static final String PROPERTY_ELICENSE_URL = "ro.elegal.url"; private static final String KEY_CM_LICENSE = "cmlicense"; private static final String KEY_E_LICENSE = "elicense"; public void onCreate(Bundle icicle) { super.onCreate(icicle); Loading @@ -68,11 +70,23 @@ public class LegalSettings extends SettingsPreferenceFragment implements Indexab @Override public boolean onPreferenceTreeClick(Preference preference) { if (preference.getKey().equals(KEY_CM_LICENSE)) { String userCMLicenseUrl = SystemProperties.get(PROPERTY_CMLICENSE_URL); boolean clickOnELicense = preference.getKey().equals(KEY_E_LICENSE); boolean clickOnCMLicense = preference.getKey().equals(KEY_CM_LICENSE); if (clickOnELicense || clickOnCMLicense) { String userLicenseUrl = ""; if (clickOnELicense) { userLicenseUrl = SystemProperties.get(PROPERTY_ELICENSE_URL); } else if (clickOnCMLicense) { userLicenseUrl = SystemProperties.get(PROPERTY_CMLICENSE_URL); } final Intent intent = new Intent(Intent.ACTION_VIEW); intent.addCategory(Intent.CATEGORY_DEFAULT); intent.setData(Uri.parse(userCMLicenseUrl)); intent.setData(Uri.parse(userLicenseUrl)); try { startActivity(intent); } catch (Exception e) { Loading Loading
res/values/strings.xml +2 −0 Original line number Diff line number Diff line Loading @@ -7966,4 +7966,6 @@ <string name="e_contributors_title">/e/ contributors</string> <string name="lineageos_contributors_title">LineageOS contributors</string> <string name="elicense_title">/e/ legal</string> </resources>
res/xml/about_legal.xml +5 −1 Original line number Diff line number Diff line Loading @@ -36,6 +36,11 @@ <intent android:action="android.settings.LICENSE" /> </PreferenceScreen> <!-- eFoundation License information --> <PreferenceScreen android:key="elicense" android:title="@string/elicense_title" /> <!-- CM License information --> <PreferenceScreen android:key="cmlicense" Loading @@ -56,4 +61,3 @@ </PreferenceScreen> </PreferenceScreen>
src/com/android/settings/LegalSettings.java +17 −3 Original line number Diff line number Diff line Loading @@ -47,7 +47,9 @@ public class LegalSettings extends SettingsPreferenceFragment implements Indexab private static final String KEY_COPYRIGHT = "copyright"; private static final String KEY_WEBVIEW_LICENSE = "webview_license"; private static final String PROPERTY_CMLICENSE_URL = "ro.cmlegal.url"; private static final String PROPERTY_ELICENSE_URL = "ro.elegal.url"; private static final String KEY_CM_LICENSE = "cmlicense"; private static final String KEY_E_LICENSE = "elicense"; public void onCreate(Bundle icicle) { super.onCreate(icicle); Loading @@ -68,11 +70,23 @@ public class LegalSettings extends SettingsPreferenceFragment implements Indexab @Override public boolean onPreferenceTreeClick(Preference preference) { if (preference.getKey().equals(KEY_CM_LICENSE)) { String userCMLicenseUrl = SystemProperties.get(PROPERTY_CMLICENSE_URL); boolean clickOnELicense = preference.getKey().equals(KEY_E_LICENSE); boolean clickOnCMLicense = preference.getKey().equals(KEY_CM_LICENSE); if (clickOnELicense || clickOnCMLicense) { String userLicenseUrl = ""; if (clickOnELicense) { userLicenseUrl = SystemProperties.get(PROPERTY_ELICENSE_URL); } else if (clickOnCMLicense) { userLicenseUrl = SystemProperties.get(PROPERTY_CMLICENSE_URL); } final Intent intent = new Intent(Intent.ACTION_VIEW); intent.addCategory(Intent.CATEGORY_DEFAULT); intent.setData(Uri.parse(userCMLicenseUrl)); intent.setData(Uri.parse(userLicenseUrl)); try { startActivity(intent); } catch (Exception e) { Loading