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

Commit 5755d9b6 authored by Austin Borger's avatar Austin Borger
Browse files

Remove watch_foreground_changes flag

Flag: EXEMPT flag removal
Test: Build
Bug: 365555693
Change-Id: I1a13efd94487401f7c55a9013441c1a27f3ae3e4
parent 448ec225
Loading
Loading
Loading
Loading
+0 −7
Original line number Original line Diff line number Diff line
@@ -25,13 +25,6 @@ flag {
    bug: "309627704"
    bug: "309627704"
}
}


flag {
    namespace: "camera_platform"
    name: "watch_foreground_changes"
    description: "Request AppOps to notify changes in the foreground status of the client"
    bug: "290086710"
}

flag {
flag {
    namespace: "camera_platform"
    namespace: "camera_platform"
    name: "camera_manual_flash_strength_control"
    name: "camera_manual_flash_strength_control"
+6 −20
Original line number Original line Diff line number Diff line
@@ -4348,14 +4348,9 @@ status_t CameraService::BasicClient::startCameraOps() {
        // Notify app ops that the camera is not available
        // Notify app ops that the camera is not available
        mOpsCallback = new OpsCallback(this);
        mOpsCallback = new OpsCallback(this);


        if (flags::watch_foreground_changes()) {
        mAppOpsManager->startWatchingMode(AppOpsManager::OP_CAMERA,
        mAppOpsManager->startWatchingMode(AppOpsManager::OP_CAMERA,
            toString16(mClientPackageName),
            toString16(mClientPackageName),
            AppOpsManager::WATCH_FOREGROUND_CHANGES, mOpsCallback);
            AppOpsManager::WATCH_FOREGROUND_CHANGES, mOpsCallback);
        } else {
            mAppOpsManager->startWatchingMode(AppOpsManager::OP_CAMERA,
                toString16(mClientPackageName), mOpsCallback);
        }


        // Just check for camera acccess here on open - delay startOp until
        // Just check for camera acccess here on open - delay startOp until
        // camera frames start streaming in startCameraStreamingOps
        // camera frames start streaming in startCameraStreamingOps
@@ -4538,20 +4533,11 @@ void CameraService::BasicClient::opChanged(int32_t op, const String16&) {
        // (WAR for b/175320666)the AppOpsManager could return MODE_IGNORED. Do not treat such
        // (WAR for b/175320666)the AppOpsManager could return MODE_IGNORED. Do not treat such
        // cases as error.
        // cases as error.
        if (!mUidIsTrusted) {
        if (!mUidIsTrusted) {
            if (flags::watch_foreground_changes()) {
            if (isUidVisible && isCameraPrivacyEnabled && supportsCameraMute()) {
            if (isUidVisible && isCameraPrivacyEnabled && supportsCameraMute()) {
                setCameraMute(true);
                setCameraMute(true);
            } else {
            } else {
                block();
                block();
            }
            }
            } else {
                if (isUidActive && isCameraPrivacyEnabled && supportsCameraMute()) {
                    setCameraMute(true);
                } else if (!isUidActive
                    || (isCameraPrivacyEnabled && !supportsCameraMute())) {
                    block();
                }
            }
        }
        }
    } else if (res == AppOpsManager::MODE_ALLOWED) {
    } else if (res == AppOpsManager::MODE_ALLOWED) {
        setCameraMute(sCameraService->mOverrideCameraMuteMode);
        setCameraMute(sCameraService->mOverrideCameraMuteMode);