Skip to content

Add new HIDL interface in Android Pie (9.0.0) # Treble complaiant

Notifications You must be signed in to change notification settings

nayobix/Add-new-HIDL-interface-in-Android-Pie

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Add new HIDL interface in Android Pie (9.0.0) # Treble complaiant

Before starting the addition of the new HIDL interface you should source and lunch your environment, and compile it in order to build the needed HIDL tools

$ cd ~/repo
$ . build/envsetup.sh
$ lunch <product>
$ make -j64
  1. Create the new HIDL interface directory, method and types definitions
$ cd ~/repo # This is the root of Android Pie repo
$ mkdir -p hardware/interfaces/nayobixlabs/1.0
$ cd hardware/interfaces/nayobixlabs/1.0
$ vim INayobixlabs.hal
$ vim types.hal
$ cd ../../../../
$ cd hardware/interfaces
$ ./update-makefiles.sh
  1. Setup env variables for the new HIDL interface
$ cd ~/repo
$ PACKAGE=android.hardware.nayobixlabs@1.0
$ LOC=hardware/interfaces/nayobixlabs/1.0/default/
  1. Generate the defaut implementation:
$ cd ~/repo
$ hidl-gen -o $LOC -Lc++-impl -randroid.hardware:hardware/interfaces \
    -randroid.hidl:system/libhidl/transport $PACKAGE
  1. Generate Android.bp for default implementation
$ hidl-gen -o $LOC -Landroidbp-impl -randroid.hardware:hardware/interfaces \
    -randroid.hidl:system/libhidl/transport $PACKAGE
  1. Edit device/<vendor>/<product>/manifest.xml file
Example:
Add the new HIDL interface to device/generic/goldfish/manifest.xml
  1. After adding it to the device manifest file, then we should build Android again.

  2. Check that the new HIDL interface is on the device and it is running:


$ adb shell lshal | grep nayobixlabs
android.hardware.nayobixlabs@1.0::I*/* (/vendor/lib/hw/)         N/A        N/A

$ adb shell ls /vendor/lib/hw | grep nayobixlabs
android.hardware.nayobixlabs@1.0-impl.so

Directory structure

.
├── device
│   └── generic
│       └── goldfish
│           └── manifest.xml
├── nayobixlabs # Created by us in hardware/interfaces
│   └── 1.0 # Created by us in hardware/interfaces
│       ├── Android.bp # Autogenerated by hidl-gen
│       ├── default # Autogenerated by hidl-gen
│       │   ├── Android.bp # Autogenerated by hidl-gen
│       │   ├── Nayobixlabs.cpp # Autogenerated by hidl-gen
│       │   └── Nayobixlabs.h # Autogenerated by hidl-gen
│       ├── INayobixlabs.hal  # Created by us
│       └── types.hal # Created by us
└── README.md

About

Add new HIDL interface in Android Pie (9.0.0) # Treble complaiant

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages