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

Commit fd05d989 authored by Austin Borger's avatar Austin Borger
Browse files

Log isUidActive and isCameraPrivacyEnabled in handleAppOpMode.

When returning -EACCES from handleAppOpMode it's not clear what the
cause is. Camera privacy may be enabled, or there could be a race
condition where isUidActive is incorrect. Log both to clarify.

Bug: 328549794
Test: Smoke test of GCA.
Change-Id: I5cac91ef6b5cd748a45d7efa2e06f4876b9644b3
parent facc94ef
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -4444,8 +4444,10 @@ status_t CameraService::BasicClient::handleAppOpMode(int32_t mode) {
        // connection has been fully established and at that time camera muting
        // capabilities are unknown.
        if (!isUidActive || !isCameraPrivacyEnabled) {
            ALOGI("Camera %s: Access for \"%s\" has been restricted",
                    mCameraIdStr.c_str(), mClientPackageName.c_str());
            ALOGI("Camera %s: Access for \"%s\" has been restricted."
                    "uid active: %s, privacy enabled: %s", mCameraIdStr.c_str(),
                    mClientPackageName.c_str(), isUidActive ? "true" : "false",
                    isCameraPrivacyEnabled ? "true" : "false");
            // Return the same error as for device policy manager rejection
            return -EACCES;
        }