summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2015-08-14 13:12:32 -0700
committerEino-Ville Talvala <etalvala@google.com>2015-08-14 16:02:03 -0700
commitbad4358c83c7daaf9eeb8542c15eea4f473c884c (patch)
tree0b01065e69f769a7dc058b8ac6652ef93d4736ed /camera
parent49f0246c2eac50bbfebf48316b1086de64ac9860 (diff)
downloadframeworks_av-bad4358c83c7daaf9eeb8542c15eea4f473c884c.zip
frameworks_av-bad4358c83c7daaf9eeb8542c15eea4f473c884c.tar.gz
frameworks_av-bad4358c83c7daaf9eeb8542c15eea4f473c884c.tar.bz2
Camera: Add camera type to ICameraService.getNumberOfCameras.
Also determine the number of 'normal' cameras present on camera service startup, and ensure that all normal cameras have IDs lower than the 'strange' cameras. Bug: 23194168 Change-Id: I1f7b14825cb52707de698a955f85da1eaa932663
Diffstat (limited to 'camera')
-rw-r--r--camera/ICameraService.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/camera/ICameraService.cpp b/camera/ICameraService.cpp
index 7c9720f..b359f57 100644
--- a/camera/ICameraService.cpp
+++ b/camera/ICameraService.cpp
@@ -94,11 +94,18 @@ public:
{
}
- // get number of cameras available
+ // get number of cameras available that support standard camera operations
virtual int32_t getNumberOfCameras()
{
+ return getNumberOfCameras(CAMERA_TYPE_BACKWARD_COMPATIBLE);
+ }
+
+ // get number of cameras available of a given type
+ virtual int32_t getNumberOfCameras(int type)
+ {
Parcel data, reply;
data.writeInterfaceToken(ICameraService::getInterfaceDescriptor());
+ data.writeInt32(type);
remote()->transact(BnCameraService::GET_NUMBER_OF_CAMERAS, data, &reply);
if (readExceptionCode(reply)) return 0;
@@ -337,7 +344,7 @@ status_t BnCameraService::onTransact(
case GET_NUMBER_OF_CAMERAS: {
CHECK_INTERFACE(ICameraService, data, reply);
reply->writeNoException();
- reply->writeInt32(getNumberOfCameras());
+ reply->writeInt32(getNumberOfCameras(data.readInt32()));
return NO_ERROR;
} break;
case GET_CAMERA_INFO: {