@@ -233,48 +233,6 @@ public static class CameraInfo {
233233 public int orientation ;
234234 };
235235
236- /**
237- * Creates a new Camera object to access a particular hardware camera.
238- *
239- * <p>When <code>force</code> is set to false, this will throw an exception
240- * if the same camera is already opened by other clients. If true, the other
241- * client will be disconnected from the camera they opened. If the device
242- * can only support one camera running at a time, all camera-using clients
243- * will be disconnected from their cameras.
244- *
245- * <p>A camera being held by an application can be taken away by other
246- * applications at any time. Before the camera is taken, applications will
247- * get {@link #CAMERA_ERROR_RELEASED} and have some time to clean up. Apps
248- * receiving this callback must immediately stop video recording and then
249- * call {@link #release()} on their camera object. Otherwise, it will be
250- * released by the frameworks in a short time. After receiving
251- * CAMERA_ERROR_RELEASED, apps should not call any method except <code>
252- * release</code> and {@link #isReleased()}. After a camera is taken away,
253- * all methods will throw exceptions except <code>isReleased</code> and
254- * <code>release</code>. Apps can use <code>isReleased</code> to see if the
255- * camera has been taken away. If the camera is taken away, the apps can
256- * silently finish themselves or show a dialog.
257- *
258- * <p>Applications with android.permission.KEEP_CAMERA can request to keep
259- * the camera. That is, the camera will not be taken by other applications
260- * while it is opened. The permission can only be obtained by trusted
261- * platform applications, such as those implementing lock screen security
262- * features.
263- *
264- * @param cameraId the hardware camera to access, between 0 and
265- * {@link #getNumberOfCameras()}-1.
266- * @param force true to take the ownership from the existing client if the
267- * camera has been opened by other clients.
268- * @param keep true if the applications do not want other apps to take the
269- * camera. Only the apps with android.permission.KEEP_CAMERA can keep
270- * the camera.
271- * @return a new Camera object, connected, locked and ready for use.
272- * @hide
273- */
274- public static Camera open (int cameraId , boolean force , boolean keep ) {
275- return new Camera (cameraId , force , keep );
276- }
277-
278236 /**
279237 * Creates a new Camera object to access a particular hardware camera. If
280238 * the same camera is opened by other applications, this will throw a
@@ -305,7 +263,7 @@ public static Camera open(int cameraId, boolean force, boolean keep) {
305263 * @see android.app.admin.DevicePolicyManager#getCameraDisabled(android.content.ComponentName)
306264 */
307265 public static Camera open (int cameraId ) {
308- return new Camera (cameraId , false , false );
266+ return new Camera (cameraId );
309267 }
310268
311269 /**
@@ -320,13 +278,13 @@ public static Camera open() {
320278 for (int i = 0 ; i < numberOfCameras ; i ++) {
321279 getCameraInfo (i , cameraInfo );
322280 if (cameraInfo .facing == CameraInfo .CAMERA_FACING_BACK ) {
323- return new Camera (i , false , false );
281+ return new Camera (i );
324282 }
325283 }
326284 return null ;
327285 }
328286
329- Camera (int cameraId , boolean force , boolean keep ) {
287+ Camera (int cameraId ) {
330288 mShutterCallback = null ;
331289 mRawImageCallback = null ;
332290 mJpegCallback = null ;
@@ -343,7 +301,7 @@ public static Camera open() {
343301 mEventHandler = null ;
344302 }
345303
346- native_setup (new WeakReference <Camera >(this ), cameraId , force , keep );
304+ native_setup (new WeakReference <Camera >(this ), cameraId );
347305 }
348306
349307 /**
@@ -356,8 +314,7 @@ protected void finalize() {
356314 release ();
357315 }
358316
359- private native final void native_setup (Object camera_this , int cameraId ,
360- boolean force , boolean keep );
317+ private native final void native_setup (Object camera_this , int cameraId );
361318 private native final void native_release ();
362319
363320
@@ -371,18 +328,6 @@ public final void release() {
371328 mFaceDetectionRunning = false ;
372329 }
373330
374- /**
375- * Whether the camera is released. When any camera method throws an
376- * exception, applications can use this to check whether the camera has been
377- * taken by other clients. If true, it means other clients have taken the
378- * camera. The applications can silently finish themselves or show a dialog.
379- *
380- * @return whether the camera is released.
381- * @see #open(int, boolean, boolean)
382- * @hide
383- */
384- public native final boolean isReleased ();
385-
386331 /**
387332 * Unlocks the camera to allow another process to access it.
388333 * Normally, the camera is locked to the process with an active Camera
@@ -1376,17 +1321,6 @@ public Face() {
13761321 */
13771322 public static final int CAMERA_ERROR_UNKNOWN = 1 ;
13781323
1379- /**
1380- * Camera was released because another client has opened the camera. The
1381- * application should call {@link #release()} after getting this. The apps
1382- * should not call any method except <code>release</code> and {@link #isReleased()}
1383- * after this.
1384- *
1385- * @see Camera.ErrorCallback
1386- * @hide
1387- */
1388- public static final int CAMERA_ERROR_RELEASED = 2 ;
1389-
13901324 /**
13911325 * Media server died. In this case, the application must release the
13921326 * Camera object and instantiate a new one.
0 commit comments