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 void 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/camera2/CameraDevice.java +60 −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,35 @@ 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. * * @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 void 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 +6 −0 Original line number Diff line number Diff line Loading @@ -2568,4 +2568,10 @@ public class CameraDeviceImpl extends CameraDevice Binder.restoreCallingIdentity(ident); } } @Override public void setCameraAudioRestriction(@CAMERA_AUDIO_RESTRICTION int mode) { // To be implemented. return; } } core/java/com/android/internal/app/IAppOpsService.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ interface IAppOpsService { void noteAsyncOp(String callingPackageName, int uid, String packageName, int opCode, String message); boolean shouldCollectNotes(int opCode); void setCameraAudioRestriction(int mode); // End of methods also called by native code. // Any new method exposed to native must be added after the last one, do not reorder Loading data/etc/platform.xml +1 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,7 @@ <assign-permission name="android.permission.GET_PROCESS_STATE_AND_OOM_SCORE" uid="cameraserver" /> <assign-permission name="android.permission.PACKAGE_USAGE_STATS" uid="cameraserver" /> <assign-permission name="android.permission.WATCH_APPOPS" uid="cameraserver" /> <assign-permission name="android.permission.MANAGE_APP_OPS_MODES" uid="cameraserver" /> <assign-permission name="android.permission.ACCESS_SURFACE_FLINGER" uid="graphics" /> Loading 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 void 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/camera2/CameraDevice.java +60 −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,35 @@ 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. * * @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 void 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 +6 −0 Original line number Diff line number Diff line Loading @@ -2568,4 +2568,10 @@ public class CameraDeviceImpl extends CameraDevice Binder.restoreCallingIdentity(ident); } } @Override public void setCameraAudioRestriction(@CAMERA_AUDIO_RESTRICTION int mode) { // To be implemented. return; } }
core/java/com/android/internal/app/IAppOpsService.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -44,6 +44,7 @@ interface IAppOpsService { void noteAsyncOp(String callingPackageName, int uid, String packageName, int opCode, String message); boolean shouldCollectNotes(int opCode); void setCameraAudioRestriction(int mode); // End of methods also called by native code. // Any new method exposed to native must be added after the last one, do not reorder Loading
data/etc/platform.xml +1 −0 Original line number Diff line number Diff line Loading @@ -166,6 +166,7 @@ <assign-permission name="android.permission.GET_PROCESS_STATE_AND_OOM_SCORE" uid="cameraserver" /> <assign-permission name="android.permission.PACKAGE_USAGE_STATS" uid="cameraserver" /> <assign-permission name="android.permission.WATCH_APPOPS" uid="cameraserver" /> <assign-permission name="android.permission.MANAGE_APP_OPS_MODES" uid="cameraserver" /> <assign-permission name="android.permission.ACCESS_SURFACE_FLINGER" uid="graphics" /> Loading