How to check if two Android proxy objects are equal?

I have a question regarding a binder for Android. If I understand correctly, a Binder can be transferred between processes. On the service side, there is a Binder object (source object). On the client side (in a separate process), there is a BinderProxy object that handles the sorting of AIDL data.

My question is: how do you check if two BinderProxy objects are equal? Equally, I mean that they refer to the same Binder object during maintenance. Is it possible to use the equals () method? Do BinderProxy objects have the same memory address as the original Binder objects?

Thank!

Edit:

In response to a comment by David Wasser:

The reason I need to do this is a little difficult to explain, but let me see if I can explain it clearly -

The remote service offers the AIDL API (which the client receives by receiving the IBinder in onServiceConnected). The AIDL API, among other things, contains two methods -

IBinder getInterface (String interfaceName);

void releaseInterface (middleware IBinder);

The idea is that client applications can request a remote service for binders for different interfaces. The interface dex code and their bindings are loaded into the service dynamically and are not known in advance. The service provides these 2 AIDL methods for client applications to access these middleware components of dynamically loaded interfaces based on the interface name.

, App1 App2. "binder1 = getInterface" ( "SomeInterface1" ); "SomeInterface1". , "releaseInterface (binder1)"; dex .

dex , App1 App2 . , . ( {Binder} == > { }). getInterface(), . releaseInterface (binder1), . , 1 .

, ( ) (- , getInterface()) ( releaseInterface() - ??).

, App1 App2 ( ) . .

, ! .

+5
2

- asBinder(), IBinder, -.

, , LocationManagerService.java Android / ILocationListener.

+7

, . BinderProxy - android.os.Binder. . , Binder , Binder BinderProxy, . , . , .

0

All Articles