sensor: Allow devices to skip the permission request
This is needed by Samsung devices with pre-M sensor blobs which have support for SENSOR_TYPE_HEART_RATE or body sensors in general. These HALs somehow segfault on the flagged code. Change-Id: I698f4129e71b683f6f063f00da79f32a5f521149
This commit is contained in:
parent
31ab17fb0c
commit
8befd14c4a
|
@ -91,6 +91,10 @@ ifeq ($(TARGET_BOARD_PLATFORM), tegra3)
|
||||||
LOCAL_CFLAGS += -DDONT_USE_FENCE_SYNC
|
LOCAL_CFLAGS += -DDONT_USE_FENCE_SYNC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(TARGET_NO_SENSOR_PERMISSION_CHECK),true)
|
||||||
|
LOCAL_CPPFLAGS += -DNO_SENSOR_PERMISSION_CHECK
|
||||||
|
endif
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|
||||||
ifeq (,$(ONE_SHOT_MAKEFILE))
|
ifeq (,$(ONE_SHOT_MAKEFILE))
|
||||||
|
|
|
@ -267,6 +267,7 @@ Sensor::Sensor(struct sensor_t const* hwSensor, int halVersion)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NO_SENSOR_PERMISSION_CHECK
|
||||||
if (mRequiredPermission.length() > 0) {
|
if (mRequiredPermission.length() > 0) {
|
||||||
// If the sensor is protected by a permission we need to know if it is
|
// If the sensor is protected by a permission we need to know if it is
|
||||||
// a runtime one to determine whether we can use the permission cache.
|
// a runtime one to determine whether we can use the permission cache.
|
||||||
|
@ -277,6 +278,7 @@ Sensor::Sensor(struct sensor_t const* hwSensor, int halVersion)
|
||||||
String16(mRequiredPermission));
|
String16(mRequiredPermission));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Sensor::~Sensor()
|
Sensor::~Sensor()
|
||||||
|
|
Loading…
Reference in New Issue