Merge pie-platform-release to aosp-master - DO NOT MERGE

Change-Id: I8db0b74ddbc5f1d1990d5258d8c0bfb8a97f5108
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
index 369b2d4..c502774 100644
--- a/AndroidProducts.mk
+++ b/AndroidProducts.mk
@@ -15,4 +15,7 @@
 #
 
 PRODUCT_MAKEFILES := \
-    $(LOCAL_DIR)/uml.mk
\ No newline at end of file
+    $(LOCAL_DIR)/uml.mk
+
+COMMON_LUNCH_CHOICES := \
+    uml-userdebug
diff --git a/sepolicy/init_eth0.te b/sepolicy/init_eth0.te
index 45fd56d..f088073 100644
--- a/sepolicy/init_eth0.te
+++ b/sepolicy/init_eth0.te
@@ -1,5 +1,5 @@
 type init_eth0, domain;
-type init_eth0_exec, exec_type, file_type;
+type init_eth0_exec, system_file_type, exec_type, file_type;
 
 init_daemon_domain(init_eth0)
 
diff --git a/surfaceflinger.rc b/surfaceflinger.rc
deleted file mode 100644
index 0f2cb32..0000000
--- a/surfaceflinger.rc
+++ /dev/null
@@ -1,12 +0,0 @@
-# This custom surfaceflinger.rc simply has `disabled' appended to it.
-# Since we are using UML without a screen, and embedded.mk is the
-# smallest mk file but still contains surfaceflinger, including this
-# custom surfaceflinger.rc will disable surfaceflinger from running.
-
-service surfaceflinger /system/bin/surfaceflinger
-    class core
-    user system
-    group graphics drmrpc readproc
-    onrestart restart zygote
-    writepid /dev/stune/foreground/tasks
-    disabled
diff --git a/uml.mk b/uml.mk
index 32240fa..5c132eb 100644
--- a/uml.mk
+++ b/uml.mk
@@ -13,7 +13,6 @@
 # limitations under the License.
 
 $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/embedded.mk)
 
 PRODUCT_NAME := uml
 PRODUCT_DEVICE := uml
@@ -26,5 +25,109 @@
 
 PRODUCT_COPY_FILES += $(LOCAL_PATH)/fstab.uml:root/fstab.uml
 PRODUCT_COPY_FILES += $(LOCAL_PATH)/init.uml.rc:root/init.uml.rc
-PRODUCT_COPY_FILES += $(LOCAL_PATH)/surfaceflinger.rc:system/etc/init/surfaceflinger.rc
 PRODUCT_COPY_FILES += $(LOCAL_PATH)/init.eth0.sh:system/bin/init.eth0.sh
+
+PRODUCT_PACKAGES += \
+    adb \
+    adbd \
+    adbd.recovery \
+    usbd \
+    android.hardware.configstore@1.1-service \
+    android.hidl.allocator@1.0-service \
+    android.hidl.memory@1.0-impl \
+    android.hidl.memory@1.0-impl.vendor \
+    atrace \
+    blank_screen \
+    bootanimation \
+    bootstat \
+    charger \
+    cmd \
+    crash_dump \
+    debuggerd\
+    dumpstate \
+    dumpsys \
+    fastboot \
+    gralloc.default \
+    healthd \
+    hwservicemanager \
+    init \
+    init.environ.rc \
+    init.rc \
+    libEGL \
+    libETC1 \
+    libFFTEm \
+    libGLESv1_CM \
+    libGLESv2 \
+    libGLESv3 \
+    libbinder \
+    libc \
+    libc_malloc_debug \
+    libc_malloc_hooks \
+    libcutils \
+    libdl \
+    libgui \
+    libhardware \
+    libhardware_legacy \
+    libjpeg \
+    liblog \
+    libm \
+    libpixelflinger \
+    libpower \
+    libsigchain \
+    libstdc++ \
+    libsurfaceflinger \
+    libsurfaceflinger_ddmconnection \
+    libsysutils \
+    libui \
+    libutils \
+    linker \
+    linker.recovery \
+    lmkd \
+    logcat \
+    lshal \
+    recovery \
+    service \
+    servicemanager \
+    shell_and_utilities \
+    storaged \
+    thermalserviced \
+    tombstoned \
+    tzdatacheck \
+    vndservice \
+    vndservicemanager \
+
+# VINTF data
+PRODUCT_PACKAGES += \
+    device_compatibility_matrix.xml \
+    device_manifest.xml \
+    framework_manifest.xml \
+    framework_compatibility_matrix.xml \
+
+# SELinux packages are added as dependencies of the selinux_policy
+# phony package.
+PRODUCT_PACKAGES += \
+    selinux_policy \
+
+# AID Generation for
+# <pwd.h> and <grp.h>
+PRODUCT_PACKAGES += \
+    passwd \
+    group \
+    fs_config_files \
+    fs_config_dirs
+
+# If there are product-specific adb keys defined, install them on debuggable
+# builds.
+PRODUCT_PACKAGES_DEBUG += \
+    adb_keys
+
+# Ensure that this property is always defined so that bionic_systrace.cpp
+# can rely on it being initially set by init.
+PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
+    debug.atrace.tags.enableflags=0
+
+PRODUCT_COPY_FILES += \
+    system/core/rootdir/init.usb.rc:root/init.usb.rc \
+    system/core/rootdir/init.usb.configfs.rc:root/init.usb.configfs.rc \
+    system/core/rootdir/ueventd.rc:root/ueventd.rc \
+    system/core/rootdir/etc/hosts:system/etc/hosts
diff --git a/vendorsetup.sh b/vendorsetup.sh
deleted file mode 100755
index fd5fc0b..0000000
--- a/vendorsetup.sh
+++ /dev/null
@@ -1 +0,0 @@
-add_lunch_combo uml-userdebug