Commit 59227727 authored by Amit Kumar's avatar Amit Kumar

Add /e/ legal and contributors info

Change-Id: Iff961766cb72d17645025e2651a09d7659aadd29
parent d12d4c7e
......@@ -350,6 +350,14 @@
<!-- LineageOS legal -->
<string name="lineagelicense_title">LineageOS legal</string>
<!-- /e/ legal -->
<string name="elicense_title">/e/ legal</string>
<!-- Contributors -->
<string name="e_contributors_title">/e/ contributors</string>
<string name="lineageos_contributors_title">LineageOS contributors</string>
<!-- Volume settings - Volume adjustment sound -->
<string name="volume_adjust_sounds_title">Volume adjustment sounds</string>
......
......@@ -37,12 +37,16 @@
<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"
android:title="@string/lineagelicense_title" />
<!-- Terms and conditions -->
<Preference
android:key="terms"
......
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/contributors_title">
<!-- Contributors cloud -->
<org.lineageos.internal.lineageparts.LineagePartsPreference
android:key="contributors" />
<!-- /e/ Contributors (web) -->
<PreferenceScreen
android:key="e_contributors"
android:title="@string/e_contributors_title" />
</PreferenceScreen>
......@@ -71,9 +71,12 @@
<Preference android:key="device_feedback"
android:title="@string/device_feedback" />
<!-- Contributors cloud -->
<org.lineageos.internal.lineageparts.LineagePartsPreference
android:key="contributors" />
<PreferenceScreen
android:key="contributors_page"
android:title="@string/contributors_title"
android:fragment="com.android.settings.Contributors" >
</PreferenceScreen>
<!-- Device hardware model -->
<Preference
......
/*
* 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);
}
}
......@@ -52,6 +52,9 @@ public class LegalSettings extends SettingsPreferenceFragment implements Indexab
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);
addPreferencesFromResource(R.xml.about_legal);
......@@ -71,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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment