How to know whether my HIDL Hal version is compatible with future Android versions

201 Views Asked by At

Let's say i am developing a device with android version 11. For example, at the time of development i used audio hal version 6.0 and graphics composer(HWC) version 2.1 and my device is treble compatible. How can i assure that my HAL's(audio & graphics) will support for future android versions(android 12/android 13) without modifications. Also how can i know whether the HAL versions that i used while in development(Android 11 in this case) are deprecated or not in upcomming android version(android 12 here).

1

There are 1 best solutions below

0
On

Don't worry about this. The future release will be compatible with the old hal. The project treble aims to do this.

Android will try the best to be compatible the old hal. Let's take the call setColorMode to hwc hal as example. It add extras code to be compatible with old hal.

Error Composer::setColorMode(Display display, ColorMode mode,
        RenderIntent renderIntent)
{
    hardware::Return<Error> ret(kDefaultError);
    if (mClient_2_3) {
        ret = mClient_2_3->setColorMode_2_3(display, mode, renderIntent);
    } else if (mClient_2_2) {
        ret = mClient_2_2->setColorMode_2_2(display, static_cast<types::V1_1::ColorMode>(mode),
                                            renderIntent);
    } else {
        ret = mClient->setColorMode(display,
                static_cast<types::V1_0::ColorMode>(mode));
    }
    return unwrapRet(ret);
}