# Print output for @column tags ?>
Developers

- Design
- Develop
- Distribute

Developer Console

## Most visited

## Recently visited

## Results for

Summary: Ctors | Methods | Inherited Methods

# CameraManager.AvailabilityCallback

`public static abstract class CameraManager.AvailabilityCallback`
`extends Object` ``

java.lang.Object
↳ | android.hardware.camera2.CameraManager.AvailabilityCallback

A callback for camera devices becoming available or unavailable to open.

Cameras become available when they are no longer in use, or when a new removable camera is connected. They become unavailable when some application or service starts using a camera, or when a removable camera is disconnected.

Extend this callback and pass an instance of the subclass to `CameraManager#registerAvailabilityCallback` to be notified of such availability changes.

See also:

- `CameraManager.registerAvailabilityCallback(CameraManager.AvailabilityCallback, Handler)`

## Summary

### Public constructors
`AvailabilityCallback()`

### Public methods
`void` | `onCameraAccessPrioritiesChanged()` Called whenever camera access priorities change.
`void` | `onCameraAvailable(String cameraId)` A new camera has become available to use.
`void` | `onCameraUnavailable(String cameraId)` A previously-available camera has become unavailable for use.
`void` | `onPhysicalCameraAvailable(String cameraId, String physicalCameraId)` A physical camera has become available for use again.
`void` | `onPhysicalCameraUnavailable(String cameraId, String physicalCameraId)` A previously-available physical camera has become unavailable for use.

### Inherited methods
From class `java.lang.Object`
`Object` | `clone()` Creates and returns a copy of this object.
`boolean` | `equals(Object obj)` Indicates whether some other object is "equal to" this one.
`void` | `finalize()` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
`final Class<?>` | `getClass()` Returns the runtime class of this `Object`.
`int` | `hashCode()` Returns a hash code value for the object.
`final void` | `notify()` Wakes up a single thread that is waiting on this object's monitor.
`final void` | `notifyAll()` Wakes up all threads that are waiting on this object's monitor.
`String` | `toString()` Returns a string representation of the object.
`final void` | `wait(long timeout, int nanos)` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
`final void` | `wait(long timeout)` Causes the current thread to wait until either another thread invokes the `notify()` method or the `notifyAll()` method for this object, or a specified amount of time has elapsed.
`final void` | `wait()` Causes the current thread to wait until another thread invokes the `notify()` method or the `notifyAll()` method for this object.

## Public constructors

### AvailabilityCallback

    public AvailabilityCallback ()

## Public methods

### onCameraAccessPrioritiesChanged

    public void onCameraAccessPrioritiesChanged ()

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.

### onCameraAvailable

    public void onCameraAvailable (String cameraId)

A new camera has become available to use.

The default implementation of this method does nothing.

Parameters
`cameraId` | `String`: The unique identifier of the new camera. This value cannot be `null`.

### onCameraUnavailable

    public void onCameraUnavailable (String cameraId)

A previously-available camera has become unavailable for use.

If an application had an active CameraDevice instance for the now-disconnected camera, that application will receive a `CameraDevice.StateCallback#onDisconnected`.

The default implementation of this method does nothing.

Parameters
`cameraId` | `String`: The unique identifier of the disconnected camera. This value cannot be `null`.

### onPhysicalCameraAvailable

    public void onPhysicalCameraAvailable (String cameraId,
                    String physicalCameraId)

A physical camera has become available for use again.

By default, all of the physical cameras of a logical multi-camera are available, so `onPhysicalCameraAvailable(String, String)` is not called for any of the physical cameras of a logical multi-camera, when `onCameraAvailable(String)` for the logical multi-camera is invoked. However, if some specific physical cameras are unavailable to begin with, `onPhysicalCameraUnavailable(String, String)` may be invoked after `onCameraAvailable(String)`.

The default implementation of this method does nothing.

Parameters
`cameraId` | `String`: The unique identifier of the logical multi-camera. This value cannot be `null`.
`physicalCameraId` | `String`: The unique identifier of the physical camera. This value cannot be `null`.

See also:

- `onCameraAvailable(String)`
- `onPhysicalCameraUnavailable(String, String)`

### onPhysicalCameraUnavailable

    public void onPhysicalCameraUnavailable (String cameraId,
                    String physicalCameraId)

A previously-available physical camera has become unavailable for use.

By default, all of the physical cameras of a logical multi-camera are available, so `onPhysicalCameraAvailable(String, String)` is not called for any of the physical cameras of a logical multi-camera, when `onCameraAvailable(String)` for the logical multi-camera is invoked. If some specific physical cameras are unavailable to begin with, `onPhysicalCameraUnavailable(String, String)` may be invoked after `onCameraAvailable(String)`.

The default implementation of this method does nothing.

Parameters
`cameraId` | `String`: The unique identifier of the logical multi-camera. This value cannot be `null`.
`physicalCameraId` | `String`: The unique identifier of the physical camera. This value cannot be `null`.

See also:

- `onCameraAvailable(String)`
- `onPhysicalCameraAvailable(String, String)`

Full name *
Email address *
Company / developer name
One of your Play Store app URLs *
Which best describes your business:*
Apps
Games
Apps & Games
*
*