Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3bffe32 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "CameraManager: Update display size query"

parents 0ae344f0 17629e2e
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.annotation.SystemService;
import android.annotation.TestApi;
import android.content.Context;
import android.content.pm.PackageManager;
import android.graphics.Point;
import android.hardware.CameraStatus;
import android.hardware.ICameraService;
import android.hardware.ICameraServiceListener;
@@ -458,12 +459,14 @@ public final class CameraManager {
                    (DisplayManager) mContext.getSystemService(Context.DISPLAY_SERVICE);
            Display display = displayManager.getDisplay(Display.DEFAULT_DISPLAY);
            if (display != null) {
                int width = display.getWidth();
                int height = display.getHeight();
                Point sz = new Point();
                display.getRealSize(sz);
                int width = sz.x;
                int height = sz.y;

                if (height > width) {
                    height = width;
                    width = display.getHeight();
                    width = sz.y;
                }

                ret = new Size(width, height);
@@ -471,7 +474,7 @@ public final class CameraManager {
                Log.e(TAG, "Invalid default display!");
            }
        } catch (Exception e) {
            Log.e(TAG, "getDisplaySize Failed. " + e.toString());
            Log.e(TAG, "getDisplaySize Failed. " + e);
        }

        return ret;