Allow the device policy management role to migrate accounts
Update copyAccountToUser to a SystemAPI
This is part of the work to split up the DevicePolicyManager
API createAndProvisionManagedProfile. The only caller of this
copyAccountToUser hidden SystemAPI will be the device policy
management role holder
Add permissions to gate the copyAccountToUser API and the
removeAccount API to allow the device policy management
role holder to call these APIs
Bug: 375382324
Test: atest AccountMigrationTest
Test: Manual testing by calling this SystemAPI in CloudDPC
CTS tests will be added as a follow-up
Flag: android.app.admin.flags.split_create_managed_profile_enabled
Change-Id: I243f7ce53c6b8c8db1b946981895782f9d1c59dd
diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml
index 526320d..0b5dfb3 100644
--- a/packages/Shell/AndroidManifest.xml
+++ b/packages/Shell/AndroidManifest.xml
@@ -242,6 +242,8 @@
<uses-permission android:name="android.permission.READ_LOWPAN_CREDENTIAL" />
<uses-permission android:name="android.permission.BLUETOOTH_STACK" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
+ <uses-permission android:name="android.permission.COPY_ACCOUNTS" />
+ <uses-permission android:name="android.permission.REMOVE_ACCOUNTS" />
<uses-permission android:name="android.permission.RETRIEVE_WINDOW_TOKEN" />
<uses-permission android:name="android.permission.FRAME_STATS" />
<uses-permission android:name="android.permission.BIND_APPWIDGET" />