2025년 3월 27일부터 AOSP를 빌드하고 기여하려면 aosp-main
대신 android-latest-release
를 사용하는 것이 좋습니다. 자세한 내용은 AOSP 변경사항을 참고하세요.
Android 카메라 서비스 사용
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Android 카메라 서비스는 자동차 기기뿐만 아니라 휴대전화, 태블릿, TV와 같은 다른 폼 팩터에서 사용되는 카메라 스택으로 구성됩니다. 전체 카메라 아키텍처를 보려면 카메라를 참고하세요. 이 페이지에서는 자동차 기기와 관련된 주제와 Android 카메라 API를 사용하는 방법을 중점적으로 다룹니다.
Android 카메라 서비스 사용 설정
자동차 플랫폼에서 Android 카메라 서비스를 사용 설정하려면 제품의 makefile에서 ENABLE_CAMERA_SERVICE
를 true
로 지정해야 합니다.
Automotive용 카메라 특성
자동차 기기 컨텍스트에서 카메라 HAL은 자동차 폼 팩터에만 해당하는 두 가지 고유한 특성을 포함해야 합니다.
카메라가 특정 위치 또는 렌즈 방향과 정확하게 일치하지 않는 경우 (android.automotive.location
또는 android.automotive.lens.facing
특성에 *_OTHER
가 표시됨) 또는 여러 카메라가 동일한 위치와 방향을 공유하는 경우 카메라 HAL은 앱이 카메라 위치를 정확하게 결정할 수 있도록 추가 특성을 제공해야 합니다. 이러한 특성에는 다음이 포함됩니다.
헤드리스 시스템 사용자에게 액세스 권한 부여
특정 시스템 및 퍼스트 파티(1P) 앱은 헤드리스 시스템 사용자(User 0이라고도 함)로 카메라에 액세스할 수 있습니다. 이 기능을 사용하면 후방 카메라와 같은 안전이 중요한 앱이 포그라운드 사용자 전환과 관계없이 중단 없이 카메라 스트리밍을 계속할 수 있습니다. 플랫폼 서명되고 새 권한 android.permission.CAMERA_HEADLESS_SYSTEM_USER
를 보유한 앱만 사용자 0으로 카메라에 액세스할 수 있습니다.
사용자 0으로 카메라에 액세스하는 앱의 경우 카메라 데이터는 로컬에서 사용해야 하며 카메라 데이터에서 파생된 데이터를 포함하여 기기 외부로 전송해서는 안 됩니다(MUST NOT). 이러한 앱은 android.permission.CAMERA
권한을 사전 부여받아야 하며 GAS 요구사항에 관한 운전용 설계에 설명된 사전 부여 권한 정책을 준수해야 합니다.
카메라 개인 정보 보호 허용 목록 구성
이제 OEM은 카메라 개인 정보 보호 전환 버튼의 상태와 관계없이 카메라 액세스를 허용하는 허용 목록에 포함되도록 특정 카메라 앱을 구성할 수 있습니다. 이 기능을 사용하면 사용자가 소셜 미디어, 화상 회의와 같은 엔터테인먼트 앱의 카메라 액세스를 사용 중지하는 동시에 허용 목록에 있는 특정 앱의 카메라 액세스를 허용할 수 있습니다.
android.permission.CAMERA_PRIVACY_ALLOWLIST
권한이 부여된 시스템 및 권한이 있는 앱만 이 기능을 사용할 수 있습니다.
Google Automotive 서비스 (GAS) 파트너는 검토를 위해 허용 목록에 추가된 앱을 제출하고 개인 정보 보호 허용 목록 정책을 준수해야 합니다. 자세한 내용은 자동차용 Android를 참고하세요.
허용 목록에 앱 추가하기
etc/sysconfig
디렉터리에서:
시스템 구성 XML 파일에 앱의 패키지 이름을 추가합니다.
<!-- In an xml file under etc/sysconfig —>
<!--
Allowlisted packages for the camera privacy toggle. Users will not be able to turn the privacy on for these packages as OEM requires camera access for these packages to preserve user safety.
-->
<config>
<camera-privacy-allowlisted-app package="package_name" />
</config>
앱의 개인정보처리방침 공개 URL을 AndroidManifest.xml
에 추가합니다.
meta-data
의 이름은 privacy_policy
여야 합니다.
<meta-data android:name="privacy_policy" android:value= privacy policy URL/>
기본적으로 허용 목록에 있는 앱 또는 필수 앱의 카메라 개인 정보 보호 전환 버튼은 개인 정보 보호 설정 UI에 숨겨져 있습니다. 하지만 OEM은 다음 플래그를 TRUE
로 설정하여 이 동작을 재정의할 수 있습니다. 이를 통해 OEM은 환경설정에 따라 필수 앱의 카메라 개인 정보 보호 전환 버튼의 표시 여부를 맞춤설정할 수 있습니다.
<!-- Whether to show the toggle to turn on the camera privacy for required apps -->
<bool name="config_show_camera_required_apps_toggle">false</bool>
카메라 사전 체험판 이용
시간에 민감하고 안전을 중시하는 특정 앱은 Android 부팅 프로세스가 완료되기 전에 카메라에 액세스할 수 있습니다. 그러나 이 액세스 권한은 UID AID_AUTOMOTIVE_EVS
가 있는 권한 있는 클라이언트에게만 부여됩니다. 네이티브 앱에 특정 UID를 할당하는 방법에 관한 자세한 내용은 선택적 액세스 제어 (DAC)를 참고하세요.
이 카메라 사전 체험판은 차량 외부에 위치한 시스템 카메라로 제한됩니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-06-12(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-06-12(UTC)"],[],[],null,["# Use the Android Camera Service\n\nThe Android Camera Service comprises the camera stack used in automotive\ndevices, as well as in other form factors such as mobile phones, tablets,\nand TVs. To view the overall camera architecture, see\n[Camera](/docs/core/camera). This page focuses on topics specific to automotive\ndevices, and working with the [Android Camera API](https://developer.android.com/reference/android/hardware/camera2/package-summary).\n\nEnable Android Camera Service\n-----------------------------\n\nTo enable the Android Camera Service on the automotive platform, the product's\nmakefile must specify `ENABLE_CAMERA_SERVICE` as `true`.\n\nAutomotive-specific camera characteristics\n------------------------------------------\n\nIn the context of automotive devices, the camera HAL must include two\ndistinctive characteristics specific to the automotive form factor:\n\n| Name | Description |\n|-------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|\n| [android.automotive.location](https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#AUTOMOTIVE_LOCATION) | Specifies the positioning of cameras in relation to the vehicle's body frame. |\n| [android.automotive.lens.facing](https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#AUTOMOTIVE_LENS_FACING) | Indicates which direction a camera lens is facing relative to the vehicle body frame and passenger seats. |\n\nIn situations when cameras don't precisely align with specific location or lens\norientation (indicated by the presence of `*_OTHER` in the\n[`android.automotive.location`](https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#AUTOMOTIVE_LOCATION) or [`android.automotive.lens.facing`](https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#AUTOMOTIVE_LENS_FACING)\ncharacteristics), or when multiple cameras share the same location and\ndirection, the camera HAL should provide additional characteristics to enable\napps to accurately determine the camera's location. These characteristics\ninclude:\n\n- [`android.lens.poseReference`](https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#LENS_POSE_REFERENCE)\n- [`android.lens.poseRotation`](https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#LENS_POSE_ROTATION)\n- [`android.lens.poseTranslation`](https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics#LENS_POSE_TRANSLATION)\n\nGrant access to the Headless System User\n----------------------------------------\n\nCertain system and first-party (1P) apps can access the camera as the Headless\nSystem User, also known as User 0. This feature ensures that safety-critical\napps, such as the rear-view camera, can continue camera streaming without\ninterruption, regardless of foreground user switching. Only apps that are\nplatform-signed and hold the new permission\n`android.permission.CAMERA_HEADLESS_SYSTEM_USER` can access the camera as\nUser 0.\n\nFor apps accessing cameras as User 0, the camera data MUST be consumed locally\nand MUST not be transmitted off the device, including any data derived from the\ncamera data. These apps require that the `android.permission.CAMERA` permission\nbe pre-granted and must adhere to the pre-grant permission policy outlined in\n[Design for Driving](https://developers.google.com/cars) for GAS requirements.\n\nConfigure a camera privacy allowlist\n------------------------------------\n\nOriginal equipment manufacturers (OEMs) can now configure specific camera apps\nto be included on an allowlist that grants camera access regardless of the\ncamera privacy toggle's status. This feature enables users to disable camera\naccess for entertainment apps, such as social media and video conferencing,\nwhile simultaneously permitting camera access for certain allowlisted apps.\n\nOnly system and privileged apps granted the\n`android.permission.CAMERA_PRIVACY_ALLOWLIST` permission can use this feature.\nGoogle Automotive Services (GAS) partners must submit their allowlisted apps\nfor review and comply with the privacy allowlist policy. To learn more, see\n[Android for Cars](https://developers.google.com/cars).\n\n### Add an app to the allowlist\n\nIn the `etc/sysconfig` directory:\n\n1. Add the app's package name in a system configuration XML file:\n\n \u003c!-- In an xml file under etc/sysconfig ---\u003e\n\n \u003c!--\n Allowlisted packages for the camera privacy toggle. Users will not be able to turn the privacy on for these packages as OEM requires camera access for these packages to preserve user safety.\n --\u003e\n\n \u003cconfig\u003e\n \u003ccamera-privacy-allowlisted-app package=\"package_name\" /\u003e\n \u003c/config\u003e\n\n2. Add the app's URL of privacy policy disclosure to `AndroidManifest.xml`.\n The name of the `meta-data` should be `privacy_policy`.\n\n \u003cmeta-data android:name=\"privacy_policy\" android:value= privacy policy URL/\u003e\n\nBy default, the camera privacy toggle for allowlisted apps or required apps is\nhidden in the **Privacy Settings** UI. However, OEMs can override this behavior\nby setting the following flag to `TRUE`. This allows OEMs to customize the\nvisibility of the camera privacy toggle for the required apps based on their\npreferences. \n\n \u003c!-- Whether to show the toggle to turn on the camera privacy for required apps --\u003e\n\n \u003cbool name=\"config_show_camera_required_apps_toggle\"\u003efalse\u003c/bool\u003e\n\nGet early camera access\n-----------------------\n\nSpecific time-sensitive and safety-oriented apps can access the camera before\nthe Android boot process is finished. However, this access is exclusively\ngranted to privileged clients with the `UID AID_AUTOMOTIVE_EVS`. To learn more\nabout assigning a specific UID to a native app,\nsee [Discretionary access control (DAC)](/docs/core/permissions/filesystem).\nThis early access to the camera is limited to system cameras positioned on the\nexterior of the vehicle's body."]]