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

Commit e9ccb98f authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Remove "sys.secpolicy.camera.off_" system property check

With I421690f14ee57fa818d2b233fe48a90a0a575a9e, now the device policy camera
restrictions will be propagated with a user restriction via appops, so the
system property check is no longer needed.

Bug 24538855

Change-Id: I7b034c0d49b834e570c758315df6a0163f64af4e
parent 7350b057
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -885,18 +885,7 @@ status_t CameraService::validateConnectLocked(const String8& cameraId, /*inout*/
        return -ENODEV;
    }

    // Check device policy for this camera
    char value[PROPERTY_VALUE_MAX];
    char key[PROPERTY_KEY_MAX];
    userid_t clientUserId = multiuser_get_user_id(clientUid);
    snprintf(key, PROPERTY_KEY_MAX, "sys.secpolicy.camera.off_%d", clientUserId);
    property_get(key, value, "0");
    if (strcmp(value, "1") == 0) {
        // Camera is disabled by DevicePolicyManager.
        ALOGE("CameraService::connect X (PID %d) rejected (camera %s is disabled by device "
                "policy)", callingPid, cameraId.string());
        return -EACCES;
    }

    // Only allow clients who are being used by the current foreground device user, unless calling
    // from our own process.