summaryrefslogtreecommitdiff
path: root/packages/Shell
diff options
context:
space:
mode:
author Eran Messeri <eranm@google.com> 2025-03-19 14:02:50 +0000
committer Eran Messeri <eranm@google.com> 2025-03-20 12:07:16 +0000
commit8afa1abb82796ed7e3d307ad031852b454f086fa (patch)
treece85ef94cac24d9078d462df45c867bf311e90a6 /packages/Shell
parent27114f7855d1281b2a42b51b8453471c29aea255 (diff)
DPM/MTE: Fix MTE developer Option when AAPM is on
This change fixes the Memory Tagging Extension developer option Settings to be greyed out if the MTE state is controlled by AAPM. The fix consists of: * A change to the DevicePolicyManagerService to return the MTE policy regardless of the caller identity - as the getMtePolicy metthod does not care which admin has set the MTE policy, just the resolved policy for the device. * A change to RestrictedLockUtilsInternal to return an EnfocredAdmin representing that the MTE policy is managed somehow. Other code in the RestrictedLockUtilsInternal knows how to resolve the right admin from the EnforcedAdmin. To test the fix, the MANAGE_DEVICE_POLICY_MTE permission was added to the shell. It is safe for the shell to have this permission because: * A human can query and modify the state of the Memory Tagging Extension policy via Developer Options. * If the device is managed and the user tries to disable MTE, there is an additional check in the DevicePolicyManagerService that only the device policy client (DPC) can disable MTE. Bug: 402456665 Test: Manual, turn on AAPM with adb commands and observe the toggle in Settings. Test: atest CtsSecurityTestCases:android.security.cts.advancedprotection.MemoryTaggingExtensionTest Test: atest CtsDevicePolicyTestCases:android.devicepolicy.cts.MtePolicyTest Test: atest CtsDevicePolicyTestCases:android.devicepolicy.cts.DeviceManagementCoexistenceTest Flag: EXEMPT bugfix Change-Id: I55ffdec9b7abc29be503d85a7ae2607ba81938de
Diffstat (limited to 'packages/Shell')
-rw-r--r--packages/Shell/AndroidManifest.xml1
1 files changed, 1 insertions, 0 deletions
diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml
index 55f7317f25e4..b8534ffe9476 100644
--- a/packages/Shell/AndroidManifest.xml
+++ b/packages/Shell/AndroidManifest.xml
@@ -961,6 +961,7 @@
android:featureFlag="android.security.aapm_api"/>
<uses-permission android:name="android.permission.QUERY_ADVANCED_PROTECTION_MODE"
android:featureFlag="android.security.aapm_api"/>
+ <uses-permission android:name="android.permission.MANAGE_DEVICE_POLICY_MTE" />
<!-- Permission required for CTS test - IntrusionDetectionManagerTest -->
<uses-permission android:name="android.permission.READ_INTRUSION_DETECTION_STATE"