CameraDevice.java revision b67a3b36fd569e63c1b8ca6b2701c34c7a3927c1
1/* 2 * Copyright (C) 2013 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package android.hardware.camera2; 18 19import android.hardware.camera2.params.StreamConfigurationMap; 20import android.graphics.ImageFormat; 21import android.os.Handler; 22import android.view.Surface; 23 24import java.util.List; 25 26/** 27 * <p>The CameraDevice class is a representation of a single camera connected to an 28 * Android device, allowing for fine-grain control of image capture and 29 * post-processing at high frame rates.</p> 30 * 31 * <p>Your application must declare the 32 * {@link android.Manifest.permission#CAMERA Camera} permission in its manifest 33 * in order to access camera devices.</p> 34 * 35 * <p>A given camera device may provide support at one of two levels: limited or 36 * full. If a device only supports the limited level, then Camera2 exposes a 37 * feature set that is roughly equivalent to the older 38 * {@link android.hardware.Camera Camera} API, although with a cleaner and more 39 * efficient interface. Devices that implement the full level of support 40 * provide substantially improved capabilities over the older camera 41 * API. Applications that target the limited level devices will run unchanged on 42 * the full-level devices; if your application requires a full-level device for 43 * proper operation, declare the "android.hardware.camera2.full" feature in your 44 * manifest.</p> 45 * 46 * @see CameraManager#openCamera 47 * @see android.Manifest.permission#CAMERA 48 */ 49public abstract class CameraDevice implements AutoCloseable { 50 51 /** 52 * Create a request suitable for a camera preview window. Specifically, this 53 * means that high frame rate is given priority over the highest-quality 54 * post-processing. These requests would normally be used with the 55 * {@link CameraCaptureSession#setRepeatingRequest} method. 56 * 57 * @see #createCaptureRequest 58 */ 59 public static final int TEMPLATE_PREVIEW = 1; 60 61 /** 62 * Create a request suitable for still image capture. Specifically, this 63 * means prioritizing image quality over frame rate. These requests would 64 * commonly be used with the {@link CameraCaptureSession#capture} method. 65 * 66 * @see #createCaptureRequest 67 */ 68 public static final int TEMPLATE_STILL_CAPTURE = 2; 69 70 /** 71 * Create a request suitable for video recording. Specifically, this means 72 * that a stable frame rate is used, and post-processing is set for 73 * recording quality. These requests would commonly be used with the 74 * {@link CameraCaptureSession#setRepeatingRequest} method. 75 * 76 * @see #createCaptureRequest 77 */ 78 public static final int TEMPLATE_RECORD = 3; 79 80 /** 81 * Create a request suitable for still image capture while recording 82 * video. Specifically, this means maximizing image quality without 83 * disrupting the ongoing recording. These requests would commonly be used 84 * with the {@link CameraCaptureSession#capture} method while a request based on 85 * {@link #TEMPLATE_RECORD} is is in use with {@link CameraCaptureSession#setRepeatingRequest}. 86 * 87 * @see #createCaptureRequest 88 */ 89 public static final int TEMPLATE_VIDEO_SNAPSHOT = 4; 90 91 /** 92 * Create a request suitable for zero shutter lag still capture. This means 93 * means maximizing image quality without compromising preview frame rate. 94 * AE/AWB/AF should be on auto mode. 95 * 96 * @see #createCaptureRequest 97 */ 98 public static final int TEMPLATE_ZERO_SHUTTER_LAG = 5; 99 100 /** 101 * A basic template for direct application control of capture 102 * parameters. All automatic control is disabled (auto-exposure, auto-white 103 * balance, auto-focus), and post-processing parameters are set to preview 104 * quality. The manual capture parameters (exposure, sensitivity, and so on) 105 * are set to reasonable defaults, but should be overriden by the 106 * application depending on the intended use case. 107 * 108 * @see #createCaptureRequest 109 */ 110 public static final int TEMPLATE_MANUAL = 6; 111 112 /** 113 * Get the ID of this camera device. 114 * 115 * <p>This matches the ID given to {@link CameraManager#openCamera} to instantiate this 116 * this camera device.</p> 117 * 118 * <p>This ID can be used to query the camera device's {@link 119 * CameraCharacteristics fixed properties} with {@link 120 * CameraManager#getCameraCharacteristics}.</p> 121 * 122 * <p>This method can be called even if the device has been closed or has encountered 123 * a serious error.</p> 124 * 125 * @return the ID for this camera device 126 * 127 * @see CameraManager#getCameraCharacteristics 128 * @see CameraManager#getCameraIdList 129 */ 130 public abstract String getId(); 131 132 /** 133 * <p>Set up a new output set of Surfaces for the camera device.</p> 134 * 135 * @deprecated Use {@link #createCaptureSession} instead 136 */ 137 @Deprecated 138 public abstract void configureOutputs(List<Surface> outputs) throws CameraAccessException; 139 140 /** 141 * <p>Create a new camera capture session by providing the target output set of Surfaces to the 142 * camera device.</p> 143 * 144 * <p>The active capture session determines the set of potential output Surfaces for 145 * the camera device for each capture request. A given request may use all 146 * or a only some of the outputs. Once the CameraCaptureSession is created, requests can be 147 * can be submitted with {@link CameraCaptureSession#capture capture}, 148 * {@link CameraCaptureSession#captureBurst captureBurst}, 149 * {@link CameraCaptureSession#setRepeatingRequest setRepeatingRequest}, or 150 * {@link CameraCaptureSession#setRepeatingBurst setRepeatingBurst}.</p> 151 * 152 * <p>Surfaces suitable for inclusion as a camera output can be created for 153 * various use cases and targets:</p> 154 * 155 * <ul> 156 * 157 * <li>For drawing to a {@link android.view.SurfaceView SurfaceView}: Set the size of the 158 * Surface with {@link android.view.SurfaceHolder#setFixedSize} to be one of the sizes 159 * returned by 160 * {@link StreamConfigurationMap#getOutputSizes(Class) getOutputSizes(SurfaceView.class)} 161 * and then obtain the Surface by calling {@link android.view.SurfaceHolder#getSurface}.</li> 162 * 163 * <li>For accessing through an OpenGL texture via a 164 * {@link android.graphics.SurfaceTexture SurfaceTexture}: Set the size of 165 * the SurfaceTexture with 166 * {@link android.graphics.SurfaceTexture#setDefaultBufferSize} to be one 167 * of the sizes returned by 168 * {@link StreamConfigurationMap#getOutputSizes(Class) getOutputSizes(SurfaceTexture.class)} 169 * before creating a Surface from the SurfaceTexture with 170 * {@link Surface#Surface}.</li> 171 * 172 * <li>For recording with {@link android.media.MediaCodec}: Call 173 * {@link android.media.MediaCodec#createInputSurface} after configuring 174 * the media codec to use one of the sizes returned by 175 * {@link StreamConfigurationMap#getOutputSizes(Class) getOutputSizes(MediaCodec.class)} 176 * </li> 177 * 178 * <li>For recording with {@link android.media.MediaRecorder}: Call 179 * {@link android.media.MediaRecorder#getSurface} after configuring the media recorder to use 180 * one of the sizes returned by 181 * {@link StreamConfigurationMap#getOutputSizes(Class) getOutputSizes(MediaRecorder.class)}, 182 * or configuring it to use one of the supported 183 * {@link android.media.CamcorderProfile CamcorderProfiles}.</li> 184 * 185 * <li>For efficient YUV processing with {@link android.renderscript}: 186 * Create a RenderScript 187 * {@link android.renderscript.Allocation Allocation} with a supported YUV 188 * type, the IO_INPUT flag, and one of the sizes returned by 189 * {@link StreamConfigurationMap#getOutputSizes(Class) getOutputSizes(Allocation.class)}, 190 * Then obtain the Surface with 191 * {@link android.renderscript.Allocation#getSurface}.</li> 192 * 193 * <li>For access to raw, uncompressed or JPEG data in the application: Create a 194 * {@link android.media.ImageReader} object with the one of the supported 195 * {@link StreamConfigurationMap#getOutputFormats() output image formats}, and a 196 * size from the supported 197 * {@link StreamConfigurationMap#getOutputSizes(int) sizes for that format}. Then obtain 198 * a Surface from it with {@link android.media.ImageReader#getSurface}.</li> 199 * 200 * </ul> 201 * 202 * </p> 203 * 204 * <p>The camera device will query each Surface's size and formats upon this 205 * call, so they must be set to a valid setting at this time (in particular: 206 * if the format is user-visible, it must be one of 207 * {@link StreamConfigurationMap#getOutputFormats}; and the size must be one of 208 * {@link StreamConfigurationMap#getOutputSizes(int)}).</p> 209 * 210 * <p>It can take several hundred milliseconds for the session's configuration to complete, 211 * since camera hardware may need to be powered on or reconfigured. Once the configuration is 212 * complete and the session is ready to actually capture data, the provided 213 * {@link CameraCaptureSession.StateListener}'s 214 * {@link CameraCaptureSession.StateListener#onConfigured} callback will be called.</p> 215 * 216 * <p>If a prior CameraCaptureSession already exists when a new one is created, the previous 217 * session is closed. Any in-progress capture requests made on the prior session will be 218 * completed before the new session is configured and is able to start capturing its own 219 * requests. To minimize the transition time, the {@link CameraCaptureSession#abortCaptures} 220 * call can be used to discard the remaining requests for the prior capture session before a new 221 * one is created. Note that once the new session is created, the old one can no longer have its 222 * captures aborted.</p> 223 * 224 * <p>Using larger resolution outputs, or more outputs, can result in slower 225 * output rate from the device.</p> 226 * 227 * <p>Configuring a session with an empty or null list will close the current session, if 228 * any. This can be used to release the current session's target surfaces for another use.</p> 229 * 230 * @param outputs The new set of Surfaces that should be made available as 231 * targets for captured image data. 232 * @param listener The listener to notify about the status of the new capture session. 233 * @param handler The handler on which the listener should be invoked, or {@code null} to use 234 * the current thread's {@link android.os.Looper looper}. 235 * 236 * @throws IllegalArgumentException if the set of output Surfaces do not meet the requirements, 237 * the listener is null, or the handler is null but the current 238 * thread has no looper. 239 * @throws CameraAccessException if the camera device is no longer connected or has 240 * encountered a fatal error 241 * @throws IllegalStateException if the camera device has been closed 242 * 243 * @see CameraCaptureSession 244 * @see StreamConfigurationMap#getOutputFormats() 245 * @see StreamConfigurationMap#getOutputSizes(int) 246 * @see StreamConfigurationMap#getOutputSizes(Class) 247 */ 248 public abstract void createCaptureSession(List<Surface> outputs, 249 CameraCaptureSession.StateListener listener, Handler handler) 250 throws CameraAccessException; 251 252 /** 253 * <p>Create a {@link CaptureRequest.Builder} for new capture requests, 254 * initialized with template for a target use case. The settings are chosen 255 * to be the best options for the specific camera device, so it is not 256 * recommended to reuse the same request for a different camera device; 257 * create a builder specific for that device and template and override the 258 * settings as desired, instead.</p> 259 * 260 * @param templateType An enumeration selecting the use case for this 261 * request; one of the CameraDevice.TEMPLATE_ values. 262 * @return a builder for a capture request, initialized with default 263 * settings for that template, and no output streams 264 * 265 * @throws IllegalArgumentException if the templateType is not in the list 266 * of supported templates. 267 * @throws CameraAccessException if the camera device is no longer connected or has 268 * encountered a fatal error 269 * @throws IllegalStateException if the camera device has been closed 270 * 271 * @see #TEMPLATE_PREVIEW 272 * @see #TEMPLATE_RECORD 273 * @see #TEMPLATE_STILL_CAPTURE 274 * @see #TEMPLATE_VIDEO_SNAPSHOT 275 * @see #TEMPLATE_MANUAL 276 */ 277 public abstract CaptureRequest.Builder createCaptureRequest(int templateType) 278 throws CameraAccessException; 279 280 /** 281 * <p>Submit a request for an image to be captured by this CameraDevice.</p> 282 * 283 * @deprecated Use {@link CameraCaptureSession#capture} instead 284 */ 285 @Deprecated 286 public abstract int capture(CaptureRequest request, CaptureListener listener, Handler handler) 287 throws CameraAccessException; 288 289 /** 290 * Submit a list of requests to be captured in sequence as a burst. 291 * 292 * @deprecated Use {@link CameraCaptureSession#captureBurst} instead 293 */ 294 @Deprecated 295 public abstract int captureBurst(List<CaptureRequest> requests, CaptureListener listener, 296 Handler handler) throws CameraAccessException; 297 298 /** 299 * Request endlessly repeating capture of images by this CameraDevice. 300 * 301 * @deprecated Use {@link CameraCaptureSession#setRepeatingRequest} instead 302 */ 303 @Deprecated 304 public abstract int setRepeatingRequest(CaptureRequest request, CaptureListener listener, 305 Handler handler) throws CameraAccessException; 306 307 /** 308 * <p>Request endlessly repeating capture of a sequence of images by this 309 * CameraDevice.</p> 310 * 311 * @deprecated Use {@link CameraCaptureSession#setRepeatingBurst} instead 312 */ 313 @Deprecated 314 public abstract int setRepeatingBurst(List<CaptureRequest> requests, CaptureListener listener, 315 Handler handler) throws CameraAccessException; 316 317 /** 318 * <p>Cancel any ongoing repeating capture set by either 319 * {@link #setRepeatingRequest setRepeatingRequest} or 320 * {@link #setRepeatingBurst}. 321 * 322 * @deprecated Use {@link CameraCaptureSession#stopRepeating} instead 323 */ 324 @Deprecated 325 public abstract void stopRepeating() throws CameraAccessException; 326 327 /** 328 * Flush all captures currently pending and in-progress as fast as 329 * possible. 330 * 331 * @deprecated Use {@link CameraCaptureSession#abortCaptures} instead 332 */ 333 @Deprecated 334 public abstract void flush() throws CameraAccessException; 335 336 /** 337 * Close the connection to this camera device as quickly as possible. 338 * 339 * <p>Immediately after this call, all calls to the camera device or active session interface 340 * will throw a {@link IllegalStateException}, except for calls to close(). Once the device has 341 * fully shut down, the {@link StateListener#onClosed} callback will be called, and the camera 342 * is free to be re-opened.</p> 343 * 344 * <p>Immediately after this call, besides the final {@link StateListener#onClosed} calls, no 345 * further callbacks from the device or the active session will occur, and any remaining 346 * submitted capture requests will be discarded, as if 347 * {@link CameraCaptureSession#abortCaptures} had been called, except that no success or failure 348 * callbacks will be invoked.</p> 349 * 350 */ 351 @Override 352 public abstract void close(); 353 354 /** 355 * <p>A listener for tracking the progress of a {@link CaptureRequest} 356 * submitted to the camera device.</p> 357 * 358 * @deprecated Use {@link CameraCaptureSession.CaptureListener} instead 359 */ 360 @Deprecated 361 public static abstract class CaptureListener { 362 363 /** 364 * This constant is used to indicate that no images were captured for 365 * the request. 366 * 367 * @hide 368 */ 369 public static final int NO_FRAMES_CAPTURED = -1; 370 371 /** 372 * This method is called when the camera device has started capturing 373 * the output image for the request, at the beginning of image exposure. 374 * 375 * @see android.media.MediaActionSound 376 */ 377 public void onCaptureStarted(CameraDevice camera, 378 CaptureRequest request, long timestamp) { 379 // default empty implementation 380 } 381 382 /** 383 * This method is called when some results from an image capture are 384 * available. 385 * 386 * @hide 387 */ 388 public void onCapturePartial(CameraDevice camera, 389 CaptureRequest request, CaptureResult result) { 390 // default empty implementation 391 } 392 393 /** 394 * This method is called when an image capture makes partial forward progress; some 395 * (but not all) results from an image capture are available. 396 * 397 */ 398 public void onCaptureProgressed(CameraDevice camera, 399 CaptureRequest request, CaptureResult partialResult) { 400 // default empty implementation 401 } 402 403 /** 404 * This method is called when an image capture has fully completed and all the 405 * result metadata is available. 406 */ 407 public void onCaptureCompleted(CameraDevice camera, 408 CaptureRequest request, TotalCaptureResult result) { 409 // default empty implementation 410 } 411 412 /** 413 * This method is called instead of {@link #onCaptureCompleted} when the 414 * camera device failed to produce a {@link CaptureResult} for the 415 * request. 416 */ 417 public void onCaptureFailed(CameraDevice camera, 418 CaptureRequest request, CaptureFailure failure) { 419 // default empty implementation 420 } 421 422 /** 423 * This method is called independently of the others in CaptureListener, 424 * when a capture sequence finishes and all {@link CaptureResult} 425 * or {@link CaptureFailure} for it have been returned via this listener. 426 */ 427 public void onCaptureSequenceCompleted(CameraDevice camera, 428 int sequenceId, long frameNumber) { 429 // default empty implementation 430 } 431 432 /** 433 * This method is called independently of the others in CaptureListener, 434 * when a capture sequence aborts before any {@link CaptureResult} 435 * or {@link CaptureFailure} for it have been returned via this listener. 436 */ 437 public void onCaptureSequenceAborted(CameraDevice camera, 438 int sequenceId) { 439 // default empty implementation 440 } 441 } 442 443 /** 444 * A listener for notifications about the state of a camera 445 * device. 446 * 447 * <p>A listener must be provided to the {@link CameraManager#openCamera} 448 * method to open a camera device.</p> 449 * 450 * <p>These events include notifications about the device completing startup ( 451 * allowing for {@link #createCaptureSession} to be called), about device 452 * disconnection or closure, and about unexpected device errors.</p> 453 * 454 * <p>Events about the progress of specific {@link CaptureRequest CaptureRequests} are provided 455 * through a {@link CameraCaptureSession.CaptureListener} given to the 456 * {@link CameraCaptureSession#capture}, {@link CameraCaptureSession#captureBurst}, 457 * {@link CameraCaptureSession#setRepeatingRequest}, or {@link CameraCaptureSession#setRepeatingBurst} methods. 458 * 459 * @see CameraManager#openCamera 460 */ 461 public static abstract class StateListener { 462 /** 463 * An error code that can be reported by {@link #onError} 464 * indicating that the camera device is in use already. 465 * 466 * <p> 467 * This error can be produced when opening the camera fails. 468 * </p> 469 * 470 * @see #onError 471 */ 472 public static final int ERROR_CAMERA_IN_USE = 1; 473 474 /** 475 * An error code that can be reported by {@link #onError} 476 * indicating that the camera device could not be opened 477 * because there are too many other open camera devices. 478 * 479 * <p> 480 * The system-wide limit for number of open cameras has been reached, 481 * and more camera devices cannot be opened until previous instances are 482 * closed. 483 * </p> 484 * 485 * <p> 486 * This error can be produced when opening the camera fails. 487 * </p> 488 * 489 * @see #onError 490 */ 491 public static final int ERROR_MAX_CAMERAS_IN_USE = 2; 492 493 /** 494 * An error code that can be reported by {@link #onError} 495 * indicating that the camera device could not be opened due to a device 496 * policy. 497 * 498 * @see android.app.admin.DevicePolicyManager#setCameraDisabled(android.content.ComponentName, boolean) 499 * @see #onError 500 */ 501 public static final int ERROR_CAMERA_DISABLED = 3; 502 503 /** 504 * An error code that can be reported by {@link #onError} 505 * indicating that the camera device has encountered a fatal error. 506 * 507 * <p>The camera device needs to be re-opened to be used again.</p> 508 * 509 * @see #onError 510 */ 511 public static final int ERROR_CAMERA_DEVICE = 4; 512 513 /** 514 * An error code that can be reported by {@link #onError} 515 * indicating that the camera service has encountered a fatal error. 516 * 517 * <p>The Android device may need to be shut down and restarted to restore 518 * camera function, or there may be a persistent hardware problem.</p> 519 * 520 * <p>An attempt at recovery <i>may</i> be possible by closing the 521 * CameraDevice and the CameraManager, and trying to acquire all resources 522 * again from scratch.</p> 523 * 524 * @see #onError 525 */ 526 public static final int ERROR_CAMERA_SERVICE = 5; 527 528 /** 529 * The method called when a camera device has finished opening. 530 * 531 * <p>At this point, the camera device is ready to use, and 532 * {@link CameraDevice#createCaptureSession} can be called to set up the first capture 533 * session.</p> 534 * 535 * @param camera the camera device that has become opened 536 */ 537 public abstract void onOpened(CameraDevice camera); // Must implement 538 539 /** 540 * The method called when a camera device has no outputs configured. 541 * 542 * @deprecated Use {@link #onOpened} instead. 543 */ 544 @Deprecated 545 public void onUnconfigured(CameraDevice camera) { 546 // Default empty implementation 547 } 548 549 /** 550 * The method called when a camera device begins processing 551 * {@link CaptureRequest capture requests}. 552 * 553 * @deprecated Use {@link CameraCaptureSession.StateListener#onActive} instead. 554 */ 555 @Deprecated 556 public void onActive(CameraDevice camera) { 557 // Default empty implementation 558 } 559 560 /** 561 * The method called when a camera device is busy. 562 * 563 * @deprecated Use {@link CameraCaptureSession.StateListener#onConfigured} instead. 564 */ 565 @Deprecated 566 public void onBusy(CameraDevice camera) { 567 // Default empty implementation 568 } 569 570 /** 571 * The method called when a camera device has been closed with 572 * {@link CameraDevice#close}. 573 * 574 * <p>Any attempt to call methods on this CameraDevice in the 575 * future will throw a {@link IllegalStateException}.</p> 576 * 577 * <p>The default implementation of this method does nothing.</p> 578 * 579 * @param camera the camera device that has become closed 580 */ 581 public void onClosed(CameraDevice camera) { 582 // Default empty implementation 583 } 584 585 /** 586 * The method called when a camera device has finished processing all 587 * submitted capture requests and has reached an idle state. 588 * 589 * @deprecated Use {@link CameraCaptureSession.StateListener#onReady} instead. 590 */ 591 @Deprecated 592 public void onIdle(CameraDevice camera) { 593 // Default empty implementation 594 } 595 596 /** 597 * The method called when a camera device is no longer available for 598 * use. 599 * 600 * <p>This callback may be called instead of {@link #onOpened} 601 * if opening the camera fails.</p> 602 * 603 * <p>Any attempt to call methods on this CameraDevice will throw a 604 * {@link CameraAccessException}. The disconnection could be due to a 605 * change in security policy or permissions; the physical disconnection 606 * of a removable camera device; or the camera being needed for a 607 * higher-priority use case.</p> 608 * 609 * <p>There may still be capture listener callbacks that are called 610 * after this method is called, or new image buffers that are delivered 611 * to active outputs.</p> 612 * 613 * <p>The default implementation logs a notice to the system log 614 * about the disconnection.</p> 615 * 616 * <p>You should clean up the camera with {@link CameraDevice#close} after 617 * this happens, as it is not recoverable until opening the camera again 618 * after it becomes {@link CameraManager.AvailabilityListener#onCameraAvailable available}. 619 * </p> 620 * 621 * @param camera the device that has been disconnected 622 */ 623 public abstract void onDisconnected(CameraDevice camera); // Must implement 624 625 /** 626 * The method called when a camera device has encountered a serious error. 627 * 628 * <p>This callback may be called instead of {@link #onOpened} 629 * if opening the camera fails.</p> 630 * 631 * <p>This indicates a failure of the camera device or camera service in 632 * some way. Any attempt to call methods on this CameraDevice in the 633 * future will throw a {@link CameraAccessException} with the 634 * {@link CameraAccessException#CAMERA_ERROR CAMERA_ERROR} reason. 635 * </p> 636 * 637 * <p>There may still be capture completion or camera stream listeners 638 * that will be called after this error is received.</p> 639 * 640 * <p>You should clean up the camera with {@link CameraDevice#close} after 641 * this happens. Further attempts at recovery are error-code specific.</p> 642 * 643 * @param camera The device reporting the error 644 * @param error The error code, one of the 645 * {@code StateListener.ERROR_*} values. 646 * 647 * @see #ERROR_CAMERA_DEVICE 648 * @see #ERROR_CAMERA_SERVICE 649 * @see #ERROR_CAMERA_DISABLED 650 * @see #ERROR_CAMERA_IN_USE 651 */ 652 public abstract void onError(CameraDevice camera, int error); // Must implement 653 } 654 655 /** 656 * To be inherited by android.hardware.camera2.* code only. 657 * @hide 658 */ 659 public CameraDevice() {} 660} 661