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

Commit f3507faa authored by Bob Wang's avatar Bob Wang Committed by Gerrit Code Review
Browse files

Merge "[framework] Handle more possible route string from service." into main

parents 1838dff0 e7571aef
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -923,12 +923,15 @@ public final class NfcOemExtension {
    }

    private @CardEmulation.ProtocolAndTechnologyRoute int routeStringToInt(String route) {
        return switch (route) {
            case "DH" -> PROTOCOL_AND_TECHNOLOGY_ROUTE_DH;
            case "eSE" -> PROTOCOL_AND_TECHNOLOGY_ROUTE_ESE;
            case "SIM" -> PROTOCOL_AND_TECHNOLOGY_ROUTE_UICC;
            default -> throw new IllegalStateException("Unexpected value: " + route);
        };
        if (route.equals("DH")) {
            return PROTOCOL_AND_TECHNOLOGY_ROUTE_DH;
        } else if (route.startsWith("eSE")) {
            return PROTOCOL_AND_TECHNOLOGY_ROUTE_ESE;
        } else if (route.startsWith("SIM")) {
            return PROTOCOL_AND_TECHNOLOGY_ROUTE_UICC;
        } else {
            throw new IllegalStateException("Unexpected value: " + route);
        }
    }

    private class ReceiverWrapper<T> implements Consumer<T> {