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

Commit 15c04f36 authored by Rafael Prado's avatar Rafael Prado Committed by Android (Google) Code Review
Browse files

Merge "Use callerPackageName instead of caller.getPackageName()" into main

parents 255e687c cead3d32
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -9089,7 +9089,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        CallerIdentity caller = getCallerIdentity(who);
        CallerIdentity caller = getCallerIdentity(who);
        if (Flags.setAutoTimeEnabledCoexistence()) {
        if (Flags.setAutoTimeEnabledCoexistence()) {
            Preconditions.checkCallAuthorization(hasPermission(SET_TIME, caller.getPackageName()));
            Preconditions.checkCallAuthorization(hasPermission(SET_TIME, callerPackageName));
        } else {
        } else {
            Objects.requireNonNull(who, "ComponentName is null");
            Objects.requireNonNull(who, "ComponentName is null");
            Preconditions.checkCallAuthorization(isProfileOwnerOnUser0(caller)
            Preconditions.checkCallAuthorization(isProfileOwnerOnUser0(caller)
@@ -9152,7 +9152,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        EnforcingAdmin enforcingAdmin = enforcePermissionAndGetEnforcingAdmin(
        EnforcingAdmin enforcingAdmin = enforcePermissionAndGetEnforcingAdmin(
                /* who */ null,
                /* who */ null,
                SET_TIME,
                SET_TIME,
                caller.getPackageName(),
                callerPackageName,
                UserHandle.USER_ALL
                UserHandle.USER_ALL
        );
        );
        Integer state = mDevicePolicyEngine.getGlobalPolicySetByAdmin(
        Integer state = mDevicePolicyEngine.getGlobalPolicySetByAdmin(
@@ -9197,7 +9197,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        CallerIdentity caller = getCallerIdentity(who);
        CallerIdentity caller = getCallerIdentity(who);
        if (Flags.setAutoTimeZoneEnabledCoexistence()) {
        if (Flags.setAutoTimeZoneEnabledCoexistence()) {
            Preconditions.checkCallAuthorization(
            Preconditions.checkCallAuthorization(
                hasPermission(SET_TIME_ZONE, caller.getPackageName()));
                hasPermission(SET_TIME_ZONE, callerPackageName));
        } else {
        } else {
            Objects.requireNonNull(who, "ComponentName is null");
            Objects.requireNonNull(who, "ComponentName is null");
            Preconditions.checkCallAuthorization(isProfileOwnerOnUser0(caller)
            Preconditions.checkCallAuthorization(isProfileOwnerOnUser0(caller)
@@ -9255,7 +9255,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        EnforcingAdmin enforcingAdmin = enforcePermissionAndGetEnforcingAdmin(
        EnforcingAdmin enforcingAdmin = enforcePermissionAndGetEnforcingAdmin(
                /* who */ null,
                /* who */ null,
                SET_TIME_ZONE,
                SET_TIME_ZONE,
                caller.getPackageName(),
                callerPackageName,
                UserHandle.USER_ALL
                UserHandle.USER_ALL
        );
        );
        Integer state = mDevicePolicyEngine.getGlobalPolicySetByAdmin(
        Integer state = mDevicePolicyEngine.getGlobalPolicySetByAdmin(