1 /*
2  * Copyright (C) 2014 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 com.android.camera.one;
18 
19 import android.os.Handler;
20 
21 import com.android.camera.device.CameraId;
22 import com.android.camera.one.OneCamera.Facing;
23 
24 /**
25  * The camera manager is responsible for providing details about the
26  * available camera hardware on the current device.
27  */
28 public interface OneCameraManager {
29 
30     /**
31      * Returns true if this hardware platform currently has any cameras at
32      * all.
33      */
hasCamera()34     public boolean hasCamera();
35 
36     /**
37      * Returns whether the device has a camera facing the given direction.
38      */
hasCameraFacing(Facing facing)39     public boolean hasCameraFacing(Facing facing);
40 
41     /**
42      * Get a platform specific device key for the first camera in the list
43      * of all camera devices.
44      */
findFirstCamera()45     public CameraId findFirstCamera();
46 
47     /**
48      * Get a platform specific device key for a camera facing a particular
49      * direction.
50      */
findFirstCameraFacing(Facing facing)51     public CameraId findFirstCameraFacing(Facing facing);
52 
53     /**
54      * Retrieve the characteristics for the camera facing at the given
55      * direction. The first camera found in the given direction will be chosen.
56      *
57      * @return A #{link com.android.camera.one.OneCameraCharacteristics} object
58      *         to provide camera characteristics information. Returns null if
59      *         there is no camera facing the given direction.
60      */
getOneCameraCharacteristics(CameraId cameraId)61     public OneCameraCharacteristics getOneCameraCharacteristics(CameraId cameraId)
62           throws OneCameraAccessException;
63 
setAvailabilityCallback(AvailabilityCallback callback, Handler handler)64     public void setAvailabilityCallback(AvailabilityCallback callback, Handler handler);
65 
66     public interface AvailabilityCallback {
onCameraAccessPrioritiesChanged()67         public void onCameraAccessPrioritiesChanged();
68     }
69 
70     public static class Factory {
71 
72     }
73 }