Loading api/current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -16904,6 +16904,10 @@ package android.hardware.camera2 { method public abstract void createReprocessableCaptureSessionByConfigurations(@NonNull android.hardware.camera2.params.InputConfiguration, @NonNull java.util.List<android.hardware.camera2.params.OutputConfiguration>, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException; method @NonNull public abstract String getId(); method public boolean isSessionConfigurationSupported(@NonNull android.hardware.camera2.params.SessionConfiguration) throws android.hardware.camera2.CameraAccessException; method public int setCameraAudioRestriction(int) throws android.hardware.camera2.CameraAccessException; field public static final int AUDIO_RESTRICTION_NONE = 0; // 0x0 field public static final int AUDIO_RESTRICTION_VIBRATION = 1; // 0x1 field public static final int AUDIO_RESTRICTION_VIBRATION_SOUND = 3; // 0x3 field public static final int TEMPLATE_MANUAL = 6; // 0x6 field public static final int TEMPLATE_PREVIEW = 1; // 0x1 field public static final int TEMPLATE_RECORD = 3; // 0x3 core/java/android/hardware/Camera.java +7 −0 Original line number Diff line number Diff line Loading @@ -2168,6 +2168,13 @@ public class Camera { return p; } /** * Setting camera audio restriction mode. * * @hide */ public native final int setAudioRestriction(int mode); /** * Image size (width and height dimensions). * @deprecated We recommend using the new {@link android.hardware.camera2} API for new Loading core/java/android/hardware/camera2/CameraDevice.java +62 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,37 @@ public abstract class CameraDevice implements AutoCloseable { TEMPLATE_MANUAL}) public @interface RequestTemplate {}; /** * No vibration or sound muting for this camera device. This is the default * mode for all camera devices. * * @see #setCameraAudioRestriction */ public static final int AUDIO_RESTRICTION_NONE = 0; /** * Mute vibration from ringtones, alarms or notifications while this camera device is in use. * * @see #setCameraAudioRestriction */ public static final int AUDIO_RESTRICTION_VIBRATION = 1; /** * Mute vibration and sound from ringtones, alarms or notifications while this camera device is * in use. * * @see #setCameraAudioRestriction */ public static final int AUDIO_RESTRICTION_VIBRATION_SOUND = 3; /** @hide */ @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = {"AUDIO_RESTRICTION_"}, value = {AUDIO_RESTRICTION_NONE, AUDIO_RESTRICTION_VIBRATION, AUDIO_RESTRICTION_VIBRATION_SOUND}) public @interface CAMERA_AUDIO_RESTRICTION {}; /** * Get the ID of this camera device. * Loading Loading @@ -1207,6 +1238,37 @@ public abstract class CameraDevice implements AutoCloseable { @ErrorCode int error); // Must implement } /** * Set audio restriction mode when this CameraDevice is being used. * * <p>Some camera hardware (e.g. devices with optical image stabilization support) * are sensitive to device vibration and video recordings can be ruined by unexpected sounds. * Applications can use this method to suppress vibration or sounds coming from * ringtones, alarms or notifications. * Other vibration or sounds (e.g. media playback or accessibility) will not be muted.</p> * * <p>The mute mode is a system-wide setting. When multiple CameraDevice objects * are setting different modes, the system will pick a the mode that's union of * all modes set by CameraDevice.</p> * * <p>The mute settings will be automatically removed when the CameraDevice is closed or * the application is disconnected from the camera.</p> * * @param mode An enumeration selecting the audio restriction mode for this camera device. * * @return The system-wide mute mode setting resulting from this call * * @throws IllegalArgumentException if the mode is not supported * * @throws CameraAccessException if the camera device is no longer connected or has * encountered a fatal error * @throws IllegalStateException if the camera device has been closed */ public @CAMERA_AUDIO_RESTRICTION int setCameraAudioRestriction( @CAMERA_AUDIO_RESTRICTION int mode) throws CameraAccessException { throw new UnsupportedOperationException("Subclasses must override this method"); } /** * To be inherited by android.hardware.camera2.* code only. * @hide Loading core/java/android/hardware/camera2/impl/CameraDeviceImpl.java +9 −0 Original line number Diff line number Diff line Loading @@ -2568,4 +2568,13 @@ public class CameraDeviceImpl extends CameraDevice Binder.restoreCallingIdentity(ident); } } @Override public @CAMERA_AUDIO_RESTRICTION int setCameraAudioRestriction( @CAMERA_AUDIO_RESTRICTION int mode) throws CameraAccessException { synchronized(mInterfaceLock) { checkIfCameraClosedOrInError(); return mRemoteDevice.setCameraAudioRestriction(mode); } } } core/java/android/hardware/camera2/impl/ICameraDeviceUserWrapper.java +9 −0 Original line number Diff line number Diff line Loading @@ -258,4 +258,13 @@ public class ICameraDeviceUserWrapper { } } public int setCameraAudioRestriction(int mode) throws CameraAccessException { try { return mRemoteDevice.setCameraAudioRestriction(mode); } catch (Throwable t) { CameraManager.throwAsPublicException(t); throw new UnsupportedOperationException("Unexpected exception", t); } } } Loading
api/current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -16904,6 +16904,10 @@ package android.hardware.camera2 { method public abstract void createReprocessableCaptureSessionByConfigurations(@NonNull android.hardware.camera2.params.InputConfiguration, @NonNull java.util.List<android.hardware.camera2.params.OutputConfiguration>, @NonNull android.hardware.camera2.CameraCaptureSession.StateCallback, @Nullable android.os.Handler) throws android.hardware.camera2.CameraAccessException; method @NonNull public abstract String getId(); method public boolean isSessionConfigurationSupported(@NonNull android.hardware.camera2.params.SessionConfiguration) throws android.hardware.camera2.CameraAccessException; method public int setCameraAudioRestriction(int) throws android.hardware.camera2.CameraAccessException; field public static final int AUDIO_RESTRICTION_NONE = 0; // 0x0 field public static final int AUDIO_RESTRICTION_VIBRATION = 1; // 0x1 field public static final int AUDIO_RESTRICTION_VIBRATION_SOUND = 3; // 0x3 field public static final int TEMPLATE_MANUAL = 6; // 0x6 field public static final int TEMPLATE_PREVIEW = 1; // 0x1 field public static final int TEMPLATE_RECORD = 3; // 0x3
core/java/android/hardware/Camera.java +7 −0 Original line number Diff line number Diff line Loading @@ -2168,6 +2168,13 @@ public class Camera { return p; } /** * Setting camera audio restriction mode. * * @hide */ public native final int setAudioRestriction(int mode); /** * Image size (width and height dimensions). * @deprecated We recommend using the new {@link android.hardware.camera2} API for new Loading
core/java/android/hardware/camera2/CameraDevice.java +62 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,37 @@ public abstract class CameraDevice implements AutoCloseable { TEMPLATE_MANUAL}) public @interface RequestTemplate {}; /** * No vibration or sound muting for this camera device. This is the default * mode for all camera devices. * * @see #setCameraAudioRestriction */ public static final int AUDIO_RESTRICTION_NONE = 0; /** * Mute vibration from ringtones, alarms or notifications while this camera device is in use. * * @see #setCameraAudioRestriction */ public static final int AUDIO_RESTRICTION_VIBRATION = 1; /** * Mute vibration and sound from ringtones, alarms or notifications while this camera device is * in use. * * @see #setCameraAudioRestriction */ public static final int AUDIO_RESTRICTION_VIBRATION_SOUND = 3; /** @hide */ @Retention(RetentionPolicy.SOURCE) @IntDef(prefix = {"AUDIO_RESTRICTION_"}, value = {AUDIO_RESTRICTION_NONE, AUDIO_RESTRICTION_VIBRATION, AUDIO_RESTRICTION_VIBRATION_SOUND}) public @interface CAMERA_AUDIO_RESTRICTION {}; /** * Get the ID of this camera device. * Loading Loading @@ -1207,6 +1238,37 @@ public abstract class CameraDevice implements AutoCloseable { @ErrorCode int error); // Must implement } /** * Set audio restriction mode when this CameraDevice is being used. * * <p>Some camera hardware (e.g. devices with optical image stabilization support) * are sensitive to device vibration and video recordings can be ruined by unexpected sounds. * Applications can use this method to suppress vibration or sounds coming from * ringtones, alarms or notifications. * Other vibration or sounds (e.g. media playback or accessibility) will not be muted.</p> * * <p>The mute mode is a system-wide setting. When multiple CameraDevice objects * are setting different modes, the system will pick a the mode that's union of * all modes set by CameraDevice.</p> * * <p>The mute settings will be automatically removed when the CameraDevice is closed or * the application is disconnected from the camera.</p> * * @param mode An enumeration selecting the audio restriction mode for this camera device. * * @return The system-wide mute mode setting resulting from this call * * @throws IllegalArgumentException if the mode is not supported * * @throws CameraAccessException if the camera device is no longer connected or has * encountered a fatal error * @throws IllegalStateException if the camera device has been closed */ public @CAMERA_AUDIO_RESTRICTION int setCameraAudioRestriction( @CAMERA_AUDIO_RESTRICTION int mode) throws CameraAccessException { throw new UnsupportedOperationException("Subclasses must override this method"); } /** * To be inherited by android.hardware.camera2.* code only. * @hide Loading
core/java/android/hardware/camera2/impl/CameraDeviceImpl.java +9 −0 Original line number Diff line number Diff line Loading @@ -2568,4 +2568,13 @@ public class CameraDeviceImpl extends CameraDevice Binder.restoreCallingIdentity(ident); } } @Override public @CAMERA_AUDIO_RESTRICTION int setCameraAudioRestriction( @CAMERA_AUDIO_RESTRICTION int mode) throws CameraAccessException { synchronized(mInterfaceLock) { checkIfCameraClosedOrInError(); return mRemoteDevice.setCameraAudioRestriction(mode); } } }
core/java/android/hardware/camera2/impl/ICameraDeviceUserWrapper.java +9 −0 Original line number Diff line number Diff line Loading @@ -258,4 +258,13 @@ public class ICameraDeviceUserWrapper { } } public int setCameraAudioRestriction(int mode) throws CameraAccessException { try { return mRemoteDevice.setCameraAudioRestriction(mode); } catch (Throwable t) { CameraManager.throwAsPublicException(t); throw new UnsupportedOperationException("Unexpected exception", t); } } }