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

Commit a37884b2 authored by Olivier Gaillard's avatar Olivier Gaillard Committed by Android (Google) Code Review
Browse files

Merge "BinderTransactionNameResolver: return transaction code when the AIDL...

Merge "BinderTransactionNameResolver: return transaction code when the AIDL generated method returns an empty string." into main
parents 59cbd003 951aaad9
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.internal.os;

import android.os.Binder;
import android.text.TextUtils;

import com.android.internal.annotations.VisibleForTesting;

@@ -37,6 +38,8 @@ import java.util.HashMap;
@VisibleForTesting(visibility = VisibleForTesting.Visibility.PACKAGE)
public class BinderTransactionNameResolver {
    private static final Method NO_GET_DEFAULT_TRANSACTION_NAME_METHOD;
    private static final boolean USE_TRANSACTION_CODES_FOR_UNKNOWN_METHODS =
            Flags.useTransactionCodesForUnknownMethods();

    /**
     * Generates the default transaction method name, which is just the transaction code.
@@ -81,7 +84,14 @@ public class BinderTransactionNameResolver {
        }

        try {
            return (String) method.invoke(null, transactionCode);
            String methodName = (String) method.invoke(null, transactionCode);
            if (USE_TRANSACTION_CODES_FOR_UNKNOWN_METHODS) {
                return TextUtils.isEmpty(methodName)
                        ? String.valueOf(transactionCode)
                        : methodName;
            } else {
                return methodName;
            }
        } catch (IllegalAccessException | InvocationTargetException e) {
            throw new RuntimeException(e);
        }
+11 −0
Original line number Diff line number Diff line
@@ -9,3 +9,14 @@ flag {
    is_fixed_read_only: true
    bug: "241474956"
}

flag {
    name: "use_transaction_codes_for_unknown_methods"
    namespace: "dropbox"
    description: "Use transaction codes when the method names is unknown"
    bug: "350041302"
    is_fixed_read_only: true
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}
 No newline at end of file