| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package android.os; |
| 18 |
|
| 19 |
import android.compat.annotation.UnsupportedAppUsage; |
| 20 |
|
| 21 |
import libcore.util.NativeAllocationRegistry; |
| 22 |
|
| 23 |
|
| 24 |
public class HwRemoteBinder implements IHwBinder { |
| 25 |
private static final String TAG = "HwRemoteBinder"; |
| 26 |
|
| 27 |
private static final NativeAllocationRegistry sNativeRegistry; |
| 28 |
|
| 29 |
@UnsupportedAppUsage |
| 30 |
public HwRemoteBinder() { |
| 31 |
native_setup_empty(); |
| 32 |
|
| 33 |
sNativeRegistry.registerNativeAllocation( |
| 34 |
this, |
| 35 |
mNativeContext); |
| 36 |
} |
| 37 |
|
| 38 |
@Override |
| 39 |
public IHwInterface queryLocalInterface(String descriptor) { |
| 40 |
return null; |
| 41 |
} |
| 42 |
|
| 43 |
@Override |
| 44 |
public native final void transact( |
| 45 |
int code, HwParcel request, HwParcel reply, int flags) |
| 46 |
throws RemoteException; |
| 47 |
|
| 48 |
public native boolean linkToDeath(DeathRecipient recipient, long cookie); |
| 49 |
public native boolean unlinkToDeath(DeathRecipient recipient); |
| 50 |
|
| 51 |
private static native final long native_init(); |
| 52 |
|
| 53 |
private native final void native_setup_empty(); |
| 54 |
|
| 55 |
static { |
| 56 |
long freeFunction = native_init(); |
| 57 |
|
| 58 |
sNativeRegistry = new NativeAllocationRegistry( |
| 59 |
HwRemoteBinder.class.getClassLoader(), |
| 60 |
freeFunction, |
| 61 |
128 ); |
| 62 |
} |
| 63 |
|
| 64 |
private static final void sendDeathNotice(DeathRecipient recipient, long cookie) { |
| 65 |
recipient.serviceDied(cookie); |
| 66 |
} |
| 67 |
|
| 68 |
private long mNativeContext; |
| 69 |
|
| 70 |
@Override |
| 71 |
public final native boolean equals(Object other); |
| 72 |
@Override |
| 73 |
public final native int hashCode(); |
| 74 |
} |