Display Safety Code Structure

This page describes the organization of the Display Safety source code.

For more information, see the README.md in each directory.

Clone the repository

To get access to the repository, contact your Google Technical Account Manager.

Framework

This directory contains the core Display Safety framework components.

Directory Purpose
api/har-platform-api Collection of platform subsystem abstractions for building high availability renderer (HAR) apps on supported platforms.
api/har-types Hardware abstraction layer types.
asset-manager Tools for managing runtime application assets.
audio/har-audio Crate for handling HAR audio playback
customizations Contains APIs, implementations, and derive macros to produce design customizations from a HAR-based app.
derive/har-ui-model-derive Procedural macros for deriving common traits used by the HAR UI model system
display_list Defines the structures and components describing a scene for rendering, decoupled from any graphical backend.
graphics/external-image A crate for external image representations.
graphics/har-gl-context Defines the graphics context API and includes multiple implementations across supported platforms, both for display and off-screen rendering.
graphics/impeller Safe Rust API for Impeller, building upon the generated FFI bindings.
graphics/impeller-renderer High-level renderer implementation using Impeller as the backing rendering engine.
har-layout A wrapper for Taffy to calculate layout for views in HAR.
har-monitoring Performance monitoring toolkit.
har-utils Common utilities.
harry Framework to be used as a foundation for building HAR applications
harry-animation An animation API and implementation for Harry
squoosh Intermediate representation and animation engine for view parameters in the Harry framework.
task-scheduler Utility for scheduling tasks and executing them in a background thread after a specified delay.
test_suites Test suites for running Display Safety unit tests

Prebuilts

This directory contains prebuilt libraries and assets.

Directory Purpose
impeller/ Prebuilt libraries for the Impeller graphics engine, organized by OS and architecture.
impeller-rs-bindgen/ Rust FFI bindings for Impeller.
impeller-rs-bindgen-wrapper/ API wrapper for the Impeller bindings.

Reference

This directory contains the HAR reference implementation, platform-specific implementations, tools, and test artifacts.

Directory Purpose
audio/tinyalsa-rs Rust FFI bindings for the Tinyalsa Audio library.
audio/tinyalsa-audio Library for audio playback and device management, building upon FFI bindings generated by the `tinyalsa-rs` crate
camera/emulated-camera Provides an implementation of an emulated camera using the `Camera` trait from `har-platform-api`.
graphics/gl-helpers Utility crate containing GL helper functions
har-user-input-evdev/ Implements a basic evdev-based input handling implementation. Supports keyboard, mouse and touch (single and multi-touch) events
harry-app/ Reference implementation for a portable high availability renderer (HAR) app built using the `harry` framework.
harry-app-core/ Core application logic, state management, and UI model definitions for the `harry-app` reference app.
harry-app-utils/ Utility functions and helper modules for the `harry-app` reference app.
harry-control-api/ Control APIs for the `harry-app` reference app.
harry-grpcio-server/ gRPC server (grpcio based). This is only used when building the Android version with soong
harry-tonic-server/ gRPC server (tonic based). This is only used when building the Linux version with Cargo.
harry-vehicle-data-grpc/ Vehicle data gRPC code, generated from the vehicle data proto files.
i18n/harry-app-i18n Internationalization and localization services for HAR.
i18n/i18n-protos Defines protobuf messages and Rust code generation for i18n data.
libyuv-rs/ Rust bindings for libyuv.
platforms/har-log Defines log and tracing implementations for every supported platform.
platforms/har-looper-headless A platform-agnostic looper implementation for headless rendering.
platforms/har-platform-android Provides Android-specific implementations of the `har-platform-api` platform abstractions.
platforms/har-platform-linux Provides Linux-specific implementations of the `har-platform-api` platform abstractions.
platforms/harry-app-platform-specific The conditional compilation bridge for harry-app, selecting the correct implementation based on the selected platform.
safety-monitor Implementation of a Reference Safety Monitor for Android.
screencap Screen capture utility for extracting screenshots directly from DRM framebuffers
vehicle-data-scripts Structures and logic for creating scripted vehicle data sequences

Service

This directory contains Android services related to Display Safety.

Directory Purpose
ds-cvd-toolkit A command-line tool for Display Safety allowing launch of multiple Cuttlefish devices.
emulator Emulator support for Runtime Resource Overlays
har-grpc-services Contains the proto definitions used in the reference implementation to establish comms channels between the HAR app and DriverUI and vehicle data services.
har-sdv-service* Provides an SDV Service Bundle used to provide data services to HAR utilizing the code generated by proto files
har-tracing-common Performance tracing services for HAR
harry-prebuilt/ Prebuilt Harry components (assets, configs, etc)
ivi/ Components related to Android IVI (In-Vehicle Infotainment)
libhar_graphics/ C++ graphics library for HAR services.
pdk/ PDK release metadata
product/ Product-specific configurations and assets
SdvCameraPreviewApp Camera preview app for SDV.
vehicledata Implements a vehicle data SDV Data Tunnel publisher using gRPC

Utils

This directory contains general utilities for reference implementations and testing.

Directory Purpose
asset-manager-cli Provides a command line interface for generating asset packages.
dcf-info/ Tool for extracting metadata from a DCF (Serialized Design Compose Figma document.)
figma-utils Provides a command line wrapper to `figma_import`, for fetching serialized Figma docs.
gauge-test App designed for testing and demonstrating dial and gauge UI elements.
gui-playground-app Sandbox environment for testing new UI and animation features.
har-platform-tests Suite of integration tests for platform-specific trait implementations.
har-rendering-parity Visual tool for verifying rendering parity between HAR, DesignCompose and Figma.
harry-rpc-client Provides a command line interface for sending commands to Harry via RPC.
human-readable-report-generator Utility for visual verification of safety artifacts.
ktx-utils Provides utilities for encoding and decoding Khronos KTX 2.0 texture files.
list-test-app Serves as a testing and demonstration environment for list management in HAR.
transfer-localizations Utility for converting Android XML localization files to the HAR proto format.
variable-density-analyzer Analyzes a Figma document and calculates the ratio of nodes to design variables.