summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Sparks <davidsparks@android.com>2009-05-20 20:02:59 -0700
committerDave Sparks <davidsparks@android.com>2009-05-20 20:02:59 -0700
commitb1f3b8f7cb6c1d22b63bade2d75d54ceb4196070 (patch)
tree14ba5b9ba911b4cef058505a64be162dad9b09bb
parent6690dc54546809c973f7f630e6488fcd81dfaa82 (diff)
downloadframeworks_base-b1f3b8f7cb6c1d22b63bade2d75d54ceb4196070.zip
frameworks_base-b1f3b8f7cb6c1d22b63bade2d75d54ceb4196070.tar.gz
frameworks_base-b1f3b8f7cb6c1d22b63bade2d75d54ceb4196070.tar.bz2
Fix permission hole in camera service. Some debugging code was added
to CameraService::onTransact() method during development. Later on the entire onTransact() method was #ifdef'd out, which inadvertently omitted the permissions check code. This change restores the code.
-rw-r--r--camera/libcameraservice/CameraService.cpp7
-rw-r--r--camera/libcameraservice/CameraService.h2
2 files changed, 3 insertions, 6 deletions
diff --git a/camera/libcameraservice/CameraService.cpp b/camera/libcameraservice/CameraService.cpp
index f85ea9f..46fc2d0 100644
--- a/camera/libcameraservice/CameraService.cpp
+++ b/camera/libcameraservice/CameraService.cpp
@@ -1052,8 +1052,6 @@ status_t CameraService::dump(int fd, const Vector<String16>& args)
}
-#if DEBUG_HEAP_LEAKS
-
#define CHECK_INTERFACE(interface, data, reply) \
do { if (!data.enforceInterface(interface::getInterfaceDescriptor())) { \
LOGW("Call incorrectly routed to " #interface); \
@@ -1085,6 +1083,8 @@ status_t CameraService::onTransact(
status_t err = BnCameraService::onTransact(code, data, reply, flags);
+#if DEBUG_HEAP_LEAKS
+
LOGD("+++ onTransact err %d code %d", err, code);
if (err == UNKNOWN_TRANSACTION || err == PERMISSION_DENIED) {
@@ -1120,9 +1120,8 @@ status_t CameraService::onTransact(
break;
}
}
+#endif // DEBUG_HEAP_LEAKS
return err;
}
-#endif // DEBUG_HEAP_LEAKS
-
}; // namespace android
diff --git a/camera/libcameraservice/CameraService.h b/camera/libcameraservice/CameraService.h
index 6752f26..a421fd3 100644
--- a/camera/libcameraservice/CameraService.h
+++ b/camera/libcameraservice/CameraService.h
@@ -58,10 +58,8 @@ public:
void removeClient(const sp<ICameraClient>& cameraClient);
-#if DEBUG_HEAP_LEAKS
virtual status_t onTransact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags);
-#endif
private: