Fix API feedback on AuthenticatedKeyMetadata

Make class final.
Add @NonNull annotation to ctor param

Fixes: 262381995
Test: atest android.security.identity.cts
Change-Id: Icae24f120090ec03e532ffdf139513a1cb852c80
This commit is contained in:
Seth Moore
2022-12-13 10:08:54 -08:00
parent 8f870ada72
commit 23fc5c8d57
2 changed files with 4 additions and 4 deletions

View File

@@ -37652,7 +37652,7 @@ package android.security.identity {
ctor public AlreadyPersonalizedException(@NonNull String, @NonNull Throwable);
}
public class AuthenticationKeyMetadata {
public final class AuthenticationKeyMetadata {
method @NonNull public java.time.Instant getExpirationDate();
method @IntRange(from=0) public int getUsageCount();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2019 The Android Open Source Project
* Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,11 +24,11 @@ import java.time.Instant;
/**
* Data about authentication keys.
*/
public class AuthenticationKeyMetadata {
public final class AuthenticationKeyMetadata {
private int mUsageCount;
private Instant mExpirationDate;
AuthenticationKeyMetadata(int usageCount, Instant expirationDate) {
AuthenticationKeyMetadata(int usageCount, @NonNull Instant expirationDate) {
mUsageCount = usageCount;
mExpirationDate = expirationDate;
}