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

Commit 25956948 authored by Limon Mia's avatar Limon Mia Committed by Gerrit Code Review
Browse files

Merge "Added Tbs error codes description" into main

parents eb5d6b6c ff534030
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -804,7 +804,8 @@ public class TbsGeneric {
            synchronized (TbsGeneric.this) {
                if (DBG) {
                    Log.d(TAG, "onCallControlPointRequest: device=" + device + " opcode="
                            + opcode + " argsLen=" + args.length);
                            + callControlRequestOpcodeStr(opcode) + "(" + opcode + ")"
                            + " argsLen=" + args.length);
                }

                if (!mIsInitialized) {
@@ -950,6 +951,21 @@ public class TbsGeneric {
        }
    };

    private String callControlRequestOpcodeStr(int opcode) {
        switch (opcode) {
            case TbsGatt.CALL_CONTROL_POINT_OPCODE_ACCEPT:
                return "ACCEPT";
            case TbsGatt.CALL_CONTROL_POINT_OPCODE_TERMINATE:
                return "TERMINATE";
            case TbsGatt.CALL_CONTROL_POINT_OPCODE_LOCAL_HOLD:
                return "LOCAL_HOLD";
            case TbsGatt.CALL_CONTROL_POINT_OPCODE_LOCAL_RETRIEVE:
                return "LOCAL_RETRIEVE";
            default:
                return "UNKNOWN";
        }
    }

    private static boolean isCcidValid(int ccid) {
        return ccid != ContentControlIdKeeper.CCID_INVALID;
    }