Lines Matching refs:connection
402 sp<SensorEventConnection> connection(mActiveConnections[i].promote()); in dump() local
403 if (connection != 0) { in dump()
405 connection->dump(result); in dump()
442 void SensorService::cleanupAutoDisabledSensorLocked(const sp<SensorEventConnection>& connection, in cleanupAutoDisabledSensorLocked() argument
449 if (connection->hasSensor(handle)) { in cleanupAutoDisabledSensorLocked()
455 sensor->autoDisable(connection.get(), handle); in cleanupAutoDisabledSensorLocked()
456 cleanupWithoutDisableLocked(connection, handle); in cleanupAutoDisabledSensorLocked()
788 const wp<SensorEventConnection> connection(c); in cleanupConnection() local
808 if (rec && rec->removeConnection(connection)) { in cleanupConnection()
819 mActiveConnections.remove(connection); in cleanupConnection()
830 status_t SensorService::enable(const sp<SensorEventConnection>& connection, in enable() argument
848 && !isWhiteListedPackage(connection->getPackageName())) { in enable()
854 rec = new SensorRecord(connection); in enable()
860 if (rec->addConnection(connection)) { in enable()
880 connection->sendEvents(&event, 1, NULL); in enable()
881 if (!connection->needsWakeLock() && mWakeLockAcquired) { in enable()
891 if (connection->addSensor(handle)) { in enable()
892 BatteryService::enableSensor(connection->getUid(), handle); in enable()
895 if (mActiveConnections.indexOf(connection) < 0) { in enable()
896 mActiveConnections.add(connection); in enable()
900 handle, connection.get()); in enable()
912 status_t err = sensor->batch(connection.get(), handle, 0, samplingPeriodNs, in enable()
920 connection->setFirstFlushPending(handle, true); in enable()
921 status_t err_flush = sensor->flush(connection.get(), handle); in enable()
924 rec->addPendingFlushConnection(connection.get()); in enable()
926 connection->setFirstFlushPending(handle, false); in enable()
932 err = sensor->activate(connection.get(), true); in enable()
936 connection->updateLooperRegistration(mLooper); in enable()
943 reg_info.mPackageName = connection->getPackageName(); in enable()
954 cleanupWithoutDisableLocked(connection, handle); in enable()
959 status_t SensorService::disable(const sp<SensorEventConnection>& connection, in disable() argument
966 status_t err = cleanupWithoutDisableLocked(connection, handle); in disable()
969 err = sensor ? sensor->activate(connection.get(), false) : status_t(BAD_VALUE); in disable()
976 reg_info.mPackageName= connection->getPackageName(); in disable()
989 const sp<SensorEventConnection>& connection, int handle) { in cleanupWithoutDisable() argument
991 return cleanupWithoutDisableLocked(connection, handle); in cleanupWithoutDisable()
995 const sp<SensorEventConnection>& connection, int handle) { in cleanupWithoutDisableLocked() argument
999 if (connection->removeSensor(handle)) { in cleanupWithoutDisableLocked()
1000 BatteryService::disableSensor(connection->getUid(), handle); in cleanupWithoutDisableLocked()
1002 if (connection->hasAnySensor() == false) { in cleanupWithoutDisableLocked()
1003 connection->updateLooperRegistration(mLooper); in cleanupWithoutDisableLocked()
1004 mActiveConnections.remove(connection); in cleanupWithoutDisableLocked()
1007 if (rec->removeConnection(connection)) { in cleanupWithoutDisableLocked()
1017 status_t SensorService::setEventRate(const sp<SensorEventConnection>& connection, in setEventRate() argument
1039 return sensor->setDelay(connection.get(), handle, ns); in setEventRate()
1042 status_t SensorService::flushSensor(const sp<SensorEventConnection>& connection, in flushSensor() argument
1050 for (size_t i = 0; i < connection->mSensorInfo.size(); ++i) { in flushSensor()
1051 const int handle = connection->mSensorInfo.keyAt(i); in flushSensor()
1061 connection->incrementPendingFlushCount(handle); in flushSensor()
1067 status_t err_flush = sensor->flush(connection.get(), handle); in flushSensor()
1070 if (rec != NULL) rec->addPendingFlushConnection(connection); in flushSensor()
1127 sp<SensorEventConnection> connection(mActiveConnections[i].promote()); in checkWakeLockStateLocked() local
1128 if (connection != 0) { in checkWakeLockStateLocked()
1129 if (connection->needsWakeLock()) { in checkWakeLockStateLocked()
1140 void SensorService::sendEventsFromCache(const sp<SensorEventConnection>& connection) { in sendEventsFromCache() argument
1142 connection->writeToSocketFromCache(); in sendEventsFromCache()
1143 if (connection->needsWakeLock()) { in sendEventsFromCache()
1152 sp<SensorEventConnection> connection(mActiveConnections[i].promote()); in populateActiveConnections() local
1153 if (connection != 0) { in populateActiveConnections()
1154 activeConnections->add(connection); in populateActiveConnections()
1188 const sp<SensorEventConnection>& connection) in SensorRecord() argument
1190 mConnections.add(connection); in SensorRecord()
1194 const sp<SensorEventConnection>& connection) in addConnection() argument
1196 if (mConnections.indexOf(connection) < 0) { in addConnection()
1197 mConnections.add(connection); in addConnection()
1204 const wp<SensorEventConnection>& connection) in removeConnection() argument
1206 ssize_t index = mConnections.indexOf(connection); in removeConnection()
1214 if (it->unsafe_get() == connection.unsafe_get()) { in removeConnection()
1224 const sp<SensorEventConnection>& connection) { in addPendingFlushConnection() argument
1225 mPendingFlushConnections.add(connection); in addPendingFlushConnection()