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

Commit b3abbc48 authored by Jonathan Klee's avatar Jonathan Klee
Browse files

Merge branch 'security_patch_r' into 'v1-r'

Add Build.VERSION.SECURITY_PATCH_EOS

See merge request e/os/android_frameworks_base!108
parents a6f7bf4b 3a3768a6
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.os;

import android.Manifest;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SuppressAutoDoc;
import android.annotation.SystemApi;
@@ -275,6 +276,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.
         */
        @Nullable 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");