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

Commit 86b5524e authored by Jonathan Klee's avatar Jonathan Klee
Browse files

Add Build.VERSION.SECURITY_PATCH_EOS

Device tree can now define PLATFORM_SECURITY_PATCH_OVERRIDE
to specify a specific ro.build.version.security_patch value.

If PLATFORM_SECURITY_PATCH_OVERRIDE is defined,
ro.eos.version.security_patch will have the overriden value
and will be read by the framework to be displayed to the user.
parent 017a84f8
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -255,6 +255,13 @@ public class Build {
        public static final String SECURITY_PATCH = SystemProperties.get(
                "ro.build.version.security_patch", "");

        /**
         * The user-visible security patch level when the device overrides the security patch with
         * PLATFORM_SECURITY_PATCH_OVERRIDE.
         */
        public static final String SECURITY_PATCH_EOS = SystemProperties.get(
                "ro.eos.version.security_patch", "");

        /**
         * The user-visible SDK version of the framework in its raw String
         * representation; use {@link #SDK_INT} instead.
+4 −0
Original line number Diff line number Diff line
@@ -154,9 +154,13 @@ public class DeviceInfoUtils {
    }

    public static String getSecurityPatch() {
        String eosPatch = Build.VERSION.SECURITY_PATCH_EOS;
        String patch = Build.VERSION.SECURITY_PATCH;
        if (!"".equals(patch)) {
            try {
                if (!"".equals(eosPatch)) {
                    patch = eosPatch;
                }
                SimpleDateFormat template = new SimpleDateFormat("yyyy-MM-dd");
                Date patchDate = template.parse(patch);
                String format = DateFormat.getBestDateTimePattern(Locale.getDefault(), "dMMMMyyyy");