angler: Add wifi HAL service to device.mk
am: 0c25038f8e

Change-Id: Ia45743d227b9dd3276590dee33333a91bb3663bd
diff --git a/apns-full-conf.xml b/apns-full-conf.xml
index e04cb1e..72c1eb5 100755
--- a/apns-full-conf.xml
+++ b/apns-full-conf.xml
@@ -740,10 +740,10 @@
       type="mms"
   />
 
-  <apn carrier="Px MMS"
+  <apn carrier="Proximus MMS"
       mcc="206"
       mnc="01"
-      apn="EVENT.PROXIMUS.BE"
+      apn="event.proximus.be"
       user="mms"
       password="mms"
       authtype="1"
@@ -753,17 +753,17 @@
       type="mms"
   />
 
-  <apn carrier="Px Internet"
+  <apn carrier="Proximus Internet"
       mcc="206"
       mnc="01"
       apn=""
       type="ia"
   />
 
-  <apn carrier="Px Internet"
+  <apn carrier="Proximus Internet"
       mcc="206"
       mnc="01"
-      apn="INTERNET.PROXIMUS.BE"
+      apn="internet.proximus.be"
       type="default,supl"
   />
 
@@ -772,7 +772,7 @@
       mnc="01"
       apn="telenetwap.be"
       type="default,supl"
-      mvno_match_data="2060188"
+      mvno_match_data="20601889"
       mvno_type="imsi"
   />
 
@@ -784,7 +784,7 @@
       mmsproxy="195.130.149.100"
       mmsport="80"
       type="mms"
-      mvno_match_data="2060188"
+      mvno_match_data="20601889"
       mvno_type="imsi"
   />
 
@@ -1008,7 +1008,6 @@
       apn="orange"
       user="orange"
       password="orange"
-      authtype="1"
       type="default,supl"
   />
 
@@ -1021,11 +1020,10 @@
       mmsc="http://mms.orange.fr"
       mmsproxy="192.168.10.200"
       mmsport="8080"
-      authtype="1"
       type="mms"
   />
 
-  <apn carrier="Orange Entreprise"
+  <apn carrier="Orange Entreprises"
       mcc="208"
       mnc="01"
       apn="orange-mib"
@@ -1033,15 +1031,14 @@
       port="8000"
       user="orange"
       password="orange"
-      authtype="2"
-      type="default"
+      type="default,supl"
   />
 
   <apn carrier="Orange Internet"
       mcc="208"
       mnc="01"
       apn="orange.fr"
-      authtype="0"
+      authtype="1"
       user="orange"
       password="orange"
       type="dun"
@@ -1163,7 +1160,7 @@
       mmsc="http://mms1"
       mmsproxy="10.151.0.1"
       mmsport="8080"
-      type="default,mms,supl"
+      type="default,hipri,mms"
   />
 
   <apn carrier="SFR option Modem"
@@ -9407,7 +9404,7 @@
        type="mms"
        protocol="IPV6"
        roaming_protocol="IPV6"
-       bearer_bitmask="18"
+       bearer="18"
   />
 
   <apn carrier="T-Mobile IMS"
@@ -9426,7 +9423,7 @@
        type="ims"
        protocol="IPV6"
        roaming_protocol="IPV6"
-       bearer_bitmask="18"
+       bearer="18"
   />
 
   <apn carrier="Project Fi - T"
@@ -24651,29 +24648,15 @@
       type="mms"
   />
 
-  <apn carrier="Mozaic Mob"
-      mcc="427"
-      mnc="01"
-      apn="gprs.qtel"
-      user="gprs"
-      password="gprs"
-      authtype="1"
-      proxy="10.23.8.3"
-      port="8080"
-      type="default,supl"
-  />
-
-  <apn carrier="Qtel MMS"
-      mcc="427"
-      mnc="01"
-      apn="mms.qtel"
-      user="10"
-      password="11"
-      authtype="1"
-      mmsproxy="10.23.8.3"
-      mmsport="8080"
-      mmsc="http://mmsr.qtelmms.qa"
-      type="mms"
+  <apn carrier="Ooredoo data"
+    mcc="427"
+    mnc="01"
+    apn="data"
+    mmsproxy="10.23.8.3"
+    mmsport="8080"
+    mmsc="http://mmsr.ooredoomms.qa"
+    type="default,supl,mms"
+    authtype="1"
   />
 
   <apn carrier="Voda internet"
@@ -24815,12 +24798,10 @@
       type="mms"
   />
 
-  <apn carrier="Irancell-GPRS"
+  <apn carrier="Irancell-Internet"
       mcc="432"
       mnc="35"
       apn="mtnirancell"
-      proxy="10.131.26.138"
-      port="8080"
       type="default,supl"
   />
 
@@ -25189,6 +25170,24 @@
       authtype="2"
   />
 
+  <apn carrier="KDDI IA"
+      mcc="440"
+      mnc="50"
+      apn=""
+      type="ia"
+      protocol="IPV4V6"
+      roaming_protocol="IP"
+  />
+
+  <apn carrier="KDDI IMS"
+      mcc="440"
+      mnc="50"
+      apn="ims"
+      type="ims"
+      protocol="IPV6"
+      user_visible="false"
+  />
+
   <apn carrier="au.au-net.ne.jp"
       mcc="440"
       mnc="50"
@@ -25199,6 +25198,34 @@
       type="default,supl"
   />
 
+  <apn carrier="KDDI IA"
+      mcc="440"
+      mnc="51"
+      apn=""
+      type="ia"
+      protocol="IPV4V6"
+      roaming_protocol="IP"
+  />
+
+  <apn carrier="KDDI IMS"
+      mcc="440"
+      mnc="51"
+      apn="ims"
+      type="ims"
+      protocol="IPV6"
+      user_visible="false"
+  />
+
+  <apn carrier="au.au-net.ne.jp"
+      mcc="440"
+      mnc="51"
+      apn="au.au-net.ne.jp"
+      user="user@au.au-net.ne.jp"
+      password="au"
+      authtype="2"
+      type="default,supl"
+  />
+
   <apn carrier="SKT IA"
       mcc="450"
       mnc="05"
diff --git a/camera/QCamera2/HAL3/QCamera3HWI.cpp b/camera/QCamera2/HAL3/QCamera3HWI.cpp
index 1c29db1..75a82ab 100644
--- a/camera/QCamera2/HAL3/QCamera3HWI.cpp
+++ b/camera/QCamera2/HAL3/QCamera3HWI.cpp
@@ -50,6 +50,7 @@
 #include "QCamera3Channel.h"
 #include "QCamera3PostProc.h"
 #include "QCamera3VendorTags.h"
+#include "cam_cond.h"
 
 using namespace android;
 
@@ -364,7 +365,8 @@
     // TODO: hardcode for now until mctl add support for min_num_pp_bufs
     //TBD - To see if this hardcoding is needed. Check by printing if this is filled by mctl to 3
     gCamCapability[cameraId]->min_num_pp_bufs = 3;
-    pthread_cond_init(&mRequestCond, NULL);
+
+    PTHREAD_COND_INIT(&mRequestCond);
     mPendingLiveRequest = 0;
     mCurrentRequestId = -1;
     pthread_mutex_init(&mMutex, NULL);
@@ -2580,17 +2582,22 @@
                 i++;
                 continue;
             } else {
-                ALOGE("%s: Fatal: Missing metadata buffer for frame number %d", __func__, i->frame_number);
-                if (free_and_bufdone_meta_buf) {
-                    mMetadataChannel->bufDone(metadata_buf);
-                    free(metadata_buf);
-                }
+                ALOGE("%s: Missing metadata buffer for frame number %d, reporting CAMERA3_MSG_ERROR_RESULT",
+                     __func__, i->frame_number);
+
+                mPendingLiveRequest--;
+
+                CameraMetadata dummyMetadata;
+                dummyMetadata.update(ANDROID_REQUEST_ID, &(i->request_id), 1);
+                result.result = dummyMetadata.release();
+
                 camera3_notify_msg_t notify_msg;
                 memset(&notify_msg, 0, sizeof(notify_msg));
                 notify_msg.type = CAMERA3_MSG_ERROR;
-                notify_msg.message.error.error_code = CAMERA3_MSG_ERROR_DEVICE;
+                notify_msg.message.error.error_code = CAMERA3_MSG_ERROR_RESULT;
+                notify_msg.message.error.error_stream = NULL;
+                notify_msg.message.error.frame_number = i->frame_number;
                 mCallbackOps->notify(mCallbackOps, &notify_msg);
-                goto done_metadata;
             }
         } else {
             i->partial_result_cnt++;
@@ -3821,7 +3828,7 @@
     // Added a timed condition wait
     struct timespec ts;
     uint8_t isValidTimeout = 1;
-    rc = clock_gettime(CLOCK_REALTIME, &ts);
+    rc = clock_gettime(CLOCK_MONOTONIC, &ts);
     if (rc < 0) {
       isValidTimeout = 0;
       ALOGE("%s: Error reading the real time clock!!", __func__);
@@ -9481,7 +9488,9 @@
     for (List<stream_info_t *>::iterator it = mStreamInfo.begin();
         it != mStreamInfo.end(); it++) {
         QCamera3Channel *channel = (QCamera3Channel *)(*it)->stream->priv;
-        channel->stop();
+        if (channel != nullptr) {
+            channel->stop();
+        }
         (*it)->status = INVALID;
     }
 
diff --git a/camera/QCamera2/stack/common/cam_cond.h b/camera/QCamera2/stack/common/cam_cond.h
new file mode 100644
index 0000000..52a6d71
--- /dev/null
+++ b/camera/QCamera2/stack/common/cam_cond.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2016 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.
+ */
+
+#ifndef CAM_COND_H
+#define CAM_COND_H
+
+#define PTHREAD_COND_INIT(cond) \
+  ({                                   \
+    int rc = 0;                       \
+    pthread_condattr_t cond_attr;     \
+    rc = pthread_condattr_init(&cond_attr);   \
+    if (rc == 0) {                            \
+      rc = pthread_condattr_setclock(&cond_attr, CLOCK_MONOTONIC);  \
+      if (rc == 0) {                                 \
+        rc = pthread_cond_init(cond, &cond_attr);  \
+      } \
+    } \
+    rc; \
+  })
+
+#endif // CAM_COND_H
diff --git a/camera/QCamera2/stack/common/cam_semaphore.h b/camera/QCamera2/stack/common/cam_semaphore.h
index a52f907..f4260c2 100644
--- a/camera/QCamera2/stack/common/cam_semaphore.h
+++ b/camera/QCamera2/stack/common/cam_semaphore.h
@@ -30,6 +30,11 @@
 #ifndef __QCAMERA_SEMAPHORE_H__
 #define __QCAMERA_SEMAPHORE_H__
 
+// System dependencies
+#include <pthread.h>
+#include <errno.h>
+#include "cam_cond.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -48,7 +53,7 @@
 static inline void cam_sem_init(cam_semaphore_t *s, int n)
 {
     pthread_mutex_init(&(s->mutex), NULL);
-    pthread_cond_init(&(s->cond), NULL);
+    PTHREAD_COND_INIT(&(s->cond));
     s->val = n;
 }
 
@@ -71,6 +76,27 @@
     return rc;
 }
 
+static inline int cam_sem_timedwait(cam_semaphore_t *s, const struct timespec *abs_timeout)
+{
+    int rc = 0;
+    pthread_mutex_lock(&(s->mutex));
+    while (s->val == 0 && rc != ETIMEDOUT)
+        rc = pthread_cond_timedwait(&(s->cond), &(s->mutex), abs_timeout);
+
+    if (s->val > 0)
+        s->val--;
+
+    pthread_mutex_unlock(&(s->mutex));
+
+    /* sem_timedwait returns -1 for failure case, and failure code is in errno
+     */
+    if (rc != 0) {
+        errno = rc;
+        rc = -1;
+    }
+    return rc;
+}
+
 static inline void cam_sem_destroy(cam_semaphore_t *s)
 {
     pthread_mutex_destroy(&(s->mutex));
diff --git a/camera/QCamera2/stack/mm-camera-interface/Android.mk b/camera/QCamera2/stack/mm-camera-interface/Android.mk
index ff71773..cef137d 100644
--- a/camera/QCamera2/stack/mm-camera-interface/Android.mk
+++ b/camera/QCamera2/stack/mm-camera-interface/Android.mk
@@ -27,6 +27,8 @@
 LOCAL_COPY_HEADERS_TO := mm-camera-interface
 LOCAL_COPY_HEADERS += ../common/cam_intf.h
 LOCAL_COPY_HEADERS += ../common/cam_types.h
+LOCAL_COPY_HEADERS += ../common/cam_cond.h
+LOCAL_COPY_HEADERS += ../common/cam_semaphore.h
 
 LOCAL_C_INCLUDES := \
     $(LOCAL_PATH)/inc \
diff --git a/camera/QCamera2/stack/mm-camera-interface/src/mm_camera.c b/camera/QCamera2/stack/mm-camera-interface/src/mm_camera.c
index 1cf357f..9e6f30f 100644
--- a/camera/QCamera2/stack/mm-camera-interface/src/mm_camera.c
+++ b/camera/QCamera2/stack/mm-camera-interface/src/mm_camera.c
@@ -43,6 +43,7 @@
 #include "mm_camera_sock.h"
 #include "mm_camera_interface.h"
 #include "mm_camera.h"
+#include "cam_cond.h"
 
 #define SET_PARM_BIT32(parm, parm_arr) \
     (parm_arr[parm/32] |= (1<<(parm%32)))
@@ -340,7 +341,7 @@
 
     pthread_mutex_init(&my_obj->cb_lock, NULL);
     pthread_mutex_init(&my_obj->evt_lock, NULL);
-    pthread_cond_init(&my_obj->evt_cond, NULL);
+    PTHREAD_COND_INIT(&my_obj->evt_cond);
 
     CDBG("%s : Launch evt Thread in Cam Open",__func__);
     snprintf(my_obj->evt_thread.threadName, THREAD_NAME_SIZE, "CAM_Dispatch");
@@ -1713,7 +1714,7 @@
 
     pthread_mutex_lock(&my_obj->evt_lock);
     while (!(my_obj->evt_rcvd.server_event_type & evt_mask)) {
-        clock_gettime(CLOCK_REALTIME, &ts);
+        clock_gettime(CLOCK_MONOTONIC, &ts);
         ts.tv_sec += WAIT_TIMEOUT;
         rc = pthread_cond_timedwait(&my_obj->evt_cond, &my_obj->evt_lock, &ts);
         if (rc == ETIMEDOUT) {
diff --git a/camera/QCamera2/stack/mm-camera-test/Android.mk b/camera/QCamera2/stack/mm-camera-test/Android.mk
index e775ead..74c7b3b 100644
--- a/camera/QCamera2/stack/mm-camera-test/Android.mk
+++ b/camera/QCamera2/stack/mm-camera-test/Android.mk
@@ -222,3 +222,19 @@
 
 LOCAL_MODULE:= libmm-qcamera
 include $(BUILD_SHARED_LIBRARY)
+
+# Build cam_semaphore_tests
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := src/cam_semaphore_tests.cpp
+
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/../common
+
+LOCAL_CFLAGS := -Wall -Wextra -Werror
+
+LOCAL_MODULE := cam_semaphore_tests
+LOCAL_MODULE_TAGS := tests
+
+include $(BUILD_NATIVE_TEST)
+
+LOCAL_PATH := $(OLD_LOCAL_PATH)
diff --git a/camera/QCamera2/stack/mm-camera-test/src/cam_semaphore_tests.cpp b/camera/QCamera2/stack/mm-camera-test/src/cam_semaphore_tests.cpp
new file mode 100644
index 0000000..98ec45b
--- /dev/null
+++ b/camera/QCamera2/stack/mm-camera-test/src/cam_semaphore_tests.cpp
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2016 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.
+ */
+
+//#define LOG_NDEBUG 0
+#define LOG_TAG "cam_semaphore_tests"
+#include <utils/Log.h>
+
+#include <gtest/gtest.h>
+
+#include "cam_semaphore.h"
+
+#define NS_PER_S 1000000000
+
+//10 ms is about standard timer resolution for most non-RTOS.
+#define TIME_THRESHOLD_IN_NS  10000000
+
+static inline void timespec_add_ms(timespec& ts, size_t ms) {
+    ts.tv_sec  += ms / 1000;
+    ts.tv_nsec += (ms % 1000) * 1000000;
+    if (ts.tv_nsec >= NS_PER_S) {
+        ts.tv_sec++;
+        ts.tv_nsec -= NS_PER_S;
+    }
+}
+
+static inline int64_t time_diff(timespec& ts_start, timespec& ts_end) {
+    if (ts_start.tv_sec == ts_end.tv_sec) {
+        return (int64_t)ts_end.tv_nsec - ts_start.tv_nsec;
+    } else {
+        return (int64_t)(ts_end.tv_sec - 1 - ts_start.tv_sec) * NS_PER_S +
+                ts_end.tv_nsec + NS_PER_S - ts_start.tv_nsec;
+    }
+}
+
+// Test cam_semaphore_timedwait
+TEST(cam_semaphore_tests, cam_semaphore_timedwait) {
+
+    cam_semaphore_t sem;
+    cam_sem_init(&sem, 0);
+
+    // Test timeout
+    timespec ts;
+    ASSERT_EQ(0, clock_gettime(CLOCK_MONOTONIC, &ts));
+    timespec_add_ms(ts, 100);
+
+    errno = 0;
+    ASSERT_EQ(-1, cam_sem_timedwait(&sem, &ts));
+    timespec ts_end;
+    clock_gettime(CLOCK_MONOTONIC, &ts_end);
+
+    ASSERT_EQ(ETIMEDOUT, errno);
+    // Check time after timeout ~= time before call + timeout
+    ASSERT_GE(time_diff(ts, ts_end), 0);
+    ASSERT_LT(time_diff(ts, ts_end), TIME_THRESHOLD_IN_NS);
+
+    // Test successful wait
+    ASSERT_EQ(0, clock_gettime(CLOCK_MONOTONIC, &ts));
+    timespec_add_ms(ts, 100);
+
+    errno = 0;
+    cam_sem_post(&sem);
+    ASSERT_EQ(0, cam_sem_timedwait(&sem, &ts));
+    ASSERT_EQ(0, errno);
+}
diff --git a/device.mk b/device.mk
index 8a5ef4f..f028dde 100644
--- a/device.mk
+++ b/device.mk
@@ -36,6 +36,7 @@
     device/huawei/angler/init.angler.usb.rc:root/init.angler.usb.rc \
     device/huawei/angler/fstab.angler:root/fstab.angler \
     device/huawei/angler/ueventd.angler.rc:root/ueventd.angler.rc \
+    device/huawei/angler/init.recovery.angler.rc:root/init.recovery.angler.rc \
     device/huawei/angler/init.angler.power.sh:system/bin/init.angler.power.sh \
     device/huawei/angler/uinput-fpc.kl:system/usr/keylayout/uinput-fpc.kl
 
@@ -50,6 +51,9 @@
 PRODUCT_COPY_FILES += \
     device/huawei/angler/init.mcfg.sh:system/bin/init.mcfg.sh
 
+PRODUCT_COPY_FILES += \
+    device/huawei/angler/init.radio.sh:system/bin/init.radio.sh
+
 # Thermal configuration
 PRODUCT_COPY_FILES += \
     device/huawei/angler/thermal-engine-angler.conf:system/etc/thermal-engine.conf
@@ -495,6 +499,10 @@
 PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
     ro.oem_unlock_supported=1
 
+# ro.product.first_api_level indicates the first api level the device has commercially launched on.
+PRODUCT_PROPERTY_OVERRIDES += \
+    ro.product.first_api_level=23
+
 # In userdebug, add minidebug info the the boot image and the system server to support
 # diagnosing native crashes.
 ifneq (,$(filter userdebug, $(TARGET_BUILD_VARIANT)))
diff --git a/gps.conf b/gps.conf
index fb22f47..56e393b 100644
--- a/gps.conf
+++ b/gps.conf
@@ -1,15 +1,14 @@
-#Uncommenting these urls would only enable
-#the power up auto injection and force injection(test case).
-#XTRA_SERVER_1=http://xtrapath1.izatcloud.net/xtra3grc.bin
-#XTRA_SERVER_2=http://xtrapath2.izatcloud.net/xtra3grc.bin
-#XTRA_SERVER_3=http://xtrapath3.izatcloud.net/xtra3grc.bin
+#URLs from which to download XTRA data
+XTRA_SERVER_1=https://xtrapath1.izatcloud.net/xtra3grc.bin
+XTRA_SERVER_2=https://xtrapath2.izatcloud.net/xtra3grc.bin
+XTRA_SERVER_3=https://xtrapath3.izatcloud.net/xtra3grc.bin
 
 #Version check for XTRA
 #DISABLE = 0
 #AUTO    = 1
 #XTRA2   = 2
 #XTRA3   = 3
-XTRA_VERSION_CHECK=0
+XTRA_VERSION_CHECK=1
 
 # Error Estimate
 # _SET = 1
diff --git a/init.angler.rc b/init.angler.rc
index 9b02b47..ef2b52a 100755
--- a/init.angler.rc
+++ b/init.angler.rc
@@ -220,6 +220,14 @@
     chmod 0440 /persist/data/st_offset
     chmod 0440 /persist/data/st_xtalk
 
+    # File flags for prebuilt ril db file
+    write /data/misc/radio/prebuilt_db_support 1
+    chown radio radio /data/misc/radio/prebuilt_db_support
+    chmod 0400 /data/misc/radio/prebuilt_db_support
+    write /data/misc/radio/db_check_done 0
+    chown radio radio /data/misc/radio/db_check_done
+    chmod 0660 /data/misc/radio/db_check_done
+
     chown system system /sys/class/kgsl/kgsl-3d0/devfreq/max_freq
     chmod 0660 /sys/class/kgsl/kgsl-3d0/devfreq/max_freq
     chown system system /sys/class/kgsl/kgsl-3d0/devfreq/min_freq
@@ -448,6 +456,12 @@
    group radio system
    oneshot
 
+service radio-sh /system/bin/init.radio.sh
+    class late_start
+    user radio
+    group root radio
+    oneshot
+
 service oem_qmi_server /vendor/bin/oem_qmi_server
     class main
     user root
diff --git a/init.angler.usb.rc b/init.angler.usb.rc
index f2edba9..90ad8e8 100644
--- a/init.angler.usb.rc
+++ b/init.angler.usb.rc
@@ -21,6 +21,7 @@
     write /sys/class/android_usb/android0/iSerial ${ro.serialno}
     write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
     write /sys/class/android_usb/android0/iProduct ${ro.product.model}
+    write /sys/module/dwc3/boot_finished 1
 
 on post-fs
     mkdir /dev/usb-ffs 0770 shell shell
diff --git a/init.radio.sh b/init.radio.sh
new file mode 100755
index 0000000..8d687a1
--- /dev/null
+++ b/init.radio.sh
@@ -0,0 +1,10 @@
+#!/system/bin/sh
+
+#
+# Copy qcril.db if needed for RIL
+#
+if [ -f /vendor/qcril.db -a ! -f /data/misc/radio/qcril.db ]; then
+    cp /vendor/qcril.db /data/misc/radio/qcril.db
+    chown -h radio.radio /data/misc/radio/qcril.db
+fi
+echo 1 > /data/misc/radio/db_check_done
diff --git a/init.recovery.angler.rc b/init.recovery.angler.rc
new file mode 100644
index 0000000..74ba632
--- /dev/null
+++ b/init.recovery.angler.rc
@@ -0,0 +1,7 @@
+on boot
+    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 960000
+    write /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq 960000
+    write /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq 960000
+    write /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq 960000
+    write /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq 960000
+    write /sys/devices/system/cpu/cpu5/cpufreq/scaling_max_freq 960000
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index 1a3c4cb..130d5e8 100755
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -277,6 +277,9 @@
          and the screen off animation has been performed. -->
     <bool name="config_dozeAfterScreenOff">true</bool>
 
+    <!-- Doze: should the TYPE_PICK_UP_GESTURE sensor be used as a pulse signal. -->
+    <bool name="config_dozePulsePickup">true</bool>
+
     <!-- Specifies whether to decouple the interactive state of the device from the display on/off state. -->
     <bool name="config_powerDecoupleInteractiveModeFromDisplay">true</bool>
 
@@ -393,4 +396,7 @@
         <item>"/system/framework/arm64/boot-core-libart.oat"</item>
     </string-array>
 
+    <!-- Enable system navigation keys. -->
+    <bool name="config_supportSystemNavigationKeys">true</bool>
+
 </resources>
diff --git a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
index 9c8433a..cf300bd 100644
--- a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
+++ b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
@@ -34,9 +34,6 @@
     <!-- Doze: does this device support STATE_DOZE and STATE_DOZE_SUSPEND?  -->
     <bool name="doze_display_state_supported">true</bool>
 
-    <!-- Doze: should the pickup sensor be used as a pulse signal? -->
-    <bool name="doze_pulse_on_pick_up">true</bool>
-
     <!-- Doze: can we assume the pickup sensor includes a proximity check? -->
     <bool name="doze_pickup_performs_proximity_check">true</bool>
 </resources>
diff --git a/self-extractors/huawei/staging/BoardConfigPartial.mk b/self-extractors/huawei/staging/BoardConfigPartial.mk
index cbb9830..4e60d69 100644
--- a/self-extractors/huawei/staging/BoardConfigPartial.mk
+++ b/self-extractors/huawei/staging/BoardConfigPartial.mk
@@ -11,3 +11,5 @@
 # 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.
+
+BOARD_PREBUILT_VENDORIMAGE := vendor/huawei/angler/proprietary/vendor.img
diff --git a/self-extractors/huawei/staging/device-partial.mk b/self-extractors/huawei/staging/device-partial.mk
index 817ef48..2987710 100644
--- a/self-extractors/huawei/staging/device-partial.mk
+++ b/self-extractors/huawei/staging/device-partial.mk
@@ -11,8 +11,3 @@
 # 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.
-
-# Vendor blob(s) necessary for Angler hardware
-PRODUCT_COPY_FILES := \
-    vendor/huawei/angler/proprietary/vendor.img:vendor.img:huawei \
-
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index e563795..4f7f58b 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -127,6 +127,7 @@
 /system/bin/init\.angler\.power\.sh      u:object_r:init-power-sh_exec:s0
 /system/bin/init\.angler\.qseecomd\.sh   u:object_r:init-angler-qseecomd-sh_exec:s0
 /system/bin/init\.mcfg\.sh               u:object_r:init-mcfg-sh_exec:s0
+/system/bin/init\.radio\.sh              u:object_r:init-radio-sh_exec:s0
 /vendor/bin/irsc_util                    u:object_r:irsc_util_exec:s0
 /vendor/bin/loc_launcher                 u:object_r:location_exec:s0
 /system/bin/location-mq                  u:object_r:location_exec:s0
diff --git a/sepolicy/fingerprintd.te b/sepolicy/fingerprintd.te
index e770c8f..f5160aa 100644
--- a/sepolicy/fingerprintd.te
+++ b/sepolicy/fingerprintd.te
@@ -7,3 +7,6 @@
 allow fingerprintd sysfs_fingerprintd:file rw_file_perms;
 allow fingerprintd sysfs_fingerprintd:dir search;
 allow fingerprintd sysfs_fingerprintd:dir r_dir_perms;
+# open/write/ioctl /dev/uinput
+allow fingerprintd uhid_device:chr_file rw_file_perms;
+allow fingerprintd fingerprintd_data_file:sock_file create_file_perms;
diff --git a/sepolicy/init-radio-sh.te b/sepolicy/init-radio-sh.te
new file mode 100644
index 0000000..daa70c4
--- /dev/null
+++ b/sepolicy/init-radio-sh.te
@@ -0,0 +1,12 @@
+# /system/bin/init.radio.sh
+type init-radio-sh, domain;
+type init-radio-sh_exec, exec_type, file_type;
+
+init_daemon_domain(init-radio-sh)
+
+allow init-radio-sh shell_exec:file rx_file_perms;
+
+allow init-radio-sh toolbox_exec:file rx_file_perms;
+
+allow init-radio-sh radio_data_file:dir rw_dir_perms;
+allow init-radio-sh radio_data_file:file create_file_perms;