Shuzhen Wang | cd9af6c | 2021-09-09 17:42:20 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2021 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.camera.device@3.8; |
| 18 | |
Rucha Katakwar | 5ad9375 | 2021-10-27 15:58:11 -0700 | [diff] [blame^] | 19 | import android.hardware.camera.common@1.0::Status; |
Shuzhen Wang | cd9af6c | 2021-09-09 17:42:20 -0700 | [diff] [blame] | 20 | import @3.7::ICameraDevice; |
| 21 | |
| 22 | /** |
| 23 | * Camera device interface |
| 24 | * |
| 25 | * Supports the android.hardware.Camera API, and the android.hardware.camera2 |
| 26 | * API at LIMITED or better hardware level. |
| 27 | * |
| 28 | * ICameraDevice.open() must return @3.2::ICameraDeviceSession, |
| 29 | * @3.5::ICameraDeviceSession, @3.6::ICameraDeviceSession, or |
| 30 | * @3.7::ICameraDeviceSession. |
| 31 | */ |
| 32 | interface ICameraDevice extends @3.7::ICameraDevice { |
Rucha Katakwar | 5ad9375 | 2021-10-27 15:58:11 -0700 | [diff] [blame^] | 33 | /** |
| 34 | * turnOnTorchWithStrengthLevel: |
| 35 | * |
| 36 | * Change the brightness level of the flash unit associated with this camera device |
| 37 | * and set it to value in torchStrength. This function also turns ON the torch |
| 38 | * with specified torchStrength if the torch is OFF. |
| 39 | * |
| 40 | * The torchStrength value must be within the valid range i.e. >=1 and |
| 41 | * <= FLASH_INFO_STRENGTH_MAXIMUM_LEVEL. Whenever the torch is turned OFF, |
| 42 | * the brightness level will reset to FLASH_INFO_STRENGTH_DEFAULT_LEVEL. |
| 43 | * When the client calls setTorchMode(ON) after turnOnTorchWithStrengthLevel(N), |
| 44 | * the flash unit will have brightness level equal to N. This level does not |
| 45 | * represent the real brightness units. It is linear in nature i.e. flashlight |
| 46 | * at level 10 is twice as bright as at level 5. |
| 47 | * |
| 48 | * @param torchStrength Brightness level to be set for the flashlight. |
| 49 | * |
| 50 | * @return status Status code for the operation, one of: |
| 51 | * OK: |
| 52 | * On a successful change to the torch strength level. |
| 53 | * INTERNAL_ERROR: |
| 54 | * The flash unit cannot be operated due to an unexpected internal |
| 55 | * error. |
| 56 | * CAMERA_IN_USE: |
| 57 | * This status code is returned when: |
| 58 | * - This camera device has been opened, so the torch cannot be |
| 59 | * controlled until it is closed. |
| 60 | * - Due to other camera devices being open, or due to other |
| 61 | * resource constraints, the torch cannot be controlled currently. |
| 62 | * ILLEGAL_ARGUMENT: |
| 63 | * If the torchStrength value is not within the range i.e. < 1 or |
| 64 | * > FLASH_INFO_STRENGTH_MAXIMUM_LEVEL. |
| 65 | * METHOD_NOT_SUPPORTED: |
| 66 | * This status code is returned when: |
| 67 | * - This camera device does not support direct operation of flashlight |
| 68 | * torch mode. The framework must open the camera device and turn |
| 69 | * the torch on through the device interface. |
| 70 | * - This camera device does not have a flash unit. |
| 71 | * - This camera device has flash unit but does not support torch |
| 72 | * strength control. |
| 73 | * CAMERA_DISCONNECTED: |
| 74 | * An external camera device has been disconnected, and is no longer |
| 75 | * available. This camera device interface is now stale, and a new |
| 76 | * instance must be acquired if the device is reconnected. All |
| 77 | * subsequent calls on this interface must return |
| 78 | * CAMERA_DISCONNECTED. |
| 79 | * |
| 80 | */ |
| 81 | turnOnTorchWithStrengthLevel(int32_t torchStrength) generates (Status status); |
| 82 | |
| 83 | /** |
| 84 | * getTorchStrengthLevel: |
| 85 | * |
| 86 | * Get current torch strength level. |
| 87 | * If the device supports torch strength control, when the torch is OFF the |
| 88 | * strength level will reset to default level, so the return |
| 89 | * value in this case will be equal to FLASH_INFO_STRENGTH_DEFAULT_LEVEL. |
| 90 | * |
| 91 | * @return status Status code for the operation, one of: |
| 92 | * OK: |
| 93 | * On success. |
| 94 | * INTERNAL_ERROR: |
| 95 | * An unexpected error occurred and the information is not |
| 96 | * available. |
| 97 | * METHOD_NOT_SUPPORTED: |
| 98 | * This status code is returned when: |
| 99 | * - This camera device does not support direct operation of flashlight |
| 100 | * torch mode. The framework must open the camera device and turn |
| 101 | * the torch on through the device interface. |
| 102 | * - This camera device does not have a flash unit. |
| 103 | * - This camera device has flash unit but does not support torch |
| 104 | * strength control. |
| 105 | * |
| 106 | * @return torchStrength Current torch strength level. |
| 107 | * |
| 108 | */ |
| 109 | getTorchStrengthLevel() generates (Status status, int32_t torchStrength); |
Shuzhen Wang | cd9af6c | 2021-09-09 17:42:20 -0700 | [diff] [blame] | 110 | }; |