Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d2006ab authored by Nihar Thakkar's avatar Nihar Thakkar Committed by Romain Hunault
Browse files

Add legal and contributors

parent b723d084
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -271,6 +271,14 @@
    <!-- Device Info screen. LineageOS legal. -->
    <string name="lineagelicense_title">LineageOS legal</string>

    <!-- Device Info screen. /e/ legal. -->
    <string name="elicense_title">/e/ legal</string>

    <!-- Device Info sceen. /e/ contributors -->
    <string name="e_contributors_title">/e/ contributors</string>
    <string name="e_supporters_title">/e/ supporters</string>
    <string name="lineageos_contributors_title">LineageOS contributors</string>

    <!-- Double tap to sleep on status bar or lockscreen -->
    <string name="status_bar_double_tap_to_sleep_title">Tap to sleep</string>
    <string name="status_bar_double_tap_to_sleep_summary">Double-tap on the status bar or lockscreen to turn off the display</string>
+5 −0
Original line number Diff line number Diff line
@@ -37,6 +37,11 @@
        <intent android:action="android.settings.LICENSE"/>
    </Preference>
    
    <!-- e Foundation License information -->
    <PreferenceScreen
        android:key="elicense"
        android:title="@string/elicense_title" />

    <!-- Lineage License information -->
    <PreferenceScreen
        android:key="lineagelicense"
+21 −0
Original line number Diff line number Diff line
<?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"
        android:title="@string/lineageos_contributors_title" />

    <!-- /e/ contributors (web) -->
    <PreferenceScreen
        android:key="e_contributors"
        android:title="@string/e_contributors_title" />

    <!-- /e/ supporters (web) -->
    <PreferenceScreen
        android:key="e_supporters"
        android:title="@string/e_supporters_title" />

</PreferenceScreen>
+7 −3
Original line number Diff line number Diff line
@@ -63,10 +63,14 @@
        android:fragment="com.android.settings.LegalSettings"
        settings:allowDividerAbove="true"/>

    <!-- Contributors cloud -->
    <org.lineageos.internal.lineageparts.LineagePartsPreference
    <!-- Contributors -->
    <PreferenceScreen
        android:key="contributors_page"
        android:order="12"
        android:key="contributors"/>
        android:title="@string/contributors_title"
        android:fragment="com.android.settings.Contributors" >
    </PreferenceScreen>


    <!-- Regulatory labels -->
    <Preference
+50 −0
Original line number Diff line number Diff line
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/about-e/#people";
    private static final String KEY_E_CONTRIBUTORS = "e_contributors";
    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) {
        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)
         || preference.getKey().equals(KEY_E_SUPPORTERS)) {
            final Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.addCategory(Intent.CATEGORY_DEFAULT);
            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) {
                Log.e(LOG_TAG, "Unable to start activity " + intent.toString());
            }
        }
        return super.onPreferenceTreeClick(preference);
    }
}
Loading