Charles Chen | 3d4a6b7 | 2023-01-17 08:16:44 +0000 | [diff] [blame^] | 1 | ### |
| 2 | ### isolated_compute_apps. |
| 3 | ### |
| 4 | ### This file defines the rules for isolated apps that requires the permission |
| 5 | ### to gather data with service manager and require computational resources to |
| 6 | ### improve the performance to process data under a sandbox. This |
| 7 | ### isolated_compute_app restricts data egress to protect the privacy. |
| 8 | ### |
| 9 | ### TODO(b/266923392): Clean rules for isolated_compute_app characteristics |
| 10 | ### |
| 11 | type isolated_compute_app, domain; |
| 12 | |
| 13 | typeattribute isolated_compute_app coredomain; |
| 14 | |
| 15 | app_domain(isolated_compute_app) |
| 16 | isolated_app_domain(isolated_compute_app) |
| 17 | |
| 18 | allow isolated_compute_app audioserver_service:service_manager find; |
| 19 | allow isolated_compute_app cameraserver_service:service_manager find; |
| 20 | allow isolated_compute_app content_capture_service:service_manager find; |
| 21 | allow isolated_compute_app device_state_service:service_manager find; |
| 22 | allow isolated_compute_app speech_recognition_service:service_manager find; |
| 23 | |
| 24 | # Enable access to hardware services for camera functionalilites |
| 25 | hal_client_domain(isolated_compute_app, hal_allocator) |
| 26 | hwbinder_use(isolated_compute_app) |
| 27 | |
| 28 | # Write app-specific trace data to the Perfetto traced damon. This requires |
| 29 | # connecting to its producer socket and obtaining a (per-process) tmpfs fd. |
| 30 | perfetto_producer(isolated_compute_app) |
| 31 | |
| 32 | # Allow profiling if the main app has been marked as profileable or |
| 33 | # debuggable. |
| 34 | can_profile_heap(isolated_compute_app) |
| 35 | can_profile_perf(isolated_compute_app) |
| 36 | |
| 37 | ##### |
| 38 | ##### Neverallow |
| 39 | ##### |
| 40 | |
| 41 | # Do not allow isolated_compute_app to access hardware service except for the |
| 42 | # ones necessary for camera service. |
| 43 | # TODO (b/266555480): The permission should be guarded by compliance test. |
| 44 | # Remove the negation for member domains when refactorization is done. |
| 45 | # neverallow isolated_compute_app { |
| 46 | # hwservice_manager_type |
| 47 | # -hal_graphics_allocator_hwservice |
| 48 | # -hal_graphics_mapper_hwservice |
| 49 | # -hidl_allocator_hwservice |
| 50 | # -hidl_manager_hwservice |
| 51 | # -hidl_memory_hwservice |
| 52 | # }:hwservice_manager *; |