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

Commit 645b9ce1 authored by Mike Ma's avatar Mike Ma Committed by Android (Google) Code Review
Browse files

Merge "Skip dump proto when initCheck fails"

parents c8ccc919 285aac19
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -520,6 +520,10 @@ status_t SensorService::dump(int fd, const Vector<String16>& args) {
status_t SensorService::dumpProtoLocked(int fd, ConnectionSafeAutolock* connLock) const {
    using namespace service::SensorServiceProto;
    util::ProtoOutputStream proto;
    proto.write(INIT_STATUS, int(SensorDevice::getInstance().initCheck()));
    if (!mSensors.hasAnySensor()) {
        return proto.flush(fd) ? OK : UNKNOWN_ERROR;
    }
    const bool privileged = IPCThreadState::self()->getCallingUid() == 0;

    timespec curTime;