Android don˙t detect rule

Hello guys!

Can not figure out for couple of days now how to resolve my flipped picture from front camera on Android 4.

I want to rotate them on this way, but for some reason android don`t detect rule for front facing camera and OS version.

public static float getDegree(int exifOrientation) {
    if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_90)
        return 180;
    else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_180)
        return 270;
    else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_270)
        return 0;

    Camera.CameraInfo info = new Camera.CameraInfo();
    android.hardware.Camera.getCameraInfo(0, info);
    if (android.os.Build.VERSION.SDK_INT>13 && info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT)
        return 270;
    else {
        return 90;

Any suggestions?

You have more returns in one method. They do not mutally exclude. You have two if-else statements. If the first applies, the function returns, without evaluating the second. Use a variable, and only put a return in the last line of the function.