diff --git a/BoardConfig.mk b/BoardConfig.mk index bacc147bca60d181deed8b7db74989ca9e5546e2..4c70b1395f2573f6116dde57677b26ddafb8f85f 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -156,6 +156,7 @@ TARGET_USES_INTERACTION_BOOST := true # Properties TARGET_SYSTEM_PROP += $(DEVICE_PATH)/system.prop +TARGET_SYSTEM_EXT_PROP += $(DEVICE_PATH)/system_ext.prop TARGET_VENDOR_PROP += $(DEVICE_PATH)/vendor.prop # Qualcomm diff --git a/device.mk b/device.mk index ed34c384c66e5f83668c51bbf0caa42dc2555c66..29fe7157ced97c4dcd2530ceb4b21b789c4abdb2 100644 --- a/device.mk +++ b/device.mk @@ -386,8 +386,7 @@ PRODUCT_COPY_FILES += \ # Shims PRODUCT_PACKAGES += \ - camera.msm8953_shim \ - libshim_dpmframework + camera.msm8953_shim # Soong namespaces PRODUCT_SOONG_NAMESPACES += \ diff --git a/extract-files.sh b/extract-files.sh index 2203dbe81240ca697a3da53386c749e56ec9a469..50b0ec1fa2dac8e68cbd61519317446139ff7031 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -55,9 +55,6 @@ fi function blob_fixup() { case "${1}" in - product/lib64/libdpmframework.so) - "${PATCHELF}" --add-needed "libshim_dpmframework.so" "${2}" - ;; vendor/lib/hw/camera.msm8953.so) "${PATCHELF}" --add-needed camera.msm8953_shim.so "${2}" ;; diff --git a/libshims/Android.bp b/libshims/Android.bp index 37d6bedc4c8b82ff14c65d3c4f67a71e1956f4eb..5351a195fec77073f163ebebd868936c56274d8a 100644 --- a/libshims/Android.bp +++ b/libshims/Android.bp @@ -22,11 +22,3 @@ cc_library_shared { proprietary: true, } - -cc_library_shared { - name: "libshim_dpmframework", - srcs: [ - "strdup16to8.cpp", - "strdup8to16.cpp", - ], -} diff --git a/libshims/jstring.h b/libshims/jstring.h deleted file mode 100644 index 6cc0df0b66348cb5608d3fc9c824ccff079f4627..0000000000000000000000000000000000000000 --- a/libshims/jstring.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2006 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. - */ - -#pragma once - -#include <stdint.h> -#include <stddef.h> - -extern "C" { - -#if __STDC_VERSION__ < 201112L && __cplusplus < 201103L - typedef uint16_t char16_t; -#endif - -extern char * strndup16to8 (const char16_t* s, size_t n); -extern size_t strnlen16to8 (const char16_t* s, size_t n); -extern char * strncpy16to8 (char *dest, const char16_t*s, size_t n); - -extern char16_t * strdup8to16 (const char* s, size_t *out_len); -extern size_t strlen8to16 (const char* utf8Str); -extern char16_t * strcpy8to16 (char16_t *dest, const char*s, size_t *out_len); - -} diff --git a/libshims/strdup16to8.cpp b/libshims/strdup16to8.cpp deleted file mode 100644 index eb9e0126659bbccc76756035e325a79e0ce24d3c..0000000000000000000000000000000000000000 --- a/libshims/strdup16to8.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* libs/cutils/strdup16to8.c -** -** Copyright 2006, 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. -*/ - -#include "jstring.h" - -#include <assert.h> -#include <limits.h> -#include <stdlib.h> - -/** - * Convert a UTF-16 string to UTF-8. - * - */ -char * strndup16to8 (const char16_t* s, size_t n) -{ - if (s == NULL) { - return NULL; - } - - size_t len = strnlen16to8(s, n); - - /* We are paranoid, and we check for SIZE_MAX-1 - * too since it is an overflow value for our - * strnlen16to8 implementation. - */ - if (len >= SIZE_MAX-1) - return NULL; - - char* ret = static_cast<char*>(malloc(len + 1)); - if (ret == NULL) - return NULL; - - strncpy16to8 (ret, s, n); - - return ret; -} - -/** - * Given a UTF-16 string, compute the length of the corresponding UTF-8 - * string in bytes. - */ -extern size_t strnlen16to8(const char16_t* utf16Str, size_t len) -{ - size_t utf8Len = 0; - - /* A small note on integer overflow. The result can - * potentially be as big as 3*len, which will overflow - * for len > SIZE_MAX/3. - * - * Moreover, the result of a strnlen16to8 is typically used - * to allocate a destination buffer to strncpy16to8 which - * requires one more byte to terminate the UTF-8 copy, and - * this is generally done by careless users by incrementing - * the result without checking for integer overflows, e.g.: - * - * dst = malloc(strnlen16to8(utf16,len)+1) - * - * Due to this, the following code will try to detect - * overflows, and never return more than (SIZE_MAX-1) - * when it detects one. A careless user will try to malloc - * SIZE_MAX bytes, which will return NULL which can at least - * be detected appropriately. - * - * As far as I know, this function is only used by strndup16(), - * but better be safe than sorry. - */ - - /* Fast path for the usual case where 3*len is < SIZE_MAX-1. - */ - if (len < (SIZE_MAX-1)/3) { - while (len != 0) { - len--; - unsigned int uic = *utf16Str++; - - if (uic > 0x07ff) - utf8Len += 3; - else if (uic > 0x7f || uic == 0) - utf8Len += 2; - else - utf8Len++; - } - return utf8Len; - } - - /* The slower but paranoid version */ - while (len != 0) { - len--; - unsigned int uic = *utf16Str++; - size_t utf8Cur = utf8Len; - - if (uic > 0x07ff) - utf8Len += 3; - else if (uic > 0x7f || uic == 0) - utf8Len += 2; - else - utf8Len++; - - if (utf8Len < utf8Cur) /* overflow detected */ - return SIZE_MAX-1; - } - - /* don't return SIZE_MAX to avoid common user bug */ - if (utf8Len == SIZE_MAX) - utf8Len = SIZE_MAX-1; - - return utf8Len; -} - - -/** - * Convert a Java-Style UTF-16 string + length to a JNI-Style UTF-8 string. - * - * This basically means: embedded \0's in the UTF-16 string are encoded - * as "0xc0 0x80" - * - * Make sure you allocate "utf8Str" with the result of strlen16to8() + 1, - * not just "len". - * - * Please note, a terminated \0 is always added, so your result will always - * be "strlen16to8() + 1" bytes long. - */ -extern char* strncpy16to8(char* utf8Str, const char16_t* utf16Str, size_t len) -{ - char* utf8cur = utf8Str; - - /* Note on overflows: We assume the user did check the result of - * strnlen16to8() properly or at a minimum checked the result of - * its malloc(SIZE_MAX) in case of overflow. - */ - while (len != 0) { - len--; - unsigned int uic = *utf16Str++; - - if (uic > 0x07ff) { - *utf8cur++ = (uic >> 12) | 0xe0; - *utf8cur++ = ((uic >> 6) & 0x3f) | 0x80; - *utf8cur++ = (uic & 0x3f) | 0x80; - } else if (uic > 0x7f || uic == 0) { - *utf8cur++ = (uic >> 6) | 0xc0; - *utf8cur++ = (uic & 0x3f) | 0x80; - } else { - *utf8cur++ = uic; - - if (uic == 0) { - break; - } - } - } - - *utf8cur = '\0'; - - return utf8Str; -} diff --git a/libshims/strdup8to16.cpp b/libshims/strdup8to16.cpp deleted file mode 100644 index 8a05ba6b25f6e36d9728ece52e023bea76e5131a..0000000000000000000000000000000000000000 --- a/libshims/strdup8to16.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/* libs/cutils/strdup8to16.c -** -** Copyright 2006, 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. -*/ - -#include "jstring.h" - -#include <assert.h> -#include <limits.h> -#include <stdlib.h> - -/* See http://www.unicode.org/reports/tr22/ for discussion - * on invalid sequences - */ - -#define UTF16_REPLACEMENT_CHAR 0xfffd - -/* Clever trick from Dianne that returns 1-4 depending on leading bit sequence*/ -#define UTF8_SEQ_LENGTH(ch) (((0xe5000000 >> (((ch) >> 3) & 0x1e)) & 3) + 1) - -/* note: macro expands to multiple lines */ -#define UTF8_SHIFT_AND_MASK(unicode, byte) \ - (unicode)<<=6; (unicode) |= (0x3f & (byte)); - -#define UNICODE_UPPER_LIMIT 0x10fffd - -/** - * out_len is an out parameter (which may not be null) containing the - * length of the UTF-16 string (which may contain embedded \0's) - */ - -extern char16_t * strdup8to16 (const char* s, size_t *out_len) -{ - char16_t *ret; - size_t len; - - if (s == NULL) return NULL; - - len = strlen8to16(s); - - // fail on overflow - if (len && SIZE_MAX/len < sizeof(char16_t)) - return NULL; - - // no plus-one here. UTF-16 strings are not null terminated - ret = (char16_t *) malloc (sizeof(char16_t) * len); - - return strcpy8to16 (ret, s, out_len); -} - -/** - * Like "strlen", but for strings encoded with Java's modified UTF-8. - * - * The value returned is the number of UTF-16 characters required - * to represent this string. - */ -extern size_t strlen8to16 (const char* utf8Str) -{ - size_t len = 0; - int ic; - int expected = 0; - - while ((ic = *utf8Str++) != '\0') { - /* bytes that start 0? or 11 are lead bytes and count as characters.*/ - /* bytes that start 10 are extention bytes and are not counted */ - - if ((ic & 0xc0) == 0x80) { - /* count the 0x80 extention bytes. if we have more than - * expected, then start counting them because strcpy8to16 - * will insert UTF16_REPLACEMENT_CHAR's - */ - expected--; - if (expected < 0) { - len++; - } - } else { - len++; - expected = UTF8_SEQ_LENGTH(ic) - 1; - - /* this will result in a surrogate pair */ - if (expected == 3) { - len++; - } - } - } - - return len; -} - - - -/* - * Retrieve the next UTF-32 character from a UTF-8 string. - * - * Stops at inner \0's - * - * Returns UTF16_REPLACEMENT_CHAR if an invalid sequence is encountered - * - * Advances "*pUtf8Ptr" to the start of the next character. - */ -static inline uint32_t getUtf32FromUtf8(const char** pUtf8Ptr) -{ - uint32_t ret; - int seq_len; - int i; - - /* Mask for leader byte for lengths 1, 2, 3, and 4 respectively*/ - static const unsigned char leaderMask[4] = {0xff, 0x1f, 0x0f, 0x07}; - - /* Bytes that start with bits "10" are not leading characters. */ - if (((**pUtf8Ptr) & 0xc0) == 0x80) { - (*pUtf8Ptr)++; - return UTF16_REPLACEMENT_CHAR; - } - - /* note we tolerate invalid leader 11111xxx here */ - seq_len = UTF8_SEQ_LENGTH(**pUtf8Ptr); - - ret = (**pUtf8Ptr) & leaderMask [seq_len - 1]; - - if (**pUtf8Ptr == '\0') return ret; - - (*pUtf8Ptr)++; - for (i = 1; i < seq_len ; i++, (*pUtf8Ptr)++) { - if ((**pUtf8Ptr) == '\0') return UTF16_REPLACEMENT_CHAR; - if (((**pUtf8Ptr) & 0xc0) != 0x80) return UTF16_REPLACEMENT_CHAR; - - UTF8_SHIFT_AND_MASK(ret, **pUtf8Ptr); - } - - return ret; -} - - -/** - * out_len is an out parameter (which may not be null) containing the - * length of the UTF-16 string (which may contain embedded \0's) - */ - -extern char16_t * strcpy8to16 (char16_t *utf16Str, const char*utf8Str, - size_t *out_len) -{ - char16_t *dest = utf16Str; - - while (*utf8Str != '\0') { - uint32_t ret; - - ret = getUtf32FromUtf8(&utf8Str); - - if (ret <= 0xffff) { - *dest++ = (char16_t) ret; - } else if (ret <= UNICODE_UPPER_LIMIT) { - /* Create surrogate pairs */ - /* See http://en.wikipedia.org/wiki/UTF-16/UCS-2#Method_for_code_points_in_Plane_1.2C_Plane_2 */ - - *dest++ = 0xd800 | ((ret - 0x10000) >> 10); - *dest++ = 0xdc00 | ((ret - 0x10000) & 0x3ff); - } else { - *dest++ = UTF16_REPLACEMENT_CHAR; - } - } - - *out_len = dest - utf16Str; - - return utf16Str; -} diff --git a/proprietary-files.txt b/proprietary-files.txt index 6c9ab41527a62360aefe9e9789f964ab0d8507ab..faaba34de5e02badc1c6bdd5c20b6fde7b0d0ae6 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -946,32 +946,24 @@ vendor/bin/consumerird vendor/lib/hw/consumerir.default.so vendor/lib64/hw/consumerir.default.so -# DPM - from daisy-user-10-QKQ1.191002.002-V11.0.18.0.QDLMIXM-release-keys -framework/tcmclient.jar|6ef9ca98f67c144fc8ae941bb3a47f99cbd93098 -product/bin/dpmd|cac8f3eadeeec202f56d5b5f7a8c75e82e376d9f -product/etc/dpm/dpm.conf|95e27da8c989e96c6faea6f0697bce11955b62a5 -product/etc/init/dpmd.rc|7f95195a89fddce06b93006a737701270e91f669 -product/etc/permissions/com.qti.dpmframework.xml|4613f8b8629d0b823e6aaab45d399ac30da06c09 -product/etc/permissions/dpmapi.xml|0991b3069308620cfcad53873e9f09af181b981d -product/framework/com.qti.dpmframework.jar|e39a7e06af2d1e95a3724c19c36b8716277f53a1 -product/framework/dpmapi.jar|4696df9793ad676b305d53b5d7ce65ecf74771ad -product/lib/com.qualcomm.qti.dpm.api@1.0.so|50a6e8edcad48708d0b0cac98e7f9be98bdea225 -product/lib/libdpmctmgr.so|7ac017c1861d2b715074083daef2aa1a6cd6021b -product/lib/libdpmfdmgr.so|2be3f4e034af1399a8aef1012708591bc3a001f9 -product/lib/libdpmframework.so|3def0c2c741d9092197d499bef6d245b8430a4c7 -product/lib/libdpmtcm.so|b9bc8c5e52b609d97a7e0fe79f3189bdd5bc80a2 -product/lib64/com.qualcomm.qti.dpm.api@1.0.so|a70cfc1be3e06cde6318d6969e114429fe1950bb -product/lib64/libdpmctmgr.so|7ee0d1d40a8fc7fea924602db13717235ed2c2aa -product/lib64/libdpmfdmgr.so|cb0157da0ffe6827471662a5b7881e85165cb5aa -product/lib64/libdpmframework.so|dedfeed9df7531f7eea4f968fc980c6bee3c02e5 -product/lib64/libdpmtcm.so|a98ab3c419ebe49c6f3351ef4fa64ebda65d0e7d --product/priv-app/dpmserviceapp/dpmserviceapp.apk|9fd873c5330c03c62dfdeb6540b5984588295319 -vendor/bin/dpmQmiMgr|a43829d478ebc243b5f7307b44aa501a7a3c8211 -vendor/etc/init/dpmQmiMgr.rc|67569302d3a8828a9118c835e5b69c51b0c8ac68 -vendor/lib/com.qualcomm.qti.dpm.api@1.0.so|50a6e8edcad48708d0b0cac98e7f9be98bdea225 -vendor/lib/libdpmqmihal.so|f618b7d9387d35b757377f47452f503d8b405ed9 -vendor/lib64/com.qualcomm.qti.dpm.api@1.0.so|a70cfc1be3e06cde6318d6969e114429fe1950bb -vendor/lib64/libdpmqmihal.so|25d74c0e867f023b71a7c599ab6d213c7de2725d +# DPM - from FP3-user 11 8901.4.A.0010 gms-f74c58a8 release-keys +system_ext/bin/dpmd|dc94ffe90c6658b0bc99c64f68517c4048d0321a +system_ext/etc/dpm/dpm.conf|95e27da8c989e96c6faea6f0697bce11955b62a5 +system_ext/etc/init/dpmd.rc|738b638ff04cda368e22c03e16baf90ba157a6fc +system_ext/etc/permissions/com.qti.dpmframework.xml|c4b7ad0879d00c1eba4f3fe3a88ddb8aa153629a +system_ext/etc/permissions/dpmapi.xml|9158c9789cc7135a685b3fb27f8cc27108b51fef +system_ext/framework/com.qti.dpmframework.jar|96a29e28b3abffb9223daadd67459e3f5a3271df +system_ext/framework/dpmapi.jar|2e2fbe2257a697b96a644c774136da0554430d3f +system_ext/lib64/com.qualcomm.qti.dpm.api@1.0.so|b992e1f565f7b8b814eac0c88517543e6d0de603 +system_ext/lib64/libdpmctmgr.so|8a687fce30df9483a96065e6cc4154f03562dfa9 +system_ext/lib64/libdpmfdmgr.so|bf3666db17e77da3a303c10579baec0bd018089f +system_ext/lib64/libdpmframework.so|235fbb48b47baebd48dbe56f72c77d97ca12c07c +system_ext/lib64/libdpmtcm.so|dff3d3dbacd18ed55b5758a174f5016ef9e7a896 +-system_ext/priv-app/dpmserviceapp/dpmserviceapp.apk|10828ba0d987fa884ad0b4a87a46bf9f505535ea +vendor/bin/dpmQmiMgr|61a421804559b0e461439c19088acc01b871982a +vendor/etc/init/dpmQmiMgr.rc|1538743661a5c48c15cd105beaad20f72953885a +vendor/lib64/com.qualcomm.qti.dpm.api@1.0.so|d9f1aa7f93b928f42499d613d20ccbc60f279097 +vendor/lib64/libdpmqmihal.so|41eb89e66ba065c43a5eb79cd3c72cef0ee167aa # DRM - from daisy-user-10-QKQ1.191002.002-V11.0.18.0.QDLMIXM-release-keys vendor/bin/qseecomd|98e59e53f6bf2e585120f07f93d1265acfa80e7b diff --git a/system_ext.prop b/system_ext.prop new file mode 100644 index 0000000000000000000000000000000000000000..586da65088ba1ee82cca960a37fd00954cfc8171 --- /dev/null +++ b/system_ext.prop @@ -0,0 +1,2 @@ +# DPM +persist.vendor.dpm.feature=11 diff --git a/vendor.prop b/vendor.prop index f7427684ff405ce45c5f154349cb6af0c6c89143..9c93d516b2da6463931057346dc81f96ded57216 100644 --- a/vendor.prop +++ b/vendor.prop @@ -31,6 +31,9 @@ ro.soc.model=SDM450 ro.vendor.display.cabl=0 ro.vendor.display.sensortype=2 +# DPM +persist.vendor.dpmhalservice.enable=1 + # DRM drm.service.enabled=true