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

Commit adbfe51c authored by Alex Xu's avatar Alex Xu Committed by Automerger Merge Worker
Browse files

Merge "Clear calling identity when getting global security state" into main...

Merge "Clear calling identity when getting global security state" into main am: 70a1c29c am: 15f2d4f8

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3377189



Change-Id: I18ca10e283493718579b62a3b8e3827d075686ef
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 58eb98f4 15f2d4f8
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -22,6 +22,7 @@ import static android.os.SecurityStateManager.KEY_VENDOR_SPL;


import android.content.Context;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager;
import android.os.Binder;
import android.os.Build;
import android.os.Build;
import android.os.Bundle;
import android.os.Bundle;
import android.os.ISecurityStateManager;
import android.os.ISecurityStateManager;
@@ -56,6 +57,15 @@ public class SecurityStateManagerService extends ISecurityStateManager.Stub {


    @Override
    @Override
    public Bundle getGlobalSecurityState() {
    public Bundle getGlobalSecurityState() {
        final long token = Binder.clearCallingIdentity();
        try {
            return getGlobalSecurityStateInternal();
        } finally {
            Binder.restoreCallingIdentity(token);
        }
    }

    private Bundle getGlobalSecurityStateInternal() {
        Bundle globalSecurityState = new Bundle();
        Bundle globalSecurityState = new Bundle();
        globalSecurityState.putString(KEY_SYSTEM_SPL, Build.VERSION.SECURITY_PATCH);
        globalSecurityState.putString(KEY_SYSTEM_SPL, Build.VERSION.SECURITY_PATCH);
        globalSecurityState.putString(KEY_VENDOR_SPL,
        globalSecurityState.putString(KEY_VENDOR_SPL,