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

Commit e3af299f authored by Kwangkyu Park's avatar Kwangkyu Park
Browse files

Fix an issue that the sensor privacy does not apply to the new camera clients

The sensor privacy (Sensors Off tile) does not apply to the new camera
clients because the 'SensorPrivacyPolicy' in the 'CameraService' mixes
API usage for the camera privacy and the sensor privacy which are
'isToggleSensorPrivacyEnabled' and 'isSensorPrivacyEnabled'
respectively.

This patch will use the 'enabled' value to fix the issue.

Bug: 257426686
Test: manual test with 'Sensors Off' tile is enabled.
Change-Id: I23bc621afe7895863665c84518ed0cafe9356bf9
parent 80cd30ae
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -3952,7 +3952,7 @@ binder::Status CameraService::SensorPrivacyPolicy::onSensorPrivacyChanged(
    int toggleType __unused, int sensor __unused, bool enabled) {
    int toggleType __unused, int sensor __unused, bool enabled) {
    {
    {
        Mutex::Autolock _l(mSensorPrivacyLock);
        Mutex::Autolock _l(mSensorPrivacyLock);
        mSensorPrivacyEnabled = mSpm.isToggleSensorPrivacyEnabled(SensorPrivacyManager::TOGGLE_SENSOR_CAMERA);
        mSensorPrivacyEnabled = enabled;
    }
    }
    // 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 (enabled) {
    if (enabled) {