| Bookatz | 04d7ae5 | 2019-08-05 14:07:12 -0700 | [diff] [blame] | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <!-- Copyright (C) 2019 The Android Open Source Project |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | --> |
| 16 | |
| 17 | <!-- |
| 18 | This XML file declares which system packages should be initially installed for new users based on |
| Bookatz | a8c2d2a | 2019-11-13 10:10:18 -0800 | [diff] [blame] | 19 | their user type. All system packages on the device should ideally have an entry in an xml file |
| Adam Bookatz | 1f04060 | 2021-01-14 13:50:29 -0800 | [diff] [blame] | 20 | (keyed by its manifest name), except for static overlays which are instead treated automatically |
| 21 | according to the entry for their corresponding overlay target package. |
| Bookatz | 04d7ae5 | 2019-08-05 14:07:12 -0700 | [diff] [blame] | 22 | |
| Bookatz | a8c2d2a | 2019-11-13 10:10:18 -0800 | [diff] [blame] | 23 | Base user-types (every user will be at least one of these types) are: |
| Bookatz | 04d7ae5 | 2019-08-05 14:07:12 -0700 | [diff] [blame] | 24 | SYSTEM (user 0) |
| 25 | FULL (any non-profile human user) |
| 26 | PROFILE (profile human user) |
| Bookatz | a8c2d2a | 2019-11-13 10:10:18 -0800 | [diff] [blame] | 27 | the precise meaning of which is defined in |
| Bookatz | 04d7ae5 | 2019-08-05 14:07:12 -0700 | [diff] [blame] | 28 | frameworks/base/core/java/android/content/pm/UserInfo.java. |
| Bookatz | a8c2d2a | 2019-11-13 10:10:18 -0800 | [diff] [blame] | 29 | TODO(b/143784345): When UserInfo flags are categorized, reference the "base type" category here. |
| 30 | |
| 31 | More granular control is also available by specifying individual user types (every user is exactly |
| 32 | one of these user types). |
| 33 | This includes AOSP user types defined in frameworks/base/core/java/android/os/UserManager.java, like |
| 34 | android.os.usertype.full.SYSTEM |
| 35 | android.os.usertype.full.SECONDARY |
| 36 | android.os.usertype.full.GUEST |
| 37 | android.os.usertype.full.DEMO |
| 38 | android.os.usertype.full.RESTRICTED |
| 39 | android.os.usertype.profile.MANAGED |
| 40 | android.os.usertype.system.HEADLESS |
| 41 | as well as any OEM custom user types defined using |
| 42 | frameworks/base/services/core/java/com/android/server/pm/UserTypeFactory.java. |
| 43 | Any specified user types must be valid user types on the device (i.e. created in UserTypeFactory). |
| Bookatz | 04d7ae5 | 2019-08-05 14:07:12 -0700 | [diff] [blame] | 44 | |
| 45 | The following three examples should cover most normal cases: |
| 46 | |
| 47 | 1. For a system package to be pre-installed only in user 0: |
| 48 | |
| 49 | <install-in-user-type package="com.android.example"> |
| Bookatz | 52c7408 | 2019-12-03 09:31:05 -0800 | [diff] [blame] | 50 | <install-in user-type="SYSTEM" /> |
| Bookatz | 04d7ae5 | 2019-08-05 14:07:12 -0700 | [diff] [blame] | 51 | </install-in-user-type> |
| 52 | |
| 53 | |
| 54 | 2. For a system package to be pre-installed on all human users (e.g. a web browser), i.e. to be |
| Yan Zhu | 31b01e4 | 2020-05-18 12:19:08 -0700 | [diff] [blame] | 55 | installed on any user of type FULL or PROFILE (since this covers all human users): |
| Bookatz | 04d7ae5 | 2019-08-05 14:07:12 -0700 | [diff] [blame] | 56 | |
| 57 | <install-in-user-type package="com.android.example"> |
| Bookatz | 52c7408 | 2019-12-03 09:31:05 -0800 | [diff] [blame] | 58 | <install-in user-type="FULL" /> |
| 59 | <install-in user-type="PROFILE" /> |
| Bookatz | 04d7ae5 | 2019-08-05 14:07:12 -0700 | [diff] [blame] | 60 | </install-in-user-type> |
| 61 | |
| 62 | |
| 63 | 3. For a system package to be pre-installed on all human users except for profile users (e.g. a |
| 64 | wallpaper app, since profiles cannot display wallpaper): |
| 65 | |
| 66 | <install-in-user-type package="com.android.example"> |
| Bookatz | 52c7408 | 2019-12-03 09:31:05 -0800 | [diff] [blame] | 67 | <install-in user-type="FULL" /> |
| Bookatz | 04d7ae5 | 2019-08-05 14:07:12 -0700 | [diff] [blame] | 68 | </install-in-user-type> |
| 69 | |
| 70 | |
| 71 | Some system packages truly are required to be on all users, regardless of type, in which case use: |
| 72 | <install-in-user-type package="com.android.example"> |
| 73 | <install-in user-type="SYSTEM"> |
| Bookatz | 52c7408 | 2019-12-03 09:31:05 -0800 | [diff] [blame] | 74 | <install-in user-type="FULL" /> |
| 75 | <install-in user-type="PROFILE" /> |
| Bookatz | 04d7ae5 | 2019-08-05 14:07:12 -0700 | [diff] [blame] | 76 | </install-in-user-type> |
| 77 | |
| Bookatz | a8c2d2a | 2019-11-13 10:10:18 -0800 | [diff] [blame] | 78 | More fine-grained options are also available by specifying individual user types. |
| 79 | E.g. |
| 80 | <install-in-user-type package="com.android.example"> |
| Bookatz | 52c7408 | 2019-12-03 09:31:05 -0800 | [diff] [blame] | 81 | <install-in user-type="android.os.usertype.profile.MANAGED" /> |
| 82 | <install-in user-type="android.os.usertype.full.GUEST" /> |
| Bookatz | a8c2d2a | 2019-11-13 10:10:18 -0800 | [diff] [blame] | 83 | <install-in user-type="SYSTEM"> |
| 84 | </install-in-user-type> |
| 85 | which installs this package on any user whose user type is a managed profile or a guest, or is of |
| 86 | a SYSTEM base type. |
| 87 | |
| 88 | Additionally, packages can blacklist user types. Blacklists override any whitelisting (in any file). |
| Bookatz | 04d7ae5 | 2019-08-05 14:07:12 -0700 | [diff] [blame] | 89 | E.g. |
| 90 | <install-in-user-type package="com.android.example"> |
| 91 | <install-in user-type="FULL" /> |
| Bookatz | a8c2d2a | 2019-11-13 10:10:18 -0800 | [diff] [blame] | 92 | <do-not-install-in user-type="android.os.usertype.full.GUEST" /> |
| Bookatz | 04d7ae5 | 2019-08-05 14:07:12 -0700 | [diff] [blame] | 93 | </install-in-user-type> |
| Bookatz | a8c2d2a | 2019-11-13 10:10:18 -0800 | [diff] [blame] | 94 | If a user is of type android.os.usertype.full.GUEST (which itself is a subtype of FULL), this |
| 95 | package will NOT be installed, because the 'do-not-install-in' takes precedence over 'install-in'. |
| Bookatz | 04d7ae5 | 2019-08-05 14:07:12 -0700 | [diff] [blame] | 96 | |
| 97 | The way that a device treats system packages that do not have any entry (for any user type) at all |
| 98 | is determined by the config resource value config_userTypePackageWhitelistMode. |
| 99 | See frameworks/base/core/res/res/values/config.xml#config_userTypePackageWhitelistMode. |
| 100 | |
| Adam Bookatz | 1efd27cd | 2020-03-19 18:37:36 -0700 | [diff] [blame] | 101 | Changes to the whitelist during system updates can result in installing additional system packages |
| 102 | to pre-existing users, but cannot uninstall pre-existing system packages from pre-existing users. |
| Bookatz | 04d7ae5 | 2019-08-05 14:07:12 -0700 | [diff] [blame] | 103 | --> |
| 104 | <config> |
| Cynthia Wasonga | 6cf76bc | 2022-12-19 02:10:18 +0000 | [diff] [blame] | 105 | <!-- Bluetooth (com.android.btservices apex) - visible on the sharesheet --> |
| 106 | <install-in-user-type package="com.android.bluetooth"> |
| 107 | <install-in user-type="SYSTEM" /> |
| 108 | <install-in user-type="FULL" /> |
| 109 | <install-in user-type="PROFILE" /> |
| 110 | <do-not-install-in user-type="android.os.usertype.profile.CLONE" /> |
| 111 | </install-in-user-type> |
| 112 | |
| 113 | <!-- Settings (Settings app) --> |
| 114 | <install-in-user-type package="com.android.settings"> |
| 115 | <install-in user-type="SYSTEM" /> |
| 116 | <install-in user-type="FULL" /> |
| 117 | <install-in user-type="PROFILE" /> |
| 118 | </install-in-user-type> |
| 119 | |
| 120 | <!-- Settings Storage (SettingsProvider) --> |
| Bookatz | 04d7ae5 | 2019-08-05 14:07:12 -0700 | [diff] [blame] | 121 | <install-in-user-type package="com.android.providers.settings"> |
| 122 | <install-in user-type="SYSTEM" /> |
| 123 | <install-in user-type="FULL" /> |
| 124 | <install-in user-type="PROFILE" /> |
| 125 | </install-in-user-type> |
| Cynthia Wasonga | 6cf76bc | 2022-12-19 02:10:18 +0000 | [diff] [blame] | 126 | |
| 127 | <!-- WallpaperBackup (WallpaperBackup)--> |
| Bookatz | 6d31ac1 | 2019-12-10 12:50:22 -0800 | [diff] [blame] | 128 | <install-in-user-type package="com.android.wallpaperbackup"> |
| 129 | <install-in user-type="FULL" /> |
| 130 | </install-in-user-type> |
| Bookatz | 04d7ae5 | 2019-08-05 14:07:12 -0700 | [diff] [blame] | 131 | </config> |