Add preinstallation configs for RCS and BatteryStats Viewer

Bug: 238970256
Test: Verify app installation on device
Change-Id: I7051a1749b31833a543e24af128227690521c00b
diff --git a/Android.bp b/Android.bp
index 57ebe85..77f50b3 100644
--- a/Android.bp
+++ b/Android.bp
@@ -34,3 +34,11 @@
         "NOTICE",
     ],
 }
+
+prebuilt_etc {
+    name: "preinstalled-packages-product-gs101-device-debug.xml",
+    src: "preinstalled-packages-product-gs101-device-debug.xml",
+    product_specific: true,
+    sub_dir: "sysconfig",
+    filename_from_src: true,
+}
diff --git a/device.mk b/device.mk
index 6d5e7ad..0c62903 100644
--- a/device.mk
+++ b/device.mk
@@ -898,6 +898,7 @@
 
 #RCS Test Messaging App
 PRODUCT_PACKAGES_DEBUG += \
+	preinstalled-packages-product-gs101-device-debug.xml \
 	TestRcsApp
 
 PRODUCT_PACKAGES += ShannonRcs
diff --git a/preinstalled-packages-product-gs101-device-debug.xml b/preinstalled-packages-product-gs101-device-debug.xml
new file mode 100644
index 0000000..64524bc
--- /dev/null
+++ b/preinstalled-packages-product-gs101-device-debug.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright 2023 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 on gs101 debug devices, per user type.
+     Documentation at frameworks/base/data/etc/preinstalled-packages-platform.xml
+-->
+<config>
+    <!-- Battery Stats Viewer (BatteryStatsViewer) -->
+    <install-in-user-type package="com.android.frameworks.core.batterystatsviewer">
+        <install-in user-type="FULL" />
+        <install-in user-type="PROFILE" />
+        <do-not-install-in user-type="android.os.usertype.profile.CLONE" />
+    </install-in-user-type>
+
+    <!-- RCS - Rich Communication Services (TestRcsApp)
+    TODO(b/259401601): Check if this should be preinstalled for SYSTEM user -->
+    <install-in-user-type package="com.google.android.sample.rcsclient">
+        <install-in user-type="SYSTEM" />
+        <install-in user-type="FULL" />
+        <install-in user-type="PROFILE" />
+        <do-not-install-in user-type="android.os.usertype.profile.CLONE" />
+    </install-in-user-type>
+</config>