Udostępnij za pośrednictwem


IWindowManager.PropertyCameraCompatAllowRefresh Field

Definition

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

[Android.Runtime.Register("PROPERTY_CAMERA_COMPAT_ALLOW_REFRESH", ApiSince=34)]
public const string PropertyCameraCompatAllowRefresh;
[<Android.Runtime.Register("PROPERTY_CAMERA_COMPAT_ALLOW_REFRESH", ApiSince=34)>]
val mutable PropertyCameraCompatAllowRefresh : 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 activity "refresh" after 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.

Force rotation is followed by the "Refresh" of the activity by going through "resumed -> ... -> stopped -> ... -> resumed" cycle (by default) or "resumed -> paused -> resumed" cycle (if overridden, see #PROPERTY_CAMERA_COMPAT_ENABLE_REFRESH_VIA_PAUSE for context). This allows to clear cached values in apps (e.g. display or camera rotation) that influence camera preview and can lead to sideways or stretching issues persisting even after force rotation.

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 "refresh" activity after the force rotation treatment. Device manufacturers can exclude packages from the "refresh" using their discretion to improve display compatibility.

With this property set to false, the system will not "refresh" activity after the force rotation treatment.

<b>Syntax:</b>

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

Java documentation for android.view.WindowManager.PROPERTY_CAMERA_COMPAT_ALLOW_REFRESH.

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