Snap for 11390602 from eac7226d2c22b14c729db9213e5c16ada6ac21ba to mainline-wifi-release

Change-Id: Ic143ad58f7c5d67c34ce1e4bb6ede8113b344bfc
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..448b64e
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,27 @@
+package {
+    // See: http://go/android-license-faq
+    default_applicable_licenses: ["Android-Apache-2.0"],
+}
+android_app_import {
+    name: "CarCalendarApp",
+    apk: "CarCalendarApp.apk",
+    certificate: "platform",
+    required: [
+        "preinstalled-packages-com.android.car.calendar.xml",
+    ],
+    overrides: ["Calendar"],
+    // This flag is needed because we're inehriting 2 `uses-library` tags from `androidx.window`
+    // that it's coming from Compose support in `car-ui-lib` in the manifest. And Soong is
+    // enforcing that both the shared libraries must be in the image. But since both of them are
+    // set to optional we can use the following flag to ignore the build error.
+    optional_uses_libs: [
+        "androidx.window.extensions",
+        "androidx.window.sidecar"
+    ]
+}
+prebuilt_etc {
+    name: "preinstalled-packages-com.android.car.calendar.xml",
+    src: "preinstalled-packages-com.android.car.calendar.xml",
+    sub_dir: "sysconfig",
+}
+
diff --git a/CarCalendarApp.apk b/CarCalendarApp.apk
new file mode 100644
index 0000000..9553aa5
--- /dev/null
+++ b/CarCalendarApp.apk
Binary files differ
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..2d08a6f
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,6 @@
+# Default code reviewers picked from top 3 or more developers.
+# Please update this list if you find better candidates.
+arnaudberry@google.com
+helenweiyu@google.com
+tompelaia@google.com
+yaoyx@google.com
diff --git a/ReadMe.txt b/ReadMe.txt
new file mode 100644
index 0000000..c37d14c
--- /dev/null
+++ b/ReadMe.txt
@@ -0,0 +1,3 @@
+This apk was built with the code released to aosp on June 23, 2022.
+To fetch and build the code, please follow the steps described here:
+https://source.android.com/docs/devices/automotive/unbundled_apps/integration
diff --git a/preinstalled-packages-com.android.car.calendar.xml b/preinstalled-packages-com.android.car.calendar.xml
new file mode 100644
index 0000000..02094b4
--- /dev/null
+++ b/preinstalled-packages-com.android.car.calendar.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 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, per user type.
+     Documentation at frameworks/base/data/etc/preinstalled-packages-platform.xml
+-->
+<config>
+    <install-in-user-type package="com.android.car.calendar">
+        <install-in user-type="FULL" />
+    </install-in-user-type>
+</config>
diff --git a/update_prebuilt.sh b/update_prebuilt.sh
new file mode 100755
index 0000000..bf682ad
--- /dev/null
+++ b/update_prebuilt.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+set -eu
+
+# Usage: update_prebuilt.sh BUILD_ID
+
+if [ -z "${1+x}" ]
+then
+    echo "build id is required"
+    exit 1
+fi
+
+function downloadApp {
+    TARGET=car_apps_gradle-all
+    # See go/fetch_artifact for details on fetch_artifact. To install it use:
+    # sudo glinux-add-repo android stable && \
+    # sudo apt update && \
+    # sudo apt install android-fetch-artifact
+
+    CMD="fetch_artifact --bid $1 --target $TARGET --use_oauth2"
+
+    $CMD $2 $2
+}
+
+
+cd $(dirname $0)
+
+downloadApp $1 "CarCalendarApp.apk"
+
+echo "Done. Don't forget to test and commit the new artifact."