SDV ডেভেলপমেন্টের জন্য IDE সেট-আপ করা

Android Automotive OS (AAOS) সফ্টওয়্যার-ডিফাইন্ড ভেহিকল (SDV) প্ল্যাটফর্ম ডেভেলপমেন্টের জন্য Android Studio for Platform (ASfP) হল সাজেস্ট করা ইন্টিগ্রেটেড ডেভেলপমেন্ট এনভায়রনমেন্ট (IDE)। ASfP সেইসব ভাষা সাপোর্ট করে যা AAOS SDV প্ল্যাটফর্ম ব্যবহার করে, এর মধ্যে SDV পরিষেবা বান্ডেলের জন্য Rust অন্তর্ভুক্ত।

এই পৃষ্ঠায় শুধু SDV-নির্দিষ্ট সেট-আপের ব্যাপারে বলা হয়েছে। সাধারণ ASfP ফিচার ও ওয়ার্কফ্লো সম্পর্কে আরও জানতে, Android Studio for Platform দেখুন।

ASfP শুধুমাত্র x86-64 সিপিইউ সহ ৬৪-বিট Linux-এ চলে। আপনি এটি লোকাল বা সেল্ফ-ম্যানেজড Linux ওয়ার্কস্টেশনে ইনস্টল করতে পারেন অথবা Google Cloud Workstations-এ আগে থেকে তৈরি Android 17 ক্লাউড ওয়ার্কস্টেশন লঞ্চ করতে পারেন যেখানে ASfP (~/Workspace/asfp-project), Cuttlefish, vsidlc এবং ~/Workspace/aaos-26q2-এ কম্পাইল করা ডুয়াল-VM টার্গেট আগে থেকে কনফিগার করা থাকে। আরও তথ্যের জন্য, ক্লাউড ডেভেলপমেন্ট দেখুন।

ASfP ইনস্টল করুন

ASfP-এর ডিফল্ট হিপ সাইজ হল ৩০ জিবি। প্ল্যাটফর্ম চেকআউট ইন্ডেক্স করতে প্রচুর মেমরি ব্যবহার হয়, বিশেষ করে যখন আপনি একই মেশিনে মাল্টি-VM Cuttlefish ডিভাইসও চালান। আপনার প্রোজেক্টকে আপনার কাজ করা ডিরেক্টরির মধ্যে সীমাবদ্ধ রাখুন, এবং প্রয়োজন হলে ASfP মেমরি সেটিংসে সর্বোচ্চ হিপ সাইজ অ্যাডজাস্ট করুন।

ASfP-এ অটোমেটিক ইন-IDE আপডেট কাজ করে। আরও তথ্যের জন্য, প্ল্যাটফর্মের জন্য Android Studio আপডেট করুন দেখুন। ASfP ডাউনলোড ও ইনস্টল করা এবং সিস্টেমের প্রয়োজনীয়তা চেক করার ব্যাপারে আরও তথ্য পেতে, প্ল্যাটফর্মের জন্য Android Studio ইনস্টল করুন দেখুন।

SDV প্রোজেক্ট তৈরি করা

শুরু করার আগে আপনার AAOS SDV চেকআউট শুরু, সিঙ্ক এবং তৈরি করুন। আপনার চেক-আউট সেট-আপ করার ব্যাপারে আরও তথ্যের জন্য, কোড লোকেশন এবং ডাউনলোড, তৈরি ও রান করুন দেখুন।

SDV প্রোজেক্ট তৈরি করতে, এইসব ধাপ অনুসরণ করুন:

  1. ASfP-তে নতুন প্রোজেক্ট তৈরি করুন এবং আপনার AAOS SDV চেক-আউটের রুটকে রিপোজিটরি চেক-আউট হিসেবে বেছে নিন। উইজার্ডের ধাপগুলি সম্পর্কে আরও তথ্যের জন্য, প্রজেক্ট তৈরি বা ইমপোর্ট করুন দেখুন।
  2. ASfP প্রোজেক্ট তৈরি করার পরে, .asfp-project ফাইল খুলতে ASfP > প্রোজেক্ট > কনফিগারেশন খুলুন বিকল্প বেছে নিন।
  3. ফাইলের কন্টেন্ট নিম্নলিখিত উদাহরণ দিয়ে পরিবর্তন করুন এবং তারপরে repo-কে আপনার চেকআউটের পাথে সেট করুন (Android 17-এ aosp_cf_x86_64_sdv_core-aosp_current-userdebug-কে sdv_core_cf-aosp_current-userdebug দিয়ে পরিবর্তন করুন):

    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. আপনি যে এলাকায় কাজ করেন তার জন্য lunch এবং directories আপডেট করুন। ইনডেক্সিং ও সিঙ্ক করার প্রসেস দ্রুত রাখতে, শুধুমাত্র সেইসব ডিরেক্টরি অন্তর্ভুক্ত করুন যেগুলি আপনি অ্যাক্টিভভাবে পরিবর্তন করেন। নিম্নলিখিত সারণীতে রিলিজ অনুযায়ী সাধারণ SDV টার্গেট ও ডিরেক্টরির তালিকা দেওয়া হয়েছে:

    SDV ডেভেলপমেন্ট ফোকাস lunch টার্গেট (Android 17 QPR2 ও তার পরবর্তী যেকোনও ভার্সন) lunch টার্গেট (Android 17) directories সাজেস্ট করা হয়েছে
    SDV পরিষেবা বান্ডেল aosp_cf_x86_64_sdv_core-aosp_current-userdebug sdv_core_cf-aosp_current-userdebug আপনার পরিষেবা ক্যাটালগ ও বান্ডেল ডিরেক্টরি, যেমন system/software_defined_vehicle/samples
    SDV Core প্ল্যাটফর্ম ইন্টিগ্রেশন 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-তে SDV গেটওয়ে aosp_cf_x86_64_auto_sdv-aosp_current-userdebug (বা 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 মিডিয়াতে ডিসপ্লে নিরাপত্তা 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-তে ডিসপ্লে নিরাপত্তা aosp_cf_x86_64_auto_sdv-aosp_current-userdebug (বা sdv_ivi_cf-aosp_current-userdebug) sdv_ivi_cf_ds-aosp_current-userdebug packages/apps/Car/DriverUI, packages/services/display_safety/service

    নেটিভ প্ল্যাটফর্ম কোড ব্রাউজ করতে, other_languages-এ cpp যোগ করুন। সব কনফিগারেশন বিকল্প সম্পর্কে আরও জানতে, কনফিগারেশন প্যারামিটার দেখুন।

  5. আপনার করা পরিবর্তনগুলি প্রয়োগ করতে, ASfP > সিঙ্ক করুন > প্রোজেক্ট সিঙ্ক করুন বিকল্প বেছে নিন। সিঙ্ক মোড (সম্পূর্ণ সিঙ্ক, আংশিক সিঙ্ক এবং নো-বিল্ড সিঙ্ক) এবং আপনার টিমের জন্য শেয়ার করা যায় এমন .asfp-project টেমপ্লেট এক্সপোর্ট বা ইমপোর্ট করা সম্পর্কে আরও তথ্যের জন্য, সিঙ্ক মোড এবং Soong টুল উইন্ডো এবং শেয়ার করা যায় এমন প্রোজেক্ট টেমপ্লেট (এক্সপোর্ট এবং ইমপোর্ট) দেখুন।

SDV সার্ভিস বান্ডেল ডিপ্লয় করা

ASfP-তে একটি SDV প্লাগ-ইন অন্তর্ভুক্ত থাকে যা আপনার পরিষেবা বান্ডেল সহ একটি APEX সরাসরি একটি চলমান SDV ডিভাইসে ডেপ্লয় করে। প্লাগ-ইন সাধারণত বন্ধ থাকে। এটি ব্যবহার করতে, সেটিংস > প্লাগ-ইন থেকে SDV প্লাগ-ইন চালু করুন। APEX প্যাকেজিং সম্পর্কে আরও তথ্যের জন্য, পরিষেবা বান্ডেল তৈরি ও ডিপ্লয় করুন নিবন্ধটি দেখুন।

আপনি কীভাবে ডিপ্লয় করবেন তা নির্ভর করে APEX আগে থেকেই ডিভাইসে আছে কিনা তার উপর:

  • APEX আগে থেকেই ইনস্টল করা থাকলে, আপনি ASfP থেকে সরাসরি আপনার পরিবর্তনগুলি ডিপ্লয় করতে পারবেন (ASfP APEX ডিপ্লয়মেন্ট আগে থেকে ইনস্টল করা /product/apex/ বান্ডেল আপডেট করে)।
  • APEX নতুন হলে, প্রথমে adb remount -R (Android 17 QPR2 এবং তার পরবর্তী যেকোনও ভার্সনে) দিয়ে পুশ করুন, সিস্টেম ইমেজ আবার তৈরি ও লঞ্চ করুন অথবা APEX সাইন করার জন্য ব্যবহৃত কী আগে থেকে ইনস্টল করে এমন সিস্টেম ইমেজ ব্যবহার করুন। তারপরে, আপনি ASfP থেকে ডিপ্লয় করতে পারবেন।

পরিষেবা বান্ডেল APEX ডিপ্লয় করতে, এই ধাপগুলি অনুসরণ করুন:

  1. Cuttlefish প্লাগ-ইন সহ আপনার SDV ডিভাইস চালু করুন। আরও তথ্যের জন্য, Cuttlefish-এ SDV ডিভাইস রান করুন নিবন্ধ দেখুন।
  2. আপনার পরিষেবা বান্ডেলের apex মডিউল সহ Android.bp ফাইলটি খুলুন (Android 17 QPR2 এবং তার পরবর্তী ভার্সনে generated/apex/<apex_name>/Android.bp, অথবা Android 17-এ apex/Android.bp) এবং apex { ব্লকের পাশে গাটারের রান আইকনে ক্লিক করুন।
  3. যে মেনু খুলবে, সেখান থেকে 'APEX_NAME ডিপ্লয় করুন' রান করুন বিকল্প বেছে নিন। আপনি ডিপ্লয় না করেই APEX তৈরি করতে পারবেন অথবা একই মেনু থেকে রান কনফিগারেশন পরিবর্তন করতে পারবেন।

Cuttlefish-এ SDV ডিভাইস রান করা

ASfP-তে একটি Cuttlefish প্লাগ-ইন অন্তর্ভুক্ত থাকে যা স্থানীয় Cuttlefish ডিভাইস তৈরি করে এবং চালায়। প্লাগ-ইনের জন্য Cuttlefish হোস্ট অর্কেস্ট্রেটর প্রয়োজন। হোস্ট অর্কিস্ট্রেটর উপলভ্য না থাকলে, ASfP এটি সেট-আপ করার জন্য নির্দেশাবলী দেখায়।

SDV ডিভাইস তৈরি করতে, এইসব ধাপ অনুসরণ করুন:

  1. টুল > ডিভাইস ম্যানেজার বেছে নিন, + চিহ্নে ক্লিক করুন এবং Cuttlefish ডিভাইস তৈরি করুন বিকল্প বেছে নিন।
  2. মাল্টি-VM সেট-আপ তৈরি করতে, ক্যানোনিকাল কনফিগারেশন থেকে বিকল্প বেছে নিন এবং আপনার সেট-আপের জন্য কনফিগারেশন তৈরি বা ইম্পোর্ট করুন, যেমন SDV IVI-এর সাথে SDV Core অথবা ডিসপ্লে নিরাপত্তার জন্য SDV IVI-এর সাথে SDV Media। একটি VM তৈরি করতে, পরিবর্তে লোকাল Android সোর্স ট্রি চেকআউট থেকে বিকল্প বেছে নিন।

একটি স্ক্রিনে সব VM ডিসপ্লে দেখতে এবং অতিরিক্ত ডিভাইস বিকল্প অ্যাক্সেস করতে, Cuttlefish টুল উইন্ডো ব্যবহার করুন। এটি খুলতে, সাইড প্যানেলে ... আইকন বেছে নিন এবং Cuttlefish বেছে নিন অথবা সহায়তা > অ্যাকশন খুঁজুন বিকল্পে গিয়ে Cuttlefish সার্চ করুন। এছাড়াও, আপনি চালু থাকা ডিভাইস-এ আলাদা আলাদা ডিসপ্লে দেখতে পারবেন। SDV Core ডিসপ্লে ছাড়াই চলে, তাই এটি পরীক্ষা করতে Logcat এবং Terminal ব্যবহার করুন।

ডিবাগ ও টেস্ট করা

ASfP-তে C++ ও Rust কোডের জন্য বিল্ট-ইন LLDB ডিবাগার অন্তর্ভুক্ত থাকে। ASfP-তে ডিবাগিং ও টেস্টিং সম্পর্কে আরও তথ্যের জন্য, প্ল্যাটফর্ম কোড ডিবাগ করুন, Rust কোড ডিবাগ করুন, atest-এর মাধ্যমে প্ল্যাটফর্ম কোড টেস্ট করুন এবং LLDB-এর অধীনে cc_test ও rust_test টার্গেট ডিবাগ করুন দেখুন।

আপনি যখন কোনও পরিষেবা বান্ডেলে ডিবাগার অ্যাটাচ করেন, তখন এটি হোস্ট করে এমন প্রসেসে অ্যাটাচ করুন। প্রসেসের নাম <bundle_name>:<instance_name> ফর্ম্যাট ব্যবহার করে, যেমন OrchestratorSampleRustServiceBundle:sample-main-no-conditions। নিম্নলিখিত কমান্ড ম্যাচিং প্রসেস ও সেগুলির প্রসেস আইডি তালিকাভুক্ত করে:

adb shell ps -A | grep <bundle_name>

একাধিক ডিভাইসে কানেক্ট করা এবং লগ দেখার মতো SDV ডিবাগিং ওয়ার্কফ্লো সম্পর্কে আরও তথ্যের জন্য, SDV ডিবাগ করুন দেখুন।

VSIDL ফাইল এডিট করুন

ASfP-তে VSIDL ল্যাঙ্গুয়েজ সার্ভার (vsidl-lsp) অন্তর্ভুক্ত থাকে, যা system/software_defined_vehicle/vsidl/language/src/protos/sdv/vsidl/v1/ (syntax.proto) চেক করে আপনার চেকআউটের VSIDL ব্যাকরণ অটোমেটিক শনাক্ত করে। Android 17 QPR2 এবং এর পরবর্তী যেকোনও ভার্সনে, vsidl-lsp apex এবং host (নেস্টেড vm, orchestration, এবং service_bundle_instance health এবং qos সহ) সিস্টেম গ্রাফ ব্লক যাচাই করে, এর সাথে service_bundle-এর সংজ্ঞা যাচাই করে। আপনার ক্যাটালগ ও সিস্টেম গ্রাফ সেট-আপ করার ব্যাপারে আরও তথ্যের জন্য, অটোমেটিক ক্যাটালগ আপডেট ও LSP ইন্টিগ্রেশন এবং সিস্টেম গ্রাফের সংজ্ঞা দিন দেখুন। আপনার ক্যাটালগে CATALOG_UPDATE ফাইল থাকলে, এডিটর VSIDL ফাইলের জন্য নিম্নলিখিত ফিচার প্রদান করে:

  • লাইভ যাচাইকরণ: এডিটর VSIDL কীওয়ার্ড হাইলাইট করে এবং সমস্যা উইন্ডোতে সিনট্যাক্স সংক্রান্ত সমস্যা, সমাধান না হওয়া টাইপ এবং VSIDLC যাচাইকরণ সংক্রান্ত সমস্যা দেখায়। যাচাইকরণ সংক্রান্ত নিয়ম ও সেগুলির ত্রুটি কোড সম্পর্কে আরও জানতে, ভাষা সংক্রান্ত স্পেসিফিকেশন দেখুন।
  • অটো-কমপ্লিশন ও ডকুমেন্টেশন: আপনি কীওয়ার্ড, মেসেজ, পরিষেবা, বিষয় ও চ্যানেল সংক্রান্ত সাজেশন পেতে Ctrl+Space প্রেস করতে পারেন এবং ডকুমেন্টেশন কমেন্ট দেখতে Ctrl+Q প্রেস করতে পারেন।
  • নেভিগেশন ও ফর্ম্যাটিং: আপনি .vsidl বা .proto-এর সংজ্ঞায় যেতে Ctrl+B, রেফারেন্স খুঁজতে Alt+Shift+F7, ফাইলের স্ট্রাকচার দেখতে Ctrl+F12 এবং ফাইল ফর্ম্যাট করতে Ctrl+Alt+L প্রেস করতে পারেন।

AI অ্যাসিস্ট্যান্টের জন্য SDV প্রসঙ্গ যোগ করুন

ASfP-তে Android Studio-তে AI এবং Soong বিল্ড ও atest টুলের সাথে একটি বিল্ট-ইন এজেন্ট অন্তর্ভুক্ত রয়েছে। ভার্সন কন্ট্রোলে আপনার সোর্স কোডের পাশাপাশি AGENTS.md ফাইল থাকে বলে, আপনি ASfP-এর বিল্ট-ইন এজেন্ট এবং কমান্ড-লাইন বা কন্টেনার-ভিত্তিক কোডিং এজেন্ট জুড়ে একই SDV নিয়ম শেয়ার করতে পারেন যা AGENTS.md পড়ে। আপনি ASfP-তে খোলা কোনও ফাইলের সাথে প্রম্পট জমা দিলে, এজেন্ট সেই ফাইলের ডিরেক্টরি এবং তার পেরেন্ট ডিরেক্টরি থেকে AGENTS.mdটি ফাইল লোড করে (যদি না একই ডিরেক্টরিতে থাকা কোনও GEMINI.md ফাইলকে অগ্রাধিকার দেওয়া হয়) এবং আপনি চ্যাট প্যানেলের কন্টেক্সট ড্রয়ারে AGENTS.mdটি ফাইল-এর অধীনে অ্যাক্টিভ ফাইলগুলি যাচাই করতে পারবেন। আরও তথ্যের জন্য, Meet Android Studio for Platform এবং AGENTS.md ফাইল ব্যবহার করে এজেন্ট কাস্টমাইজ করুন দেখুন।

নিম্নলিখিত টেমপ্লেটগুলি SDV প্রোজেক্ট তৈরি করুন-এ ওয়ার্কফ্লোর জন্য শুরুর পয়েন্ট প্রদান করে।

SDV পরিষেবা বান্ডেল

আপনার Android রিলিজের সাথে ম্যাচ করে এমন AGENTS.md ফাইলটি বান্ডেল ডিরেক্টরিতে রাখুন যা .asfp-project-এ অন্তর্ভুক্ত এবং আপনার ক্যাটালগ, জেনারেট করা এবং পরিষেবা কোড ফোল্ডারগুলি এনক্লোজ করে। আরও তথ্যের জন্য, সিস্টেম গ্রাফ নির্ধারণ করুন, মিডলওয়্যার জেনারেট করুন, সার্ভিস বান্ডেল তৈরি ও ডিপ্লয় করুন, SOME/IP ম্যাপিং ফাইল লিখুন এবং SDV কমিউনিকেশন অথরাইজেশন ওভারভিউ দেখুন।

Android 17 QPR2 এবং এর পরবর্তী যেকোনও ভার্সন

# 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 both `sdv_someip_broker_agent` and
  `sdv_someip_stack_agent` live in `init.aosp_cf_x86_64_sdv_core.rc` or
  `init.aosp_cf_arm64_sdv_core.rc`, with the stack started on
  `dev.bootcomplete=1 && ro.boot.sdv.someip.enable=true`). 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-তে SDV গেটওয়ে

এই AGENTS.md ফাইলটি আপনার IVI ক্লায়েন্ট মডিউল ডিরেক্টরি বা system/software_defined_vehicle/sdv_gateway/-এ রাখুন। আরও তথ্যের জন্য, IVI-তে SDV গেটওয়ে ব্যবহার করুন দেখুন।

# 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)

নিরাপত্তা সংক্রান্ত তথ্য দেখানো

এই AGENTS.md ফাইলটি packages/services/display_safety/ বা আপনার ইনস্ট্রুমেন্ট ক্লাস্টার অ্যাপ ডিরেক্টরিতে রাখুন। আরও তথ্যের জন্য, ডিসপ্লে সেফটি ব্যবহার শুরু করুন, HAR প্ল্যাটফর্ম অ্যাবস্ট্রাকশন লেয়ার, সেফটি ডিজাইন টুলচেন এবং DriverUI দেখুন।

# 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