I am trying to extend the implementation of HAL functionality. It seems that once HAL interface is published, we cannot made any changes in that version. So I tried to do interface inheritance by referring here https://source.android.com/devices/architecture/hidl-java#extensions.
IA.HAL File
interface IA{
Amethod();
};
ClientService.Java file
IA ia = IA.getService(true);
//ia is not null. Working fine
For extension, I created a new HAL file which involves interface inheritance as below.
IB.HAL file
import IA;
interface IB extends IA{
Bmethod()
};
ClientService.Java file
IA ia = IA.getService(true);
//ia is not null. Working fine
IB ib = IB.castFrom(ia);
**// ib is null. Issue**
Any idea what I am doing wrong. Thanks in advance.
A HAL server is identified by its interface name and its instance name. Could it be that the server providing
IA
is still running?You might have the following setup at the moment:
/system/bin/ia-service
IA
"default"
/vendor/bin/ib-service
IB
"default"
The default for
getService
is to use"default"
as instance.Solutions:
ia-service
is not started."new"
) by callingregisterAsService("new")
inib-service
and get the instance with ```getService("new", true)````in your client.