lin
2025-08-21 57113df3a0e2be01232281fad9a5f2c060567981
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*
 * Copyright (C) 2016 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
 
package android.hardware.radio@1.0;
 
interface ISapCallback {
    /**
     * CONNECT_RESP from SAP 1.1 spec 5.1.2
     *
     * @param token Id to match req-resp. Value must match the one in req.
     * @param sapConnectRsp Connection Status
     * @param maxMsgSize MaxMsgSize supported by server if request cannot be fulfilled.
     *        Valid only if connectResponse is SapConnectResponse:MSG_SIZE_TOO_LARGE.
     */
    oneway connectResponse(int32_t token, SapConnectRsp sapConnectRsp, int32_t maxMsgSize);
 
    /**
     * DISCONNECT_RESP from SAP 1.1 spec 5.1.4
     *
     * @param token Id to match req-resp. Value must match the one in req.
     */
    oneway disconnectResponse(int32_t token);
 
    /**
     * DISCONNECT_IND from SAP 1.1 spec 5.1.5
     *
     * @param token Id to match req-resp. Value must match the one in req.
     * @param disconnectType Disconnect Type to indicate if shutdown is graceful or immediate
     */
    oneway disconnectIndication(int32_t token, SapDisconnectType disconnectType);
 
    /**
     * TRANSFER_APDU_RESP from SAP 1.1 spec 5.1.7
     *
     * @param token Id to match req-resp. Value must match the one in req.
     * @param resultCode ResultCode to indicate if command was processed correctly
     *        Possible values:
     *        SapResultCode:SUCCESS,
     *        SapResultCode:GENERIC_FAILURE,
     *        SapResultCode:CARD_NOT_ACCESSSIBLE,
     *        SapResultCode:CARD_ALREADY_POWERED_OFF,
     *        SapResultCode:CARD_REMOVED
     * @param apduRsp APDU Response. Valid only if command was processed correctly and no error
     *        occurred.
     */
    oneway apduResponse(int32_t token,
                        SapResultCode resultCode,
                        vec<uint8_t> apduRsp);
 
    /**
     * TRANSFER_ATR_RESP from SAP 1.1 spec 5.1.9
     *
     * @param token Id to match req-resp. Value must match the one in req.
     * @param resultCode ResultCode to indicate if command was processed correctly
     *        Possible values:
     *        SapResultCode:SUCCESS,
     *        SapResultCode:GENERIC_FAILURE,
     *        SapResultCode:CARD_ALREADY_POWERED_OFF,
     *        SapResultCode:CARD_REMOVED,
     *        SapResultCode:DATA_NOT_AVAILABLE
     * @param atr Answer to Reset from the subscription module. Included only if no error occurred,
     *        otherwise empty.
     */
    oneway transferAtrResponse(int32_t token, SapResultCode resultCode, vec<uint8_t> atr);
 
    /**
     * POWER_SIM_OFF_RESP and POWER_SIM_ON_RESP from SAP 1.1 spec 5.1.11 + 5.1.13
     *
     * @param token Id to match req-resp. Value must match the one in req.
     * @param resultCode ResultCode to indicate if command was processed correctly
     *        Possible values:
     *        SapResultCode:SUCCESS,
     *        SapResultCode:GENERIC_FAILURE,
     *        SapResultCode:CARD_NOT_ACCESSSIBLE, (possible only for power on req)
     *        SapResultCode:CARD_ALREADY_POWERED_OFF, (possible only for power off req)
     *        SapResultCode:CARD_REMOVED,
     *        SapResultCode:CARD_ALREADY_POWERED_ON (possible only for power on req)
     */
    oneway powerResponse(int32_t token, SapResultCode resultCode);
 
    /**
     * RESET_SIM_RESP from SAP 1.1 spec 5.1.15
     *
     * @param token Id to match req-resp. Value must match the one in req.
     * @param resultCode ResultCode to indicate if command was processed correctly
     *        Possible values:
     *        SapResultCode:SUCCESS,
     *        SapResultCode:GENERIC_FAILURE,
     *        SapResultCode:CARD_NOT_ACCESSSIBLE,
     *        SapResultCode:CARD_ALREADY_POWERED_OFF,
     *        SapResultCode:CARD_REMOVED
     */
    oneway resetSimResponse(int32_t token, SapResultCode resultCode);
 
    /**
     * STATUS_IND from SAP 1.1 spec 5.1.16
     *
     * @param token Id to match req-resp. Value must match the one in req.
     * @param status Parameter to indicate reason for the status change.
     */
    oneway statusIndication(int32_t token, SapStatus status);
 
    /**
     * TRANSFER_CARD_READER_STATUS_REQ from SAP 1.1 spec 5.1.18
     *
     * @param token Id to match req-resp. Value must match the one in req.
     * @param resultCode ResultCode to indicate if command was processed correctly
     *        Possible values:
     *        SapResultCode:SUCCESS,
     *        SapResultCode:GENERIC_FAILURE
     *        SapResultCode:DATA_NOT_AVAILABLE
     * @param cardReaderStatus Card Reader Status coded as described in 3GPP TS 11.14 Section 12.33
     *        and TS 31.111 Section 8.33
     */
    oneway transferCardReaderStatusResponse(int32_t token,
                                            SapResultCode resultCode,
                                            int32_t cardReaderStatus);
 
    /**
     * ERROR_RESP from SAP 1.1 spec 5.1.19
     *
     * @param token Id to match req-resp. Value must match the one in req.
     */
    oneway errorResponse(int32_t token);
 
    /**
     * SET_TRANSPORT_PROTOCOL_RESP from SAP 1.1 spec 5.1.21
     *
     * @param token Id to match req-resp. Value must match the one in req.
     * @param resultCode ResultCode to indicate if command was processed correctly
     *        Possible values:
     *        SapResultCode:SUCCESS
     *        SapResultCode:NOT_SUPPORTED
     */
    oneway transferProtocolResponse(int32_t token, SapResultCode resultCode);
};