blob: d9a0934a49fdd353f8c69a45fe7d5a037c27251a [file] [log] [blame]
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -08001/*
2 * Copyright (C) 2013 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
17package android.hardware;
18
19import android.hardware.ICamera;
20import android.hardware.ICameraClient;
21import android.hardware.camera2.ICameraDeviceUser;
22import android.hardware.camera2.ICameraDeviceCallbacks;
Cliff Wud8cae102021-03-11 01:37:42 +080023import android.hardware.camera2.ICameraInjectionCallback;
24import android.hardware.camera2.ICameraInjectionSession;
Shuzhen Wang045be6c2023-10-12 10:01:10 -070025import android.hardware.camera2.params.SessionConfiguration;
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080026import android.hardware.camera2.params.VendorTagDescriptor;
Emilian Peev71c73a22017-03-21 16:35:51 +000027import android.hardware.camera2.params.VendorTagDescriptorCache;
Jayant Chowdhary2bbdce42020-01-12 14:55:41 -080028import android.hardware.camera2.utils.ConcurrentCameraIdCombination;
29import android.hardware.camera2.utils.CameraIdAndSessionConfiguration;
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080030import android.hardware.camera2.impl.CameraMetadataNative;
31import android.hardware.ICameraServiceListener;
32import android.hardware.CameraInfo;
Eino-Ville Talvalaf51fca22016-12-13 11:25:55 -080033import android.hardware.CameraStatus;
Avichal Rakesh6e57a2b2023-05-01 17:53:37 -070034import android.hardware.CameraExtensionSessionStats;
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080035
36/**
37 * Binder interface for the native camera service running in mediaserver.
38 *
39 * @hide
40 */
41interface ICameraService
42{
43 /**
44 * All camera service and device Binder calls may return a
45 * ServiceSpecificException with the following error codes
46 */
47 const int ERROR_PERMISSION_DENIED = 1;
48 const int ERROR_ALREADY_EXISTS = 2;
49 const int ERROR_ILLEGAL_ARGUMENT = 3;
50 const int ERROR_DISCONNECTED = 4;
51 const int ERROR_TIMED_OUT = 5;
52 const int ERROR_DISABLED = 6;
53 const int ERROR_CAMERA_IN_USE = 7;
54 const int ERROR_MAX_CAMERAS_IN_USE = 8;
55 const int ERROR_DEPRECATED_HAL = 9;
56 const int ERROR_INVALID_OPERATION = 10;
57
58 /**
59 * Types for getNumberOfCameras
60 */
61 const int CAMERA_TYPE_BACKWARD_COMPATIBLE = 0;
62 const int CAMERA_TYPE_ALL = 1;
63
64 /**
Biswarup Pal37a75182024-01-16 15:53:35 +000065 * Return the number of camera devices available in the system.
66 *
67 * @param type The type of the camera, can be either CAMERA_TYPE_BACKWARD_COMPATIBLE
68 * or CAMERA_TYPE_ALL.
69 * @param deviceId The device id of the context associated with the caller.
70 * @param devicePolicy The camera policy of the device of the associated context (default
71 * policy for default device context). Only virtual cameras would be exposed
72 * only for custom policy and only real cameras would be exposed for default
73 * policy.
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080074 */
Biswarup Pal37a75182024-01-16 15:53:35 +000075 int getNumberOfCameras(int type, int deviceId, int devicePolicy);
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -080076
77 /**
Jayant Chowdhary81d81b02024-02-15 19:13:39 +000078 * If changed, reflect in
79 * frameworks/base/core/java/android/hardware/camera2/CameraManager.java.
80 * We have an enum here since the decision to override to portrait mode / fetch the
81 * rotationOverride as it exists in CameraManager right now is based on a static system
82 * property and not something that changes based dynamically, say on fold state. As a result,
83 * we can't use just a boolean to differentiate between the case where cameraserver should
84 * override to portrait (sensor orientation is 0, 180) or just rotate the sensor feed (sensor
85 * orientation is 90, 270)
86 */
87 const int ROTATION_OVERRIDE_NONE = 0;
88 const int ROTATION_OVERRIDE_OVERRIDE_TO_PORTRAIT = 1;
89 const int ROTATION_OVERRIDE_ROTATION_ONLY = 2;
90
91 /**
Biswarup Pal37a75182024-01-16 15:53:35 +000092 * Fetch basic camera information for a camera.
93 *
94 * @param cameraId The ID of the camera to fetch information for.
Jayant Chowdhary81d81b02024-02-15 19:13:39 +000095 * @param rotationOverride Whether to override the sensor orientation information to
96 * correspond to portrait: {@link ICameraService#ROTATION_OVERRIDE_OVERRIDE_TO_PORTRAIT}
97 * will override the sensor orientation and rotate and crop, while {@link
98 * ICameraService#ROTATION_OVERRIDE_ROTATION_ONLY} will rotate and crop the camera feed
99 * without changing the sensor orientation.
Biswarup Pal37a75182024-01-16 15:53:35 +0000100 * @param deviceId The device id of the context associated with the caller.
101 * @param devicePolicy The camera policy of the device of the associated context (default
102 * policy for default device context). Only virtual cameras would be exposed
103 * only for custom policy and only real cameras would be exposed for default
104 * policy.
105 * @return CameraInfo for the camera.
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800106 */
Jayant Chowdhary81d81b02024-02-15 19:13:39 +0000107 CameraInfo getCameraInfo(int cameraId, int rotationOverride, int deviceId,
Biswarup Pal37a75182024-01-16 15:53:35 +0000108 int devicePolicy);
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800109
110 /**
111 * Default UID/PID values for non-privileged callers of
Eino-Ville Talvalaa976df82019-06-13 18:01:58 -0700112 * connect() and connectDevice()
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800113 */
114 const int USE_CALLING_UID = -1;
115 const int USE_CALLING_PID = -1;
116
117 /**
Biswarup Pal37a75182024-01-16 15:53:35 +0000118 * Open a camera device through the old camera API.
119 *
120 * @param cameraId The ID of the camera to open.
121 * @param opPackageName The package name to report for the app-ops.
122 * @param clientUid UID for the calling client.
123 * @param clientPid PID for the calling client.
Jayant Chowdhary81d81b02024-02-15 19:13:39 +0000124 * @param targetSdkVersion the target sdk level of the application calling this function.
125 * @param rotationOverride Whether to override the sensor orientation information to
126 * correspond to portrait: {@link ICameraService#ROTATION_OVERRIDE_OVERRIDE_TO_PORTRAIT}
127 * will override the sensor orientation and rotate and crop, while {@link
128 * ICameraService#ROTATION_OVERRIDE_ROTATION_ONLY} will rotate and crop the camera feed
129 * without changing the sensor orientation.
Biswarup Pal37a75182024-01-16 15:53:35 +0000130 * @param forceSlowJpegMode Whether to force slow jpeg mode.
131 * @param deviceId The device id of the context associated with the caller.
132 * @param devicePolicy The camera policy of the device of the associated context (default
133 * policy for default device context). Only virtual cameras would be exposed
134 * only for custom policy and only real cameras would be exposed for default
135 * policy.
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800136 */
137 ICamera connect(ICameraClient client,
138 int cameraId,
Austin Borger1c1bee02023-06-01 16:51:35 -0700139 @utf8InCpp String opPackageName,
Shuzhen Wangd4abdf72021-05-28 11:22:50 -0700140 int clientUid, int clientPid,
Austin Borger18b30a72022-10-27 12:20:29 -0700141 int targetSdkVersion,
Jayant Chowdhary81d81b02024-02-15 19:13:39 +0000142 int rotationOverride,
Biswarup Pal37a75182024-01-16 15:53:35 +0000143 boolean forceSlowJpegMode,
144 int deviceId,
145 int devicePolicy);
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800146
147 /**
Biswarup Pal37a75182024-01-16 15:53:35 +0000148 * Open a camera device through the new camera API.
149 * Only supported for device HAL versions >= 3.2.
150 *
151 * @param cameraId The ID of the camera to open.
152 * @param opPackageName The package name to report for the app-ops.
153 * @param clientUid UID for the calling client.
Jayant Chowdhary81d81b02024-02-15 19:13:39 +0000154 * @param targetSdkVersion the target sdk level of the application calling this function.
155 * @param rotationOverride Whether to override the sensor orientation information to
156 * correspond to portrait: {@link ICameraService#ROTATION_OVERRIDE_OVERRIDE_TO_PORTRAIT}
157 * will override the sensor orientation and rotate and crop, while {@link
158 * ICameraService#ROTATION_OVERRIDE_ROTATION_ONLY} will rotate and crop the camera feed
159 * without changing the sensor orientation.
Biswarup Pal37a75182024-01-16 15:53:35 +0000160 * @param deviceId The device id of the context associated with the caller.
161 * @param devicePolicy The camera policy of the device of the associated context (default
162 * policy for default device context). Only virtual cameras would be exposed
163 * only for custom policy and only real cameras would be exposed for default
164 * policy.
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800165 */
166 ICameraDeviceUser connectDevice(ICameraDeviceCallbacks callbacks,
Austin Borger1c1bee02023-06-01 16:51:35 -0700167 @utf8InCpp String cameraId,
168 @utf8InCpp String opPackageName,
169 @nullable @utf8InCpp String featureId,
Shuzhen Wangd4abdf72021-05-28 11:22:50 -0700170 int clientUid, int oomScoreOffset,
Austin Borger18b30a72022-10-27 12:20:29 -0700171 int targetSdkVersion,
Jayant Chowdhary81d81b02024-02-15 19:13:39 +0000172 int rotationOverride,
Biswarup Pal37a75182024-01-16 15:53:35 +0000173 int deviceId,
174 int devicePolicy);
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800175
176 /**
Eino-Ville Talvalaf51fca22016-12-13 11:25:55 -0800177 * Add listener for changes to camera device and flashlight state.
178 *
179 * Also returns the set of currently-known camera IDs and state of each device.
180 * Adding a listener will trigger the torch status listener to fire for all
Emilian Peev53722fa2019-02-22 17:47:20 -0800181 * devices that have a flash unit.
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800182 */
Eino-Ville Talvalaf51fca22016-12-13 11:25:55 -0800183 CameraStatus[] addListener(ICameraServiceListener listener);
184
185 /**
Jayant Chowdhary2bbdce42020-01-12 14:55:41 -0800186 * Get a list of combinations of camera ids which support concurrent streaming.
187 *
188 */
Jayant Chowdharycad23c22020-03-10 15:04:59 -0700189 ConcurrentCameraIdCombination[] getConcurrentCameraIds();
Jayant Chowdhary2bbdce42020-01-12 14:55:41 -0800190
191 /**
Biswarup Pal7d072862024-04-17 15:24:47 +0000192 * Check whether a particular set of session configurations are concurrently supported by the
193 * corresponding camera ids.
194 *
195 * @param sessions the set of camera id and session configuration pairs to be queried.
196 * @param targetSdkVersion the target sdk level of the application calling this function.
197 * @param deviceId The device id of the context associated with the caller.
198 * @param devicePolicy The camera policy of the device of the associated context (default
199 * policy for default device context). Only virtual cameras would be exposed
200 * only for custom policy and only real cameras would be exposed for default
201 * policy.
202 * @return true - the set of concurrent camera id and stream combinations is supported.
203 * false - the set of concurrent camera id and stream combinations is not supported
204 * OR the method was called with a set of camera ids not returned by
205 * getConcurrentCameraIds().
206 */
Jayant Chowdhary2bbdce42020-01-12 14:55:41 -0800207 boolean isConcurrentSessionConfigurationSupported(
Shuzhen Wangd4abdf72021-05-28 11:22:50 -0700208 in CameraIdAndSessionConfiguration[] sessions,
Biswarup Pal7d072862024-04-17 15:24:47 +0000209 int targetSdkVersion, int deviceId, int devicePolicy);
Jayant Chowdhary2bbdce42020-01-12 14:55:41 -0800210
211 /**
malikakash22af94c2023-12-04 18:13:14 +0000212 * Inject Session Params into an existing camera session.
213 *
214 * @param cameraId the camera id session to inject session params into. Note that
215 * if there is no active session for the input cameraid, this operation
216 * will be a no-op. In addition, future camera sessions for cameraid will
217 * not be affected.
218 * @param sessionParams the session params to override for the existing session.
219 */
220 void injectSessionParams(@utf8InCpp String cameraId,
221 in CameraMetadataNative sessionParams);
222
223 /**
Eino-Ville Talvalaf51fca22016-12-13 11:25:55 -0800224 * Remove listener for changes to camera device and flashlight state.
225 */
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800226 void removeListener(ICameraServiceListener listener);
227
228 /**
229 * Read the static camera metadata for a camera device.
230 * Only supported for device HAL versions >= 3.2
Biswarup Pal37a75182024-01-16 15:53:35 +0000231 *
232 * @param cameraId The ID of the camera to fetch metadata for.
Jayant Chowdhary81d81b02024-02-15 19:13:39 +0000233 * @param targetSdkVersion the target sdk level of the application calling this function.
234 * @param rotationOverride Whether to override the sensor orientation information to
235 * correspond to portrait: {@link ICameraService#ROTATION_OVERRIDE_OVERRIDE_TO_PORTRAIT}
236 * will override the sensor orientation and rotate and crop, while {@link
237 * ICameraService#ROTATION_OVERRIDE_ROTATION_ONLY} will rotate and crop the camera feed
238 * without changing the sensor orientation.
Biswarup Pal37a75182024-01-16 15:53:35 +0000239 * @param deviceId The device id of the context associated with the caller.
240 * @param devicePolicy The camera policy of the device of the associated context (default
241 * policy for default device context). Only virtual cameras would be exposed
242 * only for custom policy and only real cameras would be exposed for default
243 * policy.
244 * @return Characteristics for the given camera.
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800245 */
Austin Borger1c1bee02023-06-01 16:51:35 -0700246 CameraMetadataNative getCameraCharacteristics(@utf8InCpp String cameraId, int targetSdkVersion,
Jayant Chowdhary81d81b02024-02-15 19:13:39 +0000247 int rotationOverride, int deviceId, int devicePolicy);
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800248
249 /**
250 * Read in the vendor tag descriptors from the camera module HAL.
251 * Intended to be used by the native code of CameraMetadataNative to correctly
252 * interpret camera metadata with vendor tags.
253 */
254 VendorTagDescriptor getCameraVendorTagDescriptor();
255
256 /**
Emilian Peev71c73a22017-03-21 16:35:51 +0000257 * Retrieve the vendor tag descriptor cache which can have multiple vendor
258 * providers.
259 * Intended to be used by the native code of CameraMetadataNative to correctly
260 * interpret camera metadata with vendor tags.
261 */
262 VendorTagDescriptorCache getCameraVendorTagCache();
263
264 /**
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800265 * Read the legacy camera1 parameters into a String
266 */
Austin Borger1c1bee02023-06-01 16:51:35 -0700267 @utf8InCpp String getLegacyParameters(int cameraId);
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800268
269 /**
270 * apiVersion constants for supportsCameraApi
271 */
272 const int API_VERSION_1 = 1;
273 const int API_VERSION_2 = 2;
274
Shuzhen Wangf9d2c022018-08-21 12:07:35 -0700275 // Determines if a particular API version is supported directly for a cameraId.
Austin Borger1c1bee02023-06-01 16:51:35 -0700276 boolean supportsCameraApi(@utf8InCpp String cameraId, int apiVersion);
Shuzhen Wangf9d2c022018-08-21 12:07:35 -0700277 // Determines if a cameraId is a hidden physical camera of a logical multi-camera.
Austin Borger1c1bee02023-06-01 16:51:35 -0700278 boolean isHiddenPhysicalCamera(@utf8InCpp String cameraId);
Cliff Wud8cae102021-03-11 01:37:42 +0800279 // Inject the external camera to replace the internal camera session.
Austin Borger1c1bee02023-06-01 16:51:35 -0700280 ICameraInjectionSession injectCamera(@utf8InCpp String packageName, @utf8InCpp String internalCamId,
281 @utf8InCpp String externalCamId, in ICameraInjectionCallback CameraInjectionCallback);
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800282
Biswarup Pal37a75182024-01-16 15:53:35 +0000283 /**
284 * Set the torch mode for a camera device.
285 *
286 * @param cameraId The ID of the camera to set torch mode for.
287 * @param deviceId The device id of the context associated with the caller.
288 * @param devicePolicy The camera policy of the device of the associated context (default
289 * policy for default device context). Only virtual cameras would be exposed
290 * only for custom policy and only real cameras would be exposed for default
291 * policy.
292 */
293 void setTorchMode(@utf8InCpp String cameraId, boolean enabled, IBinder clientBinder,
294 int deviceId, int devicePolicy);
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800295
Biswarup Pal37a75182024-01-16 15:53:35 +0000296 /**
297 * Change the brightness level of the flash unit associated with cameraId to strengthLevel.
298 * If the torch is in OFF state and strengthLevel > 0 then the torch will also be turned ON.
299 *
300 * @param cameraId The ID of the camera.
301 * @param strengthLevel The torch strength level to set for the camera.
302 * @param deviceId The device id of the context associated with the caller.
303 * @param devicePolicy The camera policy of the device of the associated context (default
304 * policy for default device context). Only virtual cameras would be exposed
305 * only for custom policy and only real cameras would be exposed for default
306 * policy.
307 */
308 void turnOnTorchWithStrengthLevel(@utf8InCpp String cameraId, int strengthLevel,
309 IBinder clientBinder, int deviceId, int devicePolicy);
Rucha Katakwar38284522021-11-10 11:25:21 -0800310
Biswarup Pal37a75182024-01-16 15:53:35 +0000311 /**
312 * Get the brightness level of the flash unit associated with cameraId.
313 *
314 * @param cameraId The ID of the camera.
315 * @param deviceId The device id of the context associated with the caller.
316 * @param devicePolicy The camera policy of the device of the associated context (default
317 * policy for default device context). Only virtual cameras would be exposed
318 * only for custom policy and only real cameras would be exposed for default
319 * policy.
320 * @return Torch strength level for the camera.
321 */
322 int getTorchStrengthLevel(@utf8InCpp String cameraId, int deviceId, int devicePolicy);
Rucha Katakwar38284522021-11-10 11:25:21 -0800323
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800324 /**
325 * Notify the camera service of a system event. Should only be called from system_server.
326 *
327 * Callers require the android.permission.CAMERA_SEND_SYSTEM_EVENTS permission.
328 */
329 const int EVENT_NONE = 0;
Eino-Ville Talvala63f36112018-12-06 14:57:03 -0800330 const int EVENT_USER_SWITCHED = 1; // The argument is the set of new foreground user IDs.
Valentin Iftime29e2e152021-08-13 15:17:33 +0200331 const int EVENT_USB_DEVICE_ATTACHED = 2; // The argument is the deviceId and vendorId
332 const int EVENT_USB_DEVICE_DETACHED = 3; // The argument is the deviceId and vendorId
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800333 oneway void notifySystemEvent(int eventId, in int[] args);
Eino-Ville Talvala63f36112018-12-06 14:57:03 -0800334
335 /**
Emilian Peev8b64f282021-03-25 16:49:57 -0700336 * Notify the camera service of a display configuration change.
337 *
338 * Callers require the android.permission.CAMERA_SEND_SYSTEM_EVENTS permission.
339 */
340 oneway void notifyDisplayConfigurationChange();
341
342 /**
Eino-Ville Talvala63f36112018-12-06 14:57:03 -0800343 * Notify the camera service of a device physical status change. May only be called from
344 * a privileged process.
345 *
346 * newState is a bitfield consisting of DEVICE_STATE_* values combined together. Valid state
347 * combinations are device-specific. At device startup, the camera service will assume the device
348 * state is NORMAL until otherwise notified.
349 *
350 * Callers require the android.permission.CAMERA_SEND_SYSTEM_EVENTS permission.
351 */
352 oneway void notifyDeviceStateChange(long newState);
353
Avichal Rakesh6e57a2b2023-05-01 17:53:37 -0700354 /**
355 * Report Extension specific metrics to camera service for logging. This should only be called
356 * by CameraExtensionSession to log extension metrics. All calls after the first must set
357 * CameraExtensionSessionStats.key to the value returned by this function.
358 *
359 * Each subsequent call fully overwrites the existing CameraExtensionSessionStats for the
360 * current session, so the caller is responsible for keeping the stats complete.
361 *
362 * Due to cameraservice and cameraservice_proxy architecture, there is no guarantee that
363 * {@code stats} will be logged immediately (or at all). CameraService will log whatever
364 * extension stats it has at the time of camera session closing which may be before the app
365 * process receives a session/device closed callback; so CameraExtensionSession
366 * should send metrics to the cameraservice preriodically, and cameraservice must handle calls
367 * to this function from sessions that have not been logged yet and from sessions that have
368 * already been closed.
369 *
370 * @return the key that must be used to report updates to previously reported stats.
371 */
Austin Borger1c1bee02023-06-01 16:51:35 -0700372 @utf8InCpp String reportExtensionSessionStats(in CameraExtensionSessionStats stats);
Avichal Rakesh6e57a2b2023-05-01 17:53:37 -0700373
Eino-Ville Talvala63f36112018-12-06 14:57:03 -0800374 // Bitfield constants for notifyDeviceStateChange
375 // All bits >= 32 are for custom vendor states
376 // Written as ints since AIDL does not support long constants.
377 const int DEVICE_STATE_NORMAL = 0;
378 const int DEVICE_STATE_BACK_COVERED = 1;
379 const int DEVICE_STATE_FRONT_COVERED = 2;
380 const int DEVICE_STATE_FOLDED = 4;
381 const int DEVICE_STATE_LAST_FRAMEWORK_BIT = 0x80000000; // 1 << 31;
382
Biswarup Pal37a75182024-01-16 15:53:35 +0000383 /**
384 * Create a CaptureRequest metadata based on template id
385 *
386 * @param cameraId The camera id to create the CaptureRequest for.
387 * @param templateId The template id create the CaptureRequest for.
388 * @param deviceId the device id of the context associated with the caller.
389 * @param devicePolicy The camera policy of the device of the associated context (default
390 * policy for default device context). Only virtual cameras would be exposed
391 * only for custom policy and only real cameras would be exposed for default
392 * policy.
393 * @return Metadata representing the CaptureRequest.
394 */
395 CameraMetadataNative createDefaultRequest(@utf8InCpp String cameraId, int templateId,
396 int deviceId, int devicePolicy);
Shuzhen Wang045be6c2023-10-12 10:01:10 -0700397
398 /**
Avichal Rakesh3c522e22024-02-07 16:40:46 -0800399 * Check whether a particular session configuration with optional session parameters
400 * has camera device support.
401 *
402 * @param cameraId The camera id to query session configuration for
Avichal Rakeshcaf179b2024-04-04 18:42:46 -0700403 * @param targetSdkVersion the target sdk level of the application calling this function.
Avichal Rakesh3c522e22024-02-07 16:40:46 -0800404 * @param sessionConfiguration Specific session configuration to be verified.
Biswarup Pal37a75182024-01-16 15:53:35 +0000405 * @param deviceId The device id of the context associated with the caller.
406 * @param devicePolicy The camera policy of the device of the associated context (default
407 * policy for default device context). Only virtual cameras would be exposed
408 * only for custom policy and only real cameras would be exposed for default
409 * policy.
Avichal Rakesh3c522e22024-02-07 16:40:46 -0800410 * @return true - in case the stream combination is supported.
411 * false - in case there is no device support.
412 */
Shuzhen Wang045be6c2023-10-12 10:01:10 -0700413 boolean isSessionConfigurationWithParametersSupported(@utf8InCpp String cameraId,
Avichal Rakeshcaf179b2024-04-04 18:42:46 -0700414 int targetSdkVersion, in SessionConfiguration sessionConfiguration,
415 int deviceId, int devicePolicy);
Avichal Rakesh3c522e22024-02-07 16:40:46 -0800416
417 /**
418 * Get the camera characteristics for a particular session configuration for
419 * the given camera device.
420 *
421 * @param cameraId ID of the device for which the session characteristics must be fetched.
Avichal Rakeshcaf179b2024-04-04 18:42:46 -0700422 * @param targetSdkVersion the target sdk level of the application calling this function.
Jayant Chowdhary81d81b02024-02-15 19:13:39 +0000423 * @param rotationOverride Whether to override the sensor orientation information to
424 * correspond to portrait: {@link ICameraService#ROTATION_OVERRIDE_OVERRIDE_TO_PORTRAIT}
425 * will override the sensor orientation and rotate and crop, while {@link
426 * ICameraService#ROTATION_OVERRIDE_ROTATION_ONLY} will rotate and crop the camera feed
427 * without changing the sensor orientation.
Biswarup Pal37a75182024-01-16 15:53:35 +0000428 * @param sessionConfiguration Session configuration for which the characteristics
Avichal Rakeshcaf179b2024-04-04 18:42:46 -0700429 * must be fetched.
Biswarup Pal37a75182024-01-16 15:53:35 +0000430 * @param deviceId The device id of the context associated with the caller.
431 * @param devicePolicy The camera policy of the device of the associated context (default
432 * policy for default device context). Only virtual cameras would be exposed
433 * only for custom policy and only real cameras would be exposed for default
434 * policy.
435 * @return Characteristics associated with the given session.
Avichal Rakesh3c522e22024-02-07 16:40:46 -0800436 */
437 CameraMetadataNative getSessionCharacteristics(@utf8InCpp String cameraId,
Biswarup Pal37a75182024-01-16 15:53:35 +0000438 int targetSdkVersion,
Jayant Chowdhary81d81b02024-02-15 19:13:39 +0000439 int rotationOverride,
Biswarup Pal37a75182024-01-16 15:53:35 +0000440 in SessionConfiguration sessionConfiguration,
441 int deviceId,
442 int devicePolicy);
Eino-Ville Talvalad56db1d2015-12-17 16:50:35 -0800443}