Add annotations to Camera2 simple objects' methods.

Test: Built locally.
Bug: 236187068
Change-Id: Ie68d712db54b770a4d27f520912b45ed03fc449b
This commit is contained in:
Austin Borger
2022-08-15 16:36:31 -07:00
parent 5a15ad16bd
commit 15e7c2ce3f
3 changed files with 6 additions and 4 deletions

View File

@@ -18219,7 +18219,7 @@ package android.hardware.camera2.params {
method public android.graphics.Point getLeftEyePosition();
method public android.graphics.Point getMouthPosition();
method public android.graphics.Point getRightEyePosition();
method public int getScore();
method @IntRange(from=android.hardware.camera2.params.Face.SCORE_MIN, to=android.hardware.camera2.params.Face.SCORE_MAX) public int getScore();
field public static final int ID_UNSUPPORTED = -1; // 0xffffffff
field public static final int SCORE_MAX = 100; // 0x64
field public static final int SCORE_MIN = 1; // 0x1
@@ -18234,7 +18234,7 @@ package android.hardware.camera2.params {
method @NonNull public android.hardware.camera2.params.Face.Builder setLeftEyePosition(@NonNull android.graphics.Point);
method @NonNull public android.hardware.camera2.params.Face.Builder setMouthPosition(@NonNull android.graphics.Point);
method @NonNull public android.hardware.camera2.params.Face.Builder setRightEyePosition(@NonNull android.graphics.Point);
method @NonNull public android.hardware.camera2.params.Face.Builder setScore(int);
method @NonNull public android.hardware.camera2.params.Face.Builder setScore(@IntRange(from=android.hardware.camera2.params.Face.SCORE_MIN, to=android.hardware.camera2.params.Face.SCORE_MAX) int);
}
public final class InputConfiguration {

View File

@@ -204,7 +204,7 @@ public final class DeviceStateSensorOrientationMap {
*
*/
@SuppressLint("MissingGetterMatchingBuilder")
public @NonNull Builder addOrientationForState(long deviceState, long angle) {
public @NonNull Builder addOrientationForState(@DeviceState long deviceState, long angle) {
if (angle % 90 != 0) {
throw new IllegalArgumentException("Sensor orientation not divisible by 90: "
+ angle);

View File

@@ -17,6 +17,7 @@
package android.hardware.camera2.params;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.graphics.Point;
@@ -173,6 +174,7 @@ public final class Face {
* @see #SCORE_MAX
* @see #SCORE_MIN
*/
@IntRange(from = SCORE_MIN, to = SCORE_MAX)
public int getScore() {
return mScore;
}
@@ -377,7 +379,7 @@ public final class Face {
* @param score Confidence level between {@value #SCORE_MIN}-{@value #SCORE_MAX}.
* @return This builder.
*/
public @NonNull Builder setScore(int score) {
public @NonNull Builder setScore(@IntRange(from = SCORE_MIN, to = SCORE_MAX) int score) {
checkNotUsed();
checkScore(score);
mBuilderFieldsSet |= FIELD_SCORE;