Code example for ConditionVariable

Methods: block, close

0
                        mCamera.setPreviewCallback((PreviewCallback) msg.obj);
                        break; 
 
                    case ENABLE_SHUTTER_SOUND:
                        enableShutterSound((msg.arg1 == 1) ? true : false);
                        break; 
 
                    case WAIT_FOR_IDLE:
                        // do nothing 
                        break; 
 
                    default: 
                        throw new RuntimeException("Invalid CameraProxy message=" + msg.what);
                } 
            } catch (RuntimeException e) {
                if (msg.what != RELEASE && mCamera != null) {
                    try { 
                        mCamera.release();
                    } catch (Exception ex) {
                        Log.e(TAG, "Fail to release the camera.");
                    }