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

Commit 112d0abb authored by Guang Zhu's avatar Guang Zhu Committed by Android (Google) Code Review
Browse files

Merge "do not allow monkey to flip OEM unlock flag" into lmp-dev

parents 74cc5c39 514c5804
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.server;

import android.Manifest;
import android.app.ActivityManager;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Binder;
@@ -26,7 +27,9 @@ import android.os.SystemProperties;
import android.os.UserHandle;
import android.service.persistentdata.IPersistentDataBlockService;
import android.util.Slog;

import com.android.internal.R;

import libcore.io.IoUtils;

import java.io.DataInputStream;
@@ -241,6 +244,10 @@ public class PersistentDataBlockService extends SystemService {

        @Override
        public void setOemUnlockEnabled(boolean enabled) {
            // do not allow monkey to flip the flag
            if (ActivityManager.isUserAMonkey()) {
                return;
            }
            enforceOemUnlockPermission();
            FileOutputStream outputStream;
            try {