blob: fd91cbfa5bb282e8531cb7f895ec2887cbfc1c51 [file] [log] [blame]
Badhri Jagan Sridharan2f162ef2017-01-04 00:02:59 -08001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.hardware.usb@1.0;
18
Andreas Huber40d3a9b2017-03-28 16:19:16 -070019/**
Badhri Jagan Sridharan2f162ef2017-01-04 00:02:59 -080020 * Callback object used for all the IUsb async methods which expects a result.
21 * Caller is expected to register the callback object using setCallback method
22 * to receive updates on the PortStatus.
23 */
24interface IUsbCallback {
Andreas Huber40d3a9b2017-03-28 16:19:16 -070025 /**
Badhri Jagan Sridharan2f162ef2017-01-04 00:02:59 -080026 * Used to convey the current port status to the caller.
27 * Called either when PortState changes due to the port partner (or)
28 * when caller requested for the PortStatus update through queryPortStatus.
29 *
30 * @param currentPortStatus vector object of current status of all the
31 * typeC ports in the device.
32 * @param retval SUCCESS when query was done successfully.
33 * ERROR otherwise.
34 */
35 oneway notifyPortStatusChange(vec<PortStatus> currentPortStatus, Status retval);
36
Andreas Huber40d3a9b2017-03-28 16:19:16 -070037 /**
Badhri Jagan Sridharan2f162ef2017-01-04 00:02:59 -080038 * Used to notify the result of the switchRole call to the caller.
39 *
40 * @param portName name of the port for which the roleswap is requested.
41 * @param newRole the new role requested by the caller.
42 * @param retval SUCCESS if the role switch succeeded. FAILURE otherwise.
43 */
44 oneway notifyRoleSwitchStatus(string portName, PortRole newRole, Status retval);
45};