Share via


CameraManager.AvailabilityCallback.OnCameraAccessPrioritiesChanged Method

Definition

Called whenever camera access priorities change.

[Android.Runtime.Register("onCameraAccessPrioritiesChanged", "()V", "GetOnCameraAccessPrioritiesChangedHandler", ApiSince=29)]
public virtual void OnCameraAccessPrioritiesChanged ();
[<Android.Runtime.Register("onCameraAccessPrioritiesChanged", "()V", "GetOnCameraAccessPrioritiesChangedHandler", ApiSince=29)>]
abstract member OnCameraAccessPrioritiesChanged : unit -> unit
override this.OnCameraAccessPrioritiesChanged : unit -> unit
Attributes

Remarks

Called whenever camera access priorities change.

Notification that camera access priorities have changed and the camera may now be openable. An application that was previously denied camera access due to a higher-priority user already using the camera, or that was disconnected from an active camera session due to a higher-priority user trying to open the camera, should try to open the camera again if it still wants to use it. Note that multiple applications may receive this callback at the same time, and only one of them will succeed in opening the camera in practice, depending on exact access priority levels and timing. This method is useful in cases where multiple applications may be in the resumed state at the same time, and the user switches focus between them, or if the current camera-using application moves between full-screen and Picture-in-Picture (PiP) states. In such cases, the camera available/unavailable callbacks will not be invoked, but another application may now have higher priority for camera access than the current camera-using application.

The default implementation of this method does nothing.

Java documentation for android.hardware.camera2.CameraManager.AvailabilityCallback.onCameraAccessPrioritiesChanged().

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