Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 847947d8 authored by Jayant Chowdhary's avatar Jayant Chowdhary
Browse files

cameraserver: Enforce system only camera permissions in camera1 api.



In camera1 api
- getNumberOfCameras won't count hidden secure cameras.
- getNumberOfCameras will return public non system cameras or public
  cameras depending on whether the client has SYSTEM_CAMERA and CAMERA
  permissions or not.
- getCameraInfo checks for SYSTEM_CAMERA and CAMERA permissions in case
  the info is requested for a system camera.

Bug: 140243224

Test: Harcode all cameras as SYSTEM_ONLY_CAMERA; cts camera1 tests
      get 0 on calling getNumberOfCameras() without using
      adoptShellPermissionIdentity().

Test: Harcode all cameras as SYSTEM_ONLY_CAMERA; cts camera1 tests
      get a finite number on calling getNumberOfCameras() when
      adoptShellPermissionIdentity() is used.

Test: Harcode all cameras as HIDDEN_CAMERA; cts camera1 tests
      get 0 when calling getNumberOfCameras.

Change-Id: I9d1721fd5e94fa7f692c3da52aa667ae9247d368
Signed-off-by: default avatarJayant Chowdhary <jchowdhary@google.com>
parent 20ea1ca9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment