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

Commit 01cfd8bf authored by Zhao Wei Liew's avatar Zhao Wei Liew
Browse files

Settings: DeviceInfo: Clean up the PlatLogo checks

Re-use the existing AOSP check for displaying our logo instead
of maintaining a chunk of copied code.

Also, change the intent from 'is_cm' to 'is_lineage' for rebranding.

Change-Id: I23dfc7b6aa6b8d96d45a757a4b44f2399e62196c
parent f9987fb2
Loading
Loading
Loading
Loading
+3 −15
Original line number Diff line number Diff line
@@ -226,7 +226,8 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In

    @Override
    public boolean onPreferenceTreeClick(Preference preference) {
        if (preference.getKey().equals(KEY_FIRMWARE_VERSION)) {
        if (preference.getKey().equals(KEY_FIRMWARE_VERSION)
                || 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)) {
@@ -240,6 +241,7 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
                }

                Intent intent = new Intent(Intent.ACTION_MAIN);
                intent.putExtra("is_lineage", preference.getKey().equals(KEY_MOD_VERSION));
                intent.setClassName("android",
                        com.android.internal.app.PlatLogoActivity.class.getName());
                try {
@@ -317,20 +319,6 @@ 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);
    }