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.camera2; 18 19 import android.hardware.camera2.ICameraInjectionSession; 20 21 /** 22 * Binder interface used to call back the error state injected by the external camera, 23 * and camera service can be switched back to internal camera when binder signals process death. 24 * 25 * @hide 26 */ 27 interface ICameraInjectionCallback 28 { 29 // Error codes for onInjectionError 30 // To indicate all invalid error codes 31 const int ERROR_INJECTION_INVALID_ERROR = -1; 32 // To indicate the camera injection session has encountered a fatal error, such as injection 33 // init failure, configure failure or injecting failure etc. 34 const int ERROR_INJECTION_SESSION = 0; 35 // To indicate the camera service has encountered a fatal error. 36 const int ERROR_INJECTION_SERVICE = 1; 37 // To indicate the injection camera does not support certain camera functions, such as 38 // unsupport stream format, no capture/record function or no multi-camera function etc. 39 // When this error occurs, the default processing is still in the inject state, and the app is 40 // notified to display an error message and a black screen. 41 const int ERROR_INJECTION_UNSUPPORTED = 2; 42 onInjectionError(int errorCode)43 oneway void onInjectionError(int errorCode); 44 } 45