1/*
2 * Copyright (C) 2018 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.2;
18
19import android.hardware.usb@1.1::IUsbCallback;
20import android.hardware.usb@1.0::Status;
21
22/**
23 * Callback object used for all the IUsb async methods which expects a result.
24 * Caller is expected to register the callback object using setCallback method
25 * to receive updates on the PortStatus.
26 */
27interface IUsbCallback extends @1.1::IUsbCallback {
28    /**
29     * Used to convey the current port status to the caller.
30     * Must be called either when PortState changes due to the port partner or
31     * when caller requested for the PortStatus update through queryPortStatus.
32     *
33     * @param currentPortStatus vector object of current status(PortStatus
34     * of all the typeC ports in the device.
35     * @param retval SUCCESS when the required information was enquired form
36     *               kernel and the PortStatus_1_2 object was built.
37     *               ERROR otherwise.
38     */
39    oneway notifyPortStatusChange_1_2(vec<PortStatus> currentPortStatus,
40        @1.0::Status retval);
41};
42
43