From 8c3e55f4149deda3ec7c7a67fda81216d5f9af25 Mon Sep 17 00:00:00 2001 From: Ben Fennema Date: Wed, 2 Dec 2015 01:04:40 +0000 Subject: [PATCH] Revert "DO NOT MERGE ANYWHERE Add new interface for sensor physical data" This reverts commit d4db70a7b8b2d136c46c50f89b276f8150be5fc2. Change-Id: Ifb52d5595970a5178e12c2a90da4aac0e38f5942 --- include/gui/ISensorServer.h | 1 - include/gui/SensorManager.h | 2 +- libs/gui/ISensorServer.cpp | 21 +-------------------- libs/gui/SensorManager.cpp | 17 ----------------- services/sensorservice/SensorDevice.cpp | 15 --------------- services/sensorservice/SensorDevice.h | 1 - services/sensorservice/SensorService.cpp | 8 -------- services/sensorservice/SensorService.h | 1 - 8 files changed, 2 insertions(+), 64 deletions(-) diff --git a/include/gui/ISensorServer.h b/include/gui/ISensorServer.h index e590ce9c3..3dca2a373 100644 --- a/include/gui/ISensorServer.h +++ b/include/gui/ISensorServer.h @@ -41,7 +41,6 @@ public: virtual sp createSensorEventConnection(const String8& packageName, int mode, const String16& opPackageName) = 0; virtual int32_t isDataInjectionEnabled() = 0; - virtual status_t setSensorPhysicalData(const char* physicaldata) = 0; }; // ---------------------------------------------------------------------------- diff --git a/include/gui/SensorManager.h b/include/gui/SensorManager.h index 2b07ca7ce..0cff46c07 100644 --- a/include/gui/SensorManager.h +++ b/include/gui/SensorManager.h @@ -58,7 +58,7 @@ public: Sensor const* getDefaultSensor(int type); sp createEventQueue(String8 packageName = String8(""), int mode = 0); bool isDataInjectionEnabled(); - bool SetPhysicalData(const char* data); + private: // DeathRecipient interface void sensorManagerDied(); diff --git a/libs/gui/ISensorServer.cpp b/libs/gui/ISensorServer.cpp index 8cd17254b..f581b5c1d 100644 --- a/libs/gui/ISensorServer.cpp +++ b/libs/gui/ISensorServer.cpp @@ -35,8 +35,7 @@ namespace android { enum { GET_SENSOR_LIST = IBinder::FIRST_CALL_TRANSACTION, CREATE_SENSOR_EVENT_CONNECTION, - ENABLE_DATA_INJECTION, - SET_SENSOR_PHYSICAL_DATA, + ENABLE_DATA_INJECTION }; class BpSensorServer : public BpInterface @@ -84,16 +83,6 @@ public: remote()->transact(ENABLE_DATA_INJECTION, data, &reply); return reply.readInt32(); } - - virtual status_t setSensorPhysicalData(const char* physicaldata) - { - Parcel data, reply; - //ALOGD("ISensorManager::SetSensorPhysicalData(%s)",physicaldata); - data.writeInterfaceToken(ISensorServer::getInterfaceDescriptor()); - data.writeCString(physicaldata); - remote()->transact(SET_SENSOR_PHYSICAL_DATA, data, &reply); - return reply.readInt32(); - } }; // Out-of-line virtual method definition to trigger vtable emission in this @@ -135,14 +124,6 @@ status_t BnSensorServer::onTransact( reply->writeInt32(static_cast(ret)); return NO_ERROR; } - case SET_SENSOR_PHYSICAL_DATA: { - CHECK_INTERFACE(ISensorServer, data, reply); - const char* physicaldata = data.readCString(); - //ALOGD("ISensorManager, BnSensorServer::onTransact, physicaldata is: (%s)",physicaldata); - status_t result = setSensorPhysicalData(physicaldata); - reply->writeInt32(result); - return NO_ERROR; - } } return BBinder::onTransact(code, data, reply, flags); } diff --git a/libs/gui/SensorManager.cpp b/libs/gui/SensorManager.cpp index 343131fc0..33608b5bd 100644 --- a/libs/gui/SensorManager.cpp +++ b/libs/gui/SensorManager.cpp @@ -227,22 +227,5 @@ bool SensorManager::isDataInjectionEnabled() { return false; } -bool SensorManager::SetPhysicalData(const char* data) -{ - status_t reply; - //ALOGD("SensorManager::SetPhysicalData(%s)",data); - - reply = mSensorServer->setSensorPhysicalData(data); - - if(reply == NO_ERROR) - { - return true; - } - else - { - return false; - } -} - // ---------------------------------------------------------------------------- }; // namespace android diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp index 48ae2fb7a..dd1bccfbe 100644 --- a/services/sensorservice/SensorDevice.cpp +++ b/services/sensorservice/SensorDevice.cpp @@ -407,21 +407,6 @@ status_t SensorDevice::setMode(uint32_t mode) { return mSensorModule->set_operation_mode(mode); } -status_t SensorDevice::setSensorPhysicalData(const char* physicaldata) -{ - //ALOGD("SensorDevice::setSensorPhysicalData(%s)",physicaldata); - Mutex::Autolock _l(mLock); - if((mSensorModule->set_sensor_physical_data == NULL) || (getHalDeviceVersion() < SENSORS_DEVICE_API_VERSION_1_3_5)) - { - return NO_INIT; - } - else - { - return mSensorModule->set_sensor_physical_data(physicaldata); - } -} - - // --------------------------------------------------------------------------- int SensorDevice::Info::numActiveClients() { diff --git a/services/sensorservice/SensorDevice.h b/services/sensorservice/SensorDevice.h index f65849749..c48484994 100644 --- a/services/sensorservice/SensorDevice.h +++ b/services/sensorservice/SensorDevice.h @@ -104,7 +104,6 @@ public: void autoDisable(void *ident, int handle); status_t injectSensorData(const sensors_event_t *event); void dump(String8& result); - status_t setSensorPhysicalData(const char* physicaldata); }; // --------------------------------------------------------------------------- diff --git a/services/sensorservice/SensorService.cpp b/services/sensorservice/SensorService.cpp index 2548a3e81..fd72b2312 100644 --- a/services/sensorservice/SensorService.cpp +++ b/services/sensorservice/SensorService.cpp @@ -735,14 +735,6 @@ Vector SensorService::getSensorList(const String16& opPackageName) return accessibleSensorList; } -status_t SensorService::setSensorPhysicalData(const char* physicaldata) -{ - SensorDevice& dev(SensorDevice::getInstance()); - - //ALOGD("SensorService::setSensorPhysicalData(%s)",physicaldata); - return dev.setSensorPhysicalData(physicaldata); -} - sp SensorService::createSensorEventConnection(const String8& packageName, int requestedMode, const String16& opPackageName) { // Only 2 modes supported for a SensorEventConnection ... NORMAL and DATA_INJECTION. diff --git a/services/sensorservice/SensorService.h b/services/sensorservice/SensorService.h index 3a1ffb25e..9a573ae78 100644 --- a/services/sensorservice/SensorService.h +++ b/services/sensorservice/SensorService.h @@ -130,7 +130,6 @@ class SensorService : virtual sp createSensorEventConnection(const String8& packageName, int requestedMode, const String16& opPackageName); virtual int isDataInjectionEnabled(); - virtual status_t setSensorPhysicalData(const char* physicaldata); virtual status_t dump(int fd, const Vector& args); class SensorEventConnection : public BnSensorEventConnection, public LooperCallback {