Merge "Update Crosshatch SVN to 18" into qt-dev am: 601254a127
am: 60629f5fd4

Change-Id: I9133883603e883a948fa9b3c1937edd44bb17372
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 7b7a6ec..a4963f7 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -153,10 +153,8 @@
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/android.hardware.atrace@1.0-service.rc)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/vintf/manifest/android.hardware.atrace@1.0-service.xml)
 
-# Combine light/memtrack/thermal/vibrator HALs into small_hals.crosshatch-service
+# Combine memtrack/thermal/vibrator HALs into small_hals.crosshatch-service
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/android.hardware.vibrator@1.2-service.crosshatch.rc)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.vibrator@1.2-service.crosshatch)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/android.hardware.memtrack@1.0-service.rc)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/bin/hw/android.hardware.memtrack@1.0-service)
-$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/etc/init/hardware.google.light@1.0-service.rc)
-$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/bin/hw/hardware.google.light@1.0-service)
diff --git a/device-common.mk b/device-common.mk
index 9f7ced4..f0618a1 100644
--- a/device-common.mk
+++ b/device-common.mk
@@ -146,3 +146,7 @@
     POSTINSTALL_PATH_product=bin/check_dynamic_partitions \
     FILESYSTEM_TYPE_product=ext4 \
     POSTINSTALL_OPTIONAL_product=false \
+
+# Set thermal warm reset
+PRODUCT_PRODUCT_PROPERTIES += \
+    ro.thermal_warmreset = true \
diff --git a/device.mk b/device.mk
index 826d6a0..44be2b1 100644
--- a/device.mk
+++ b/device.mk
@@ -363,13 +363,16 @@
 PRODUCT_PACKAGES += \
     android.hardware.health.storage@1.0-service
 
-# Light/Memtrack/Vibrator HALs
+# Light HAL
+PRODUCT_PACKAGES += \
+    lights.$(PRODUCT_PLATFORM) \
+    hardware.google.light@1.0-service
+
+# Memtrack/Vibrator HALs
 PRODUCT_PACKAGES += \
     memtrack.sdm845 \
     android.hardware.memtrack@1.0-impl \
     android.hardware.vibrator@1.2-impl.crosshatch \
-    lights.$(PRODUCT_PLATFORM) \
-    hardware.google.light@1.0-impl \
     small_hals.crosshatch-service
 
 # Bluetooth HAL
@@ -419,6 +422,10 @@
     frameworks/native/data/etc/android.hardware.nfc.ese.xml:$(TARGET_COPY_OUT_VENDOR)/odm/etc/permissions/sku_G013D/android.hardware.nfc.ese.xml
 
 PRODUCT_COPY_FILES += \
+    device/google/crosshatch/nfc/com.google.hardware.pixel.japan.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_G013B/com.google.hardware.pixel.japan.xml \
+    device/google/crosshatch/nfc/com.google.hardware.pixel.japan.xml:$(TARGET_COPY_OUT_ODM)/etc/permissions/sku_G013D/com.google.hardware.pixel.japan.xml
+
+PRODUCT_COPY_FILES += \
     device/google/crosshatch/nfc/libnfc-nci.conf:$(TARGET_COPY_OUT_PRODUCT)/etc/libnfc-nci.conf \
     device/google/crosshatch/nfc/libese-nxp.conf:$(TARGET_COPY_OUT_VENDOR)/etc/libese-nxp.conf
 
diff --git a/device_framework_matrix.xml b/device_framework_matrix.xml
index 2771002..a41215a 100644
--- a/device_framework_matrix.xml
+++ b/device_framework_matrix.xml
@@ -99,7 +99,6 @@
         <interface>
             <name>IQcRilAudio</name>
             <instance>slot1</instance>
-            <instance>slot2</instance>
         </interface>
     </hal>
     <hal format="hidl" optional="true">
@@ -108,7 +107,6 @@
         <interface>
             <name>IImsRadio</name>
             <instance>imsradio0</instance>
-            <instance>imsradio1</instance>
         </interface>
     </hal>
     <hal format="hidl" optional="true">
@@ -125,7 +123,6 @@
         <interface>
             <name>IQtiOemHook</name>
             <instance>oemhook0</instance>
-            <instance>oemhook1</instance>
         </interface>
     </hal>
     <hal format="hidl" optional="true">
diff --git a/gpt-utils/gpt-utils.h b/gpt-utils/gpt-utils.h
index c3321df..cb4226c 100644
--- a/gpt-utils/gpt-utils.h
+++ b/gpt-utils/gpt-utils.h
@@ -72,7 +72,7 @@
 #define AB_PARTITION_ATTR_SLOT_ACTIVE (0x1<<2)
 #define AB_PARTITION_ATTR_BOOT_SUCCESSFUL (0x1<<6)
 #define AB_PARTITION_ATTR_UNBOOTABLE (0x1<<7)
-#define AB_SLOT_ACTIVE_VAL              0x3F
+#define AB_SLOT_ACTIVE_VAL              0x1F
 #define AB_SLOT_INACTIVE_VAL            0x0
 #define AB_SLOT_ACTIVE                  1
 #define AB_SLOT_INACTIVE                0
diff --git a/manifest.xml b/manifest.xml
index 3d2fcf9..6b47c85 100644
--- a/manifest.xml
+++ b/manifest.xml
@@ -198,6 +198,24 @@
         </interface>
     </hal>
     <hal format="hidl">
+        <name>android.hardware.light</name>
+        <transport>hwbinder</transport>
+        <version>2.0</version>
+        <interface>
+            <name>ILight</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+    <hal format="hidl">
+        <name>hardware.google.light</name>
+        <transport>hwbinder</transport>
+        <version>1.0</version>
+        <interface>
+            <name>ILight</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+    <hal format="hidl">
         <name>android.hardware.media.c2</name>
         <transport>hwbinder</transport>
         <version>1.0</version>
@@ -223,7 +241,9 @@
         <name>android.hardware.neuralnetworks</name>
         <transport>hwbinder</transport>
         <fqname>@1.0::IDevice/paintbox</fqname>
-        <fqname>@1.1::IDevice/default</fqname>
+        <fqname>@1.2::IDevice/qti-default</fqname>
+        <fqname>@1.2::IDevice/qti-dsp</fqname>
+        <fqname>@1.2::IDevice/qti-gpu</fqname>
     </hal>
     <hal format="hidl">
         <name>android.hardware.nfc</name>
@@ -284,8 +304,6 @@
         <transport>hwbinder</transport>
         <fqname>@1.2::ISap/slot1</fqname>
         <fqname>@1.3::IRadio/slot1</fqname>
-        <fqname>@1.3::IRadio/slot2</fqname>
-
     </hal>
     <hal format="hidl">
       <name>android.hardware.radio.config</name>
@@ -402,7 +420,6 @@
         <interface>
             <name>IImsRadio</name>
             <instance>imsradio0</instance>
-            <instance>imsradio1</instance>
         </interface>
     </hal>
     <hal format="hidl">
@@ -421,7 +438,6 @@
         <interface>
             <name>IQtiOemHook</name>
             <instance>oemhook0</instance>
-            <instance>oemhook1</instance>
         </interface>
     </hal>
     <hal format="hidl">
@@ -485,7 +501,6 @@
         <interface>
             <name>IQcRilAudio</name>
             <instance>slot1</instance>
-            <instance>slot2</instance>
         </interface>
     </hal>
     <hal format="hidl">
diff --git a/nfc/com.google.hardware.pixel.japan.xml b/nfc/com.google.hardware.pixel.japan.xml
new file mode 100644
index 0000000..bf06ed2
--- /dev/null
+++ b/nfc/com.google.hardware.pixel.japan.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2019 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.
+-->
+<!--
+    Feature for Pixel Japan SKU devices.
+-->
+<permissions>
+    <feature name="com.google.hardware.pixel.japan" />
+</permissions>
diff --git a/small_hals/Android.bp b/small_hals/Android.bp
index 8df722d..489c141 100644
--- a/small_hals/Android.bp
+++ b/small_hals/Android.bp
@@ -9,12 +9,10 @@
     srcs: ["service.cpp"],
 
     shared_libs: [
-        "android.hardware.light@2.0",
         "android.hardware.memtrack@1.0",
         "android.hardware.vibrator@1.0",
         "android.hardware.vibrator@1.1",
         "android.hardware.vibrator@1.2",
-        "hardware.google.light@1.0",
         "libbase",
         "libhidlbase",
         "libhidltransport",
diff --git a/small_hals/service.cpp b/small_hals/service.cpp
index 4517675..41eaf9c 100644
--- a/small_hals/service.cpp
+++ b/small_hals/service.cpp
@@ -18,7 +18,6 @@
 
 #include <android/hardware/memtrack/1.0/IMemtrack.h>
 #include <android/hardware/vibrator/1.2/IVibrator.h>
-#include <hardware/google/light/1.0/ILight.h>
 #include <hidl/LegacySupport.h>
 
 using android::OK;
@@ -27,11 +26,9 @@
 using android::hardware::registerPassthroughServiceImplementation;
 using android::hardware::memtrack::V1_0::IMemtrack;
 using android::hardware::vibrator::V1_2::IVibrator;
-using hardware::google::light::V1_0::ILight;
 
 int main(int /*argc*/, char ** /*argv*/) {
     configureRpcThreadpool(1, true /* callerWillJoin */);
-    LOG_ALWAYS_FATAL_IF(OK != registerPassthroughServiceImplementation<ILight>());
     LOG_ALWAYS_FATAL_IF(OK != registerPassthroughServiceImplementation<IMemtrack>());
     LOG_ALWAYS_FATAL_IF(OK != registerPassthroughServiceImplementation<IVibrator>());
     joinRpcThreadpool();
diff --git a/small_hals/small_hals.crosshatch-service.xml b/small_hals/small_hals.crosshatch-service.xml
index 579259b..dadde0d 100644
--- a/small_hals/small_hals.crosshatch-service.xml
+++ b/small_hals/small_hals.crosshatch-service.xml
@@ -1,23 +1,5 @@
 <manifest version="1.0" type="device">
     <hal format="hidl">
-        <name>android.hardware.light</name>
-        <transport>hwbinder</transport>
-        <version>2.0</version>
-        <interface>
-            <name>ILight</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
-        <name>hardware.google.light</name>
-        <transport>hwbinder</transport>
-        <version>1.0</version>
-        <interface>
-            <name>ILight</name>
-            <instance>default</instance>
-        </interface>
-    </hal>
-    <hal format="hidl">
         <name>android.hardware.memtrack</name>
         <transport>hwbinder</transport>
         <version>1.0</version>