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

Commit 26a95e3a authored by Austin Borger's avatar Austin Borger Committed by Android (Google) Code Review
Browse files

Merge "Remove watch_foreground_changes flag" into main

parents 323f7a8a 5755d9b6
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -25,13 +25,6 @@ flag {
    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 {
    namespace: "camera_platform"
    name: "camera_manual_flash_strength_control"
+6 −20
Original line number Diff line number Diff line
@@ -4340,14 +4340,9 @@ status_t CameraService::BasicClient::startCameraOps() {
        // Notify app ops that the camera is not available
        mOpsCallback = new OpsCallback(this);

        if (flags::watch_foreground_changes()) {
        mAppOpsManager->startWatchingMode(AppOpsManager::OP_CAMERA,
            toString16(mClientPackageName),
            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
        // camera frames start streaming in startCameraStreamingOps
@@ -4530,20 +4525,11 @@ void CameraService::BasicClient::opChanged(int32_t op, const String16&) {
        // (WAR for b/175320666)the AppOpsManager could return MODE_IGNORED. Do not treat such
        // cases as error.
        if (!mUidIsTrusted) {
            if (flags::watch_foreground_changes()) {
            if (isUidVisible && isCameraPrivacyEnabled && supportsCameraMute()) {
                setCameraMute(true);
            } else {
                block();
            }
            } else {
                if (isUidActive && isCameraPrivacyEnabled && supportsCameraMute()) {
                    setCameraMute(true);
                } else if (!isUidActive
                    || (isCameraPrivacyEnabled && !supportsCameraMute())) {
                    block();
                }
            }
        }
    } else if (res == AppOpsManager::MODE_ALLOWED) {
        setCameraMute(sCameraService->mOverrideCameraMuteMode);