2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
システムカメラ
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Android 11 以降を搭載したデバイスでは、Android フレームワークはシステムカメラをサポートしています。システムカメラは、android.permission.SYSTEM_CAMERA
権限と通常のカメラ権限を持つプロセスにのみ表示されるカメラデバイスです。Android 11 で導入された android.permission.SYSTEM_CAMERA
権限の保護レベルは system|signature
です。つまり、システム パーティションにインストールされているアプリ、またはシステムと同じ証明書で署名されたアプリのみにこの権限を付与できます。サードパーティの一般公開アプリはシステムカメラにアクセスできません。
システムカメラは、カメラへのアクセスは必要なものの、特権アプリまたはシステムアプリだけに制限される機能を実装するデバイス メーカーにとって有用です。
android.permission.SYSTEM_CAMERA
権限が付与されるシステムアプリには android.permission.CAMERA
権限も必要なため、ユーザーは通常の CAMERA
権限を取り消して、そのようなアプリがデバイスのカメラにアクセスできないようにすることもできます。
実装
特定のカメラデバイスをシステムカメラにするために、カメラ HAL は機能リスト内で ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA
をアドバタイズする必要があります。
システムカメラにアクセスできるアプリを作成するには、そのアプリをデバイス固有の privapp-permissions.xml
ファイルの許可リストに登録する必要があります。このファイルには、android.permission.SYSTEM_CAMERA
権限を付与する必要のあるアプリが指定されています。
検証
一般公開アプリでデバイスのシステムカメラを検出できないことを検証するには、android.permission.cts.Camera2PermissionTest.testSystemCameraDiscovery
CTS テストを実行します。
すべてのカメラ CTS テストは、システム カメラデバイスで実行されます。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-26 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-03-26 UTC。"],[],[],null,["# System cameras\n\nOn devices running Android 11 or higher, the Android\nframework supports system\ncameras, which are camera devices that are visible only to processes with the\n`android.permission.SYSTEM_CAMERA` permission and regular camera permissions.\nThe `android.permission.SYSTEM_CAMERA` permission, introduced in\nAndroid 11, has\na protection level of `system|signature`. This means that only apps installed on\nthe system partition with or signed with the same certificate as the system can\nbe granted this permission. Third-party public apps can't access system cameras.\n\nSystem cameras are useful for device manufacturers that want to implement\nfeatures that require access to a camera but are also restricted to privileged\nor system apps.\n\nBecause systems apps that are granted the\n`android.permission.SYSTEM_CAMERA` permission must also have the\n[`android.permission.CAMERA`](https://developer.android.com/reference/android/Manifest.permission#CAMERA)\npermission, users can choose to revoke normal `CAMERA` permissions to prevent\nsuch an app from accessing the cameras on the device.\n\nImplementation\n--------------\n\nTo make a particular camera device a system camera, the camera HAL must\nadvertise\n[`ANDROID_REQUEST_AVAILABLE_CAPABILITIES_SYSTEM_CAMERA`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/camera/metadata/3.5/types.hal#120)\nin its capabilities list.\n\nTo create an app that has access to a system camera, the app must be allowlisted\nin the device-specific `privapp-permissions.xml` file, which specifies the apps\nthat the\n[`android.permission.SYSTEM_CAMERA`](https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android16-release/core/res/AndroidManifest.xml#1312)\npermission must be granted to.\n\nValidation\n----------\n\nTo verify that no system cameras on the device can be discovered by a public\napp, run the\n`android.permission.cts.Camera2PermissionTest.testSystemCameraDiscovery` CTS\ntest.\n\nAll\n[camera CTS tests](/docs/compatibility/cts/camera-hal#cts_tests)\nrun on system camera devices."]]