Loading libs/renderengine/TEST_MAPPING +6 −0 Original line number Diff line number Diff line Loading @@ -3,5 +3,11 @@ { "name": "librenderengine_test" } ], "imports": [ { "path": "frameworks/native/services/surfaceflinger" } ] } services/sensorservice/BatteryService.cpp +0 −17 Original line number Diff line number Diff line Loading @@ -74,23 +74,6 @@ void BatteryService::disableSensorImpl(uid_t uid, int handle) { } } void BatteryService::cleanupImpl(uid_t uid) { if (checkService()) { Mutex::Autolock _l(mActivationsLock); int64_t identity = IPCThreadState::self()->clearCallingIdentity(); for (size_t i=0 ; i<mActivations.size() ; ) { const Info& info(mActivations[i]); if (info.uid == uid) { mBatteryStatService->noteStopSensor(info.uid, info.handle); mActivations.removeAt(i); } else { i++; } } IPCThreadState::self()->restoreCallingIdentity(identity); } } bool BatteryService::checkService() { if (mBatteryStatService == nullptr) { const sp<IServiceManager> sm(defaultServiceManager()); Loading services/sensorservice/BatteryService.h +0 −4 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ class BatteryService : public Singleton<BatteryService> { void enableSensorImpl(uid_t uid, int handle); void disableSensorImpl(uid_t uid, int handle); void cleanupImpl(uid_t uid); struct Info { uid_t uid; Loading @@ -58,9 +57,6 @@ public: static void disableSensor(uid_t uid, int handle) { BatteryService::getInstance().disableSensorImpl(uid, handle); } static void cleanup(uid_t uid) { BatteryService::getInstance().cleanupImpl(uid); } }; // --------------------------------------------------------------------------- Loading services/sensorservice/SensorDevice.cpp +10 −1 Original line number Diff line number Diff line Loading @@ -612,8 +612,10 @@ int SensorDevice::getHalDeviceVersion() const { return SENSORS_DEVICE_API_VERSION_1_4; } status_t SensorDevice::flush(void* /*ident*/, int handle) { status_t SensorDevice::flush(void* ident, int handle) { if (mHalWrapper == nullptr) return NO_INIT; if (isClientDisabled(ident)) return INVALID_OPERATION; ALOGD_IF(DEBUG_CONNECTIONS, "\t>>> actuating h/w flush %d", handle); return mHalWrapper->flush(handle); } Loading Loading @@ -754,6 +756,13 @@ void SensorDevice::disableAllSensors() { status_t SensorDevice::injectSensorData(const sensors_event_t* injected_sensor_event) { if (mHalWrapper == nullptr) return NO_INIT; ALOGD_IF(DEBUG_CONNECTIONS, "sensor_event handle=%d ts=%" PRId64 " data=%.2f, %.2f, %.2f %.2f %.2f %.2f", injected_sensor_event->sensor, injected_sensor_event->timestamp, injected_sensor_event->data[0], injected_sensor_event->data[1], injected_sensor_event->data[2], injected_sensor_event->data[3], injected_sensor_event->data[4], injected_sensor_event->data[5]); return mHalWrapper->injectSensorData(injected_sensor_event); } Loading services/sensorservice/SensorService.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -1611,7 +1611,9 @@ void SensorService::cleanupConnection(SensorEventConnection* c) { } else { ALOGE("sensor interface of handle=0x%08x is null!", handle); } c->removeSensor(handle); if (c->removeSensor(handle)) { BatteryService::disableSensor(c->getUid(), handle); } } SensorRecord* rec = mActiveSensors.valueAt(i); ALOGE_IF(!rec, "mActiveSensors[%zu] is null (handle=0x%08x)!", i, handle); Loading @@ -1631,7 +1633,6 @@ void SensorService::cleanupConnection(SensorEventConnection* c) { } c->updateLooperRegistration(mLooper); mConnectionHolder.removeEventConnection(connection); BatteryService::cleanup(c->getUid()); if (c->needsWakeLock()) { checkWakeLockStateLocked(&connLock); } Loading Loading
libs/renderengine/TEST_MAPPING +6 −0 Original line number Diff line number Diff line Loading @@ -3,5 +3,11 @@ { "name": "librenderengine_test" } ], "imports": [ { "path": "frameworks/native/services/surfaceflinger" } ] }
services/sensorservice/BatteryService.cpp +0 −17 Original line number Diff line number Diff line Loading @@ -74,23 +74,6 @@ void BatteryService::disableSensorImpl(uid_t uid, int handle) { } } void BatteryService::cleanupImpl(uid_t uid) { if (checkService()) { Mutex::Autolock _l(mActivationsLock); int64_t identity = IPCThreadState::self()->clearCallingIdentity(); for (size_t i=0 ; i<mActivations.size() ; ) { const Info& info(mActivations[i]); if (info.uid == uid) { mBatteryStatService->noteStopSensor(info.uid, info.handle); mActivations.removeAt(i); } else { i++; } } IPCThreadState::self()->restoreCallingIdentity(identity); } } bool BatteryService::checkService() { if (mBatteryStatService == nullptr) { const sp<IServiceManager> sm(defaultServiceManager()); Loading
services/sensorservice/BatteryService.h +0 −4 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ class BatteryService : public Singleton<BatteryService> { void enableSensorImpl(uid_t uid, int handle); void disableSensorImpl(uid_t uid, int handle); void cleanupImpl(uid_t uid); struct Info { uid_t uid; Loading @@ -58,9 +57,6 @@ public: static void disableSensor(uid_t uid, int handle) { BatteryService::getInstance().disableSensorImpl(uid, handle); } static void cleanup(uid_t uid) { BatteryService::getInstance().cleanupImpl(uid); } }; // --------------------------------------------------------------------------- Loading
services/sensorservice/SensorDevice.cpp +10 −1 Original line number Diff line number Diff line Loading @@ -612,8 +612,10 @@ int SensorDevice::getHalDeviceVersion() const { return SENSORS_DEVICE_API_VERSION_1_4; } status_t SensorDevice::flush(void* /*ident*/, int handle) { status_t SensorDevice::flush(void* ident, int handle) { if (mHalWrapper == nullptr) return NO_INIT; if (isClientDisabled(ident)) return INVALID_OPERATION; ALOGD_IF(DEBUG_CONNECTIONS, "\t>>> actuating h/w flush %d", handle); return mHalWrapper->flush(handle); } Loading Loading @@ -754,6 +756,13 @@ void SensorDevice::disableAllSensors() { status_t SensorDevice::injectSensorData(const sensors_event_t* injected_sensor_event) { if (mHalWrapper == nullptr) return NO_INIT; ALOGD_IF(DEBUG_CONNECTIONS, "sensor_event handle=%d ts=%" PRId64 " data=%.2f, %.2f, %.2f %.2f %.2f %.2f", injected_sensor_event->sensor, injected_sensor_event->timestamp, injected_sensor_event->data[0], injected_sensor_event->data[1], injected_sensor_event->data[2], injected_sensor_event->data[3], injected_sensor_event->data[4], injected_sensor_event->data[5]); return mHalWrapper->injectSensorData(injected_sensor_event); } Loading
services/sensorservice/SensorService.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -1611,7 +1611,9 @@ void SensorService::cleanupConnection(SensorEventConnection* c) { } else { ALOGE("sensor interface of handle=0x%08x is null!", handle); } c->removeSensor(handle); if (c->removeSensor(handle)) { BatteryService::disableSensor(c->getUid(), handle); } } SensorRecord* rec = mActiveSensors.valueAt(i); ALOGE_IF(!rec, "mActiveSensors[%zu] is null (handle=0x%08x)!", i, handle); Loading @@ -1631,7 +1633,6 @@ void SensorService::cleanupConnection(SensorEventConnection* c) { } c->updateLooperRegistration(mLooper); mConnectionHolder.removeEventConnection(connection); BatteryService::cleanup(c->getUid()); if (c->needsWakeLock()) { checkWakeLockStateLocked(&connLock); } Loading