Merge tag 'android-6.0.0_r26' into HEAD

Android 6.0.0 release 26

* tag 'android-6.0.0_r26':
  Avoid frequently operation on btwrite
  Revert upio changes to fix wear timeouts.
  Fix btwrite timer timeout for Angler (1/2)

Change-Id: I6a2ba3d1fa87b5bfc056e1777279c64faefb0b47
diff --git a/include/vnd_angler.txt b/include/vnd_angler.txt
index 103b656..8d7b271 100755
--- a/include/vnd_angler.txt
+++ b/include/vnd_angler.txt
@@ -2,7 +2,7 @@
 FW_PATCHFILE_LOCATION = "/vendor/firmware/"
 BT_WAKE_VIA_PROC = TRUE
 BT_WAKE_VIA_PROC_NOTIFY_DEASSERT=TRUE
-PROC_BTWRITE_TIMER_TIMEOUT_MS = 4000
+PROC_BTWRITE_TIMER_TIMEOUT_MS = 0
 UART_TARGET_BAUD_RATE = 3000000
 LPM_IDLE_TIMEOUT_MULTIPLE = 5
 LPM_HC_IDLE_THRESHOLD = 24
diff --git a/src/hardware.c b/src/hardware.c
index 02103ca..10bf22b 100755
--- a/src/hardware.c
+++ b/src/hardware.c
@@ -1211,9 +1211,10 @@
      */
     timeout_ms = (uint32_t)lpm_param.host_stack_idle_threshold \
                             * LPM_IDLE_TIMEOUT_MULTIPLE;
-
     if (strstr(hw_cfg_cb.local_chip_name, "BCM4325") != NULL)
         timeout_ms *= 25; // 12.5 or 25 ?
+    else if (strstr(hw_cfg_cb.local_chip_name, "BCM4358") != NULL)
+        timeout_ms *= 50;
     else
         timeout_ms *= 300;
 
diff --git a/src/upio.c b/src/upio.c
index 3f73482..d24d496 100644
--- a/src/upio.c
+++ b/src/upio.c
@@ -507,6 +507,10 @@
             }
 #endif
 
+#if (BT_WAKE_VIA_PROC_NOTIFY_DEASSERT == TRUE)
+            lpm_proc_cb.btwrite_active = TRUE;
+#endif
+
             UPIODBG("%s: proc btwrite assertion, buffer: %c, timer_armed %d %d",
                     __FUNCTION__, buffer, lpm_proc_cb.btwrite_active, lpm_proc_cb.timer_created);