From da93377bc9387796b4e9664f1b9d3b3f56c3991b Mon Sep 17 00:00:00 2001 From: Ravneet Dhanjal Date: Tue, 4 Jun 2024 21:41:16 +0000 Subject: Camera: Fix lint errors added by EFV APIs - Add private constructor to fix error: Fully-static utility classes must not have constructor - Update lint-baseline to reflect currently merged EFV API Test: Camera CTS Bug: 300065685 Change-Id: Ibc8b8079a8036109a9e85d4be3777764738cb493 --- core/api/current.txt | 2 -- core/api/lint-baseline.txt | 24 ---------------------- .../hardware/camera2/ExtensionCaptureRequest.java | 4 +++- .../hardware/camera2/ExtensionCaptureResult.java | 4 +++- 4 files changed, 6 insertions(+), 28 deletions(-) diff --git a/core/api/current.txt b/core/api/current.txt index 53cf7d59f974..3d96cddbe047 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -19904,7 +19904,6 @@ package android.hardware.camera2 { } @FlaggedApi("com.android.internal.camera.flags.concert_mode_api") public final class ExtensionCaptureRequest { - ctor public ExtensionCaptureRequest(); field @FlaggedApi("com.android.internal.camera.flags.concert_mode_api") @NonNull public static final android.hardware.camera2.CaptureRequest.Key EFV_AUTO_ZOOM; field @FlaggedApi("com.android.internal.camera.flags.concert_mode_api") @NonNull public static final android.hardware.camera2.CaptureRequest.Key EFV_MAX_PADDING_ZOOM_FACTOR; field @FlaggedApi("com.android.internal.camera.flags.concert_mode_api") @NonNull public static final android.hardware.camera2.CaptureRequest.Key EFV_PADDING_ZOOM_FACTOR; @@ -19917,7 +19916,6 @@ package android.hardware.camera2 { } @FlaggedApi("com.android.internal.camera.flags.concert_mode_api") public final class ExtensionCaptureResult { - ctor public ExtensionCaptureResult(); field @FlaggedApi("com.android.internal.camera.flags.concert_mode_api") @NonNull public static final android.hardware.camera2.CaptureResult.Key EFV_AUTO_ZOOM; field @FlaggedApi("com.android.internal.camera.flags.concert_mode_api") @NonNull public static final android.hardware.camera2.CaptureResult.Key EFV_AUTO_ZOOM_PADDING_REGION; field @FlaggedApi("com.android.internal.camera.flags.concert_mode_api") @NonNull public static final android.hardware.camera2.CaptureResult.Key EFV_MAX_PADDING_ZOOM_FACTOR; diff --git a/core/api/lint-baseline.txt b/core/api/lint-baseline.txt index 1b0da055038d..e6a7ca5bf54c 100644 --- a/core/api/lint-baseline.txt +++ b/core/api/lint-baseline.txt @@ -245,14 +245,6 @@ BroadcastBehavior: android.telephony.euicc.EuiccManager#ACTION_NOTIFY_CARRIER_SE Field 'ACTION_NOTIFY_CARRIER_SETUP_INCOMPLETE' is missing @BroadcastBehavior -CompileTimeConstant: android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_GIMBAL: - All constants must be defined at compile time: android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_GIMBAL -CompileTimeConstant: android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_LOCKED: - All constants must be defined at compile time: android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_LOCKED -CompileTimeConstant: android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_OFF: - All constants must be defined at compile time: android.hardware.camera2.ExtensionCaptureRequest#EFV_STABILIZATION_MODE_OFF - - DeprecationMismatch: android.accounts.AccountManager#newChooseAccountIntent(android.accounts.Account, java.util.ArrayList, String[], boolean, String, String, String[], android.os.Bundle): Method android.accounts.AccountManager.newChooseAccountIntent(android.accounts.Account, java.util.ArrayList, String[], boolean, String, String, String[], android.os.Bundle): @Deprecated annotation (present) and @deprecated doc tag (not present) do not match DeprecationMismatch: android.app.Activity#enterPictureInPictureMode(): @@ -1095,14 +1087,6 @@ RequiresPermission: android.webkit.WebSettings#setGeolocationEnabled(boolean): Method 'setGeolocationEnabled' documentation mentions permissions without declaring @RequiresPermission -StaticUtils: ExtensionCaptureRequest: - Fully-static utility classes must not have constructor -StaticUtils: android.hardware.camera2.ExtensionCaptureRequest: - Fully-static utility classes must not have constructor -StaticUtils: android.hardware.camera2.ExtensionCaptureResult: - Fully-static utility classes must not have constructor - - Todo: android.hardware.camera2.params.StreamConfigurationMap: Documentation mentions 'TODO' Todo: android.provider.ContactsContract.RawContacts#newEntityIterator(android.database.Cursor): @@ -1462,14 +1446,6 @@ UnflaggedApi: android.graphics.text.PositionedGlyphs#getItalicOverride(int): UnflaggedApi: android.graphics.text.PositionedGlyphs#getWeightOverride(int): New API must be flagged with @FlaggedApi: method android.graphics.text.PositionedGlyphs.getWeightOverride(int) -UnflaggedApi: android.hardware.camera2.ExtensionCaptureRequest: - New API must be flagged with @FlaggedApi: class android.hardware.camera2.ExtensionCaptureRequest -UnflaggedApi: android.hardware.camera2.ExtensionCaptureRequest#ExtensionCaptureRequest(): - New API must be flagged with @FlaggedApi: constructor android.hardware.camera2.ExtensionCaptureRequest() -UnflaggedApi: android.hardware.camera2.ExtensionCaptureResult: - New API must be flagged with @FlaggedApi: class android.hardware.camera2.ExtensionCaptureResult -UnflaggedApi: android.hardware.camera2.ExtensionCaptureResult#ExtensionCaptureResult(): - New API must be flagged with @FlaggedApi: constructor android.hardware.camera2.ExtensionCaptureResult() UnflaggedApi: android.media.MediaRoute2Info#TYPE_REMOTE_CAR: New API must be flagged with @FlaggedApi: field android.media.MediaRoute2Info.TYPE_REMOTE_CAR UnflaggedApi: android.media.MediaRoute2Info#TYPE_REMOTE_COMPUTER: diff --git a/core/java/android/hardware/camera2/ExtensionCaptureRequest.java b/core/java/android/hardware/camera2/ExtensionCaptureRequest.java index c33956b59f2f..b681ce40dfd9 100644 --- a/core/java/android/hardware/camera2/ExtensionCaptureRequest.java +++ b/core/java/android/hardware/camera2/ExtensionCaptureRequest.java @@ -18,7 +18,6 @@ package android.hardware.camera2; import android.annotation.FlaggedApi; import android.annotation.NonNull; -import android.hardware.camera2.CameraCharacteristics; import android.hardware.camera2.CaptureRequest; import android.hardware.camera2.CaptureRequest.Key; import android.hardware.camera2.impl.ExtensionKey; @@ -43,6 +42,9 @@ import com.android.internal.camera.flags.Flags; @FlaggedApi(Flags.FLAG_CONCERT_MODE_API) public final class ExtensionCaptureRequest { + /** To avoid exposing constructor */ + private ExtensionCaptureRequest() {} + /** *

Used to apply an additional digital zoom factor for the * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_EYES_FREE_VIDEOGRAPHY } diff --git a/core/java/android/hardware/camera2/ExtensionCaptureResult.java b/core/java/android/hardware/camera2/ExtensionCaptureResult.java index 95feb2fd268a..b7ba78cb34b5 100644 --- a/core/java/android/hardware/camera2/ExtensionCaptureResult.java +++ b/core/java/android/hardware/camera2/ExtensionCaptureResult.java @@ -18,7 +18,6 @@ package android.hardware.camera2; import android.annotation.FlaggedApi; import android.annotation.NonNull; -import android.hardware.camera2.CameraCharacteristics; import android.hardware.camera2.CameraExtensionCharacteristics; import android.hardware.camera2.CaptureResult; import android.hardware.camera2.CaptureResult.Key; @@ -45,6 +44,9 @@ import com.android.internal.camera.flags.Flags; @FlaggedApi(Flags.FLAG_CONCERT_MODE_API) public final class ExtensionCaptureResult { + /** To avoid exposing constructor */ + private ExtensionCaptureResult() {} + /** *

The padding region for the * {@link android.hardware.camera2.CameraExtensionCharacteristics#EXTENSION_EYES_FREE_VIDEOGRAPHY } -- cgit v1.2.3-59-g8ed1b