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

Commit a62b6b10 authored by Michael Bestas's avatar Michael Bestas Committed by Gerrit Code Review
Browse files

Revert "Add processor info in device info screen"

This reverts commit 737a0cc3.

Change-Id: I16763c165f496a8ceb3040c5f3aab95fbbca6d18
parent 2fcd3d5f
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -2152,8 +2152,6 @@
    <string name="firmware_version">Android version</string>
    <!-- About phone screen, status item label  [CHAR LIMIT=40] -->
    <string name="model_number">Model number</string>
    <!-- About phone screen, status item label  [CHAR LIMIT=40] -->
    <string name="processor_info">Processor info</string>
    <!-- About phone screen, fcc equipment id label  [CHAR LIMIT=40] -->
    <string name="fcc_equipment_id">Equipment ID</string>
    <!-- About phone screen,  setting option name  [CHAR LIMIT=40] -->
+0 −6
Original line number Diff line number Diff line
@@ -133,12 +133,6 @@
                android:title="@string/mod_version"
                android:summary="@string/mod_version_default" />

        <!-- Device hardware processor infol -->
        <Preference android:key="device_processor"
                style="?android:preferenceInformationStyle"
                android:title="@string/processor_info"
                android:summary="@string/device_info_default"/>

        <!-- Device firmware version -->
        <Preference android:key="firmware_version" 
                style="?android:preferenceInformationStyle"
+0 −37
Original line number Diff line number Diff line
@@ -63,7 +63,6 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
    private static final String LOG_TAG = "DeviceInfoSettings";
    private static final String FILENAME_PROC_VERSION = "/proc/version";
    private static final String FILENAME_MSV = "/sys/board_properties/soc/msv";
    private static final String FILENAME_PROC_CPUINFO = "/proc/cpuinfo";

    private static final String KEY_CONTAINER = "container";
    private static final String KEY_REGULATORY_INFO = "regulatory_info";
@@ -77,7 +76,6 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
    private static final String KEY_KERNEL_VERSION = "kernel_version";
    private static final String KEY_BUILD_NUMBER = "build_number";
    private static final String KEY_DEVICE_MODEL = "device_model";
    private static final String KEY_DEVICE_PROCESSOR = "device_processor";
    private static final String KEY_SELINUX_STATUS = "selinux_status";
    private static final String KEY_BASEBAND_VERSION = "baseband_version";
    private static final String KEY_FIRMWARE_VERSION = "firmware_version";
@@ -110,7 +108,6 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
        findPreference(KEY_FIRMWARE_VERSION).setEnabled(true);
        setValueSummary(KEY_BASEBAND_VERSION, "gsm.version.baseband");
        setStringSummary(KEY_DEVICE_MODEL, Build.MODEL + getMsvSuffix());
        setStringSummary(KEY_DEVICE_PROCESSOR, getDeviceProcessorInfo());
        setValueSummary(KEY_EQUIPMENT_ID, PROPERTY_EQUIPMENT_ID);
        setStringSummary(KEY_DEVICE_MODEL, Build.MODEL);
        setStringSummary(KEY_BUILD_NUMBER, Build.DISPLAY);
@@ -538,40 +535,6 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
            }
        };

    /**
     * Returns the Hardware value in /proc/cpuinfo, else returns "Unknown".
     * @return a string that describes the processor
     */
    private static String getDeviceProcessorInfo() {
        // Hardware : XYZ
        final String PROC_HARDWARE_REGEX = "Hardware\\s*:\\s*(.*)$"; /* hardware string */

        try {
            BufferedReader reader = new BufferedReader(new FileReader(FILENAME_PROC_CPUINFO));
            String cpuinfo;

            try {
                while (null != (cpuinfo = reader.readLine())) {
                    if (cpuinfo.startsWith("Hardware")) {
                        Matcher m = Pattern.compile(PROC_HARDWARE_REGEX).matcher(cpuinfo);
                        if (m.matches()) {
                            return m.group(1);
                        }
                    }
                }
                return "Unknown";
            } finally {
                reader.close();
            }
        } catch (IOException e) {
            Log.e(LOG_TAG,
                "IO Exception when getting cpuinfo for Device Info screen",
                e);

            return "Unknown";
        }
    }

    private boolean removePreferenceIfPackageNotInstalled(Preference preference) {
        String intentUri=((PreferenceScreen) preference).getIntent().toUri(1);
        Pattern pattern = Pattern.compile("component=([^/]+)/");