Badhri Jagan Sridharan | b577571 | 2019-01-18 00:39:47 -0800 | [diff] [blame] | 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 | |
| 17 | package android.hardware.usb@1.2; |
| 18 | |
| 19 | import android.hardware.usb@1.1::IUsb; |
| 20 | |
| 21 | /** |
| 22 | * The setCallback function in V1_0 is used to register the V1_2 |
| 23 | * IUsbCallback object as well. The implementation can use the |
| 24 | * castFrom method to cast the IUsbCallback object. |
| 25 | */ |
| 26 | interface IUsb extends @1.1::IUsb { |
| 27 | /** |
| 28 | * When supportsEnableContaminantPresenceDetection is true, |
| 29 | * enableContaminantPresenceDetection enables/disables contaminant |
| 30 | * presence detection algorithm. Calling enableContaminantPresenceDetection |
| 31 | * when supportsEnableContaminantPresenceDetection is false does |
| 32 | * not have any effect. |
| 33 | * Change in contantaminant presence status should notify should |
| 34 | * be notified to the client via notifyPortStatusChange_1_2 through |
| 35 | * PortStatus. |
| 36 | * |
| 37 | * @param portName name of the port. |
| 38 | * @param enable true Enable contaminant presence detection algorithm. |
| 39 | * false Disable contaminant presence detection algorithm. |
| 40 | */ |
| 41 | oneway enableContaminantPresenceDetection(string portName, bool enable); |
| 42 | |
| 43 | /** |
| 44 | * When supportsEnableContaminantPresenceProtection is true, |
| 45 | * enableContaminantPresenceProtection enables/disables contaminant |
| 46 | * presence protection algorithm. Calling |
| 47 | * enableContaminantPresenceProtection |
| 48 | * when supportsEnableContaminantPresenceProtection is false does |
| 49 | * not have any effect. |
| 50 | * Used to enable/disable contaminant presence protection algorithm. |
| 51 | * Enabling port protection algoritm must make the lower layers to autonomously |
| 52 | * act on taking the corresponding preventive measure mentioned at |
| 53 | * ContaminantProtectionModes when contaminant is detected on the USB Port. |
| 54 | * Calling this method with enable set to true must set to contaminantProtectionEnabled |
| 55 | * to true upon success and vice versa. |
| 56 | * currentContaminantProtectionMode should be updated whenever there is a |
| 57 | * change in the status of contaminant presence protection algorithm. |
| 58 | * |
| 59 | * @param portName name of the port. |
| 60 | * @param enable true Reduce capabilities of the port to protect port |
| 61 | * from damage due to contaminant presence. |
| 62 | * false No action is taken upon contaminant presence. |
| 63 | */ |
| 64 | oneway enableContaminantPresenceProtection(string portName, bool enable); |
| 65 | }; |