Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 460ff141 authored by Andreas Gampe's avatar Andreas Gampe
Browse files

BinderProxy: Fix up differences

Fix up resolves to minimize differences to internal code.

Test: m
Change-Id: Idbacb6ad14c43aff8030d70b5e17427b86e92d6e
Merged-In: I4e06b3f93e30ed1c7868ec9e018709a7e796e441
parent c1493b28
Loading
Loading
Loading
Loading
+19 −19
Original line number Diff line number Diff line
@@ -314,7 +314,8 @@ public final class BinderProxy implements IBinder {
                new ArrayList[MAIN_INDEX_SIZE];
    }

    private static ProxyMap sProxyMap = new ProxyMap();
    @GuardedBy("sProxyMap")
    private static final ProxyMap sProxyMap = new ProxyMap();

    /**
     * Simple pair-value class to store number of binder proxy interfaces live in this process.
@@ -364,8 +365,6 @@ public final class BinderProxy implements IBinder {

    /**
     * Return a BinderProxy for IBinder.
     * This method is thread-hostile!  The (native) caller serializes getInstance() calls using
     * gProxyLock.
     * If we previously returned a BinderProxy bp for the same iBinder, and bp is still
     * in use, then we return the same bp.
     *
@@ -377,6 +376,7 @@ public final class BinderProxy implements IBinder {
     */
    private static BinderProxy getInstance(long nativeData, long iBinder) {
        BinderProxy result;
        synchronized (sProxyMap) {
            try {
                result = sProxyMap.get(iBinder);
                if (result != null) {
@@ -392,6 +392,7 @@ public final class BinderProxy implements IBinder {
            NoImagePreloadHolder.sRegistry.registerNativeAllocation(result, nativeData);
            // The registry now owns nativeData, even if registration threw an exception.
            sProxyMap.set(iBinder, result);
        }
        return result;
    }

@@ -572,12 +573,11 @@ public final class BinderProxy implements IBinder {
        }
    }

    private static final void sendDeathNotice(DeathRecipient recipient) {
    private static void sendDeathNotice(DeathRecipient recipient) {
        if (false) Log.v("JavaBinder", "sendDeathNotice to " + recipient);
        try {
            recipient.binderDied();
        }
        catch (RuntimeException exc) {
        } catch (RuntimeException exc) {
            Log.w("BinderNative", "Uncaught exception from death notification",
                    exc);
        }