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

Commit ff9cea3c authored by Danesh M's avatar Danesh M
Browse files

Settings : Launch demo mode on triple tap of build date

Change-Id: I85341ad7f9c8bba107e26e5e12924906466b0c76
parent 7cb203df
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -140,6 +140,7 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
        setValueSummary(KEY_MOD_BUILD_DATE, "ro.build.date");
        setExplicitValueSummary(KEY_MOD_API_LEVEL, constructApiLevelString());
        findPreference(KEY_MOD_API_LEVEL).setEnabled(true);
        findPreference(KEY_MOD_BUILD_DATE).setEnabled(true);

        if (!SELinux.isSELinuxEnabled()) {
            String status = getResources().getString(R.string.selinux_status_disabled);
@@ -246,6 +247,19 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
                    Log.e(LOG_TAG, "Unable to start activity " + intent.toString());
                }
            }
        } else if (preference.getKey().equals(KEY_MOD_BUILD_DATE)) {
            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.setClassName("com.android.systemui",
                        "com.android.systemui.tuner.TunerActivity$DemoModeActivity");
                try {
                    startActivity(intent);
                } catch (Exception e) {
                    Log.e(LOG_TAG, "Unable to start activity " + intent.toString());
                }
            }
        } else if (preference.getKey().equals(KEY_BUILD_NUMBER)) {
            // Don't enable developer options for secondary users.
            if (UserHandle.myUserId() != UserHandle.USER_OWNER) return true;