Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba21e333 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8554681 from 7be8557f to tm-release

Change-Id: I540bff9dcdb2d0892885c1592fa98b98dfe469f3
parents 49fed20e 7be8557f
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3,5 +3,11 @@
    {
      "name": "librenderengine_test"
    }
  ],

  "imports": [
    {
      "path": "frameworks/native/services/surfaceflinger"
    }
  ]
}
+0 −17
Original line number Diff line number Diff line
@@ -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());
+0 −4
Original line number Diff line number Diff line
@@ -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;
@@ -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);
    }
};

// ---------------------------------------------------------------------------
+10 −1
Original line number Diff line number Diff line
@@ -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);
}

@@ -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);
}

+3 −2
Original line number Diff line number Diff line
@@ -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);
@@ -1631,7 +1633,6 @@ void SensorService::cleanupConnection(SensorEventConnection* c) {
    }
    c->updateLooperRegistration(mLooper);
    mConnectionHolder.removeEventConnection(connection);
    BatteryService::cleanup(c->getUid());
    if (c->needsWakeLock()) {
        checkWakeLockStateLocked(&connLock);
    }