29 Commits

Author SHA1 Message Date
Kiyoung Kim
acc34fa037 Move definition for vendor_camera_binder_service into product
vendor_camera_binder_service is defined in vendor image, but this
property is required and used from the system image. This causes
Cuttlefish Hybrid Device to fail from sepolicy error. This change is to
move system-required property from vendor to product so it can be used
when vendor image is changed into generic one.

Bug: 309469924
Test: Build and boot succeeded with cheetah
Change-Id: Iea3e5be110498f759e268df8b7e5126b65b06a67
2023-11-15 12:44:31 +09:00
Aaron Ramirez
15cb30dcaf Add missing node_bind permission to SEPolicy.
Bug: 299315760
Test: Tested with SEPolicy enforcement on and verified PCS could open
requested video stream.

Change-Id: I41af99531feb968015c46cdf67d8c2d03b243a93
2023-09-18 11:17:14 -07:00
Aaron Ramirez
5d54c68f6c Configure SEPolicy to allow PCS to open and use socket connections.
Bug: 299315760
Test: Tested with SEPolicy enforcement on and verified PCS could perform
socket operations.

Change-Id: Idd9048da4bb3856666698bc0589dbc68aa74fd1a
2023-09-11 10:34:11 -07:00
Inseob Kim
dc624c5311 Move camera's coredomain sepolicy to product
Because they are installed to product partition and it's Treble
violation to assign them with vendor sepolicy

Bug: 296512192
Test: lunch panther and build
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:85f9b1e5bc9320a4ab8dc3f6d26027dba76882c6)
Merged-In: I2d2c2a8027eed2b3e2ee1a78d629d44b99867128
Change-Id: I2d2c2a8027eed2b3e2ee1a78d629d44b99867128
2023-09-05 23:51:15 +00:00
Inseob Kim
ee253beede Start tracking vendor seapp coredomain violations (1)
As part of Treble, enforce that vendor's seapp_contexts can't label apps
using coredomains. Apps installed to system/system_ext/product should be
labeled with platform side sepolicy.

This change marks violating domains that need to be fixed.

Bug: 296512192
Test: build and see build log
Change-Id: I755657e538ada8807313bd0063c880264e4b79be
2023-08-21 11:55:35 +00:00
Utku Utkan
46d6a88211 Add SEPolicy config for PCS to act as a media app
These are the minimum set of services that PCS needs to have access for
it to be able act as a media app and use Exoplayer for playing recorded
video files.

However, there'll be a follow up change to broaden the permissions to be
future proof and have greater flexibility as a media app, which will let
PCS to be updated via Play Store without the worry of a missing SEPolicy
config that is common among media apps.

Bug: 287069860
Test: m && flashall
Change-Id: I956219faacbc0c1b649cb638cede964480766718
2023-08-14 09:56:08 -07:00
Utku Utkan
1a4567113d Allow Pixel Camera Services to bind to Lyric for callbacks
Bug: 287069860
Test: m && flashall && end-to-end developer testing
Change-Id: I86173ecaf9900f5c869847106166f07e482e6a74
2023-08-14 09:33:04 -07:00
malikakash
8dc27bcee5 Add SePolicy allowances for ICameraIdRemapper
- This allows us to register the CameraIdRemapper
  service through servicemanager and allows PCS
  to find it.

Bug: 287069860
Test: m
Change-Id: Ic7f778c4f173caa1ce389c9ad39a14433afc3133
2023-08-07 23:07:00 +00:00
malikakash
236507606d Associate vendor_pcs_app with PCS services
- :* will associate the context with the individual
  services, which might start in their own processes.

Bug: 280340307
Test: m
Change-Id: I0cc183ae07f18a2fc8e3c2caf960654296eeab53
2023-08-07 20:19:12 +00:00
Eliot Wong
06c6ca63b5 Merge "Add SEPolicy for vendor_camera_isp_service" into udc-qpr-dev 2023-08-07 16:57:50 +00:00
Eliot Wong
2daad9a814 Add SEPolicy for vendor_camera_isp_service
Allows the Camera HAL to start a new ISP Service.

avc message:
07-31 17:08:46.990   536   536 E SELinux : avc:  denied  { add } for
pid=8308 uid=1000 name=com.google.pixel.camera.isp.IIspService/default
scontext=u:r:hal_camera_default:s0
tcontext=u:object_r:default_android_service:s0 tclass=service_manager
permissive=0

Bug: 293447476
Test: verify no avc errors and ISP Service starts
Test: atest liblyric.services_isp_service_test
Change-Id: Icbd07820d3323c09868d0249c1ef9d7f2952751e
2023-08-02 15:23:27 +00:00
malikakash
89b8a6e02f Allow PCS to bind to LyricConfigProvider
- Sepolicy change

Bug: 280340307
Test: Local Testing

Change-Id: Id2dcf659b3c288b5c4c1756e9bd7ae80915b7942
2023-07-25 23:48:51 +00:00
malikakash
7c32a87d82 Add Sepolicy for LyricConfigProvider to use CameraService
Bug: 280340307
Test: LyricConfigProvider can reach out to CameraService.
Change-Id: I9b1c7f82fdb1cea09b5c520684574c36be8cd15d
2023-07-20 23:29:14 +00:00
malikakash
bdccd2c97b Add sepolicy to allow pbcs to use SysProps
-Add custom domain for our sysprops, of the forms
  -vendor.camera.pbcs.debug.*
  -persist.vendor.camera.pbcs.debug.*
  -Example: vendor.camera.pbcs.debug.enable_lyricconfigprovider
  -This domain will be system + vendor_init writable
-Allow PBCS to read those sysprops

We should now be able to gate our features in PBCS and merge in
successfully. For local dev, we can do:

adb root && adb shell setprop <prop> 1

Bug: 280340307
Test: android.os.SystemProperties.get() works successfully in
  LyricConfigProvider for vendor.camera.pbcs.debug.* props

Change-Id: I4b151f606883c0ae32f99b5f75b70b5d4e228f1d
2023-07-19 21:24:31 +00:00
malikakash
8a5b714f8d Add sepolicy configs for LyricConfigProvider Service
- Introduce service_context for ILyricConfigProvider service
- Allow adding the ILyricConfigProvider to the service manager.
- Allow HAL to find ILyricConfigProvider from servicemanager
- Allow all proceses in com.google.pixel.services:* to have the same domain as the app (vendor_pbcs_app)
  -- We'll be running services in their own processes so this
     is needed.
- TODO: binder_call(vendor_pbcs_app, vendor_pcs_app);
  Allow PBCS appdomain to make binder calls into PCS appdomain
  after ag/24030784 lands.

Bug: 280340307
Test: We can successfully start and register the LyricConfigProvider service with the servicemanager.
Change-Id: Ia0a74065e98761e48aa041bf7f2f34188017cee4
2023-07-19 21:21:39 +00:00
Utku Utkan
88284b922a Add SEPolicy for hal_pixel_remote_camera_service
Bug: 287069860
Test: Manual developer testing with 'setenforce 1'
Change-Id: Iffe22dae7485bd433abdb60249ce8900a1996291
2023-07-18 20:53:59 -07:00
Utku Utkan
ab8b16b905 Revert^2 "Add SEPolicy for Pixel Camera Services Extensions"
Revert submission 24122569-revert-24056607-pixel-camera-services-extensions-sepolicy-OFSULTXSBL

Reason for revert: Relanding the original topic after copying the certificates under `device/google` for `without-vendor` branches

Reverted changes: /q/submissionid:24122569-revert-24056607-pixel-camera-services-extensions-sepolicy-OFSULTXSBL

Bug: 287069860
Test: m && flashall && dev test with Open Camera and Camera2 Ext
Change-Id: I7f9a759ca7b5538441de451eb80f20b3cb1e30a9
2023-07-18 20:37:13 -07:00
Utku Utkan
5896049be5 Revert^2 "Add vendor_pcs_app domain for PixelCameraServices"
Revert submission 24122569-revert-24056607-pixel-camera-services-extensions-sepolicy-OFSULTXSBL

Reason for revert: Relanding the original topic after copying the certificates under `device/google` for `without-vendor` branches

Reverted changes: /q/submissionid:24122569-revert-24056607-pixel-camera-services-extensions-sepolicy-OFSULTXSBL

Bug: 287069860
Test: m && flashall
Change-Id: Ic6ef3d67a518500f0db2cb8c537a3934e64d366b
2023-07-18 20:36:47 -07:00
Inseob Kim
cf2ca49dd5 Merge changes from topic "revert-24056607-pixel-camera-services-extensions-sepolicy-OFSULTXSBL" into udc-qpr-dev
* changes:
  Revert "Add vendor_pcs_app domain for PixelCameraServices"
  Revert "Add SEPolicy for Pixel Camera Services Extensions"
2023-07-19 02:08:56 +00:00
Inseob Kim
34a6dcecf5 Revert "Add vendor_pcs_app domain for PixelCameraServices"
Revert submission 24056607-pixel-camera-services-extensions-sepolicy

Reason for revert: build breakage on git_main-without-vendor

Reverted changes: /q/submissionid:24056607-pixel-camera-services-extensions-sepolicy

Change-Id: Ia18508a9350c4418795b5c861d29eb461e3b9ee6
2023-07-19 01:15:07 +00:00
Inseob Kim
09e3385652 Revert "Add SEPolicy for Pixel Camera Services Extensions"
Revert submission 24056607-pixel-camera-services-extensions-sepolicy

Reason for revert: build breakage on git_main-without-vendor

Reverted changes: /q/submissionid:24056607-pixel-camera-services-extensions-sepolicy

Change-Id: I9b4a52ec3edaa1a19aa4ec938191a26acc475a8a
2023-07-19 01:15:07 +00:00
Utku Utkan
be42c5b12c Don't audit any system_app_data_file:dir access
Lab devices don't do factory reset. So we see 'avc: denied' logs
everynow and then. The fix disables the related audits to avoid any
false negatives.

Bug: 287069860
Test: m && flashall && check for 'avc: denied { write }'
Change-Id: I4f98af849b99f4ece737c85a23e22b817677d917
2023-07-18 16:10:59 -07:00
Utku Utkan
d77ddb4c15 Add SEPolicy for Pixel Camera Services Extensions
Bug: 287069860
Test: m && flashall && dev test with Open Camera and Camera2 Ext
Change-Id: I4eac5697a122b56939bb3c3946b28a17dfdf4c0c
2023-07-18 12:18:34 -07:00
Utku Utkan
6c397defc4 Add vendor_pcs_app domain for PixelCameraServices
Bug: 287069860
Test: lunch <device-type>-userdebug && m
Change-Id: Ib5ee8dd71193b41190e7092e393ab912a4a7676a
2023-07-18 12:18:34 -07:00
Utku Utkan
fb20bc80c4 Add SEPolicy for vendor_camera_binder_service
Bug: 287069860
Test: lunch <device-type>-userdebug && m
Change-Id: Id993e137ebc041e583b4f6c5f6e1ab6e8cdae7b2
2023-07-12 09:45:54 -07:00
Utku Utkan
6b44778e00 Allow vendor_pbcs_app to search system_app_data_file:dir
Bug: 287069860
Test: m && flashall && check for 'avc: denied { search }'
Change-Id: I5d0ff960a6ad5b3359dbeedeeea3cac78471419b
2023-07-12 09:45:48 -07:00
Utku Utkan
049b1dfb53 Add vendor_pbcs_app domain for PersistentBackgroundCameraServices
Bug: 287069860
Test: lunch <device-type>-userdebug && m
Change-Id: I4153daaf3c8c656380333e695cc7f99ecd821e21
2023-07-06 18:34:36 -07:00
Krzysztof Kosiński
eea841f1cd Add shared config for Lyric camera HAL.
The config needs to be moved here to support future PDK builds
where the LyricCameraHAL directory will be absent.

Bug: 280124102
Test: presubmit
Change-Id: If967c3db8bb94cadd761ee19b7665db8b7e4b305
2023-04-29 09:31:41 +00:00
Adam Shih
1a62bec194 move camera dump to gs-common
Bug: 240530709
Test: adb bugreport
Create empty files starting with the following prefix
/data/vendor/camera/profiler/session-ended-
/data/vendor/camera/profiler/high-drop-rate-
/data/vendor/camera/profiler/watchdog-
/data/vendor/camera/profiler/camera-ended-
and do adb bugreport and make sure they end up in dumpstate_board.bin

Change-Id: I2f9dfb74476af295db8a392ebf7757681404841e
2023-03-06 10:02:00 +08:00