blob: 625558406b9c00fa4bfab6f1f5e1aae5cc27ce7c [file] [log] [blame]
Bookatz04d7ae52019-08-05 14:07:12 -07001<?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<!--
18This XML file declares which system packages should be initially installed for new users based on
Bookatza8c2d2a2019-11-13 10:10:18 -080019their user type. All system packages on the device should ideally have an entry in an xml file
Yan Zhu31b01e42020-05-18 12:19:08 -070020(keyed by its manifest name), except auto-generated rro packages. Auto-generated RRO packages
21(package name ends with ".auto_generated_rro_product__" or ".auto_generated_rro_vendor__")
22will be installed for new users according to corresponding overlay target packages.
Bookatz04d7ae52019-08-05 14:07:12 -070023
Bookatza8c2d2a2019-11-13 10:10:18 -080024Base user-types (every user will be at least one of these types) are:
Bookatz04d7ae52019-08-05 14:07:12 -070025 SYSTEM (user 0)
26 FULL (any non-profile human user)
27 PROFILE (profile human user)
Bookatza8c2d2a2019-11-13 10:10:18 -080028the precise meaning of which is defined in
Bookatz04d7ae52019-08-05 14:07:12 -070029frameworks/base/core/java/android/content/pm/UserInfo.java.
Bookatza8c2d2a2019-11-13 10:10:18 -080030TODO(b/143784345): When UserInfo flags are categorized, reference the "base type" category here.
31
32More granular control is also available by specifying individual user types (every user is exactly
33one of these user types).
34This includes AOSP user types defined in frameworks/base/core/java/android/os/UserManager.java, like
35 android.os.usertype.full.SYSTEM
36 android.os.usertype.full.SECONDARY
37 android.os.usertype.full.GUEST
38 android.os.usertype.full.DEMO
39 android.os.usertype.full.RESTRICTED
40 android.os.usertype.profile.MANAGED
41 android.os.usertype.system.HEADLESS
42as well as any OEM custom user types defined using
43frameworks/base/services/core/java/com/android/server/pm/UserTypeFactory.java.
44Any specified user types must be valid user types on the device (i.e. created in UserTypeFactory).
Bookatz04d7ae52019-08-05 14:07:12 -070045
46The following three examples should cover most normal cases:
47
481. For a system package to be pre-installed only in user 0:
49
50 <install-in-user-type package="com.android.example">
Bookatz52c74082019-12-03 09:31:05 -080051 <install-in user-type="SYSTEM" />
Bookatz04d7ae52019-08-05 14:07:12 -070052 </install-in-user-type>
53
54
552. For a system package to be pre-installed on all human users (e.g. a web browser), i.e. to be
Yan Zhu31b01e42020-05-18 12:19:08 -070056installed on any user of type FULL or PROFILE (since this covers all human users):
Bookatz04d7ae52019-08-05 14:07:12 -070057
58 <install-in-user-type package="com.android.example">
Bookatz52c74082019-12-03 09:31:05 -080059 <install-in user-type="FULL" />
60 <install-in user-type="PROFILE" />
Bookatz04d7ae52019-08-05 14:07:12 -070061 </install-in-user-type>
62
63
643. For a system package to be pre-installed on all human users except for profile users (e.g. a
65wallpaper app, since profiles cannot display wallpaper):
66
67 <install-in-user-type package="com.android.example">
Bookatz52c74082019-12-03 09:31:05 -080068 <install-in user-type="FULL" />
Bookatz04d7ae52019-08-05 14:07:12 -070069 </install-in-user-type>
70
71
72Some system packages truly are required to be on all users, regardless of type, in which case use:
73 <install-in-user-type package="com.android.example">
74 <install-in user-type="SYSTEM">
Bookatz52c74082019-12-03 09:31:05 -080075 <install-in user-type="FULL" />
76 <install-in user-type="PROFILE" />
Bookatz04d7ae52019-08-05 14:07:12 -070077 </install-in-user-type>
78
Bookatza8c2d2a2019-11-13 10:10:18 -080079More fine-grained options are also available by specifying individual user types.
80E.g.
81 <install-in-user-type package="com.android.example">
Bookatz52c74082019-12-03 09:31:05 -080082 <install-in user-type="android.os.usertype.profile.MANAGED" />
83 <install-in user-type="android.os.usertype.full.GUEST" />
Bookatza8c2d2a2019-11-13 10:10:18 -080084 <install-in user-type="SYSTEM">
85 </install-in-user-type>
86which installs this package on any user whose user type is a managed profile or a guest, or is of
87a SYSTEM base type.
88
89Additionally, packages can blacklist user types. Blacklists override any whitelisting (in any file).
Bookatz04d7ae52019-08-05 14:07:12 -070090E.g.
91 <install-in-user-type package="com.android.example">
92 <install-in user-type="FULL" />
Bookatza8c2d2a2019-11-13 10:10:18 -080093 <do-not-install-in user-type="android.os.usertype.full.GUEST" />
Bookatz04d7ae52019-08-05 14:07:12 -070094 </install-in-user-type>
Bookatza8c2d2a2019-11-13 10:10:18 -080095If a user is of type android.os.usertype.full.GUEST (which itself is a subtype of FULL), this
96package will NOT be installed, because the 'do-not-install-in' takes precedence over 'install-in'.
Bookatz04d7ae52019-08-05 14:07:12 -070097
98The way that a device treats system packages that do not have any entry (for any user type) at all
99is determined by the config resource value config_userTypePackageWhitelistMode.
100See frameworks/base/core/res/res/values/config.xml#config_userTypePackageWhitelistMode.
101
Adam Bookatz1efd27cd2020-03-19 18:37:36 -0700102Changes to the whitelist during system updates can result in installing additional system packages
103to pre-existing users, but cannot uninstall pre-existing system packages from pre-existing users.
Bookatz04d7ae52019-08-05 14:07:12 -0700104-->
105<config>
106 <install-in-user-type package="com.android.providers.settings">
107 <install-in user-type="SYSTEM" />
108 <install-in user-type="FULL" />
109 <install-in user-type="PROFILE" />
110 </install-in-user-type>
Bookatz6d31ac12019-12-10 12:50:22 -0800111 <install-in-user-type package="com.android.wallpaperbackup">
112 <install-in user-type="FULL" />
113 </install-in-user-type>
Bookatz04d7ae52019-08-05 14:07:12 -0700114</config>