Hi,
I have encountered a crash problem of
HEART RATE sensor implement on Android 6 ( Android 5 is fine ).
I added heart rate sensor in the sensor
HAL.
But the device can not boot up due to
crash problem.
I found the code
frameworks\native\libs\gui\sensor.cpp has been changed of heart rate type below
(Red color) on android 6.
The crash is caused by this change.
case SENSOR_TYPE_HEART_RATE: {
mStringType = SENSOR_STRING_TYPE_HEART_RATE;
mRequiredPermission = SENSOR_PERMISSION_BODY_SENSORS;
AppOpsManager appOps;
mRequiredAppOp = appOps.permissionToOpCode(String16(SENSOR_PERMISSION_BODY_SENSORS));
mFlags |= SENSOR_FLAG_ON_CHANGE_MODE;
} break;
Any tips or help would be appreciated!
Thanks!!
Crash information :
--------- beginning of crash
01-01 00:18:35.912 863 931 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 931 (system_server)
01-01 00:18:36.047 315 315 I SELinux : SELinux: Loaded file_contexts contexts from /file_contexts.
01-01 00:18:36.058 315 315 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
01-01 00:18:36.058 315 315 F DEBUG : Build fingerprint: 'qcom/msm8909w/msm8909w:6.0/MRA58K/wells01201501:userdebug/test-keys'
01-01 00:18:36.058 315 315 F DEBUG : Revision: '0'
01-01 00:18:36.058 315 315 F DEBUG : ABI: 'arm'
01-01 00:18:36.058 315 315 F DEBUG : pid: 863, tid: 931, name: system_server >>> system_server <<<
01-01 00:18:36.059 315 315 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
01-01 00:18:36.093 315 315 F DEBUG : r0 00000000 r1 0000046e r2 70c9b848 r3 a2755610
01-01 00:18:36.093 315 315 F DEBUG : r4 00000000 r5 00000008 r6 b7b72c48 r7 00000008
01-01 00:18:36.093 315 315 F DEBUG : r8 a27556b4 r9 a2755680 sl 00000000 fp b8997f78
01-01 00:18:36.093 315 315 F DEBUG : ip b6e3f470 sp a2755600 lr b6de701f pc b6de3562 cpsr 600e0030
01-01 00:18:36.120 315 315 F DEBUG :
01-01 00:18:36.120 315 315 F DEBUG : backtrace:
01-01 00:18:36.121 315 315 F DEBUG : #00 pc 00083562 /system/lib/libandroid_runtime.so
01-01 00:18:36.121 315 315 F DEBUG : #01 pc 0008701b /system/lib/libandroid_runtime.so
01-01 00:18:36.121 315 315 F DEBUG : #02 pc 000198b1 /system/lib/libbinder.so (android::BBinder::transact(unsigned int, android::Parcel const&, android::Parcel*, unsigned int)+60)
01-01 00:18:36.121 315 315 F DEBUG : #03 pc 0001b74f /system/lib/libbinder.so (android::BpAppOpsService::permissionToOpCode(android::String16 const&)+62)
01-01 00:18:36.121 315 315 F DEBUG : #04 pc 000197bb /system/lib/libbinder.so (android::AppOpsManager::permissionToOpCode(android::String16 const&)+26)
01-01 00:18:36.121 315 315 F DEBUG : #05 pc 00045b1b /system/lib/libgui.so (android::Sensor::Sensor(sensor_t const*, int)+654)
01-01 00:18:36.122 315 315 F DEBUG : #06 pc 00008ce7 /system/lib/libsensorservice.so
01-01 00:18:36.122 315 315 F DEBUG : #07 pc 0000aca9 /system/lib/libsensorservice.so
01-01 00:18:36.122 315 315 F DEBUG : #08 pc 000154df /system/lib/libandroid_servers.so (android::sensorInit(void*)+82)
01-01 00:18:36.122 315 315 F DEBUG : #09 pc 00041613 /system/lib/libc.so (__pthread_start(void*)+30)
01-01 00:18:36.123 315 315 F DEBUG : #10 pc 00019265 /system/lib/libc.so (__start_thread+6)
01-01 00:18:36.501 407 618 E slim_daemon: [NDK] bindNDKSensors: Sensor server is unavailable.