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

Commit 54a4b009 authored by Jyoti Bhayana's avatar Jyoti Bhayana
Browse files

Modify the API for camera privacy allowlist

After AAOS IVI review, it was recommended to not categorize
the camera privacy allowlisted apps into helpful apps,required apps
and helpful and required apps. Therefore removing those categories and changing the name to be more descriptive.

Bug: 326182516
Test: Build and test using camera privacy settings UI on automotive devices.
Change-Id: I4b04415422d0c2f97f6f1939e9eaa26225691fe6
parent a8b7ec8e
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -2414,12 +2414,8 @@ bool CameraService::isCameraPrivacyEnabled(const String16& packageName, const st
        return true;
    } else if (mSensorPrivacyPolicy->getCameraPrivacyState() == SensorPrivacyManager::DISABLED) {
        return false;
    } else if ((mSensorPrivacyPolicy->getCameraPrivacyState()
            == SensorPrivacyManager::AUTOMOTIVE_DRIVER_ASSISTANCE_HELPFUL_APPS) ||
            (mSensorPrivacyPolicy->getCameraPrivacyState()
            == SensorPrivacyManager::AUTOMOTIVE_DRIVER_ASSISTANCE_REQUIRED_APPS) ||
            (mSensorPrivacyPolicy->getCameraPrivacyState() ==
            SensorPrivacyManager::AUTOMOTIVE_DRIVER_ASSISTANCE_APPS)) {
    } else if (mSensorPrivacyPolicy->getCameraPrivacyState()
            == SensorPrivacyManager::ENABLED_EXCEPT_ALLOWLISTED_APPS) {
        if (hasPermissionsForCameraPrivacyAllowlist(callingPid, callingUid)) {
            return false;
        } else {
@@ -4978,9 +4974,7 @@ binder::Status CameraService::SensorPrivacyPolicy::onSensorPrivacyStateChanged(
    // if sensor privacy is enabled then block all clients from accessing the camera
    if (state == SensorPrivacyManager::ENABLED) {
        service->blockAllClients();
    } else if ((state == SensorPrivacyManager::AUTOMOTIVE_DRIVER_ASSISTANCE_APPS)
            || (state == SensorPrivacyManager::AUTOMOTIVE_DRIVER_ASSISTANCE_HELPFUL_APPS)
            || (state == SensorPrivacyManager::AUTOMOTIVE_DRIVER_ASSISTANCE_REQUIRED_APPS)) {
    } else if (state == SensorPrivacyManager::ENABLED_EXCEPT_ALLOWLISTED_APPS) {
        service->blockPrivacyEnabledClients();
    }
    return binder::Status::ok();