1*4d7e907cSAndroid Build Coastguard Worker/* 2*4d7e907cSAndroid Build Coastguard Worker * Copyright (C) 2018 The Android Open Source Project 3*4d7e907cSAndroid Build Coastguard Worker * 4*4d7e907cSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License"); 5*4d7e907cSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License. 6*4d7e907cSAndroid Build Coastguard Worker * You may obtain a copy of the License at 7*4d7e907cSAndroid Build Coastguard Worker * 8*4d7e907cSAndroid Build Coastguard Worker * http://www.apache.org/licenses/LICENSE-2.0 9*4d7e907cSAndroid Build Coastguard Worker * 10*4d7e907cSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software 11*4d7e907cSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS, 12*4d7e907cSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*4d7e907cSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and 14*4d7e907cSAndroid Build Coastguard Worker * limitations under the License. 15*4d7e907cSAndroid Build Coastguard Worker */ 16*4d7e907cSAndroid Build Coastguard Worker 17*4d7e907cSAndroid Build Coastguard Workerpackage [email protected]; 18*4d7e907cSAndroid Build Coastguard Worker 19*4d7e907cSAndroid Build Coastguard Workerimport [email protected]::Status; 20*4d7e907cSAndroid Build Coastguard Workerimport [email protected]::ICameraProvider; 21*4d7e907cSAndroid Build Coastguard Worker 22*4d7e907cSAndroid Build Coastguard Worker/** 23*4d7e907cSAndroid Build Coastguard Worker * Camera provider HAL 24*4d7e907cSAndroid Build Coastguard Worker * 25*4d7e907cSAndroid Build Coastguard Worker * Version 2.5 adds support for the notifyDeviceStateChange method 26*4d7e907cSAndroid Build Coastguard Worker */ 27*4d7e907cSAndroid Build Coastguard Workerinterface ICameraProvider extends @2.4::ICameraProvider { 28*4d7e907cSAndroid Build Coastguard Worker 29*4d7e907cSAndroid Build Coastguard Worker /** 30*4d7e907cSAndroid Build Coastguard Worker * notifyDeviceStateChange: 31*4d7e907cSAndroid Build Coastguard Worker * 32*4d7e907cSAndroid Build Coastguard Worker * Notify the HAL provider that the state of the overall device has 33*4d7e907cSAndroid Build Coastguard Worker * changed in some way that the HAL may want to know about. 34*4d7e907cSAndroid Build Coastguard Worker * 35*4d7e907cSAndroid Build Coastguard Worker * For example, a physical shutter may have been uncovered or covered, 36*4d7e907cSAndroid Build Coastguard Worker * or a camera may have been covered or uncovered by an add-on keyboard 37*4d7e907cSAndroid Build Coastguard Worker * or other accessory. 38*4d7e907cSAndroid Build Coastguard Worker * 39*4d7e907cSAndroid Build Coastguard Worker * The state is a bitfield of potential states, and some physical configurations 40*4d7e907cSAndroid Build Coastguard Worker * could plausibly correspond to multiple different combinations of state bits. 41*4d7e907cSAndroid Build Coastguard Worker * The HAL must ignore any state bits it is not actively using to determine 42*4d7e907cSAndroid Build Coastguard Worker * the appropriate camera configuration. 43*4d7e907cSAndroid Build Coastguard Worker * 44*4d7e907cSAndroid Build Coastguard Worker * For example, on some devices the FOLDED state could mean that 45*4d7e907cSAndroid Build Coastguard Worker * backward-facing cameras are covered by the fold, so FOLDED by itself implies 46*4d7e907cSAndroid Build Coastguard Worker * BACK_COVERED. But other devices may support folding but not cover any cameras 47*4d7e907cSAndroid Build Coastguard Worker * when folded, so for those FOLDED would not imply any of the other flags. 48*4d7e907cSAndroid Build Coastguard Worker * Since these relationships are very device-specific, it is difficult to specify 49*4d7e907cSAndroid Build Coastguard Worker * a comprehensive policy. But as a recommendation, it is suggested that if a flag 50*4d7e907cSAndroid Build Coastguard Worker * necessarily implies other flags are set as well, then those flags should be set. 51*4d7e907cSAndroid Build Coastguard Worker * So even though FOLDED would be enough to infer BACK_COVERED on some devices, the 52*4d7e907cSAndroid Build Coastguard Worker * BACK_COVERED flag should also be set for clarity. 53*4d7e907cSAndroid Build Coastguard Worker * 54*4d7e907cSAndroid Build Coastguard Worker * This method may be invoked by the HAL client at any time. It must not 55*4d7e907cSAndroid Build Coastguard Worker * cause any active camera device sessions to be closed, but may dynamically 56*4d7e907cSAndroid Build Coastguard Worker * change which physical camera a logical multi-camera is using for its 57*4d7e907cSAndroid Build Coastguard Worker * active and future output. 58*4d7e907cSAndroid Build Coastguard Worker * 59*4d7e907cSAndroid Build Coastguard Worker * The method must be invoked by the HAL client at least once before the 60*4d7e907cSAndroid Build Coastguard Worker * client calls ICameraDevice::open on any camera device interfaces listed 61*4d7e907cSAndroid Build Coastguard Worker * by this provider, to establish the initial device state. 62*4d7e907cSAndroid Build Coastguard Worker * 63*4d7e907cSAndroid Build Coastguard Worker * @param newState 64*4d7e907cSAndroid Build Coastguard Worker * The new state of the device. 65*4d7e907cSAndroid Build Coastguard Worker */ 66*4d7e907cSAndroid Build Coastguard Worker notifyDeviceStateChange(bitfield<DeviceState> newState); 67*4d7e907cSAndroid Build Coastguard Worker 68*4d7e907cSAndroid Build Coastguard Worker}; 69