diff options
author | Jay Shrauner <shrauner@google.com> | 2015-04-11 12:45:39 -0700 |
---|---|---|
committer | Jay Shrauner <shrauner@google.com> | 2015-04-11 12:54:35 -0700 |
commit | 85d3eec2d4cb984a783e7b5a033114b5cbc0a632 (patch) | |
tree | 69e4db3d798935de66059e6b2964260962491bab /telecomm | |
parent | 6036cd51265d31c08eefe0470a9f37e7f757aae8 (diff) | |
download | frameworks_base-85d3eec2d4cb984a783e7b5a033114b5cbc0a632.zip frameworks_base-85d3eec2d4cb984a783e7b5a033114b5cbc0a632.tar.gz frameworks_base-85d3eec2d4cb984a783e7b5a033114b5cbc0a632.tar.bz2 |
Add constructor without zoom
Add constructor without zoom params. Reorder params in constructor
with zoom to move zoom params to the end of the param list (API
guidelines). Reorder code to match param ordering. Tag all zoom related
methods with @hide.
Bug:20160534
Change-Id: Ic2149af82a5450666c49b8757daf6950bcb68977
Diffstat (limited to 'telecomm')
-rw-r--r-- | telecomm/java/android/telecom/CameraCapabilities.java | 71 |
1 files changed, 42 insertions, 29 deletions
diff --git a/telecomm/java/android/telecom/CameraCapabilities.java b/telecomm/java/android/telecom/CameraCapabilities.java index f968c13..6eaf6a2 100644 --- a/telecomm/java/android/telecom/CameraCapabilities.java +++ b/telecomm/java/android/telecom/CameraCapabilities.java @@ -26,6 +26,16 @@ import android.os.Parcelable; public final class CameraCapabilities implements Parcelable { /** + * The width of the camera video in pixels. + */ + private final int mWidth; + + /** + * The height of the camera video in pixels. + */ + private final int mHeight; + + /** * Whether the camera supports zoom. */ private final boolean mZoomSupported; @@ -36,28 +46,29 @@ public final class CameraCapabilities implements Parcelable { private final float mMaxZoom; /** - * The width of the camera video in pixels. - */ - private final int mWidth; - - /** - * The height of the camera video in pixels. + * Create a call camera capabilities instance that doesn't support zoom. + * + * @param width The width of the camera video (in pixels). + * @param height The height of the camera video (in pixels). */ - private final int mHeight; + public CameraCapabilities(int width, int height) { + this(width, height, false, 1.0f); + } /** * Create a call camera capabilities instance. * - * @param zoomSupported True when camera supports zoom. - * @param maxZoom Maximum zoom supported by camera. * @param width The width of the camera video (in pixels). * @param height The height of the camera video (in pixels). + * @param zoomSupported True when camera supports zoom. + * @param maxZoom Maximum zoom supported by camera. + * @hide */ - public CameraCapabilities(boolean zoomSupported, float maxZoom, int width, int height) { - mZoomSupported = zoomSupported; - mMaxZoom = maxZoom; + public CameraCapabilities(int width, int height, boolean zoomSupported, float maxZoom) { mWidth = width; mHeight = height; + mZoomSupported = zoomSupported; + mMaxZoom = maxZoom; } /** @@ -73,12 +84,12 @@ public final class CameraCapabilities implements Parcelable { */ @Override public CameraCapabilities createFromParcel(Parcel source) { - boolean supportsZoom = source.readByte() != 0; - float maxZoom = source.readFloat(); int width = source.readInt(); int height = source.readInt(); + boolean supportsZoom = source.readByte() != 0; + float maxZoom = source.readFloat(); - return new CameraCapabilities(supportsZoom, maxZoom, width, height); + return new CameraCapabilities(width, height, supportsZoom, maxZoom); } @Override @@ -108,37 +119,39 @@ public final class CameraCapabilities implements Parcelable { */ @Override public void writeToParcel(Parcel dest, int flags) { - dest.writeByte((byte) (isZoomSupported() ? 1 : 0)); - dest.writeFloat(getMaxZoom()); dest.writeInt(getWidth()); dest.writeInt(getHeight()); + dest.writeByte((byte) (isZoomSupported() ? 1 : 0)); + dest.writeFloat(getMaxZoom()); } /** - * Whether the camera supports zoom. + * The width of the camera video in pixels. */ - public boolean isZoomSupported() { - return mZoomSupported; + public int getWidth() { + return mWidth; } /** - * The maximum zoom supported by the camera. + * The height of the camera video in pixels. */ - public float getMaxZoom() { - return mMaxZoom; + public int getHeight() { + return mHeight; } /** - * The width of the camera video in pixels. + * Whether the camera supports zoom. + * @hide */ - public int getWidth() { - return mWidth; + public boolean isZoomSupported() { + return mZoomSupported; } /** - * The height of the camera video in pixels. + * The maximum zoom supported by the camera. + * @hide */ - public int getHeight() { - return mHeight; + public float getMaxZoom() { + return mMaxZoom; } } |