2016/3/4

android 6.0 : fingerprint cannot exceed 91 bytes..

出現了
error: ro.build.fingerprint cannot exceed 91 bytes:
然後網路上說,改一些 PROP_VALUE_MAX 的值:
http://stackoverflow.com/questions/28776970/android-build-error-ro-build-fingerprint-cannot-exceed-91-bytes
Edit build/tools/post_process_props.py. Change lines as follows:

PROP_NAME_MAX = 31
# PROP_VALUE_MAX = 91
PROP_VALUE_MAX = 128
Edit bionic/libc/include/sys/system_properties.h. Change lines as follows:

#define PROP_NAME_MAX   32
// #define PROP_VALUE_MAX  92
#define PROP_VALUE_MAX  128
Do

make clean
make
所以照著改...
然後就出現...
In file included from hardware/qcom/camera/QCamera/HAL/core/src/QCameraHWI_Record.cpp:27:0:
In function 'int property_get(const char*, char*, const char*)',
    inlined from 'virtual android::status_t android::QCameraStream_record::getBuf(mm_camera_frame_len_offset*, uint8_t, uint8_t*, mm_camera_buf_def_t*)' 
at 
hardware/qcom/camera/QCamera/HAL/core/src/QCameraHWI_Record.cpp:220:60:
system/core/include/cutils/properties.h:122:41: 
error: call to '__property_get_too_small_error' declared with attribute error: 
property_get() called with too small of a buffer
         __property_get_too_small_error();
因為一開始出現了 ...所以改 PROPERTY_VALUE_MAX 從 92 改 128.
結果出現上面的錯誤。

因為google 很好心的寫了一個 check, 在 system/core/include/properties.h:
int property_get(const char *key, char *value, const char *default_value) {
   size_t bos = __bos(value);
   if (bos < PROPERTY_VALUE_MAX) {
      __property_get_too_small_error();
      ...

所以問題應該是在call property_get( ) function 的 code, 傳入的 array size 太小。
所以打開 QCameraHWI_Record.cpp : 220 : 60:
char value[100];
...
property_get("persist.camera.mem.usecache",value,"1");
...
把 value[100] 改 value[PROPERTY_VALUE_MAX]

沒有留言:

張貼留言