Loading res/values/strings.xml +1 −0 Original line number Diff line number Diff line Loading @@ -9061,4 +9061,5 @@ <string name="e_contributors_title">/e/ contributors</string> <string name="lineageos_contributors_title">LineageOS contributors</string> <string name="microg_title">MicroG settings</string> <string name="elicense_title">/e/ legal</string> </resources> res/xml/about_legal.xml +6 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,12 @@ <intent android:action="android.settings.LICENSE"/> </Preference> <!-- eFoundation License information --> <PreferenceScreen android:key="elicense" android:title="@string/elicense_title" /> <!-- Lineage License information --> <PreferenceScreen android:key="lineagelicense" Loading Loading @@ -65,4 +71,3 @@ --> </PreferenceScreen> src/com/android/settings/LegalSettings.java +17 −3 Original line number Diff line number Diff line Loading @@ -50,7 +50,9 @@ public class LegalSettings extends SettingsPreferenceFragment implements Indexab private static final String KEY_WALLPAPER_ATTRIBUTIONS = "wallpaper_attributions"; */ private static final String PROPERTY_LINEAGELICENSE_URL = "ro.lineagelegal.url"; private static final String PROPERTY_ELICENSE_URL = "ro.elegal.url"; private static final String KEY_LINEAGE_LICENSE = "lineagelicense"; private static final String KEY_E_LICENSE = "elicense"; public void onCreate(Bundle icicle) { super.onCreate(icicle); Loading @@ -71,11 +73,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); boolean clickOnELicense = preference.getKey().equals(KEY_E_LICENSE); boolean clickOnLineageLicense = preference.getKey().equals(KEY_LINEAGE_LICENSE); if (clickOnELicense || clickOnLineageLicense) { String userLicenseUrl = ""; if (clickOnELicense) { userLicenseUrl = SystemProperties.get(PROPERTY_ELICENSE_URL); } else if (clickOnLineageLicense) { userLicenseUrl = SystemProperties.get(PROPERTY_LINEAGELICENSE_URL); } 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) { Loading Loading
res/values/strings.xml +1 −0 Original line number Diff line number Diff line Loading @@ -9061,4 +9061,5 @@ <string name="e_contributors_title">/e/ contributors</string> <string name="lineageos_contributors_title">LineageOS contributors</string> <string name="microg_title">MicroG settings</string> <string name="elicense_title">/e/ legal</string> </resources>
res/xml/about_legal.xml +6 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,12 @@ <intent android:action="android.settings.LICENSE"/> </Preference> <!-- eFoundation License information --> <PreferenceScreen android:key="elicense" android:title="@string/elicense_title" /> <!-- Lineage License information --> <PreferenceScreen android:key="lineagelicense" Loading Loading @@ -65,4 +71,3 @@ --> </PreferenceScreen>
src/com/android/settings/LegalSettings.java +17 −3 Original line number Diff line number Diff line Loading @@ -50,7 +50,9 @@ public class LegalSettings extends SettingsPreferenceFragment implements Indexab private static final String KEY_WALLPAPER_ATTRIBUTIONS = "wallpaper_attributions"; */ private static final String PROPERTY_LINEAGELICENSE_URL = "ro.lineagelegal.url"; private static final String PROPERTY_ELICENSE_URL = "ro.elegal.url"; private static final String KEY_LINEAGE_LICENSE = "lineagelicense"; private static final String KEY_E_LICENSE = "elicense"; public void onCreate(Bundle icicle) { super.onCreate(icicle); Loading @@ -71,11 +73,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); boolean clickOnELicense = preference.getKey().equals(KEY_E_LICENSE); boolean clickOnLineageLicense = preference.getKey().equals(KEY_LINEAGE_LICENSE); if (clickOnELicense || clickOnLineageLicense) { String userLicenseUrl = ""; if (clickOnELicense) { userLicenseUrl = SystemProperties.get(PROPERTY_ELICENSE_URL); } else if (clickOnLineageLicense) { userLicenseUrl = SystemProperties.get(PROPERTY_LINEAGELICENSE_URL); } 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) { Loading