Camera:Retain dumpsys logs from previous open session.

When cameraserver is started and no devices have been open yet, there
will be no previous retained info in the dumpsys.If a single device is
open and closed, dumpsys taken during closed camera will show the
previous open session info.

If multiple devices are open and any of the devices disconnect, info for
all the devices open will be retained and will be available in dumpsys
output.

All the cached data will be cleared during new connect device session.

bug: 185140738
Test: Tested locally. Camera CTS tests pass.
Change-Id: I60470ab148c5df2a5de0cf3abcf02e07cbc99a0d
diff --git a/services/camera/libcameraservice/common/Camera2ClientBase.cpp b/services/camera/libcameraservice/common/Camera2ClientBase.cpp
index ce479a1..56e5ae1 100644
--- a/services/camera/libcameraservice/common/Camera2ClientBase.cpp
+++ b/services/camera/libcameraservice/common/Camera2ClientBase.cpp
@@ -195,6 +195,8 @@
 
     ALOGV("Camera %s: Shutting down", TClientBase::mCameraIdStr.string());
 
+    // Before detaching the device, cache the info from current open session
+    Camera2ClientBase::getCameraService()->cacheDump();
     detachDevice();
 
     CameraService::BasicClient::disconnect();