1/*
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.IProCameraUser;
22import android.hardware.IProCameraCallbacks;
23import android.hardware.camera2.ICameraDeviceUser;
24import android.hardware.camera2.ICameraDeviceCallbacks;
25import android.hardware.camera2.impl.CameraMetadataNative;
26import android.hardware.camera2.utils.BinderHolder;
27import android.hardware.ICameraServiceListener;
28import android.hardware.CameraInfo;
29
30/** @hide */
31interface ICameraService
32{
33    /**
34     * Keep up-to-date with frameworks/av/include/camera/ICameraService.h
35     */
36    int getNumberOfCameras();
37
38    // rest of 'int' return values in this file are actually status_t
39
40    int getCameraInfo(int cameraId, out CameraInfo info);
41
42    int connect(ICameraClient client, int cameraId,
43                    String clientPackageName,
44                    int clientUid,
45                    // Container for an ICamera object
46                    out BinderHolder device);
47
48    int connectPro(IProCameraCallbacks callbacks, int cameraId,
49                              String clientPackageName,
50                              int clientUid,
51                              // Container for an IProCameraUser object
52                              out BinderHolder device);
53
54    int connectDevice(ICameraDeviceCallbacks callbacks, int cameraId,
55                              String clientPackageName,
56                              int clientUid,
57                              // Container for an ICameraDeviceUser object
58                              out BinderHolder device);
59
60    int addListener(ICameraServiceListener listener);
61    int removeListener(ICameraServiceListener listener);
62
63    int getCameraCharacteristics(int cameraId, out CameraMetadataNative info);
64
65    /**
66     * The java stubs for this method are not intended to be used.  Please use
67     * the native stub in frameworks/av/include/camera/ICameraService.h instead.
68     * The BinderHolder output is being used as a placeholder, and will not be
69     * well-formatted in the generated java method.
70     */
71    int getCameraVendorTagDescriptor(out BinderHolder desc);
72
73    // Writes the camera1 parameters into a single-element array.
74    int getLegacyParameters(int cameraId, out String[] parameters);
75    // Determines if a particular API version is supported; see ICameraService.h for version defines
76    int supportsCameraApi(int cameraId, int apiVersion);
77
78    int connectLegacy(ICameraClient client, int cameraId,
79                    int halVersion,
80                    String clientPackageName,
81                    int clientUid,
82                    // Container for an ICamera object
83                    out BinderHolder device);
84}
85