Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use inheritance in AIDL interfaces?

I want to share an interface via AIDL with client applications. I have been getting compile time errors. The code snippet is :-

interface ChildListener extends ParentListener {

    public void onUpdate(Class1  c1);
}

AIDL Set(All in the same package) -->

ChildListener.aidl - Contains the above code.

Class1.aidl - Declares Class1 as parcelable. Definition of Class1 implements parcelable.

ParentListener.aidl - Declares ParentListener.

Errors -->

I am getting compile time errors (while compiling service)

1. syntax error don't know what to do with "extends"
2. syntax error don't know what to do with "ParentListener "

It seems that we can not use inheritance in AIDL interfaces? Or is it that I am missing something here. Any pointers would be appreciated.

Best Regards

like image 699
Robin Avatar asked Dec 14 '11 08:12

Robin


1 Answers

You cannot use extend when you declare aidl interface. Aidl interface is of special format. It even does not correspond to java interface declaration.

If you specify what you want to do we will try to point you how to solve the problem.

like image 182
Yury Avatar answered Oct 26 '22 02:10

Yury