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

Commit 44e2167e authored by Jyoti Bhayana's avatar Jyoti Bhayana Committed by Android (Google) Code Review
Browse files

Merge "Modify the API for camera privacy allowlist" into main

parents 98682673 54a4b009
Loading
Loading
Loading
Loading
+3 −9
Original line number Original line Diff line number Diff line
@@ -2353,12 +2353,8 @@ bool CameraService::isCameraPrivacyEnabled(const String16& packageName, const st
        return true;
        return true;
    } else if (mSensorPrivacyPolicy->getCameraPrivacyState() == SensorPrivacyManager::DISABLED) {
    } else if (mSensorPrivacyPolicy->getCameraPrivacyState() == SensorPrivacyManager::DISABLED) {
        return false;
        return false;
    } else if ((mSensorPrivacyPolicy->getCameraPrivacyState()
    } else if (mSensorPrivacyPolicy->getCameraPrivacyState()
            == SensorPrivacyManager::AUTOMOTIVE_DRIVER_ASSISTANCE_HELPFUL_APPS) ||
            == SensorPrivacyManager::ENABLED_EXCEPT_ALLOWLISTED_APPS) {
            (mSensorPrivacyPolicy->getCameraPrivacyState()
            == SensorPrivacyManager::AUTOMOTIVE_DRIVER_ASSISTANCE_REQUIRED_APPS) ||
            (mSensorPrivacyPolicy->getCameraPrivacyState() ==
            SensorPrivacyManager::AUTOMOTIVE_DRIVER_ASSISTANCE_APPS)) {
        if (hasPermissionsForCameraPrivacyAllowlist(callingPid, callingUid)) {
        if (hasPermissionsForCameraPrivacyAllowlist(callingPid, callingUid)) {
            return false;
            return false;
        } else {
        } else {
@@ -4903,9 +4899,7 @@ binder::Status CameraService::SensorPrivacyPolicy::onSensorPrivacyStateChanged(
    // if sensor privacy is enabled then block all clients from accessing the camera
    // if sensor privacy is enabled then block all clients from accessing the camera
    if (state == SensorPrivacyManager::ENABLED) {
    if (state == SensorPrivacyManager::ENABLED) {
        service->blockAllClients();
        service->blockAllClients();
    } else if ((state == SensorPrivacyManager::AUTOMOTIVE_DRIVER_ASSISTANCE_APPS)
    } else if (state == SensorPrivacyManager::ENABLED_EXCEPT_ALLOWLISTED_APPS) {
            || (state == SensorPrivacyManager::AUTOMOTIVE_DRIVER_ASSISTANCE_HELPFUL_APPS)
            || (state == SensorPrivacyManager::AUTOMOTIVE_DRIVER_ASSISTANCE_REQUIRED_APPS)) {
        service->blockPrivacyEnabledClients();
        service->blockPrivacyEnabledClients();
    }
    }
    return binder::Status::ok();
    return binder::Status::ok();