diff options
author | Wu-cheng Li <wuchengli@google.com> | 2012-04-19 12:23:31 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2012-04-19 14:18:44 +0800 |
commit | 7bc1b21a5217c3737ae82edd3ff2d901c69a51ad (patch) | |
tree | 3469a121fed4dd4b0c023b5ed88c410ebd45b890 /core/java/android/hardware/Camera.java | |
parent | 83cb5807b0eaa36b417ce5c978e4e460b1fcc9e2 (diff) | |
download | frameworks_base-7bc1b21a5217c3737ae82edd3ff2d901c69a51ad.zip frameworks_base-7bc1b21a5217c3737ae82edd3ff2d901c69a51ad.tar.gz frameworks_base-7bc1b21a5217c3737ae82edd3ff2d901c69a51ad.tar.bz2 |
Remove new camera open API.
Applications are not resumed under the lock screen now.
This API is not needed anymore.
bug:5584464
Change-Id: I1c18efb5ba1ecd39320eb5fd252c6e1229d7b89c
Diffstat (limited to 'core/java/android/hardware/Camera.java')
-rw-r--r-- | core/java/android/hardware/Camera.java | 76 |
1 files changed, 5 insertions, 71 deletions
diff --git a/core/java/android/hardware/Camera.java b/core/java/android/hardware/Camera.java index 640b47b..4fb710e 100644 --- a/core/java/android/hardware/Camera.java +++ b/core/java/android/hardware/Camera.java @@ -234,48 +234,6 @@ public class Camera { }; /** - * Creates a new Camera object to access a particular hardware camera. - * - * <p>When <code>force</code> is set to false, this will throw an exception - * if the same camera is already opened by other clients. If true, the other - * client will be disconnected from the camera they opened. If the device - * can only support one camera running at a time, all camera-using clients - * will be disconnected from their cameras. - * - * <p>A camera being held by an application can be taken away by other - * applications at any time. Before the camera is taken, applications will - * get {@link #CAMERA_ERROR_RELEASED} and have some time to clean up. Apps - * receiving this callback must immediately stop video recording and then - * call {@link #release()} on their camera object. Otherwise, it will be - * released by the frameworks in a short time. After receiving - * CAMERA_ERROR_RELEASED, apps should not call any method except <code> - * release</code> and {@link #isReleased()}. After a camera is taken away, - * all methods will throw exceptions except <code>isReleased</code> and - * <code>release</code>. Apps can use <code>isReleased</code> to see if the - * camera has been taken away. If the camera is taken away, the apps can - * silently finish themselves or show a dialog. - * - * <p>Applications with android.permission.KEEP_CAMERA can request to keep - * the camera. That is, the camera will not be taken by other applications - * while it is opened. The permission can only be obtained by trusted - * platform applications, such as those implementing lock screen security - * features. - * - * @param cameraId the hardware camera to access, between 0 and - * {@link #getNumberOfCameras()}-1. - * @param force true to take the ownership from the existing client if the - * camera has been opened by other clients. - * @param keep true if the applications do not want other apps to take the - * camera. Only the apps with android.permission.KEEP_CAMERA can keep - * the camera. - * @return a new Camera object, connected, locked and ready for use. - * @hide - */ - public static Camera open(int cameraId, boolean force, boolean keep) { - return new Camera(cameraId, force, keep); - } - - /** * Creates a new Camera object to access a particular hardware camera. If * the same camera is opened by other applications, this will throw a * RuntimeException. @@ -305,7 +263,7 @@ public class Camera { * @see android.app.admin.DevicePolicyManager#getCameraDisabled(android.content.ComponentName) */ public static Camera open(int cameraId) { - return new Camera(cameraId, false, false); + return new Camera(cameraId); } /** @@ -320,13 +278,13 @@ public class Camera { for (int i = 0; i < numberOfCameras; i++) { getCameraInfo(i, cameraInfo); if (cameraInfo.facing == CameraInfo.CAMERA_FACING_BACK) { - return new Camera(i, false, false); + return new Camera(i); } } return null; } - Camera(int cameraId, boolean force, boolean keep) { + Camera(int cameraId) { mShutterCallback = null; mRawImageCallback = null; mJpegCallback = null; @@ -343,7 +301,7 @@ public class Camera { mEventHandler = null; } - native_setup(new WeakReference<Camera>(this), cameraId, force, keep); + native_setup(new WeakReference<Camera>(this), cameraId); } /** @@ -356,8 +314,7 @@ public class Camera { release(); } - private native final void native_setup(Object camera_this, int cameraId, - boolean force, boolean keep); + private native final void native_setup(Object camera_this, int cameraId); private native final void native_release(); @@ -372,18 +329,6 @@ public class Camera { } /** - * Whether the camera is released. When any camera method throws an - * exception, applications can use this to check whether the camera has been - * taken by other clients. If true, it means other clients have taken the - * camera. The applications can silently finish themselves or show a dialog. - * - * @return whether the camera is released. - * @see #open(int, boolean, boolean) - * @hide - */ - public native final boolean isReleased(); - - /** * Unlocks the camera to allow another process to access it. * Normally, the camera is locked to the process with an active Camera * object until {@link #release()} is called. To allow rapid handoff @@ -1377,17 +1322,6 @@ public class Camera { public static final int CAMERA_ERROR_UNKNOWN = 1; /** - * Camera was released because another client has opened the camera. The - * application should call {@link #release()} after getting this. The apps - * should not call any method except <code>release</code> and {@link #isReleased()} - * after this. - * - * @see Camera.ErrorCallback - * @hide - */ - public static final int CAMERA_ERROR_RELEASED = 2; - - /** * Media server died. In this case, the application must release the * Camera object and instantiate a new one. * @see Camera.ErrorCallback |