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

Commit 3d803c75 authored by Chris Soyars's avatar Chris Soyars Committed by Arne Coucheron
Browse files

Add Modver to Settings.

Change-Id: I596064a80210517ff0dae30401f71b52adabd614

Rename modversion

Change-Id: I6557d5aa68a3ad00166cdd2b8951f425ad7800df

DeviceInfoSettings: Use ro.cm.display.version instead of ro.cm.version

Follows the same logic as ro.build.display.id/ro.build.id:
engineering, debug and unsigned builds will have no distinction,
user and signed builds will show a simplified version

Change-Id: I713ccb2445ea2e333e831129ef7733fd518282eb

settings: This is CyanogenMod!

Change-Id: If9f14d6579b18c4ae049d35e312dd2d98746aced

Change-Id: I6557d5aa68a3ad00166cdd2b8951f425ad7800df

Settings: Use cyanogenmod.os.Build for props.

Change-Id: I7c1ac67a001c090e784ec2b02cefdeb1026572b5

Settings: Add CM Api level to about phone.

Change-Id: I802202719ca9a2d1f98fda807f133efceec7be4a

Settings: Update strings for api level.

Change-Id: I9ed5a1020ad5ee750c9270897710784e31ce354f

Added build date (ro.build.date from build.prop) to device info.

Change-Id: I5e19ee04de5c26822e171d4af8f4bfc052be9b74

CM PlatLogo: CyanogenMod version preference (2/2)

Binds the CyanogenMod version preference to launch CM easter egg
upon multiple taps.

Change-Id: I8e06642944d24581c0932c9964f2d9615bfcb832

Settings: Use cm build properties correctly.

TICKET: CYNGNOS-2379
Change-Id: I8342589c52d633c044570be02f48c7f5a48f788c
parent 1719f750
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -23,4 +23,17 @@
    <string name="root_access_apps">Apps only</string>
    <string name="root_access_adb">ADB only</string>
    <string name="root_access_all">Apps and ADB</string>

    <!-- About phone screen, CyanogenMod version -->
    <string name="mod_version">CyanogenMod version</string>
    <string name="mod_version_default">Unknown</string>

    <!-- About phone screen, CyanogenMod Api Level -->
    <string name="mod_api_level">CyanogenMod API level</string>
    <string name="mod_api_level_default">Unknown</string>

    <!-- About phone screen, build date -->
    <string name="build_date">Build date</string>
    <string name="build_date_default">2015-01-01-0000</string>

</resources>
+23 −1
Original line number Diff line number Diff line
@@ -88,6 +88,20 @@
                android:title="@string/firmware_version"
                android:summary="@string/device_info_default"/>

        <!-- Mod version -->
        <Preference android:key="mod_version"
                android:enabled="false"
                android:shouldDisableView="false"
                android:title="@string/mod_version"
                android:summary="@string/mod_version_default" />

        <!-- CyanogenMod API Version -->
        <Preference android:key="mod_api_level"
                android:enabled="false"
                android:shouldDisableView="false"
                android:title="@string/mod_api_level"
                android:summary="@string/mod_api_level_default" />

        <!-- Security patch level -->
        <PreferenceScreen android:key="security_patch"
                android:title="@string/security_patch"
@@ -109,7 +123,8 @@

        <!-- Device MBN version -->
        <Preference android:key="mbn_version"
                style="?android:preferenceInformationStyle"
                android:enabled="false"
                android:shouldDisableView="false"
                android:title="@string/mbn_version"
                android:summary="@string/device_info_default"/>

@@ -135,6 +150,13 @@
                settings:allowDividerAbove="true"
                settings:allowDividerBelow="true"/>

        <!-- Build date -->
        <Preference android:key="build_date"
                android:enabled="false"
                android:shouldDisableView="false"
                android:title="@string/build_date"
                android:summary="@string/build_date_default" />

        <!-- Detailed build version -->
        <Preference android:key="build_number"
                android:enabled="false"
+39 −0
Original line number Diff line number Diff line
@@ -79,6 +79,9 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
    private static final String PROPERTY_QGP_VERSION = "persist.qgp.version";
    private static final String MBN_VERSION_PATH = "/persist/speccfg/mbnversion";
    private static final String QGP_VERSION_PATH = "/persist/speccfg/qgpversion";
    private static final String KEY_MOD_VERSION = "mod_version";
    private static final String KEY_MOD_BUILD_DATE = "build_date";
    private static final String KEY_MOD_API_LEVEL = "mod_api_level";

    static final int TAPS_TO_BE_A_DEVELOPER = 7;

@@ -143,6 +146,12 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
        if(mMbnVersion == null){
            getPreferenceScreen().removePreference(findPreference(KEY_MBN_VERSION));
        }
        findPreference(KEY_MOD_VERSION).setSummary(
                cyanogenmod.os.Build.CYANOGENMOD_DISPLAY_VERSION);
        findPreference(KEY_MOD_VERSION).setEnabled(true);
        setValueSummary(KEY_MOD_BUILD_DATE, "ro.build.date");
        setExplicitValueSummary(KEY_MOD_API_LEVEL, constructApiLevelString());
        findPreference(KEY_MOD_API_LEVEL).setEnabled(true);

        if (!SELinux.isSELinuxEnabled()) {
            String status = getResources().getString(R.string.selinux_status_disabled);
@@ -332,6 +341,20 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
            if (b != null && b.getBoolean(CarrierConfigManager.KEY_CI_ACTION_ON_SYS_UPDATE_BOOL)) {
                ciActionOnSysUpdate(b);
            }
        } else if (preference.getKey().equals(KEY_MOD_VERSION)) {
            System.arraycopy(mHits, 1, mHits, 0, mHits.length-1);
            mHits[mHits.length-1] = SystemClock.uptimeMillis();
            if (mHits[0] >= (SystemClock.uptimeMillis()-500)) {
                Intent intent = new Intent(Intent.ACTION_MAIN);
                intent.putExtra("is_cm", true);
                intent.setClassName("android",
                        com.android.internal.app.PlatLogoActivity.class.getName());
                try {
                    startActivity(intent);
                } catch (Exception e) {
                    Log.e(LOG_TAG, "Unable to start activity " + intent.toString());
                }
            }
        }
        return super.onPreferenceTreeClick(preference);
    }
@@ -450,6 +473,14 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
        }
    }

    private void setExplicitValueSummary(String preference, String value) {
        try {
            findPreference(preference).setSummary(value);
        } catch (RuntimeException e) {
            // No recovery
        }
    }

    private void sendFeedback() {
        String reporterPackage = DeviceInfoUtils.getFeedbackReporterPackage(getActivity());
        if (TextUtils.isEmpty(reporterPackage)) {
@@ -460,6 +491,14 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
        startActivityForResult(intent, 0);
    }

    private static String constructApiLevelString() {
        int sdkInt = cyanogenmod.os.Build.CM_VERSION.SDK_INT;
        StringBuilder builder = new StringBuilder();
        builder.append(cyanogenmod.os.Build.getNameForSDKInt(sdkInt))
                .append(" (" + sdkInt + ")");
        return builder.toString();
    }

    private static class SummaryProvider implements SummaryLoader.SummaryProvider {

        private final Context mContext;