Loading core/java/android/hardware/camera2/CameraManager.java +7 −4 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading @@ -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; Loading Loading
core/java/android/hardware/camera2/CameraManager.java +7 −4 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading @@ -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; Loading