SDV geliştirme için IDE ayarlama

Android Studio for Platform (ASfP), Android Automotive OS (AAOS) yazılım tanımlı araç (SDV) platformu geliştirme için önerilen entegre geliştirme ortamıdır (IDE). ASfP, SDV hizmet paketleri için Rust dahil olmak üzere AAOS SDV platformunun kullandığı tüm dilleri destekler.

Bu sayfada yalnızca SDV'ye özel kurulum ele alınmaktadır. Genel ASfP özellikleri ve iş akışları hakkında daha fazla bilgi edinmek için Android Studio for Platform sayfasına bakın.

ASfP yalnızca x86-64 CPU'lara sahip 64 bit Linux'ta çalışır. ASfP (~/Workspace/asfp-project), Cuttlefish, vsidlc ve ~/Workspace/aaos-26q2 adresindeki derlenmiş çift sanal makine hedeflerinin önceden yapılandırılmış olarak sunulduğu Google Cloud Workstations'da önceden oluşturulmuş bir Android 17 bulut iş istasyonu başlatabilir veya bunu yerel ya da kendi kendine yönetilen bir Linux iş istasyonuna yükleyebilirsiniz. Daha fazla bilgi için Bulut geliştirme bölümüne bakın.

ASfP'yi yükleme

ASfP, varsayılan olarak maksimum 30 GB yığın boyutuna sahiptir. Platformun tamamını dizine eklemek çok fazla bellek kullanır. Özellikle aynı makinede birden fazla sanal makine Cuttlefish cihazı çalıştırıyorsanız bu durum daha da belirginleşir. Projenizin kapsamını üzerinde çalıştığınız dizinlerle sınırlı tutun ve gerekirse ASfP bellek ayarlarında maksimum yığın boyutunu ayarlayın.

ASfP, IDE içi otomatik güncellemeleri destekler. Daha fazla bilgi için Platform için Android Studio'yu güncelleme başlıklı makaleyi inceleyin. ASfP'yi indirme ve yükleme, sistem gereksinimlerini kontrol etme hakkında daha fazla bilgi için Android Studio for Platform'u yükleme başlıklı makaleyi inceleyin.

SDV projesi oluşturma

Başlamadan önce AAOS SDV ödeme işleminizi ilk kullanıma hazırlayın, senkronize edin ve derleyin. Ödeme sayfanızı ayarlama hakkında daha fazla bilgi için Kod konumu ve İndirme, derleme ve çalıştırma bölümlerine bakın.

SDV projesi oluşturmak için aşağıdaki adımları uygulayın:

  1. ASfP'de yeni bir proje oluşturun ve depo çıkışı olarak AAOS SDV çıkışınızın kökünü seçin. Sihirbaz adımları hakkında daha fazla bilgi için Proje oluşturma veya içe aktarma başlıklı makaleyi inceleyin.
  2. ASfP projeyi oluşturduktan sonra ASfP > Project > Open Config'i (ASfP > Proje > Yapılandırmayı Aç) seçerek .asfp-project dosyasını açın.
  3. Dosyanın içeriğini aşağıdaki örnekle değiştirin ve ardından repo değerini ödeme işleminizin yoluna ayarlayın (Android 17'de aosp_cf_x86_64_sdv_core-aosp_current-userdebug değerini sdv_core_cf-aosp_current-userdebug ile değiştirin):

    repo: /path/to/sdv_source
    lunch: aosp_cf_x86_64_sdv_core-aosp_current-userdebug
    directories:
      include:
        -   system/software_defined_vehicle/samples
    other_languages:
      -   rust
    
  4. Çalıştığınız alan için lunch ve directories değerlerini güncelleyin. Dizine ekleme ve senkronizasyonun hızlı olması için yalnızca aktif olarak değiştirdiğiniz dizinleri dahil edin. Aşağıdaki tabloda, sürüme göre yaygın SDV hedefleri ve dizinleri listelenmiştir:

    SDV geliştirme odağı lunch hedefi (Android 17 QPR2 ve sonraki sürümler) lunch hedefi (Android 17) Önerilenler directories
    SDV hizmet paketleri aosp_cf_x86_64_sdv_core-aosp_current-userdebug sdv_core_cf-aosp_current-userdebug Hizmet kataloğunuz ve paket dizininiz (ör. system/software_defined_vehicle/samples)
    SDV Core platform entegrasyonu aosp_cf_x86_64_sdv_core-aosp_current-userdebug sdv_core_cf-aosp_current-userdebug system/software_defined_vehicle/middleware, system/software_defined_vehicle/automotive_services, device/google/sdv
    SDV IVI'da SDV Ağ Geçidi aosp_cf_x86_64_auto_sdv-aosp_current-userdebug (veya sdv_ivi_cf-aosp_current-userdebug) sdv_ivi_cf-aosp_current-userdebug system/software_defined_vehicle/sdv_gateway, system/software_defined_vehicle/samples/sdv_gateway, packages/services/Car
    SDV Medya'da Ekran Güvenliği aosp_cf_x86_64_sdv_media-aosp_current-userdebug sdv_media_har_cf-aosp_current-userdebug packages/services/display_safety, device/google/sdv, device/google/sdv_display_safety
    SDV IVI'da Güvenlik Ekranı aosp_cf_x86_64_auto_sdv-aosp_current-userdebug (veya sdv_ivi_cf-aosp_current-userdebug) sdv_ivi_cf_ds-aosp_current-userdebug packages/apps/Car/DriverUI, packages/services/display_safety/service

    Yerel platform koduna da göz atmak için other_languages dosyasına cpp ekleyin. Tüm yapılandırma seçenekleri hakkında daha fazla bilgi için Yapılandırma parametreleri başlıklı makaleyi inceleyin.

  5. Değişikliklerinizi uygulamak için ASfP > Sync > Sync Project'i (ASfP > Senkronize et > Projeyi senkronize et) seçin. Senkronizasyon modları (Tam Senkronizasyon, Kısmi Senkronizasyon ve Derlemesiz Senkronizasyon) ve ekibiniz için paylaşılabilir .asfp-project şablonlarını dışa veya içe aktarma hakkında daha fazla bilgi edinmek için Senkronizasyon modları ve Soong araç penceresi ve Paylaşılabilir proje şablonları (dışa ve içe aktarma) başlıklı makaleleri inceleyin.

SDV hizmet paketlerini dağıtma

ASfP, hizmet paketlerinizi içeren bir APEX'i doğrudan çalışan bir SDV cihazına dağıtan bir SDV eklentisi içerir. Eklenti varsayılan olarak devre dışıdır. Kullanmak için Ayarlar > Eklentiler bölümünde SDV eklentisini etkinleştirin. APEX paketleme hakkında daha fazla bilgi için Hizmet paketleri oluşturma ve dağıtma başlıklı makaleyi inceleyin.

Dağıtım şekliniz, APEX'in cihazda zaten mevcut olup olmadığına bağlıdır:

  • APEX zaten yüklüyse değişikliklerinizi doğrudan ASfP'den dağıtabilirsiniz (ASfP APEX, önceden yüklenmiş /product/apex/ paketlerini günceller).
  • APEX yeniyse önce adb remount -R ile aktarın (Android 17 QPR2 ve sonraki sürümlerde), sistem görüntüsünü yeniden oluşturup yeniden başlatın veya APEX'i imzalamak için kullanılan anahtarı önceden yükleyen bir sistem görüntüsü kullanın. Ardından ASfP'den dağıtım yapabilirsiniz.

Hizmet paketi APEX'i dağıtmak için aşağıdaki adımları uygulayın:

  1. Cuttlefish eklentisiyle SDV cihazınızı başlatın. Daha fazla bilgi için Cuttlefish'te SDV cihazlarını çalıştırma başlıklı makaleyi inceleyin.
  2. Hizmet paketinizin apex modülünü içeren Android.bp dosyasını açın (Android 17 QPR2 ve sonraki sürümlerde generated/apex/<apex_name>/Android.bp, Android 17'de apex/Android.bp) ve apex { bloğunun yanındaki cilt payında bulunan Çalıştır simgesini tıklayın.
  3. Açılan menüde Run 'Deploy APEX_NAME' ('Dağıt'ı çalıştır) seçeneğini belirleyin. Ayrıca APEX'i dağıtmadan derleyebilir veya aynı menüden çalıştırma yapılandırmasını değiştirebilirsiniz.

Cuttlefish'te SDV cihazlarını çalıştırma

ASfP, yerel Cuttlefish cihazları oluşturup çalıştıran bir Cuttlefish eklentisi içerir. Eklenti için Cuttlefish ana makine düzenleyicisi gerekir. Ana makine düzenleyici kullanılamıyorsa ASfP, kurulum talimatlarını gösterir.

SDV cihazı oluşturmak için aşağıdaki adımları uygulayın:

  1. Tools > Device Manager'ı (Araçlar > Cihaz Yönetim Paneli) seçin, + simgesini tıklayın ve Create Cuttlefish Device'ı (Cuttlefish Cihazı Oluştur) seçin.
  2. Çoklu sanal makine kurulumu oluşturmak için Standart yapılandırmadan'ı seçin ve kurulumunuz için bir yapılandırma oluşturun veya içe aktarın (ör. SDV IVI ile SDV Core veya Display Safety için SDV IVI ile SDV Media). Tek bir sanal makine oluşturmak için Yerel Android kaynak ağacı çıkışından'ı seçin.

Tüm sanal makine ekranlarını tek bir ekranda görüntülemek ve ek cihaz seçeneklerine erişmek için Cuttlefish araç penceresini kullanın. Açmak için yan paneldeki ... simgesini seçip Cuttlefish'i seçin veya Yardım > İşlem Bul bölümünde Cuttlefish'i arayın. Ekranları Çalışan Cihazlar'da tek tek de görüntüleyebilirsiniz. SDV Core, ekran olmadan çalıştığı için incelemek üzere Logcat ve Terminal'i kullanın.

Hata ayıklama ve test etme

ASfP, C++ ve Rust kodu için yerleşik bir LLDB hata ayıklayıcı içerir. ASfP'de hata ayıklama ve test etme hakkında daha fazla bilgi için Platform kodunda hata ayıklama, Rust kodunda hata ayıklama, atest ile platform kodunu test etme ve LLDB altında cc_test ve rust_test hedeflerinde hata ayıklama başlıklı makaleleri inceleyin.

Hata ayıklayıcıyı bir hizmet paketine eklediğinizde, paketi barındıran işleme ekleyin. İşlem adları <bundle_name>:<instance_name> biçimini kullanır (ör. OrchestratorSampleRustServiceBundle:sample-main-no-conditions). Aşağıdaki komut, eşleşen işlemleri ve işlem kimliklerini listeler:

adb shell ps -A | grep <bundle_name>

Birden fazla cihaza bağlanma ve günlükleri görüntüleme gibi SDV hata ayıklama iş akışları hakkında daha fazla bilgi için SDV'de hata ayıklama başlıklı makaleyi inceleyin.

VSIDL dosyalarını düzenleme

ASfP, ödeme sayfanızın VSIDL dil bilgisini otomatik olarak algılamak için system/software_defined_vehicle/vsidl/language/src/protos/sdv/vsidl/v1/ (syntax.proto) dosyasını inceleyen VSIDL Dil Sunucusu'nu (vsidl-lsp) içerir. Android 17 QPR2 ve sonraki sürümlerde vsidl-lsp, service_bundle tanımlarına ek olarak apex ve host (iç içe yerleştirilmiş vm, orchestration ve service_bundle_instance health ve qos dahil) sistem grafiği bloklarını doğrular. Kataloğunuzu ve sistem grafiğinizi oluşturma hakkında daha fazla bilgi için Otomatik katalog güncellemeleri ve LSP entegrasyonu ile Sistem grafiğini tanımlama başlıklı makaleleri inceleyin. Kataloğunuzda bir CATALOG_UPDATE dosyası varsa düzenleyici, VSIDL dosyaları için aşağıdaki özellikleri sağlar:

  • Canlı doğrulama: Düzenleyici, VSIDL anahtar kelimelerini vurgular ve Sorunlar penceresinde söz dizimi hatalarını, çözümlenmemiş türleri ve VSIDLC doğrulama hatalarını gösterir. Doğrulama kuralları ve hata kodları hakkında daha fazla bilgi için Dil spesifikasyonu bölümüne bakın.
  • Otomatik tamamlama ve dokümanlar: Anahtar kelime, mesaj, hizmet, konu ve kanal önerileri için Ctrl+Boşluk tuşlarına, doküman yorumlarını görüntülemek için Ctrl+Q tuşlarına basabilirsiniz.
  • Gezinme ve biçimlendirme: .vsidl veya .proto tanımlarına gitmek için Ctrl+B, referansları bulmak için Alt+Üst Karakter+F7, dosya yapısını görüntülemek için Ctrl+F12 ve dosyayı biçimlendirmek için Ctrl+Alt+L tuşlarına basabilirsiniz.

Yapay zeka asistanları için SDV bağlamı ekleme

ASfP, Android Studio'da yapay zeka ve Soong derleme ve atest araçları içeren yerleşik bir temsilci içerir. AGENTS.md dosyaları, sürüm denetiminde kaynak kodunuzla birlikte yer aldığından aynı SDV kurallarını ASfP'nin yerleşik temsilcisi ve AGENTS.md dosyasını okuyan komut satırı veya container tabanlı kodlama temsilcileri arasında paylaşabilirsiniz. ASfP'de bir dosya açıkken istem gönderdiğinizde temsilci, ilgili dosyanın dizininden ve üst dizinlerinden AGENTS.md dosyalarını yükler (aynı dizindeki bir GEMINI.md dosyası öncelikli değilse). Etkin dosyaları, sohbet panelinin Bağlam çekmecesindeki AGENTS.md Dosyaları bölümünden doğrulayabilirsiniz. Daha fazla bilgi için Platform için Android Studio ile tanışın ve AGENTS.md dosyalarını kullanarak temsilciyi özelleştirme başlıklı makaleleri inceleyin.

Aşağıdaki şablonlar, SDV projesi oluşturma bölümündeki iş akışları için başlangıç noktaları sağlar.

SDV hizmet paketleri

Android sürümünüzle eşleşen AGENTS.md dosyasını, katalog, oluşturulan ve hizmet kodu klasörlerinizi içeren .asfp-project paket dizinine yerleştirin. Daha fazla bilgi için Sistem grafiğini tanımlama, Ara katman yazılımı oluşturma, Hizmet paketleri oluşturma ve dağıtma, SOME/IP eşleme dosyası yazma ve SDV iletişim yetkilendirmesine genel bakış başlıklı makaleleri inceleyin.

Android 17 QPR2 ve sonraki sürümler

# AAOS SDV service bundle and VSIDL system graph rules

## Source checkout, build, and test
- Sync public AOSP from `-b android-latest-release` (`repo init` syncs all SDV
  repos automatically; pass `-g default,swcar` only when filtering manifest
  groups with `-g`, and never pass `-b main` on public AOSP because `main`
  omits SDV repos)
- Always use 3-part `lunch` targets with `-aosp_current-userdebug` (never 2-part
  `lunch`): `aosp_cf_x86_64_sdv_core-aosp_current-userdebug` or
  `aosp_cf_arm64_sdv_core-aosp_current-userdebug` (`_perf` omits sample
  bundles; `aosp_cf_x86_64_sdv_core_tiny` is the minimal variant)
- Export a distinct `OUT_DIR` per VM terminal before `source build/envsetup.sh`
  and `lunch` when building multiple VMs from one checkout, build modules
  incrementally with Soong (`m <module_name>`, without regenerating
  `super.img`), and run tests with `atest <TestModuleName>` (`rust_test`,
  `rust_test_host`, `cc_test`, or `python_test_host`), without creating
  `Cargo.toml` files or running `cargo`
- In catalog `Android.bp` files, avoid `defaults` on `rust_protobuf` modules
  (`vsidlc` uses a regex parser), include each `.proto` file in at most one
  `rust_protobuf` target, and cover all catalog files in the first `filegroup`
  (`srcs: ["**/*"]`)

## Protobuf, VSIDL system graph, and SOME/IP mapping conventions
- Keep `.proto` files limited to `message`, `enum`, and RPC `service` schemas
  with `sdv/vsidl/v1/annotations.proto` bounds (`variable_type_max_size` on
  `string`/`bytes` and `repeated_field_max_count` on `repeated` fields; `E511`)
- Write VSIDL files in TextProto `VsidlEntry` syntax against
  `system/software_defined_vehicle/vsidl/language/src/protos/sdv/vsidl/v1/syntax.proto`
  (confirm `repeated Apex apex` is present to verify a 26Q4+ checkout):
  declare `service_bundle`, `apex` (`service_bundle_manifest`, plus
  `native_library: "lib<so>"` for C++ `cc_library_shared` bundles), and `host`
  (containing `vm` blocks with `orchestration` and `service_bundle_instance`
  entries for `health` and `qos`) so `vsidlc` generates APEX packaging,
  orchestration, and least-privilege `permissions.textproto` policies
  automatically; isolate `some_ip_mapping` or `vhal_mapping` rules in dedicated
  VSIDL files
- Use `PascalCase` for `service_bundle` names, `snake_case` for
  `build_cfg.target_name`, a globally unique lowercase `package` with at least
  four segments (`com.<org>.sdv.<domain>`; never reuse `com.android.sdv.*` or
  `com.sdv.*`), lowercase dash-case starting with a letter for `topic`,
  `channel`, and instance names, and an even `capacity >= 2` on every
  `publisher`

## Code generation, runtime security, and inner-loop deployment
- Run `vsidlc -c <catalog_dir> -o <output_dir> --services` (or `vsidlc -r <dir>`
  for recursive `CATALOG_UPDATE` regeneration; inspect `E100`-`E700` codes with
  `vsidlc --explain <CODE>`): genrule mode is enabled by default (pass
  `--no-genrule` for static Rust files), Soong rules write under
  `<output_dir>/generated/{rust,apex,vm,services}` (with the main genrule
  `Android.bp` at `<output_dir>/generated/rust/Android.bp`, producing generated
  configs such as `permissions.textproto`, `someip-config.binpb`, and
  `vsidl-config.binpb` at build time), and modifiable handwritten Rust code is
  isolated under `--hwc <path>` (default
  `<output_dir>/hwc/services/<package_path>/<ServiceBundleName>/src/main.rs`) so
  `vsidlc -p` updates `<output_dir>/generated/` without overwriting `hwc/`
- Core SDV agents reside on `/system` (`/system/bin/...`; the SOME/IP broker
  runs as `user system_ext_sdv_someip` and lives in
  `init.aosp_cf_x86_64_sdv_core.rc` or `init.aosp_cf_arm64_sdv_core.rc`).
  Default Cuttlefish authorization (`sdv-cf` `-z=permissions_only`) is
  `PermissionsOnly`: bundles missing `permissions.textproto` are denied at run
  time unless `sdv.authz.enable=acls_only` is set. Health Monitor VM
  configuration (`HealthMonitorConfiguration` from
  `ro.sdv.health_monitor.config_path` or
  `persist.sdv.health_monitor.config_path`) sets per-agent `binder_timeout_ms`
  inside `monitored_agent`
  (`ro.boot.sdv.health_monitor.agent_startup_timeout_sec` was removed). OEM A/B
  custom partitions (`oem_ab/Android.bp`) pass non-sparse
  `$OUT/oem_ab_a.img;$OUT/oem_ab_b.img;$OUT/oem_ab_metadata.img` to
  `cvd create --custom_partition_path`
- In Rust bundles, wait for publisher or RPC server availability before
  creating subscribers or clients, stop active tasks in `on_stop`, and run
  blocking work in `tokio::spawn_blocking`
- Fast CLI inner-loop deployment on `userdebug`/`eng` builds (without bumping
  `apex_manifest.json` `version`): run `adb root && adb remount -R &&
  adb wait-for-device && adb root && adb remount` once on a fresh VM, then on
  each edit run `m <apex_module> &&
  adb push $OUT/product/apex/<apex_module>.apex /product/apex/ && adb reboot`.
  ASfP gutter deploy updates preinstalled `/product/apex/` bundles (new bundles
  require `adb remount -R` or a full image build first). Launch Cuttlefish with
  `sdv-cf create --instance_name=instance1` (or
  `cvd create --config=sdv_core_instance1`) when running sample bundles, and use
  `/data/mydir/` plus `sdv_update_manager_client` when verifying staged OTA
  updates

Android 17

# AAOS SDV service bundle and VSIDL rules (Android 17 (26Q2))

## Build and test
- Pin Android 17 (26Q2) checkouts with `-b android17-release` (or
  `android-17.0.0_r1`). When running outside ASfP, export a distinct `OUT_DIR`
  per VM terminal before `source build/envsetup.sh` and
  `lunch sdv_core_cf-aosp_current-userdebug` when building multiple VM targets
  from one checkout, build modules incrementally with Soong (`m <module_name>`,
  which writes only that module's artifact under `$OUT` without regenerating
  `super.img`), and run tests with `atest <TestModuleName>` (`rust_test`,
  `rust_test_host`, `cc_test`, or `python_test_host`), without creating
  `Cargo.toml` files or running `cargo`
- In catalog `Android.bp` files, avoid `defaults` on `rust_protobuf` modules
  (`vsidlc` uses a regex parser), include each `.proto` file in at most one
  `rust_protobuf` target, and cover all catalog files in the first `filegroup`
  (`srcs: ["**/*"]`)

## Protobuf, VSIDL, and AUTOSAR SOME/IP mapping conventions
- Keep `.proto` files limited to `message`, `enum`, and RPC `service` schemas
  (using `sdv/vsidl/v1/annotations.proto` only for field size bounds), without
  topic names, channel names, or queue capacities
- Write `.vsidl` files in TextProto `VsidlEntry` syntax (`package: "..."`,
  `service_bundle { name: "..." }`, `publisher` or `subscriber` with `message`
  and `topic`, and `server` or `client` with `service` and `channel`, without
  `import` statements; RPCs support unary, client-streaming, and
  server-streaming methods, not bidirectional streaming), and isolate
  `some_ip_mapping` (`sdv_type_mapping` and `someip_service_mapping` for
  AUTOSAR electronic control unit (ECU) `ARXML` or `vsomeip` IDs) or
  `vhal_mapping` rules in dedicated `.vsidl` mapping files so core bundles stay
  transport-independent
- Use `PascalCase` for `service_bundle` names (avoiding Rust, C++, and Java
  keywords), `snake_case` for `build_cfg.target_name`, a globally unique
  lowercase `package` with at least four segments (`com.<org>.sdv.<domain>`;
  never reuse platform-reserved `com.android.sdv.*` or sample `com.sdv.*`
  names), and lowercase dash-case starting with a letter (no consecutive or
  trailing hyphens, underscores, or slashes) for `topic`, `channel`, and
  instance names
- Set `capacity` on every `publisher` to an even integer greater than or equal
  to 2, and pair every `subscriber` and RPC `client` with a matching
  `publisher` or `server` in the catalog or its `-d` dependency catalogs

## Code generation, authorization, and APEX packaging
- Export `ANDROID_BUILD_TOP`, check `CATALOG_UPDATE` for catalog-relative
  `output_path` (such as `".."`), `dependency_catalog_paths` (`-d`), and
  `vsidlc_gen_args`, and run `vsidlc -c <catalog_dir> -o <output_dir>`; omit
  `--services` from `vsidlc_gen_args` and avoid `-p` (`--purge`) or
  `regenerator` when `output_path` holds handwritten `services/` code
- Leave generated files in `generated_rs/`, `apex/`, and `configs/` unmodified
  (except when incrementing `version` in `apex/apex_manifest.json` for iterative
  updates or adding manual authorization policies), and implement Rust logic in
  `services/<ServiceBundleName>/src/main.rs` (even though the initial
  `vsidlc --services` skeleton header says not to edit; C++ bundles do not use
  `vsidlc` C++ codegen and instead use `libsdv_lifecycle_client_cpp`,
  `libsdv_comms_cpp`, and `sdv_service_bundle_metadata` with
  `native_library_path: "lib64/lib<so>.so"` in
  `sdv_service_bundles_manifest.textproto`)
- Keep communications authorization `.textproto` policies in `configs/` aligned
  with every `publisher`, `subscriber`, `server`, and `client` unit (omitting
  `capacity` inside manual authorization `.textproto` `publisher` entries)
  because Soong skips `.textproto` validation at build time and failures surface
  only at runtime
- In Rust bundles, wait for publisher or RPC server availability before
  creating subscribers or clients, stop active tasks in `on_stop`, and run
  blocking work in `tokio::spawn_blocking`
- Generate Rust service bundle APEXes with `vsidlc --apex` (`updatable: true`,
  `min_sdk_version: "35"`, and `product_specific: true` in `apex/Android.bp`,
  never `vendor: true` or `soc_specific: true`, with matching unique `name` and
  `version` >= 1 in `apex_manifest.json`), stage iterative CLI updates on
  `sdv_core_cf` by incrementing `version`, building `m <apex_module>`, running
  `adb root` (passing `-s 0.0.0.0:6520` when multiple VMs run), pushing the
  APEX to `/data/mydir/`, and invoking `sdv_update_manager_client` from
  `/apex/com.android.sdv.sample.update_manager.client/bin/`
  (`prepare service-bundle`, `activate`, `adb reboot`, `status`, `commit`),
  flush writes with `adb reboot` before `cvd stop` and resume stopped VMs with
  the matching `cvd start` or `sdv-cf start --instance_name=instance1` (through
  `instance3`) command (running `cvd remove` before `cvd create` when resetting
  overlays), and do not set `supportsRebootlessUpdate: true` or run
  `adb install --force-non-staged` because SDV APEX updates require a reboot

SDV IVI'da SDV Ağ Geçidi

Bu AGENTS.md dosyasını IVI istemci modülü dizininize veya system/software_defined_vehicle/sdv_gateway/ dizinine yerleştirin. Daha fazla bilgi için IVI'da SDV Gateway'i kullanma başlıklı makaleyi inceleyin.

# AAOS SDV Gateway on SDV IVI rules

- When running outside ASfP, export a distinct `OUT_DIR` per VM terminal before
  `source build/envsetup.sh` and
  `lunch aosp_cf_x86_64_auto_sdv-aosp_current-userdebug` (or
  `sdv_ivi_cf-aosp_current-userdebug` on Android 17 QPR2 (26Q4), where
  `ENABLE_SDV_INTEGRATION` and Display Safety are enabled by default; on
  Android 17 (26Q2), use `sdv_ivi_cf-aosp_current-userdebug`) when building
  alongside SDV Core (`aosp_cf_x86_64_sdv_core-aosp_current-userdebug`, or
  `sdv_core_cf-aosp_current-userdebug` on Android 17 (26Q2)), build IVI modules
  incrementally with Soong (`m <module_name>`, staging updatable IVI APEXes such
  as `com.oem.sdv.authz` with `adb install --staged` and `adb reboot`, passing
  `-s 0.0.0.0:6521` when a second VM runs alongside `0.0.0.0:6520`, or running
  `m` when updating partition files), resume stopped Cuttlefish VMs with the
  matching `cvd start` (with `--group_name` when multiple groups exist) or
  `sdv-cf start --instance_name=instance2` command after flushing writes with
  `adb reboot`, and run verification with `atest <TestModuleName>`
- On `android-latest-release` (Android 17 QPR2 (26Q4) and higher),
  `libsdvgatewayclient` connects directly to SDV agents without a separate
  `sdv_gateway` daemon. For native C or C++ IVI clients (including vehicle
  hardware abstraction layer (VHAL) integrations), link `libsdvgatewayclient`
  (`#include "libsdvgatewayclient.h"`); for in-tree system Java or Kotlin
  clients, use `libsdvgatewayclient-java`, `libsdvgatewayclient-java-sdk.stubs`,
  `libsdvgatewayclient-java-sdk`, and `com.android.sdv.gateway.client`, and
  declare
  `<uses-library android:name="libsdvgatewayclient-java-sdk" android:required="true" />`
  in `AndroidManifest.xml`
- Start the Binder thread pool before calling `ASDVGateway_Client_new`, and
  call `ASDVGateway_Client_initComms` (or `SdvGatewayClient.initComms`) before
  any service discovery, data tunnel, or RPC calls
- Check `ASDVGateway_Client_isRpcAvailable` or
  `ASDVGateway_Client_isProcessBoundToSdvRpcNetworkInterface` before opening
  RPC sockets on early boot, treat `ASDVGateway_StatusCode_OK` with null
  `ASDVGateway_RpcCredentials_t` as insecure `UNLOCKED` boot mode, and free
  non-null credentials with `ASDVGateway_Client_deleteRpcCredentials`
- Grant `sdv_gateway_client_domain(<domain>)` in SELinux (do not add
  `binder_use` on `/vendor` daemons, which violates Treble `neverallow`; add
  `group inet` on native init services, and `INTERNET` plus
  `CONNECTIVITY_USE_RESTRICTED_NETWORKS` privapp permissions for system Java
  RPC clients)

Güvenlik ayarlarını göster

Bu AGENTS.md dosyasını packages/services/display_safety/ dizinine veya gösterge paneli uygulama dizininize yerleştirin. Daha fazla bilgi için Display Safety'yi kullanmaya başlama, HAR platform soyutlama katmanı, Güvenlik tasarımı araç zinciri ve DriverUI sayfalarını inceleyin.

# AAOS Display Safety partner integration rules

- Display Safety spans two guest VMs with separate `lunch` targets: keep
  safety-critical telltales, gauges, camera views, chimes, and early-boot or
  fallback placeholders in the Rust high availability renderer (HAR) and safety
  monitor on SDV Media (`aosp_cf_x86_64_sdv_media-aosp_current-userdebug` on
  `android-latest-release`, or `sdv_media_har_cf-aosp_current-userdebug` on
  Android 17 (26Q2)), and build non-safety cluster UI on SDV IVI
  (`aosp_cf_x86_64_auto_sdv-aosp_current-userdebug`, or
  `sdv_ivi_cf-aosp_current-userdebug` on Android 17 QPR2 (26Q4), where Display
  Safety is included by default; use `sdv_ivi_cf_ds-aosp_current-userdebug` on
  Android 17 (26Q2)) using `ClusterHomeManager` (`Cluster2` rather than legacy
  `Cluster1`)
- Implement target OS and hardware subsystems (display, graphics, exterior view
  system (EVS) cameras, audio, user input, and vehicle signals) in a dedicated
  `har-platform-<target>` platform abstraction layer (PAL) crate implementing
  `har-platform-api` traits rather than modifying core `harry` framework crates,
  and verify PAL crates against the HAR platform test suite with `atest`
- Generate safety monitor configurations and telltale inspection artifacts from
  the compiled `.dcf` document and safety configuration JSON
  (`safety-config.json`, specifying top-level `document_id` and `displays`
  entries with `root_node_id` and `states` telltale node mappings) by running
  `/apex/com.google.sdv.display_safety.har/bin/har_design_compiler` with `-c`
  (`--config-file-path`), `-o` (`--artifacts-output-dir`), `--documents-path`,
  and `--fonts-path`, pulling artifacts into
  `packages/services/display_safety/service/harry-prebuilt/data/assets/common/artifacts/`
  rather than hardcoding telltale pixel coordinates
- Because the HAR display plane composites above Android IVI, ensure HAR clears
  the cluster viewport region to `alpha = 0.0` while valid `HeartbeatRequest`
  gRPC messages arrive from IVI, and set opaque pixels in custom HAR OpenGL ES
  surfaces to `alpha = 1.0` (`0xFF`)
- When running outside ASfP, export a distinct `OUT_DIR` per VM terminal
  (`export OUT_DIR=out-media` and `export OUT_DIR=out-ivi`) before
  `source build/envsetup.sh` and `lunch`: on `android-latest-release`, launch
  both VMs directly with `ds_toolkit launch -mb
  $ANDROID_BUILD_TOP/out-media/target/product/aosp_cf_x86_64_sdv_media -ib
  $ANDROID_BUILD_TOP/out-ivi/target/product/sdv_ivi_cf -ht
  $ANDROID_BUILD_TOP/out-media/host/linux-x86` (on Android 17 (26Q2), where
  `ds_toolkit launch` lacks `-ht`, launch VMs individually with `cvd create` or
  run `ds_toolkit gen_config` with `-mb .../target/product/sdv_har_cf` and
  `-ib .../target/product/sdv_ivi_cf`, set `common.host_package`, and run
  `cvd load`), integrate prebuilt cluster APKs through `DriverUIPrebuilt`
  (`overrides: ["DriverUIStubApp"]`), use `adb reboot` for clean VM restarts and
  pass matching `--extra_bootconfig_args` (plus `--display1` on IVI and
  `--group_name` selectors from `cvd fleet`) when resuming stopped VMs with
  `cvd start`, pass `--user 0` to `adb shell am` cluster commands, and note
  that `adb shell dumpsys SurfaceFlinger` on SDV IVI inspects only Android
  layers rather than the overlying HAR plane