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

Commit b4e99810 authored by Mina Granic's avatar Mina Granic Committed by Android Build Coastguard Worker
Browse files

Do not access DesktopModeFlags for camera in isolated process.

Flag: EXEMPT simple test fix
Fixes: 405104778
Test: atest VisualQueryDetectionServiceBasicTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:9a17b97dba7ac0ac37e87461de2e93e92d26f2ed)
Simple fix for b/405104778.
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b643e1f8bacb6c7e22152983f2d034624e705230)
Merged-In: I2a55b593486387838539d6a018cfa82dda5981a9
Change-Id: I2a55b593486387838539d6a018cfa82dda5981a9
parent 2c16eb43
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1686,7 +1686,10 @@ public final class CameraManager {
     */
    public static int getRotationOverride(@Nullable Context context,
            @Nullable PackageManager packageManager, @Nullable String packageName) {
        if (DesktopModeFlags.ENABLE_CAMERA_COMPAT_SIMULATE_REQUESTED_ORIENTATION.isTrue()) {
        // Isolated process does not have access to the ContentProvider which
        // `DesktopModeFlags` uses. `DesktopModeFlags` combines developer options and Aconfig flags.
        if (!Process.isIsolated() && DesktopModeFlags
                .ENABLE_CAMERA_COMPAT_SIMULATE_REQUESTED_ORIENTATION.isTrue()) {
            return getRotationOverrideInternal(context, packageManager, packageName);
        } else {
            return shouldOverrideToPortrait(packageManager, packageName)