Share via


WindowManager.PropertyCameraCompatAllowForceRotation Field

Definition

Caution

Use 'Android.Views.IWindowManager.PropertyCameraCompatAllowForceRotation'. This class will be removed in a future release.

Application level android.content.pm.PackageManager.Property PackageManager .Property for an app to inform the system that the app should be excluded from the camera compatibility force rotation treatment.

[Android.Runtime.Register("PROPERTY_CAMERA_COMPAT_ALLOW_FORCE_ROTATION", ApiSince=34)]
[System.Obsolete("Use 'Android.Views.IWindowManager.PropertyCameraCompatAllowForceRotation'. This class will be removed in a future release.")]
public const string PropertyCameraCompatAllowForceRotation;
[<Android.Runtime.Register("PROPERTY_CAMERA_COMPAT_ALLOW_FORCE_ROTATION", ApiSince=34)>]
[<System.Obsolete("Use 'Android.Views.IWindowManager.PropertyCameraCompatAllowForceRotation'. This class will be removed in a future release.")>]
val mutable PropertyCameraCompatAllowForceRotation : string

Field Value

Attributes

Remarks

Application level android.content.pm.PackageManager.Property PackageManager .Property for an app to inform the system that the app should be excluded from the camera compatibility force rotation treatment.

The camera compatibility treatment aligns orientations of portrait app window and natural orientation of the device and set opposite to natural orientation for a landscape app window. Mismatch between them can lead to camera issues like sideways or stretched viewfinder since this is one of the strongest assumptions that apps make when they implement camera previews. Since app and natural display orientations aren't guaranteed to match, the rotation can cause letterboxing. The forced rotation is triggered as soon as app opens to camera and is removed once camera is closed.

The camera compatibility can be enabled by device manufacturers on the displays that have ignoreOrientationRequest display setting enabled (enables compatibility mode for fixed orientation, see Enhanced letterboxing for more details).

With this property set to true or unset, the system may apply the force rotation treatment to fixed orientation activities. Device manufacturers can exclude packages from the treatment using their discretion to improve display compatibility.

With this property set to false, the system will not apply the force rotation treatment.

<b>Syntax:</b>

&lt;application&gt;
              &lt;property
                android:name="android.window.PROPERTY_CAMERA_COMPAT_ALLOW_FORCE_ROTATION"
                android:value="true|false"/&gt;
            &lt;/application&gt;

Java documentation for android.view.WindowManager.PROPERTY_CAMERA_COMPAT_ALLOW_FORCE_ROTATION.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to