Merge "meta-google: Add getprop script to the host system." am: 77927c855b

Original change: https://android-review.googlesource.com/c/device/google/trout/+/2194480

Change-Id: I40318433627bbb053e8bdbbcb21394d4b6766df2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/agl_services_build/yocto-layer/meta-google/recipes-devtools/getprop/files/getprop b/agl_services_build/yocto-layer/meta-google/recipes-devtools/getprop/files/getprop
new file mode 100755
index 0000000..bf33def
--- /dev/null
+++ b/agl_services_build/yocto-layer/meta-google/recipes-devtools/getprop/files/getprop
@@ -0,0 +1,26 @@
+#!/usr/bin/env python3
+#
+# Copyright (C) 2022 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.
+
+import sys
+
+PROPERTIES = {
+    'ro.build.flavor': 'trout_pvm-eng',
+}
+
+for arg in sys.argv[1:]:
+    val = PROPERTIES.get(arg)
+    if val:
+        print(val)
diff --git a/agl_services_build/yocto-layer/meta-google/recipes-devtools/getprop/getprop.bb b/agl_services_build/yocto-layer/meta-google/recipes-devtools/getprop/getprop.bb
new file mode 100644
index 0000000..c2c461c
--- /dev/null
+++ b/agl_services_build/yocto-layer/meta-google/recipes-devtools/getprop/getprop.bb
@@ -0,0 +1,16 @@
+SUMMARY = "A script that allows Google internal tools to recognize the host VM as a Trout device."
+
+LICENSE = "Apache-2.0"
+
+inherit allarch
+
+SRC_URI = " \
+    file://getprop \
+"
+
+do_install() {
+    install -d ${D}${prefix}/local/bin
+    install -m 0755 ${WORKDIR}/getprop ${D}${prefix}/local/bin
+}
+
+FILES_${PN} += "${prefix}/local/bin/getprop"