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 |
| 19 | the type of user. All system packages on the device should ideally have an entry in an xml file |
| 20 | (keys by its manifest name). |
| 21 | |
| 22 | Main user-types (every user will be at least one of these types) are: |
| 23 | SYSTEM (user 0) |
| 24 | FULL (any non-profile human user) |
| 25 | PROFILE (profile human user) |
| 26 | |
| 27 | Additional optional types are: GUEST, RESTRICTED, MANAGED_PROFILE, EPHEMERAL, DEMO |
| 28 | |
| 29 | The meaning of each of these user types is delineated by flags in |
| 30 | frameworks/base/core/java/android/content/pm/UserInfo.java. |
| 31 | See frameworks/base/services/core/java/com/android/server/pm/UserSystemPackageInstaller#getFlagsFromUserTypes |
| 32 | |
| 33 | The following three examples should cover most normal cases: |
| 34 | |
| 35 | 1. For a system package to be pre-installed only in user 0: |
| 36 | |
| 37 | <install-in-user-type package="com.android.example"> |
| 38 | <install-in user-type="SYSTEM"> |
| 39 | </install-in-user-type> |
| 40 | |
| 41 | |
| 42 | 2. For a system package to be pre-installed on all human users (e.g. a web browser), i.e. to be |
| 43 | installed on any user of type type FULL or PROFILE (since this covers all human users): |
| 44 | |
| 45 | <install-in-user-type package="com.android.example"> |
| 46 | <install-in user-type="FULL"> |
| 47 | <install-in user-type="PROFILE"> |
| 48 | </install-in-user-type> |
| 49 | |
| 50 | |
| 51 | 3. For a system package to be pre-installed on all human users except for profile users (e.g. a |
| 52 | wallpaper app, since profiles cannot display wallpaper): |
| 53 | |
| 54 | <install-in-user-type package="com.android.example"> |
| 55 | <install-in user-type="FULL"> |
| 56 | </install-in-user-type> |
| 57 | |
| 58 | |
| 59 | Some system packages truly are required to be on all users, regardless of type, in which case use: |
| 60 | <install-in-user-type package="com.android.example"> |
| 61 | <install-in user-type="SYSTEM"> |
| 62 | <install-in user-type="FULL"> |
| 63 | <install-in user-type="PROFILE"> |
| 64 | </install-in-user-type> |
| 65 | |
| 66 | More fine-grained options are also available (see below). Additionally, packages can blacklist |
| 67 | user types. Blacklists override any whitelisting (in any file). |
| 68 | E.g. |
| 69 | <install-in-user-type package="com.android.example"> |
| 70 | <install-in user-type="FULL" /> |
| 71 | <do-not-install-in user-type="GUEST" /> |
| 72 | </install-in-user-type> |
| 73 | |
| 74 | If a user is of type FULL and GUEST, this package will NOT be installed, because the |
| 75 | 'do-not-install-in' takes precedence over 'install-in'. |
| 76 | |
| 77 | The way that a device treats system packages that do not have any entry (for any user type) at all |
| 78 | is determined by the config resource value config_userTypePackageWhitelistMode. |
| 79 | See frameworks/base/core/res/res/values/config.xml#config_userTypePackageWhitelistMode. |
| 80 | |
| 81 | Changes to the whitelist during system updates can result in installing new system packages |
| 82 | to pre-existing users, but cannot uninstall system packages from pre-existing users. |
| 83 | --> |
| 84 | <config> |
| 85 | <install-in-user-type package="com.android.providers.settings"> |
| 86 | <install-in user-type="SYSTEM" /> |
| 87 | <install-in user-type="FULL" /> |
| 88 | <install-in user-type="PROFILE" /> |
| 89 | </install-in-user-type> |
| 90 | </config> |