diff options
-rw-r--r-- | service/java/com/android/safetycenter/data/SafetySourceDataValidator.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/service/java/com/android/safetycenter/data/SafetySourceDataValidator.java b/service/java/com/android/safetycenter/data/SafetySourceDataValidator.java index 942e4ce18..4b74b0440 100644 --- a/service/java/com/android/safetycenter/data/SafetySourceDataValidator.java +++ b/service/java/com/android/safetycenter/data/SafetySourceDataValidator.java @@ -29,10 +29,10 @@ import android.util.Log; import androidx.annotation.Nullable; import com.android.modules.utils.build.SdkLevel; -import com.android.permission.util.UserUtils; import com.android.safetycenter.SafetyCenterConfigReader; import com.android.safetycenter.SafetyCenterFlags; import com.android.safetycenter.SafetySources; +import com.android.safetycenter.UserProfileGroup; import java.util.List; import java.util.Set; @@ -90,10 +90,14 @@ final class SafetySourceDataValidator { validateCallingPackage(safetySource, packageName, safetySourceId); } - if (UserUtils.isManagedProfile(userId, mContext) - && !SafetySources.supportsManagedProfiles(safetySource)) { + @UserProfileGroup.ProfileType int profileType = + UserProfileGroup.getProfileTypeOfUser(userId, mContext); + if (!SafetySources.supportsProfileType(safetySource, profileType)) { throw new IllegalArgumentException( - "Unexpected managed profile request for safety source: " + safetySourceId); + "Unexpected profile type: " + + profileType + + " for safety source: " + + safetySourceId); } boolean retrievingOrClearingData = safetySourceData == null; |