Merge "Added parameter callerPackage to setApplicationExemptions for metrics test"
This commit is contained in:
committed by
Android (Google) Code Review
commit
8d170ccd2b
@@ -15753,7 +15753,7 @@ public class DevicePolicyManager {
|
||||
throwIfParentInstance("setApplicationExemptions");
|
||||
if (mService != null) {
|
||||
try {
|
||||
mService.setApplicationExemptions(packageName,
|
||||
mService.setApplicationExemptions(mContext.getPackageName(), packageName,
|
||||
ArrayUtils.convertToIntArray(new ArraySet<>(exemptions)));
|
||||
} catch (ServiceSpecificException e) {
|
||||
switch (e.errorCode) {
|
||||
|
||||
@@ -591,7 +591,7 @@ interface IDevicePolicyManager {
|
||||
|
||||
List<UserHandle> getPolicyManagedProfiles(in UserHandle userHandle);
|
||||
|
||||
void setApplicationExemptions(String packageName, in int[]exemptions);
|
||||
void setApplicationExemptions(String callerPackage, String packageName, in int[]exemptions);
|
||||
int[] getApplicationExemptions(String packageName);
|
||||
|
||||
void setMtePolicy(int flag, String callerPackageName);
|
||||
|
||||
@@ -19648,7 +19648,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApplicationExemptions(String packageName, int[] exemptions) {
|
||||
public void setApplicationExemptions(String callerPackage, String packageName,
|
||||
int[] exemptions) {
|
||||
if (!mHasFeature) {
|
||||
return;
|
||||
}
|
||||
@@ -19659,7 +19660,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
||||
Preconditions.checkCallAuthorization(
|
||||
hasCallingOrSelfPermission(permission.MANAGE_DEVICE_POLICY_APP_EXEMPTIONS));
|
||||
|
||||
final CallerIdentity caller = getCallerIdentity();
|
||||
final CallerIdentity caller = getCallerIdentity(callerPackage);
|
||||
final ApplicationInfo packageInfo;
|
||||
packageInfo = getPackageInfoWithNullCheck(packageName, caller);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user