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

Commit f66a6d01 authored by Rocky Fang's avatar Rocky Fang
Browse files

Align enable with createSensorEventConnection

This is needed since without this, a package might not be able to
reregister a sensor after creating it.

Bug: 366422218
Test: Tested by reporter using the method described in the bug
Flag: EXEMPT bugfix
Change-Id: I38a3d84a3d2a9793c8659ed7ac73d0a13eeccafc
parent fbf5a5bd
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2049,7 +2049,8 @@ status_t SensorService::enable(const sp<SensorEventConnection>& connection,
    }

    ConnectionSafeAutolock connLock = mConnectionHolder.lock(mLock);
    if (mCurrentOperatingMode != NORMAL && mCurrentOperatingMode != REPLAY_DATA_INJECTION &&
    if (mCurrentOperatingMode != NORMAL &&
        !isInjectionMode(mCurrentOperatingMode) &&
        !isAllowListedPackage(connection->getPackageName())) {
      return INVALID_OPERATION;
    }