summaryrefslogtreecommitdiffstats
path: root/usb/1.2/IUsb.hal
blob: ecc911ebf25810faa0641519344de7da325ded59 (plain)
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
/*
 * Copyright (C) 2018 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.usb@1.2;

import android.hardware.usb@1.1::IUsb;

/**
 * The setCallback function in V1_0 is used to register the V1_2
 * IUsbCallback object as well. The implementation can use the
 * castFrom method to cast the IUsbCallback object.
 */
interface IUsb extends @1.1::IUsb {
    /**
     * When supportsEnableContaminantPresenceDetection is true,
     * enableContaminantPresenceDetection enables/disables contaminant
     * presence detection algorithm. Calling enableContaminantPresenceDetection
     * when supportsEnableContaminantPresenceDetection is false does
     * not have any effect.
     * Change in contantaminant presence status should notify should
     * be notified to the client via notifyPortStatusChange_1_2 through
     * PortStatus.
     *
     * @param portName name of the port.
     * @param enable true Enable contaminant presence detection algorithm.
     *               false Disable contaminant presence detection algorithm.
     */
    oneway enableContaminantPresenceDetection(string portName, bool enable);

    /**
     * When supportsEnableContaminantPresenceProtection is true,
     * enableContaminantPresenceProtection enables/disables contaminant
     * presence protection algorithm. Calling
     * enableContaminantPresenceProtection
     * when supportsEnableContaminantPresenceProtection is false does
     * not have any effect.
     * Used to enable/disable contaminant presence protection algorithm.
     * Enabling port protection algoritm must make the lower layers to autonomously
     * act on taking the corresponding preventive measure mentioned at
     * ContaminantProtectionModes when contaminant is detected on the USB Port.
     * Calling this method with enable set to true must set to contaminantProtectionEnabled
     * to true upon success and vice versa.
     * currentContaminantProtectionMode should be updated whenever there is a
     * change in the status of contaminant presence protection algorithm.
     *
     * @param portName name of the port.
     * @param enable true Reduce capabilities of the port to protect port
     *                    from damage due to contaminant presence.
     *               false No action is taken upon contaminant presence.
     */
    oneway enableContaminantPresenceProtection(string portName, bool enable);
};