Skip to content

Commit 487acdf

Browse files
author
Eino-Ville Talvala
committed
Camera: Improve enableShutterSound documentation.
Bug: 7216272 Change-Id: I1b9add715c7d3671472b9f98d9b1d80823109365
1 parent 8658e1a commit 487acdf

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

core/java/android/hardware/Camera.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,25 +1161,28 @@ public final void takePicture(ShutterCallback shutter, PictureCallback raw,
11611161
public native final void setDisplayOrientation(int degrees);
11621162

11631163
/**
1164-
* Enable or disable the default shutter sound when taking a picture.
1164+
* <p>Enable or disable the default shutter sound when taking a picture.</p>
11651165
*
1166-
* By default, the camera plays the system-defined camera shutter sound when
1167-
* {@link #takePicture} is called. Using this method, the shutter sound can
1168-
* be disabled. It is strongly recommended that an alternative shutter sound
1169-
* is played in the {@link ShutterCallback} when the system shutter sound is
1170-
* disabled.
1166+
* <p>By default, the camera plays the system-defined camera shutter sound
1167+
* when {@link #takePicture} is called. Using this method, the shutter sound
1168+
* can be disabled. It is strongly recommended that an alternative shutter
1169+
* sound is played in the {@link ShutterCallback} when the system shutter
1170+
* sound is disabled.</p>
11711171
*
1172-
* Note that devices may not always allow control of the camera shutter
1173-
* sound. If the shutter sound cannot be controlled, this method will return
1174-
* false.
1172+
* <p>Note that devices may not always allow disabling the camera shutter
1173+
* sound. If the shutter sound state cannot be set to the desired value,
1174+
* this method will return false. {@link CameraInfo#canDisableShutterSound}
1175+
* can be used to determine whether the device will allow the shutter sound
1176+
* to be disabled.</p>
11751177
*
11761178
* @param enabled whether the camera should play the system shutter sound
11771179
* when {@link #takePicture takePicture} is called.
1178-
* @return true if the shutter sound state was successfully changed. False
1179-
* if the shutter sound cannot be controlled; in this case, the
1180-
* application should not play its own shutter sound since the
1181-
* system shutter sound will play when a picture is taken.
1180+
* @return {@code true} if the shutter sound state was successfully
1181+
* changed. {@code false} if the shutter sound state could not be
1182+
* changed. {@code true} is also returned if shutter sound playback
1183+
* is already set to the requested state.
11821184
* @see #takePicture
1185+
* @see CameraInfo#canDisableShutterSound
11831186
* @see ShutterCallback
11841187
*/
11851188
public native final boolean enableShutterSound(boolean enabled);

0 commit comments

Comments
 (0)