OK, so for "Face in". It's either a kernel feature (most likely), or a feature associated with "libmedia.so" (even though the error is thrown by "libmedia_jni.iso", it's just the JNI for "libmedia.so", not the actual library). The feature is simple: enabling both back (primary, ID#0) and front (secondary, ID#1) cameras to open at the same time.
Decompile "Face in" (DualCamera.apk) and open "\com\sonymobile\android\addoncamera\dual\device\CameraDevicesManager.smali", comment out these lines and recompile it.
http://oi60.tinypic.com/eog2s.jpg
After commenting out the lines and recompiling it, this is what you get when the app treats the back camera both as front and back camera. (attached)
The key function here is this:
Code:
#const/4 v1, 0x1
...
#invoke-direct {v0, v1, v2}, Lcom/sonymobile/android/addoncamera/dual/device/CameraDeviceHandler;-><init>(ILandroid/hardware/Camera$PreviewCallback;)V
v1 is the Camera ID. which is saved by DeviceCameraHandler's constructor, like this:
Code:
iput p1, p0, Lcom/sonymobile/android/addoncamera/dual/device/CameraDeviceHandler;->mCameraDeviceId:I
Then (com\sonyericsson\cameracommon\activity\BaseExtendedActivity$StartUpGuardian.smali) calls:
Code:
Lcom/sonyericsson/cameracommon/activity/BaseActivity;->resumeAll()V
calls (DualCameraActivity.smali):
Code:
Lcom/sonymobile/android/addoncamera/dual/device/CameraDeviceHandler;->requestStartCameraOpen(Landroid/content/Context;)V
calls (device\CameraDeviceHandler.smali):
Code:
Lcom/sonymobile/android/addoncamera/dual/device/CameraDeviceHandler;->startCameraOpen(Landroid/content/Context;)V
calls (device\CameraDeviceHandler.smali):
Code:
invoke-static {}, Ljava/util/concurrent/Executors;->newSingleThreadExecutor()Ljava/util/concurrent/ExecutorService;
move-result-object v1
iget-object v2, p0, Lcom/sonymobile/android/addoncamera/dual/device/CameraDeviceHandler;->mOpenDeviceTask:Lcom/sonymobile/android/addoncamera/dual/device/CameraDeviceHandler$OpenDeviceTask;
invoke-interface {v1, v2}, Ljava/util/concurrent/ExecutorService;->submit(Ljava/util/concurrent/Callable;)Ljava/util/concurrent/Future;
internally calls:
Code:
Lcom/sonymobile/android/addoncamera/dual/device/CameraDeviceHandler$OpenDeviceTask;->call()Ljava/lang/Object;
calls (device/CameraDeviceHandler$OpenDeviceTask.smali):
Code:
Lcom/sonymobile/android/addoncamera/dual/device/CameraDeviceHandler$OpenDeviceTask;->call()Landroid/hardware/Camera;
calls (device/CameraDeviceHandler$OpenDeviceTask.smali):
Code:
Lcom/sonymobile/android/addoncamera/dual/device/CameraDeviceHandler$OpenDeviceTask;->openCamera()Z
calls (device/CameraDeviceHandler$OpenDeviceTask.smali):
Code:
invoke-static {v4}, Landroid/hardware/Camera;->open(I)Landroid/hardware/Camera;
while v4 is that "mCameraDeviceId" that was saved earlier.
The only solution I know is possible is, using only the back camera, and the moment you take a photo, take a photo with the back camera, turn off the back camera, turn on the front camera and take a photo, turn off the front camera and turn on the back camera again, and process the photo.