Loading services/core/java/com/android/server/oemlock/OemLockService.java +8 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.Context; import android.content.pm.PackageManager; import android.hardware.oemlock.V1_0.IOemLock; import android.os.Binder; import android.os.Build; import android.os.Bundle; import android.os.IBinder; import android.os.SystemProperties; Loading @@ -38,6 +39,8 @@ import com.android.server.pm.UserManagerInternal; import com.android.server.pm.UserManagerInternal.UserRestrictionsListener; import com.android.server.pm.UserRestrictionsUtils; import java.util.Locale; /** * Service for managing the OEM lock state of the device. * Loading Loading @@ -92,6 +95,7 @@ public class OemLockService extends SystemService { @Override public void onUserRestrictionsChanged(int userId, Bundle newRestrictions, Bundle prevRestrictions) { if (isSamsungDevice()) return; // The admin can prevent OEM unlock with the DISALLOW_FACTORY_RESET user restriction if (UserRestrictionsUtils.restrictionsChanged(prevRestrictions, newRestrictions, UserManager.DISALLOW_FACTORY_RESET)) { Loading Loading @@ -266,6 +270,10 @@ public class OemLockService extends SystemService { } } private boolean isSamsungDevice() { return Build.MANUFACTURER.toLowerCase(Locale.US).contains("samsung"); } private void enforceUserIsAdmin() { final int userId = UserHandle.getCallingUserId(); final long token = Binder.clearCallingIdentity(); Loading Loading
services/core/java/com/android/server/oemlock/OemLockService.java +8 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.Context; import android.content.pm.PackageManager; import android.hardware.oemlock.V1_0.IOemLock; import android.os.Binder; import android.os.Build; import android.os.Bundle; import android.os.IBinder; import android.os.SystemProperties; Loading @@ -38,6 +39,8 @@ import com.android.server.pm.UserManagerInternal; import com.android.server.pm.UserManagerInternal.UserRestrictionsListener; import com.android.server.pm.UserRestrictionsUtils; import java.util.Locale; /** * Service for managing the OEM lock state of the device. * Loading Loading @@ -92,6 +95,7 @@ public class OemLockService extends SystemService { @Override public void onUserRestrictionsChanged(int userId, Bundle newRestrictions, Bundle prevRestrictions) { if (isSamsungDevice()) return; // The admin can prevent OEM unlock with the DISALLOW_FACTORY_RESET user restriction if (UserRestrictionsUtils.restrictionsChanged(prevRestrictions, newRestrictions, UserManager.DISALLOW_FACTORY_RESET)) { Loading Loading @@ -266,6 +270,10 @@ public class OemLockService extends SystemService { } } private boolean isSamsungDevice() { return Build.MANUFACTURER.toLowerCase(Locale.US).contains("samsung"); } private void enforceUserIsAdmin() { final int userId = UserHandle.getCallingUserId(); final long token = Binder.clearCallingIdentity(); Loading