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

Commit e73587d1 authored by Felipe Leme's avatar Felipe Leme
Browse files

New DPM resources: policy_exempt_apps and vendor_policy_exempt_apps.

DevicePolicyManager has many APIs that let the DPC app to disable
other apps, which could be a problem on automotive builds as some
apps (like the rear-view camera app) are critical for driving safety
and should never be disabled.

This CL only introduces the new config (which is overlaid on
automotive CLs in this topic); its usage (and CTS tests that exercise
it) will be added on follow-up CLs.

Test: adb shell dumpsys device_policy| grep policy_exempt
Bug: 181238156

Change-Id: I839022c1e302565ffe6286af3e890223206ff65a
parent e4ba4f83
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2021 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<resources>
    <!--
    A collection of apps that are critical for the device and hence will never be disabled by
    device policies or APIs.
    -->
    <string-array translatable="false" name="policy_exempt_apps">
    </string-array>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -1264,6 +1264,8 @@
  <java-symbol type="array" name="vendor_disallowed_apps_managed_device" />
  <java-symbol type="array" name="cross_profile_apps" />
  <java-symbol type="array" name="vendor_cross_profile_apps" />
  <java-symbol type="array" name="policy_exempt_apps" />
  <java-symbol type="array" name="vendor_policy_exempt_apps" />

  <java-symbol type="drawable" name="default_wallpaper" />
  <java-symbol type="drawable" name="default_lock_wallpaper" />
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright (C) 2021 The Android Open Source Project
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<resources>
    <!--
    A collection of apps that are critical for the device and hence will never be disabled by
    device policies or APIs.
    -->
    <string-array translatable="false" name="vendor_policy_exempt_apps">
    </string-array>
</resources>
+2 −0
Original line number Diff line number Diff line
@@ -9329,6 +9329,8 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        dumpResources(pw, mContext, "vendor_cross_profile_apps", R.array.vendor_cross_profile_apps);
        dumpResources(pw, mContext, "config_packagesExemptFromSuspension",
                R.array.config_packagesExemptFromSuspension);
        dumpResources(pw, mContext, "policy_exempt_apps", R.array.policy_exempt_apps);
        dumpResources(pw, mContext, "vendor_policy_exempt_apps", R.array.vendor_policy_exempt_apps);
        pw.decreaseIndent();
        pw.println();
    }