Enforce uxr configuration permissions
Bug: 139093446
Test: atest CarServiceTest
Change-Id: I663f696ce56c3e70242dc7e70d0daf5a257e412e
diff --git a/service/src/com/android/car/CarUxRestrictionsManagerService.java b/service/src/com/android/car/CarUxRestrictionsManagerService.java
index d85ebaa..e95fd63 100644
--- a/service/src/com/android/car/CarUxRestrictionsManagerService.java
+++ b/service/src/com/android/car/CarUxRestrictionsManagerService.java
@@ -174,6 +174,7 @@
@Override
public List<CarUxRestrictionsConfiguration> getConfigs() {
+ ICarImpl.assertPermission(mContext, Car.PERMISSION_CAR_UX_RESTRICTIONS_CONFIGURATION);
return new ArrayList<>(mCarUxRestrictionsConfigurations.values());
}
@@ -415,6 +416,8 @@
@Override
@Nullable
public List<CarUxRestrictionsConfiguration> getStagedConfigs() {
+ ICarImpl.assertPermission(mContext, Car.PERMISSION_CAR_UX_RESTRICTIONS_CONFIGURATION);
+
File stagedConfig = getFile(CONFIG_FILENAME_STAGED);
if (stagedConfig.exists()) {
logd("Attempting to read staged config");