mName(name), mHandle(0), mType(0),
mMinValue(0), mMaxValue(0), mResolution(0),
mPower(0), mMinDelay(0), mVersion(0), mFifoReservedEventCount(0),
- mFifoMaxEventCount(0), mRequiredAppOp(0),
+ mFifoMaxEventCount(0), mRequiredAppOp(-1),
mMaxDelay(0), mFlags(0) {
}
return (mFlags & SENSOR_FLAG_DYNAMIC_SENSOR) != 0;
}
+bool Sensor::isDataInjectionSupported() const {
+ return (mFlags & SENSOR_FLAG_DATA_INJECTION) != 0;
+}
+
bool Sensor::hasAdditionalInfo() const {
return (mFlags & SENSOR_FLAG_ADDITIONAL_INFO) != 0;
}
uint32_t getFlags() const;
bool isWakeUpSensor() const;
bool isDynamicSensor() const;
+ bool isDataInjectionSupported() const;
bool hasAdditionalInfo() const;
int32_t getHighestDirectReportRateLevel() const;
bool isDirectChannelTypeSupported(int32_t sharedMemType) const;
forEachSensor([&result] (const Sensor& s) -> bool {
result.appendFormat(
"%#010x) %-25s | %-15s | ver: %" PRId32 " | type: %20s(%" PRId32
- ") | perm: %s\n",
+ ") | perm: %s | flags: 0x%08x\n",
s.getHandle(),
s.getName().string(),
s.getVendor().string(),
s.getVersion(),
s.getStringType().string(),
s.getType(),
- s.getRequiredPermission().size() ? s.getRequiredPermission().string() : "n/a");
+ s.getRequiredPermission().size() ? s.getRequiredPermission().string() : "n/a",
+ static_cast<int>(s.getFlags()));
result.append("\t");
const int reportingMode = s.getReportingMode();
result.appendFormat("non-wakeUp | ");
}
+ if (s.isDataInjectionSupported()) {
+ result.appendFormat("data-injection, ");
+ }
+
if (s.isDynamicSensor()) {
result.appendFormat("dynamic, ");
}
+
if (s.hasAdditionalInfo()) {
result.appendFormat("has-additional-info, ");
}
if (s.isDirectChannelTypeSupported(SENSOR_DIRECT_MEM_TYPE_GRALLOC)) {
result.append("gralloc, ");
}
- result.appendFormat("flag =0x%08x", static_cast<int>(s.getFlags()));
result.append("\n");
}
return true;