Fix device admin access with permission checks.

Plus a handful of other fixes.

Fixes: 271818883

Test: btest a.d.c.LockTest -c yes
Test: btest a.d.c.WipeDataTest -c yes
Change-Id: I4a7c8c5393c5f3e9e9799684b7eccb387dc943cc
This commit is contained in:
Elis Elliott
2023-03-06 11:48:25 +00:00
parent 5f3a9aa34c
commit a0abafa17e
3 changed files with 409 additions and 309 deletions

View File

@@ -6413,7 +6413,7 @@ public class DevicePolicyManager {
public void lockNow(@LockNowFlag int flags) {
if (mService != null) {
try {
mService.lockNow(flags, mParentInstance);
mService.lockNow(flags, mContext.getPackageName(), mParentInstance);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}

View File

@@ -119,7 +119,7 @@ interface IDevicePolicyManager {
void setRequiredStrongAuthTimeout(in ComponentName who, String callerPackageName, long timeMs, boolean parent);
long getRequiredStrongAuthTimeout(in ComponentName who, int userId, boolean parent);
void lockNow(int flags, boolean parent);
void lockNow(int flags, String callerPackageName, boolean parent);
/**
* @param factoryReset only applicable when `targetSdk >= U`, either tries to factoryReset/fail or removeUser/fail otherwise