Merge pi-qpr1-release PQ1A.181105.017.A1 to pi-platform-release

Change-Id: I9d217702012e6067adf95b221470bc788230e38b
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
index 7055a67..ec7f5de 100644
--- a/AndroidProducts.mk
+++ b/AndroidProducts.mk
@@ -17,12 +17,16 @@
 PRODUCT_MAKEFILES := \
 	aosp_cf_x86_64_auto:$(LOCAL_DIR)/vsoc_x86_64/auto/device.mk \
 	aosp_cf_x86_64_phone:$(LOCAL_DIR)/vsoc_x86_64/phone/device.mk \
+	aosp_cf_x86_64_go_phone:$(LOCAL_DIR)/vsoc_x86_64/go_phone/device.mk \
+	aosp_cf_x86_64_go_512_phone:$(LOCAL_DIR)/vsoc_x86_64/go_512_phone/device.mk \
 	aosp_cf_x86_64_tablet:$(LOCAL_DIR)/vsoc_x86_64/tablet/device.mk \
 	aosp_cf_x86_64_tablet_3g:$(LOCAL_DIR)/vsoc_x86_64/tablet_3g/device.mk \
 	aosp_cf_x86_64_tv:$(LOCAL_DIR)/vsoc_x86_64/tv/device.mk \
 	aosp_cf_x86_64_wear:$(LOCAL_DIR)/vsoc_x86_64/wear/device.mk \
 	aosp_cf_x86_auto:$(LOCAL_DIR)/vsoc_x86/auto/device.mk \
 	aosp_cf_x86_phone:$(LOCAL_DIR)/vsoc_x86/phone/device.mk \
+	aosp_cf_x86_go_phone:$(LOCAL_DIR)/vsoc_x86/go_phone/device.mk \
+	aosp_cf_x86_go_512_phone:$(LOCAL_DIR)/vsoc_x86/go_512_phone/device.mk \
 	aosp_cf_x86_tablet:$(LOCAL_DIR)/vsoc_x86/tablet/device.mk \
 	aosp_cf_x86_tablet_3g:$(LOCAL_DIR)/vsoc_x86/tablet_3g/device.mk \
 	aosp_cf_x86_tv:$(LOCAL_DIR)/vsoc_x86/tv/device.mk \
diff --git a/OWNERS b/OWNERS
index fe15e48..5c0d0bd 100644
--- a/OWNERS
+++ b/OWNERS
@@ -1,5 +1,5 @@
 ghartman@google.com
 jemoreira@google.com
-pinghao@google.com
 haining@google.com
 malchev@google.com
+schuffelen@google.com
diff --git a/host_package.mk b/host_package.mk
index 257bffc..f16eccf 100644
--- a/host_package.mk
+++ b/host_package.mk
@@ -8,8 +8,9 @@
 .PHONY: cf_local_image
 cf_local_image: bootimage cacheimage hosttar systemimage userdataimage vendorimage
 
+$(cvd_host_package_tar): PRIVATE_TAR_FORMAT :=
 ifeq ($(HOST_OS),linux)
-CVD_TAR_FORMAT := --format=gnu
+$(cvd_host_package_tar): PRIVATE_TAR_FORMAT := --format=gnu
 endif
 
 # Build and store them on the build server.
@@ -50,12 +51,8 @@
     libicuuc-host \
 
 cvd_host_configs := \
-    cuttlefish.dtb
-
-cvd_host_packages := \
-    cuttlefish_dtb \
-    $(cvd_host_executables) \
-    $(cvd_host_tests) \
+    system-root.dtb \
+    initrd-root.dtb
 
 cvd_host_package_files := \
      $(addprefix config/,$(cvd_host_configs)) \
@@ -63,6 +60,7 @@
      $(addprefix $(lib_path)/,$(addsuffix .so,$(cvd_host_shared_libraries))) \
      $(foreach test,$(cvd_host_tests), ${tests_path}/$(test)/$(test)) \
 
-$(cvd_host_package_tar): $(cvd_host_packages)
-	$(hide) rm -rf $@ && tar Scfz $@.tmp -C $(HOST_OUT) $(CVD_TAR_FORMAT) $(cvd_host_package_files)
+$(cvd_host_package_tar): PRIVATE_FILES := $(cvd_host_package_files)
+$(cvd_host_package_tar): $(addprefix $(HOST_OUT)/,$(cvd_host_package_files))
+	$(hide) rm -rf $@ && tar Scfz $@.tmp -C $(HOST_OUT) $(PRIVATE_TAR_FORMAT) $(PRIVATE_FILES)
 	$(hide) mv $@.tmp $@
diff --git a/shared/BoardConfig.mk b/shared/BoardConfig.mk
index 6fa12ba..e468482 100644
--- a/shared/BoardConfig.mk
+++ b/shared/BoardConfig.mk
@@ -25,6 +25,9 @@
 TARGET_COPY_OUT_VENDOR := vendor
 
 TARGET_NO_RECOVERY := true
+ifneq (,$(CUTTLEFISH_SYSTEM_AS_ROOT))
+BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
+endif
 BOARD_USES_GENERIC_AUDIO := false
 USE_CAMERA_STUB := true
 TARGET_USERIMAGES_USE_EXT4 := true
@@ -116,8 +119,6 @@
 
 INIT_BOOTCHART := true
 
-DEVICE_MANIFEST_FILE := device/google/cuttlefish/shared/config/manifest.xml
-
 # Need this so that the application's loop on reading input can be synchronized
 # with HW VSYNC
 TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK := true
diff --git a/shared/auto/device.mk b/shared/auto/device.mk
index cc7e211..4a2871a 100644
--- a/shared/auto/device.mk
+++ b/shared/auto/device.mk
@@ -14,5 +14,71 @@
 # limitations under the License.
 #
 
-$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_no_telephony.mk)
+################################################
+# Begin GCE specific configurations
+
+DEVICE_MANIFEST_FILE += device/google/cuttlefish/shared/config/manifest.xml
+DEVICE_MANIFEST_FILE += device/google/cuttlefish/shared/auto/manifest-extra.xml
+
 $(call inherit-product, device/google/cuttlefish/shared/device.mk)
+
+################################################
+# Begin general Android Auto Embedded configurations
+
+PRODUCT_COPY_FILES += \
+    packages/services/Car/car_product/init/init.bootstat.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw//init.bootstat.rc \
+    packages/services/Car/car_product/init/init.car.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw//init.car.rc
+
+# Auto core hardware permissions
+PRODUCT_COPY_FILES += \
+    frameworks/native/data/etc/car_core_hardware.xml:system/etc/permissions/car_core_hardware.xml \
+    frameworks/native/data/etc/android.hardware.type.automotive.xml:system/etc/permissions/android.hardware.type.automotive.xml \
+
+# Enable landscape
+PRODUCT_COPY_FILES += \
+    frameworks/native/data/etc/android.hardware.screen.landscape.xml:system/etc/permissions/android.hardware.screen.landscape.xml
+
+# Location permissions
+PRODUCT_COPY_FILES += \
+    frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml
+
+# Broadcast Radio permissions
+PRODUCT_COPY_FILES += \
+    frameworks/native/data/etc/android.hardware.broadcastradio.xml:system/etc/permissions/android.hardware.broadcastradio.xml
+
+PRODUCT_PROPERTY_OVERRIDES += \
+    android.car.hvac.demo=true
+
+# vehicle HAL
+PRODUCT_PACKAGES += android.hardware.automotive.vehicle@2.0-service
+
+# Broadcast Radio
+PRODUCT_PACKAGES += android.hardware.broadcastradio@2.0-service
+
+# DRM HAL
+PRODUCT_PACKAGES += \
+    android.hardware.drm@1.0-impl \
+    android.hardware.drm@1.0-service
+
+# GPS HAL
+PRODUCT_PACKAGES += \
+    gps.vsoc_x86 \
+    android.hardware.gnss@1.0-impl
+
+# DRM Properities
+PRODUCT_PROPERTY_OVERRIDES += \
+    drm.service.enabled=true
+
+# Add car related sepolicy
+# TODO: Now use sepolicies from car emulator for test. Create a separate one for GCE
+BOARD_SEPOLICY_DIRS += \
+    device/generic/car/common/sepolicy \
+
+BOARD_IS_AUTOMOTIVE := true
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)
+$(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk)
+$(call inherit-product, packages/services/Car/car_product/build/car.mk)
+
+# Placed here due to b/110784510
+PRODUCT_BRAND := generic
diff --git a/shared/auto/manifest-extra.xml b/shared/auto/manifest-extra.xml
new file mode 100644
index 0000000..47e8b99
--- /dev/null
+++ b/shared/auto/manifest-extra.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2018, 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.
+** limitations under the License.
+*/
+-->
+<!-- Android Auto Embedded specific HALs-->
+<manifest version="1.0" type="device">
+    <hal format="hidl">
+        <name>android.hardware.automotive.audiocontrol</name>
+        <transport>hwbinder</transport>
+        <version>1.0</version>
+        <interface>
+            <name>IAudioControl</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+    <hal format="hidl">
+        <name>android.hardware.automotive.vehicle</name>
+        <transport>hwbinder</transport>
+        <version>2.0</version>
+        <interface>
+            <name>IVehicle</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+    <hal format="hidl">
+        <name>android.hardware.broadcastradio</name>
+        <transport>hwbinder</transport>
+        <version>2.0</version>
+        <interface>
+            <name>IBroadcastRadio</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+</manifest>
diff --git a/shared/config/Android.mk b/shared/config/Android.mk
index 57e5c0e..9a75f3f 100644
--- a/shared/config/Android.mk
+++ b/shared/config/Android.mk
@@ -14,6 +14,8 @@
 # limitations under the License.
 #
 
+LOCAL_PATH := $(call my-dir)
+
 include $(CLEAR_VARS)
 
 # This section generates wpa_supplicant.conf using the target product name and
@@ -28,9 +30,28 @@
 
 include $(BUILD_SYSTEM)/base_rules.mk
 
-$(LOCAL_BUILT_MODULE): device/google/cuttlefish/shared/config/gen_wpa_supplicant_conf.sh
+$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/gen_wpa_supplicant_conf.sh
 	$(hide) echo "Generating $@"
 	$(hide) mkdir -p $(dir $@)
-	$(hide) device/google/cuttlefish/shared/config/gen_wpa_supplicant_conf.sh \
-	    "${TARGET_PRODUCT}" "${PRODUCT_MODEL}" "${PLATFORM_SDK_VERSION}" \
-	    > $@
+	$(hide) $< "${TARGET_PRODUCT}" "${PRODUCT_MODEL}" \
+	    "${PLATFORM_SDK_VERSION}" > $@
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := initrd_root_dtb
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(HOST_OUT)/config
+LOCAL_MODULE_STEM := initrd-root.dtb
+LOCAL_SRC_FILES := initrd-root.dtb
+
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := system_root_dtb
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_PATH := $(HOST_OUT)/config
+LOCAL_MODULE_STEM := system-root.dtb
+LOCAL_SRC_FILES := system-root.dtb
+
+include $(BUILD_PREBUILT)
diff --git a/shared/config/init.hardware.usb.rc b/shared/config/init.hardware.usb.rc
index c3bb74c..df180dc 100644
--- a/shared/config/init.hardware.usb.rc
+++ b/shared/config/init.hardware.usb.rc
@@ -15,7 +15,6 @@
 #
 
 on boot
-    mount configfs none /config
     mkdir /config/usb_gadget/g1 0770 shell shell
     mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell
     write /config/usb_gadget/g1/bcdUSB 0x0200
diff --git a/shared/config/init.vsoc.rc b/shared/config/init.vsoc.rc
index fe5734b..669a46b 100644
--- a/shared/config/init.vsoc.rc
+++ b/shared/config/init.vsoc.rc
@@ -1,8 +1,6 @@
 on early-init
 #    loglevel 8
     symlink /sdcard /storage/sdcard0
-    symlink /profile /.profile
-    chmod 0555 /profile
     mkdir /var/run 0755 root root
     mkdir /var/run/media 0755 media root
     mkdir /var/run/system 0755 system root
@@ -31,7 +29,6 @@
 
 on fs
     mount_all /vendor/etc/fstab.${ro.hardware}
-    wait /vendor/etc/selinux/nonplat_mac_permissions.xml
     restorecon_recursive /vendor
 
     # works around framework netiface enumeration issue
@@ -73,10 +70,6 @@
     mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
     start socket_forward_proxy
 
-    # TODO(ender): Re-enable these
-    # Compass.
-    stop akmd
-
 
 service rename_eth0 /vendor/bin/rename_netiface eth0 rmnet0
     oneshot
@@ -99,13 +92,13 @@
     oneshot
 
 
-on property:sys.cf.ser.cf-logcat=*
-    symlink ${sys.cf.ser.cf-logcat} /dev/cf-logcat
+on property:vendor.ser.cf-logcat=*
+    symlink ${vendor.ser.cf-logcat} /dev/cf-logcat
     enable seriallogging
 
 
-on property:sys.cf.ser.cf-gadget-usb-v1=*
-    symlink ${sys.cf.ser.cf-gadget-usb-v1} /dev/cf-gadget-usb-v1
+on property:vendor.ser.cf-gadget-usb-v1=*
+    symlink ${vendor.ser.cf-gadget-usb-v1} /dev/cf-gadget-usb-v1
     enable usbforward
 
 
diff --git a/shared/config/initrd-root.dtb b/shared/config/initrd-root.dtb
new file mode 100644
index 0000000..1c75cd6
--- /dev/null
+++ b/shared/config/initrd-root.dtb
Binary files differ
diff --git a/shared/config/initrd-root.dts b/shared/config/initrd-root.dts
new file mode 100644
index 0000000..70a34fc
--- /dev/null
+++ b/shared/config/initrd-root.dts
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2018 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.
+ */
+
+/dts-v1/;
+
+/ {
+	firmware {
+		android {
+			compatible = "android,firmware";
+			fstab {
+				compatible = "android,fstab";
+				system {
+					compatible = "android,system";
+					dev = "/dev/block/vda";
+					type = "ext4";
+					mnt_flags = "noatime,ro,errors=panic";
+					fsmgr_flags = "wait";
+				};
+
+				vendor {
+					compatible = "android,vendor";
+					dev = "/dev/block/vdd";
+					type = "ext4";
+					mnt_flags = "noatime,ro,errors=panic";
+					fsmgr_flags = "wait";
+				};
+			};
+		};
+	};
+};
diff --git a/shared/config/profile.root b/shared/config/profile.root
deleted file mode 100755
index 4056118..0000000
--- a/shared/config/profile.root
+++ /dev/null
@@ -1,12 +0,0 @@
-export ANDROID_ASSETS=/system/app
-export ANDROID_BOOTLOGO=1
-export ANDROID_DATA=/data
-export ANDROID_ROOT=/system
-export ANDROID_STORAGE=/storage
-export ASEC_MOUNTPOINT=/mnt/asec
-export BOOTCLASSPATH=/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/android.test.base.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/mms-common.jar:/system/framework/android.policy.jar:/system/framework/apache-xml.jar
-export EXTERNAL_STORAGE=/storage/emulated/legacy
-export LOOP_MOUNTPOINT=/mnt/obb
-export OPTIND=1
-export PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
-export SYSTEMSERVERCLASSPATH=/system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar
diff --git a/shared/config/system-root.dtb b/shared/config/system-root.dtb
new file mode 100644
index 0000000..bdffbc7
--- /dev/null
+++ b/shared/config/system-root.dtb
Binary files differ
diff --git a/shared/config/system-root.dts b/shared/config/system-root.dts
new file mode 100644
index 0000000..d0dedbe
--- /dev/null
+++ b/shared/config/system-root.dts
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2018 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.
+ */
+
+/dts-v1/;
+
+/ {
+	firmware {
+		android {
+			compatible = "android,firmware";
+			fstab {
+				compatible = "android,fstab";
+				vendor {
+					compatible = "android,vendor";
+					dev = "/dev/block/vdd";
+					type = "ext4";
+					mnt_flags = "noatime,ro,errors=panic";
+					fsmgr_flags = "wait";
+				};
+			};
+		};
+	};
+};
diff --git a/shared/config/ueventd.vsoc.rc b/shared/config/ueventd.vsoc.rc
new file mode 100644
index 0000000..4948706
--- /dev/null
+++ b/shared/config/ueventd.vsoc.rc
@@ -0,0 +1,3 @@
+/dev/dri/card0 0660 system graphics
+/dev/dri/controlD64 0660 system graphics
+/dev/dri/renderD128 0666 system graphics
diff --git a/shared/device.mk b/shared/device.mk
index 300792c..251d7d4 100644
--- a/shared/device.mk
+++ b/shared/device.mk
@@ -28,7 +28,6 @@
     ro.carrier=unknown \
     ro.com.android.dataroaming=false \
     ro.com.google.locationfeatures=1 \
-    ro.debuggable=1 \
     ro.hardware.virtual_device=1 \
     ro.logd.size=1M \
     ro.opengles.version=131072 \
@@ -103,38 +102,38 @@
 #
 PRODUCT_COPY_FILES += \
     device/google/cuttlefish/shared/config/audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_configuration.xml \
-    device/google/cuttlefish/shared/config/camera_v1.json:vendor/etc/config/camera.json \
-    device/google/cuttlefish/shared/config/init.vsoc.rc:root/init.vsoc.rc \
-    device/google/cuttlefish/shared/config/media_codecs.xml:system/etc/media_codecs.xml \
-    device/google/cuttlefish/shared/config/media_codecs_performance.xml:system/etc/media_codecs_performance.xml \
-    device/google/cuttlefish/shared/config/media_profiles.xml:system/etc/media_profiles.xml \
-    device/google/cuttlefish/shared/config/profile.root:root/profile \
+    device/google/cuttlefish/shared/config/camera_v1.json:$(TARGET_COPY_OUT_VENDOR)/etc/config/camera.json \
+    device/google/cuttlefish/shared/config/init.vsoc.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.vsoc.rc \
+    device/google/cuttlefish/shared/config/ueventd.vsoc.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/ueventd.vsoc.rc \
+    device/google/cuttlefish/shared/config/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
+    device/google/cuttlefish/shared/config/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml \
+    device/google/cuttlefish/shared/config/media_profiles.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_V1_0.xml \
     device/google/cuttlefish/shared/config/fstab.vsoc:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.vsoc \
     frameworks/av/media/libeffects/data/audio_effects.conf:system/etc/audio_effects.conf \
-    frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \
-    frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:system/etc/media_codecs_google_telephony.xml \
-    frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \
+    frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \
+    frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_telephony.xml \
+    frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_video.xml \
     frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy_volumes.xml \
     frameworks/av/services/audiopolicy/config/default_volume_tables.xml:$(TARGET_COPY_OUT_VENDOR)/etc/default_volume_tables.xml \
     frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:$(TARGET_COPY_OUT_VENDOR)/etc/r_submix_audio_policy_configuration.xml \
-    frameworks/native/data/etc/android.hardware.audio.low_latency.xml:system/etc/permissions/android.hardware.audio.low_latency.xml \
-    frameworks/native/data/etc/android.hardware.bluetooth_le.xml:system/etc/permissions/android.hardware.bluetooth_le.xml \
-    frameworks/native/data/etc/android.hardware.bluetooth.xml:system/etc/permissions/android.hardware.bluetooth.xml \
-    frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:system/etc/permissions/android.hardware.camera.xml \
-    frameworks/native/data/etc/android.hardware.camera.full.xml:system/etc/permissions/android.hardware.camera.full.xml \
-    frameworks/native/data/etc/android.hardware.camera.front.xml:system/etc/permissions/android.hardware.camera.front.xml \
-    frameworks/native/data/etc/android.hardware.camera.raw.xml:system/etc/permissions/android.hardware.camera.raw.xml \
-    frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/permissions/android.hardware.ethernet.xml \
-    frameworks/native/data/etc/android.hardware.location.gps.xml:system/etc/permissions/android.hardware.location.gps.xml \
-    frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:system/etc/permissions/android.hardware.sensor.accelerometer.xml \
-    frameworks/native/data/etc/android.hardware.sensor.barometer.xml:system/etc/permissions/android.hardware.sensor.barometer.xml \
-    frameworks/native/data/etc/android.hardware.sensor.compass.xml:system/etc/permissions/android.hardware.sensor.compass.xml \
-    frameworks/native/data/etc/android.hardware.sensor.light.xml:system/etc/permissions/android.hardware.sensor.light.xml \
-    frameworks/native/data/etc/android.hardware.sensor.proximity.xml:system/etc/permissions/android.hardware.sensor.proximity.xml \
-    frameworks/native/data/etc/android.hardware.touchscreen.xml:system/etc/permissions/android.hardware.touchscreen.xml \
-    frameworks/native/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml \
-    frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \
-    frameworks/native/data/etc/android.software.app_widgets.xml:system/etc/permissions/android.software.app_widgets.xml \
+    frameworks/native/data/etc/android.hardware.audio.low_latency.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.audio.low_latency.xml \
+    frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml \
+    frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \
+    frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.xml \
+    frameworks/native/data/etc/android.hardware.camera.full.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.full.xml \
+    frameworks/native/data/etc/android.hardware.camera.front.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.front.xml \
+    frameworks/native/data/etc/android.hardware.camera.raw.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.raw.xml \
+    frameworks/native/data/etc/android.hardware.ethernet.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.ethernet.xml \
+    frameworks/native/data/etc/android.hardware.location.gps.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.location.gps.xml \
+    frameworks/native/data/etc/android.hardware.sensor.accelerometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.accelerometer.xml \
+    frameworks/native/data/etc/android.hardware.sensor.barometer.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.barometer.xml \
+    frameworks/native/data/etc/android.hardware.sensor.compass.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.compass.xml \
+    frameworks/native/data/etc/android.hardware.sensor.light.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.light.xml \
+    frameworks/native/data/etc/android.hardware.sensor.proximity.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.sensor.proximity.xml \
+    frameworks/native/data/etc/android.hardware.touchscreen.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.touchscreen.xml \
+    frameworks/native/data/etc/android.hardware.usb.accessory.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.accessory.xml \
+    frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \
+    frameworks/native/data/etc/android.software.app_widgets.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.app_widgets.xml \
     system/bt/vendor_libs/test_vendor_lib/data/controller_properties.json:system/etc/bluetooth/controller_properties.json \
 
 
@@ -169,7 +168,6 @@
 #
 PRODUCT_PACKAGES += \
     android.hardware.bluetooth@1.0-service.sim \
-    libbt-vendor-build-test
 
 #
 # Audio HAL
diff --git a/shared/go/device.mk b/shared/go/device.mk
new file mode 100644
index 0000000..7198cb9
--- /dev/null
+++ b/shared/go/device.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2018 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.
+#
+
+$(call inherit-product, build/target/product/go_defaults.mk)
diff --git a/shared/go_512/device.mk b/shared/go_512/device.mk
new file mode 100644
index 0000000..44c2185
--- /dev/null
+++ b/shared/go_512/device.mk
@@ -0,0 +1,17 @@
+#
+# Copyright (C) 2018 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.
+#
+
+$(call inherit-product, build/target/product/go_defaults_512.mk)
diff --git a/shared/phone/device.mk b/shared/phone/device.mk
index 2b77504..a4c4813 100644
--- a/shared/phone/device.mk
+++ b/shared/phone/device.mk
@@ -14,10 +14,14 @@
 # limitations under the License.
 #
 
+DEVICE_MANIFEST_FILE += device/google/cuttlefish/shared/config/manifest.xml
+
 $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
 $(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk)
 $(call inherit-product, device/google/cuttlefish/shared/device.mk)
 
+CUTTLEFISH_SYSTEM_AS_ROOT := true
+
 PRODUCT_CHARACTERISTICS := nosdcard
 
 PRODUCT_PROPERTY_OVERRIDES += \
@@ -42,3 +46,7 @@
 
 PRODUCT_COPY_FILES += \
     frameworks/native/data/etc/android.hardware.telephony.gsm.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.telephony.gsm.xml
+
+# These flags are important for the GSI, but break auto
+PRODUCT_ENFORCE_RRO_TARGETS := framework-res
+PRODUCT_ENFORCE_RRO_EXCLUDED_OVERLAYS := device/google/cuttlefish/shared/overlay
diff --git a/shared/sepolicy/vport_trigger.te b/shared/sepolicy/vport_trigger.te
index 4a2e874..78cafd6 100644
--- a/shared/sepolicy/vport_trigger.te
+++ b/shared/sepolicy/vport_trigger.te
@@ -8,3 +8,4 @@
 r_dir_file(vport_trigger, sysfs_type)
 
 set_prop(vport_trigger, sys_cf_ser_prop)
+set_prop(vport_trigger, vendor_default_prop)
diff --git a/shared/tablet/device.mk b/shared/tablet/device.mk
index 1a99394..6038275 100644
--- a/shared/tablet/device.mk
+++ b/shared/tablet/device.mk
@@ -14,6 +14,8 @@
 # limitations under the License.
 #
 
+DEVICE_MANIFEST_FILE += device/google/cuttlefish/shared/config/manifest.xml
+
 $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk)
 $(call inherit-product, frameworks/native/build/tablet-7in-xhdpi-2048-dalvik-heap.mk)
 $(call inherit-product, device/google/cuttlefish/shared/device.mk)
diff --git a/shared/tablet_3g/device.mk b/shared/tablet_3g/device.mk
index 917945c..b60dc0a 100644
--- a/shared/tablet_3g/device.mk
+++ b/shared/tablet_3g/device.mk
@@ -14,6 +14,8 @@
 # limitations under the License.
 #
 
+DEVICE_MANIFEST_FILE += device/google/cuttlefish/shared/config/manifest.xml
+
 $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
 $(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk)
 $(call inherit-product, device/google/cuttlefish/shared/device.mk)
diff --git a/shared/tv/device.mk b/shared/tv/device.mk
index 2154125..bc30379 100644
--- a/shared/tv/device.mk
+++ b/shared/tv/device.mk
@@ -14,6 +14,8 @@
 # limitations under the License.
 #
 
+DEVICE_MANIFEST_FILE += device/google/cuttlefish/shared/config/manifest.xml
+
 $(call inherit-product, $(SRC_TARGET_DIR)/product/generic_no_telephony.mk)
 $(call inherit-product, device/google/cuttlefish/shared/device.mk)
 
diff --git a/shared/wear/device.mk b/shared/wear/device.mk
index 2154125..bc30379 100644
--- a/shared/wear/device.mk
+++ b/shared/wear/device.mk
@@ -14,6 +14,8 @@
 # limitations under the License.
 #
 
+DEVICE_MANIFEST_FILE += device/google/cuttlefish/shared/config/manifest.xml
+
 $(call inherit-product, $(SRC_TARGET_DIR)/product/generic_no_telephony.mk)
 $(call inherit-product, device/google/cuttlefish/shared/device.mk)
 
diff --git a/vendorsetup.sh b/vendorsetup.sh
index 3f110e1..eb7da44 100755
--- a/vendorsetup.sh
+++ b/vendorsetup.sh
@@ -32,7 +32,6 @@
 add_lunch_combo cf_x86_tablet_3g-userdebug
 add_lunch_combo cf_x86_tv-userdebug
 add_lunch_combo cf_x86_wear-userdebug
-add_lunch_combo cf_x86_64_auto-userdebug
 add_lunch_combo cf_x86_64_phone-userdebug
 add_lunch_combo cf_x86_64_tablet-userdebug
 add_lunch_combo cf_x86_64_tablet_3g-userdebug
diff --git a/vsoc_x86/go_512_phone/device.mk b/vsoc_x86/go_512_phone/device.mk
new file mode 100644
index 0000000..b33d06e
--- /dev/null
+++ b/vsoc_x86/go_512_phone/device.mk
@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2018 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.
+#
+
+$(call inherit-product, device/google/cuttlefish/shared/go_512/device.mk)
+$(call inherit-product, device/google/cuttlefish/vsoc_x86/phone/device.mk)
+
+PRODUCT_NAME := aosp_cf_x86_go_512_phone
+PRODUCT_DEVICE := vsoc_x86
+PRODUCT_MODEL := Cuttlefish x86 Go 512 phone
+PRODUCT_PACKAGE_OVERLAYS := device/google/cuttlefish/vsoc_x86/phone/overlay
diff --git a/vsoc_x86/go_phone/device.mk b/vsoc_x86/go_phone/device.mk
new file mode 100644
index 0000000..ef62d70
--- /dev/null
+++ b/vsoc_x86/go_phone/device.mk
@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2018 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.
+#
+
+$(call inherit-product, device/google/cuttlefish/shared/go/device.mk)
+$(call inherit-product, device/google/cuttlefish/vsoc_x86/phone/device.mk)
+
+PRODUCT_NAME := aosp_cf_x86_go_phone
+PRODUCT_DEVICE := vsoc_x86
+PRODUCT_MODEL := Cuttlefish x86 Go phone
+PRODUCT_PACKAGE_OVERLAYS := device/google/cuttlefish/vsoc_x86/phone/overlay
diff --git a/vsoc_x86_64/go_512_phone/device.mk b/vsoc_x86_64/go_512_phone/device.mk
new file mode 100644
index 0000000..f76bfbe
--- /dev/null
+++ b/vsoc_x86_64/go_512_phone/device.mk
@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2018 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.
+#
+
+$(call inherit-product, device/google/cuttlefish/shared/go_512/device.mk)
+$(call inherit-product, device/google/cuttlefish/vsoc_x86_64/phone/device.mk)
+
+PRODUCT_NAME := aosp_cf_x86_64_go_512_phone
+PRODUCT_DEVICE := vsoc_x86_64
+PRODUCT_MODEL := Cuttlefish x86_64 Go 512 phone
+PRODUCT_PACKAGE_OVERLAYS := device/google/cuttlefish/vsoc_x86_64/phone/overlay
diff --git a/vsoc_x86_64/go_phone/device.mk b/vsoc_x86_64/go_phone/device.mk
new file mode 100644
index 0000000..acc037e
--- /dev/null
+++ b/vsoc_x86_64/go_phone/device.mk
@@ -0,0 +1,23 @@
+#
+# Copyright (C) 2018 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.
+#
+
+$(call inherit-product, device/google/cuttlefish/shared/go/device.mk)
+$(call inherit-product, device/google/cuttlefish/vsoc_x86_64/phone/device.mk)
+
+PRODUCT_NAME := aosp_cf_x86_64_go_phone
+PRODUCT_DEVICE := vsoc_x86_64
+PRODUCT_MODEL := Cuttlefish x86_64 Go phone
+PRODUCT_PACKAGE_OVERLAYS := device/google/cuttlefish/vsoc_x86_64/phone/overlay