自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
错误和信息流处理
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-26。
[null,null,["最后更新时间 (UTC):2025-03-26。"],[],[],null,["# Error and stream handling\n\nError management\n----------------\n\nHIDL interface methods that interact with the camera must generate\nthe corresponding camera-specific\n[status](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/camera/common/1.0/types.hal).\n\nIf\n[`ICameraDeviceCallbacks::notify()`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/camera/device/3.2/ICameraDeviceCallback.hal#133) is called with\n[`ERROR_DEVICE`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/camera/device/3.2/types.hal#575), only the\n[`ICameraDeviceSession::close()`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/camera/device/3.2/ICameraDeviceSession.hal#406) method can be called\nsuccessfully. All other methods will return\n[`INTERNAL_ERROR`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/camera/common/1.0/types.hal#69).\n\nTransient errors in image capture must be reported through\n[`ICameraDeviceCallbacks::notify()`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/camera/device/3.2/ICameraDeviceCallback.hal#133) with the appropriate\n[error code](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/camera/device/3.2/types.hal#568). In each transient failure case, the HAL must still call\n[`ICameraDeviceCallbacks::processCaptureResult()`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/camera/device/3.2/ICameraDeviceCallback.hal#109) with an\nappropriate\n[capture result](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/camera/device/3.2/types.hal#846).\n\nStream management\n-----------------\n\nHAL clients must configure camera streams by calling\n[`ICameraDeviceSession::configurestreams()`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/camera/device/3.2/ICameraDeviceSession.hal#167)."]]