-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/dummy hal #13
base: hal_example
Are you sure you want to change the base?
Conversation
1a30088
to
aa1085b
Compare
6c5dc4d
to
42d7557
Compare
cc_defaults{ | ||
name: "profusion.hardware.dummy_car_info_hal-defaults", | ||
shared_libs: [ | ||
"profusion.hardware.dummy_car_info_hal-V1-ndk", | ||
"libbase", | ||
"liblog", | ||
"libbinder_ndk", | ||
], | ||
vendor: true, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would honestly avoid using defaults 😅. Take a look at my message here: https://profusion-mobi.slack.com/archives/C0714A7UT0D/p1736878171974269
class DummyCarInfoHAL : public BnDummyCarInfoHAL { | ||
virtual ndk::ScopedAStatus getCarInfo(CarInfo* carInfo) override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is private, is that on purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I didn't understand. What is private here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The method is private. When you don't specify a visibility in class
fields in C++, they're private by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that makes sense. In that case, it's okay to stay private. This method will only be invoked through the HAL interface.
LOG(INFO) << "DummyHAL: Main HAL initialization failed"; | ||
return EXIT_FAILURE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed? Won't this always return a failure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I understand about this type of service binding, ABinderProcess_joinThreadPool should never be completed, so the expected behavior is that it does not reach this return.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like eventually it would exit (even if at the end of the process), but I'm not very familiar with Android so you may be right
java_defaults { | ||
name: "dummyCarInfo_defaults", | ||
static_libs: [ | ||
"profusion.hardware.dummy_car_info_hal-V1-java", | ||
], | ||
} | ||
|
||
android_app { | ||
name: "dummyCarInfoService", | ||
defaults: ["dummyCarInfo_defaults"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto about defaults
dex_preopt: { | ||
enabled: false, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property supposedly reduces AOSP build time but also reduces app performance at the emulator. As our app is very simple and just a sample, I think it's a fair trade
srcs: [ | ||
"src/com/profusion/dummyCarInfo/DummyCarInfoManager.java", | ||
], | ||
unsafe_ignore_missing_latest_api: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I brought this from hello-world-service. When I was migrating from android 9 to android 14 I faced some problems with apis, and I found a topic at the java_sdk_library documentation about this one. But maybe isn't necessary anymore, since I figured out the problem with m update-api
. I will try it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, stills the same. If I remove this property, I get this error:
error: packages/services/profusion/dummy-car-info-service/Android.bp:33:1: "DummyCarInfoManager" depends on undefined module "DummyCarInfoManager.api.public.latest".
Or did you mean ["CarFrameworkResVisualThemePinkRROBase" "CarServiceMultiDisplayOverlayEmulator" "CarServiceOverlayEmulatorMediaGoogle" "CarSystemUISystemBarPersistcyImmersive" "mediaresourcemanager_fuzzer_defaults"]?
error: packages/services/profusion/dummy-car-info-service/Android.bp:33:1: "DummyCarInfoManager" depends on undefined module "DummyCarInfoManager-removed.api.public.latest".
Or did you mean ["CarEmulationAutomotiveUltrawideCutoutOverlay" "CarSystemUISystemBarPersistcyImmersiveWithNav"]?
error: packages/services/profusion/dummy-car-info-service/Android.bp:33:1: "DummyCarInfoManager" depends on undefined module "DummyCarInfoManager.api.system.latest".
Or did you mean ["CarFrameworkResVisualThemePinkRROBase" "CarServiceMultiDisplayOverlayEmulator" "CarServiceOverlayEmulatorMediaGoogle" "CarSystemUISystemBarPersistcyImmersive" "mediaresourcemanager_fuzzer_defaults"]?
error: packages/services/profusion/dummy-car-info-service/Android.bp:33:1: "DummyCarInfoManager" depends on undefined module "DummyCarInfoManager-removed.api.system.latest".
Or did you mean ["CarEmulationAutomotiveUltrawideCutoutOverlay" "CarSystemUISystemBarPersistcyImmersiveWithNav"]?
fatal errors encountered
I think it is related to the fact that I am defining a new SDK and not extending from a module that already exists at AOSP.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is because for java_sdk_libraries
, you need to define filegroups for your api, create an api directory and create .txt
files that represent your api. I learned this while going through the BMW codebase. I'll share an example on Slack
42d7557
to
71f61a2
Compare
71f61a2
to
e9adaba
Compare
- Create a new service to interact with HAL service to get car info - Create a Manager to handle the service binding and communication - Add Manager to sdk-addon
- Instead of using the Service directly, the example app will use the Manager to get the car info.
e9adaba
to
68f9697
Compare
68f9697
to
0678217
Compare
Description
This PR introduces a simple HAL implementation to the project, which provides some dummy data about a car. The goal is to understand and document the steps required to develop such a feature, as it is quite important and common in Android development. The idea is to eventually add a PR that improves or creates a new HAL using the SOME/IP and CommonAPI libraries to address a more typical demand in AOSP projects.
Visual reference