Initial version of preinstalled-packages-product-car-emulator.xml

Bug: 123533823
Test: adb shell pm list packages --user 0 com.android.car.carlauncher
Test: adb shell pm list packages --user 10 com.android.car.carlauncher

Change-Id: I4a0e5ee30a1e83d0f495f235055ce4047be7f60a
diff --git a/common/car.mk b/common/car.mk
index 509694f..2ede743 100644
--- a/common/car.mk
+++ b/common/car.mk
@@ -62,6 +62,10 @@
 
 DEVICE_MANIFEST_FILE := device/generic/car/common/manifest.xml
 
+# Whitelisted packages per user type
+PRODUCT_COPY_FILES += \
+  device/generic/car/common/preinstalled-packages-product-car-emulator.xml:product/etc/sysconfig/preinstalled-packages-product-car-emulator.xml
+
 # Car emulator specific sepolicy
 BOARD_SEPOLICY_DIRS += \
     device/generic/car/common/sepolicy
diff --git a/common/preinstalled-packages-product-car-emulator.xml b/common/preinstalled-packages-product-car-emulator.xml
new file mode 100644
index 0000000..82698a4
--- /dev/null
+++ b/common/preinstalled-packages-product-car-emulator.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2019 The Android Open Source Project
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License
+  -->
+<!-- System packages to preinstall, per user type.
+     Documentation at frameworks/base/data/etc/preinstalled-packages-platform.xml
+-->
+<config>
+    <!-- TODO(b/123533823): launcher could be removed, but it's useful for debugging during
+         development
+    <install-in-user-type package="com.android.car.carlauncher">
+        <install-in user-type="FULL" />
+    </install-in-user-type>
+    -->
+    <install-in-user-type package="com.android.car.settings">
+        <install-in user-type="FULL" />
+    </install-in-user-type>
+    <!--
+     TODO(b/123533823):
+       - add everything that's provided by reference implementation but should be provided by OEM
+       - change whitelist mode to be explicit
+     -->
+</config>