Address API review feedback
"Can the getters be made public so this can be CTS tested?"
"Please add getters and mark them @TestApi so CTS can use them."
"Antispoofkey and AntiSpoofkey should be AntispoofKey."
"please rename accountKey to something like deviceAccountKey"
Getters are added as SystemApi since @TestApi doesn't work well with mainline.
BUG: 218682005
BUG: 222489854
Test: unit test
Change-Id: Ia4cb720ac266e8e07650829a4d3473806e437522
diff --git a/nearby/framework/java/android/nearby/FastPairAccountKeyDeviceMetadata.java b/nearby/framework/java/android/nearby/FastPairAccountKeyDeviceMetadata.java
index e44707d..8861d90 100644
--- a/nearby/framework/java/android/nearby/FastPairAccountKeyDeviceMetadata.java
+++ b/nearby/framework/java/android/nearby/FastPairAccountKeyDeviceMetadata.java
@@ -36,20 +36,21 @@
}
/**
- * Get Account Key, which uniquely identifies a Fast Pair device associated with an account.
+ * Get Device Account Key, which uniquely identifies a Fast Pair device associated with an
+ * account.
*/
@Nullable
- public byte[] getAccountKey() {
- return mMetadataParcel.accountKey;
+ public byte[] getDeviceAccountKey() {
+ return mMetadataParcel.deviceAccountKey;
}
/**
- * Get a hash value of account key and public bluetooth address without revealing the public
- * bluetooth address.
+ * Get a hash value of device's account key and public bluetooth address without revealing the
+ * public bluetooth address.
*/
@Nullable
- public byte[] getSha256AccountKeyPublicAddress() {
- return mMetadataParcel.sha256AccountKeyPublicAddress;
+ public byte[] getSha256DeviceAccountKeyPublicAddress() {
+ return mMetadataParcel.sha256DeviceAccountKeyPublicAddress;
}
/**
@@ -86,8 +87,8 @@
*/
public Builder() {
mBuilderParcel = new FastPairAccountKeyDeviceMetadataParcel();
- mBuilderParcel.accountKey = null;
- mBuilderParcel.sha256AccountKeyPublicAddress = null;
+ mBuilderParcel.deviceAccountKey = null;
+ mBuilderParcel.sha256DeviceAccountKeyPublicAddress = null;
mBuilderParcel.metadata = null;
mBuilderParcel.discoveryItem = null;
}
@@ -95,25 +96,27 @@
/**
* Set Account Key.
*
- * @param accountKey Fast Pair device account key.
+ * @param deviceAccountKey Fast Pair device account key.
* @return The builder, to facilitate chaining {@code builder.setXXX(..).setXXX(..)}.
*/
@NonNull
- public Builder setAccountKey(@Nullable byte[] accountKey) {
- mBuilderParcel.accountKey = accountKey;
+ public Builder setDeviceAccountKey(@Nullable byte[] deviceAccountKey) {
+ mBuilderParcel.deviceAccountKey = deviceAccountKey;
return this;
}
/**
* Set sha256 account key and public address.
*
- * @param sha256AccountKeyPublicAddress Hash value of account key and public address.
+ * @param sha256DeviceAccountKeyPublicAddress Hash value of device's account key and public
+ * address.
* @return The builder, to facilitate chaining {@code builder.setXXX(..).setXXX(..)}.
*/
@NonNull
- public Builder setSha256AccountKeyPublicAddress(
- @Nullable byte[] sha256AccountKeyPublicAddress) {
- mBuilderParcel.sha256AccountKeyPublicAddress = sha256AccountKeyPublicAddress;
+ public Builder setSha256DeviceAccountKeyPublicAddress(
+ @Nullable byte[] sha256DeviceAccountKeyPublicAddress) {
+ mBuilderParcel.sha256DeviceAccountKeyPublicAddress =
+ sha256DeviceAccountKeyPublicAddress;
return this;
}
@@ -126,7 +129,11 @@
*/
@NonNull
public Builder setFastPairDeviceMetadata(@Nullable FastPairDeviceMetadata metadata) {
- mBuilderParcel.metadata = metadata.mMetadataParcel;
+ if (metadata == null) {
+ mBuilderParcel.metadata = null;
+ } else {
+ mBuilderParcel.metadata = metadata.mMetadataParcel;
+ }
return this;
}
@@ -138,7 +145,11 @@
*/
@NonNull
public Builder setFastPairDiscoveryItem(@Nullable FastPairDiscoveryItem discoveryItem) {
- mBuilderParcel.discoveryItem = discoveryItem.mMetadataParcel;
+ if (discoveryItem == null) {
+ mBuilderParcel.discoveryItem = null;
+ } else {
+ mBuilderParcel.discoveryItem = discoveryItem.mMetadataParcel;
+ }
return this;
}
diff --git a/nearby/framework/java/android/nearby/FastPairAntispoofKeyDeviceMetadata.java b/nearby/framework/java/android/nearby/FastPairAntispoofKeyDeviceMetadata.java
index 32fd043..ace00d4 100644
--- a/nearby/framework/java/android/nearby/FastPairAntispoofKeyDeviceMetadata.java
+++ b/nearby/framework/java/android/nearby/FastPairAntispoofKeyDeviceMetadata.java
@@ -23,6 +23,7 @@
/**
* Class for a type of registered Fast Pair device keyed by modelID, or antispoofKey.
+ *
* @hide
*/
@SystemApi
@@ -35,7 +36,32 @@
}
/**
- * Builder used to create FastPairAntispoofKeyDeviceMetadata.
+ * Get Antispoof public key.
+ *
+ * @hide
+ */
+ @SystemApi
+ @Nullable
+ public byte[] getAntispoofPublicKey() {
+ return this.mMetadataParcel.antispoofPublicKey;
+ }
+
+ /**
+ * Get metadata of a Fast Pair device type.
+ *
+ * @hide
+ */
+ @SystemApi
+ @Nullable
+ public FastPairDeviceMetadata getFastPairDeviceMetadata() {
+ if (this.mMetadataParcel.deviceMetadata == null) {
+ return null;
+ }
+ return new FastPairDeviceMetadata(this.mMetadataParcel.deviceMetadata);
+ }
+
+ /**
+ * Builder used to create FastPairAntispoofkeyDeviceMetadata.
*/
public static final class Builder {
@@ -46,20 +72,20 @@
*/
public Builder() {
mBuilderParcel = new FastPairAntispoofKeyDeviceMetadataParcel();
- mBuilderParcel.antiSpoofPublicKey = null;
+ mBuilderParcel.antispoofPublicKey = null;
mBuilderParcel.deviceMetadata = null;
}
/**
* Set AntiSpoof public key, which uniquely identify a Fast Pair device type.
*
- * @param antiSpoofPublicKey AntiSpoof public key.
+ * @param antispoofPublicKey AntiSpoof public key.
* @return The builder, to facilitate chaining {@code builder.setXXX(..).setXXX(..)}.
*/
@SuppressLint("MissingGetterMatchingBuilder")
@NonNull
- public Builder setAntiSpoofPublicKey(@Nullable byte[] antiSpoofPublicKey) {
- mBuilderParcel.antiSpoofPublicKey = antiSpoofPublicKey;
+ public Builder setAntispoofPublicKey(@Nullable byte[] antispoofPublicKey) {
+ mBuilderParcel.antispoofPublicKey = antispoofPublicKey;
return this;
}
@@ -73,7 +99,11 @@
@SuppressLint("MissingGetterMatchingBuilder")
@NonNull
public Builder setFastPairDeviceMetadata(@Nullable FastPairDeviceMetadata metadata) {
- mBuilderParcel.deviceMetadata = metadata.mMetadataParcel;
+ if (metadata != null) {
+ mBuilderParcel.deviceMetadata = metadata.mMetadataParcel;
+ } else {
+ mBuilderParcel.deviceMetadata = null;
+ }
return this;
}
diff --git a/nearby/framework/java/android/nearby/FastPairDataProviderBase.java b/nearby/framework/java/android/nearby/FastPairDataProviderBase.java
index dfb8760..abf0857 100644
--- a/nearby/framework/java/android/nearby/FastPairDataProviderBase.java
+++ b/nearby/framework/java/android/nearby/FastPairDataProviderBase.java
@@ -258,22 +258,22 @@
}
/**
- * Get allowlist of Fast Pair devices using a collection of accountKeys.
+ * Get allowlist of Fast Pair devices using a collection of deviceAccountKeys.
* Note that as a special case, empty list actually means all FastPair devices under the
* account instead of none.
*
- * @return allowlist of Fast Pair devices using a collection of accountKeys.
+ * @return allowlist of Fast Pair devices using a collection of deviceAccountKeys.
*/
- public @NonNull Collection<byte[]> getAccountKeys() {
- if (this.mMetadataRequestParcel.accountKeys == null) {
+ public @NonNull Collection<byte[]> getDeviceAccountKeys() {
+ if (this.mMetadataRequestParcel.deviceAccountKeys == null) {
return new ArrayList<byte[]>(0);
}
- List<byte[]> accountKeys =
- new ArrayList<>(this.mMetadataRequestParcel.accountKeys.length);
- for (ByteArrayParcel accountKey : this.mMetadataRequestParcel.accountKeys) {
- accountKeys.add(accountKey.byteArray);
+ List<byte[]> deviceAccountKeys =
+ new ArrayList<>(this.mMetadataRequestParcel.deviceAccountKeys.length);
+ for (ByteArrayParcel deviceAccountKey : this.mMetadataRequestParcel.deviceAccountKeys) {
+ deviceAccountKeys.add(deviceAccountKey.byteArray);
}
- return accountKeys;
+ return deviceAccountKeys;
}
}
diff --git a/nearby/framework/java/android/nearby/FastPairEligibleAccount.java b/nearby/framework/java/android/nearby/FastPairEligibleAccount.java
index 8195a16..1cc4ce8 100644
--- a/nearby/framework/java/android/nearby/FastPairEligibleAccount.java
+++ b/nearby/framework/java/android/nearby/FastPairEligibleAccount.java
@@ -38,6 +38,27 @@
}
/**
+ * Get Account.
+ *
+ * @hide
+ */
+ @SystemApi
+ @Nullable
+ public Account getAccount() {
+ return this.mAccountParcel.account;
+ }
+
+ /**
+ * Get OptIn Status.
+ *
+ * @hide
+ */
+ @SystemApi
+ public boolean isOptIn() {
+ return this.mAccountParcel.optIn;
+ }
+
+ /**
* Builder used to create FastPairEligibleAccount.
*/
public static final class Builder {
diff --git a/nearby/framework/java/android/nearby/aidl/FastPairAccountDevicesMetadataRequestParcel.aidl b/nearby/framework/java/android/nearby/aidl/FastPairAccountDevicesMetadataRequestParcel.aidl
index 5953935..fc3ba22 100644
--- a/nearby/framework/java/android/nearby/aidl/FastPairAccountDevicesMetadataRequestParcel.aidl
+++ b/nearby/framework/java/android/nearby/aidl/FastPairAccountDevicesMetadataRequestParcel.aidl
@@ -25,5 +25,5 @@
*/
parcelable FastPairAccountDevicesMetadataRequestParcel {
Account account;
- ByteArrayParcel[] accountKeys;
+ ByteArrayParcel[] deviceAccountKeys;
}
\ No newline at end of file
diff --git a/nearby/framework/java/android/nearby/aidl/FastPairAccountKeyDeviceMetadataParcel.aidl b/nearby/framework/java/android/nearby/aidl/FastPairAccountKeyDeviceMetadataParcel.aidl
index 8880d35..8014323 100644
--- a/nearby/framework/java/android/nearby/aidl/FastPairAccountKeyDeviceMetadataParcel.aidl
+++ b/nearby/framework/java/android/nearby/aidl/FastPairAccountKeyDeviceMetadataParcel.aidl
@@ -24,9 +24,9 @@
// TODO(b/204780849): remove unnecessary fields and polish comments.
parcelable FastPairAccountKeyDeviceMetadataParcel {
// Key of the Fast Pair device associated with the account.
- byte[] accountKey;
- // Hash function of account key and public bluetooth address.
- byte[] sha256AccountKeyPublicAddress;
+ byte[] deviceAccountKey;
+ // Hash function of device account key and public bluetooth address.
+ byte[] sha256DeviceAccountKeyPublicAddress;
// Fast Pair device metadata for the Fast Pair device.
FastPairDeviceMetadataParcel metadata;
// Fast Pair discovery item tied to both the Fast Pair device and the
diff --git a/nearby/framework/java/android/nearby/aidl/FastPairAntispoofKeyDeviceMetadataParcel.aidl b/nearby/framework/java/android/nearby/aidl/FastPairAntispoofKeyDeviceMetadataParcel.aidl
index 071d020..4fd4d4b 100644
--- a/nearby/framework/java/android/nearby/aidl/FastPairAntispoofKeyDeviceMetadataParcel.aidl
+++ b/nearby/framework/java/android/nearby/aidl/FastPairAntispoofKeyDeviceMetadataParcel.aidl
@@ -23,8 +23,8 @@
* {@hide}
*/
parcelable FastPairAntispoofKeyDeviceMetadataParcel {
- // Anti spoof public key.
- byte[] antiSpoofPublicKey;
+ // Anti-spoof public key.
+ byte[] antispoofPublicKey;
// Fast Pair device metadata for the Fast Pair device.
FastPairDeviceMetadataParcel deviceMetadata;
diff --git a/nearby/service/java/com/android/server/nearby/provider/FastPairDataProvider.java b/nearby/service/java/com/android/server/nearby/provider/FastPairDataProvider.java
index 35cb5d8..8420b60 100644
--- a/nearby/service/java/com/android/server/nearby/provider/FastPairDataProvider.java
+++ b/nearby/service/java/com/android/server/nearby/provider/FastPairDataProvider.java
@@ -157,23 +157,23 @@
* Loads FastPair devices for a list of accountKeys of a given account.
*
* @param account The account of the FastPair devices.
- * @param accountKeys The allow list of FastPair devices if it is not empty. Otherwise, the
- * function returns accountKeys of all FastPair devices under the account,
- * without detailed fields.
+ * @param deviceAccountKeys The allow list of FastPair devices if it is not empty. Otherwise,
+ * the function returns accountKeys of all FastPair devices under the
+ * account, without detailed fields.
*
* @throws IllegalStateException If ProxyFastPairDataProvider is not available.
*/
public List<Data.FastPairDeviceWithAccountKey> loadFastPairDeviceWithAccountKey(
- Account account, List<byte[]> accountKeys) {
+ Account account, List<byte[]> deviceAccountKeys) {
if (mProxyFastPairDataProvider != null) {
FastPairAccountDevicesMetadataRequestParcel requestParcel =
new FastPairAccountDevicesMetadataRequestParcel();
requestParcel.account = account;
- requestParcel.accountKeys = new ByteArrayParcel[accountKeys.size()];
+ requestParcel.deviceAccountKeys = new ByteArrayParcel[deviceAccountKeys.size()];
int i = 0;
- for (byte[] accountKey : accountKeys) {
- requestParcel.accountKeys[i] = new ByteArrayParcel();
- requestParcel.accountKeys[i].byteArray = accountKey;
+ for (byte[] deviceAccountKey : deviceAccountKeys) {
+ requestParcel.deviceAccountKeys[i] = new ByteArrayParcel();
+ requestParcel.deviceAccountKeys[i].byteArray = deviceAccountKey;
i = i + 1;
}
return Utils.convertToFastPairDevicesWithAccountKey(
diff --git a/nearby/service/java/com/android/server/nearby/provider/Utils.java b/nearby/service/java/com/android/server/nearby/provider/Utils.java
index 2c0cde6..22e31cd 100644
--- a/nearby/service/java/com/android/server/nearby/provider/Utils.java
+++ b/nearby/service/java/com/android/server/nearby/provider/Utils.java
@@ -55,12 +55,13 @@
}
Data.FastPairDeviceWithAccountKey.Builder fpDeviceBuilder =
Data.FastPairDeviceWithAccountKey.newBuilder();
- if (metadataParcel.accountKey != null) {
- fpDeviceBuilder.setAccountKey(ByteString.copyFrom(metadataParcel.accountKey));
+ if (metadataParcel.deviceAccountKey != null) {
+ fpDeviceBuilder.setAccountKey(
+ ByteString.copyFrom(metadataParcel.deviceAccountKey));
}
- if (metadataParcel.sha256AccountKeyPublicAddress != null) {
+ if (metadataParcel.sha256DeviceAccountKeyPublicAddress != null) {
fpDeviceBuilder.setSha256AccountKeyPublicAddress(
- ByteString.copyFrom(metadataParcel.sha256AccountKeyPublicAddress));
+ ByteString.copyFrom(metadataParcel.sha256DeviceAccountKeyPublicAddress));
}
Cache.StoredDiscoveryItem.Builder storedDiscoveryItemBuilder =
@@ -301,9 +302,9 @@
FastPairAntispoofKeyDeviceMetadataParcel metadata) {
Rpcs.Device.Builder deviceBuilder = Rpcs.Device.newBuilder();
- if (metadata.antiSpoofPublicKey != null) {
+ if (metadata.antispoofPublicKey != null) {
deviceBuilder.setAntiSpoofingKeyPair(Rpcs.AntiSpoofingKeyPair.newBuilder()
- .setPublicKey(ByteString.copyFrom(metadata.antiSpoofPublicKey))
+ .setPublicKey(ByteString.copyFrom(metadata.antispoofPublicKey))
.build());
}
if (metadata.deviceMetadata != null) {
@@ -489,10 +490,11 @@
FastPairAccountKeyDeviceMetadataParcel accountKeyDeviceMetadataParcel =
new FastPairAccountKeyDeviceMetadataParcel();
if (uploadInfo.getAccountKey() != null) {
- accountKeyDeviceMetadataParcel.accountKey = uploadInfo.getAccountKey().toByteArray();
+ accountKeyDeviceMetadataParcel.deviceAccountKey =
+ uploadInfo.getAccountKey().toByteArray();
}
if (uploadInfo.getSha256AccountKeyPublicAddress() != null) {
- accountKeyDeviceMetadataParcel.sha256AccountKeyPublicAddress =
+ accountKeyDeviceMetadataParcel.sha256DeviceAccountKeyPublicAddress =
uploadInfo.getSha256AccountKeyPublicAddress().toByteArray();
}
if (uploadInfo.getStoredDiscoveryItem() != null) {
diff --git a/nearby/tests/cts/fastpair/src/android/nearby/cts/FastPairAntispoofKeyDeviceMetadataTest.java b/nearby/tests/cts/fastpair/src/android/nearby/cts/FastPairAntispoofKeyDeviceMetadataTest.java
new file mode 100644
index 0000000..226efbb
--- /dev/null
+++ b/nearby/tests/cts/fastpair/src/android/nearby/cts/FastPairAntispoofKeyDeviceMetadataTest.java
@@ -0,0 +1,214 @@
+/*
+ * Copyright (C) 2021 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.nearby.cts;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.nearby.FastPairAntispoofKeyDeviceMetadata;
+import android.nearby.FastPairDeviceMetadata;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SdkSuppress;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+public class FastPairAntispoofKeyDeviceMetadataTest {
+
+ private static final String ASSISTANT_SETUP_HALFSHEET = "ASSISTANT_SETUP_HALFSHEET";
+ private static final String ASSISTANT_SETUP_NOTIFICATION = "ASSISTANT_SETUP_NOTIFICATION";
+ private static final int BLE_TX_POWER = 5;
+ private static final String CONFIRM_PIN_DESCRIPTION = "CONFIRM_PIN_DESCRIPTION";
+ private static final String CONFIRM_PIN_TITLE = "CONFIRM_PIN_TITLE";
+ private static final String CONNECT_SUCCESS_COMPANION_APP_INSTALLED =
+ "CONNECT_SUCCESS_COMPANION_APP_INSTALLED";
+ private static final String CONNECT_SUCCESS_COMPANION_APP_NOT_INSTALLED =
+ "CONNECT_SUCCESS_COMPANION_APP_NOT_INSTALLED";
+ private static final float DELTA = 0.001f;
+ private static final int DEVICE_TYPE = 7;
+ private static final String DOWNLOAD_COMPANION_APP_DESCRIPTION =
+ "DOWNLOAD_COMPANION_APP_DESCRIPTION";
+ private static final String FAIL_CONNECT_GOTO_SETTINGS_DESCRIPTION =
+ "FAIL_CONNECT_GOTO_SETTINGS_DESCRIPTION";
+ private static final String FAST_PAIR_TV_CONNECT_DEVICE_NO_ACCOUNT_DESCRIPTION =
+ "FAST_PAIR_TV_CONNECT_DEVICE_NO_ACCOUNT_DESCRIPTION";
+ private static final byte[] IMAGE = new byte[] {7, 9};
+ private static final String IMAGE_URL = "IMAGE_URL";
+ private static final String INITIAL_NOTIFICATION_DESCRIPTION =
+ "INITIAL_NOTIFICATION_DESCRIPTION";
+ private static final String INITIAL_NOTIFICATION_DESCRIPTION_NO_ACCOUNT =
+ "INITIAL_NOTIFICATION_DESCRIPTION_NO_ACCOUNT";
+ private static final String INITIAL_PAIRING_DESCRIPTION = "INITIAL_PAIRING_DESCRIPTION";
+ private static final String INTENT_URI = "INTENT_URI";
+ private static final String LOCALE = "LOCALE";
+ private static final String OPEN_COMPANION_APP_DESCRIPTION = "OPEN_COMPANION_APP_DESCRIPTION";
+ private static final String RETRO_ACTIVE_PAIRING_DESCRIPTION =
+ "RETRO_ACTIVE_PAIRING_DESCRIPTION";
+ private static final String SUBSEQUENT_PAIRING_DESCRIPTION = "SUBSEQUENT_PAIRING_DESCRIPTION";
+ private static final String SYNC_CONTACT_DESCRPTION = "SYNC_CONTACT_DESCRPTION";
+ private static final String SYNC_CONTACTS_TITLE = "SYNC_CONTACTS_TITLE";
+ private static final String SYNC_SMS_DESCRIPTION = "SYNC_SMS_DESCRIPTION";
+ private static final String SYNC_SMS_TITLE = "SYNC_SMS_TITLE";
+ private static final float TRIGGER_DISTANCE = 111;
+ private static final String TRUE_WIRELESS_IMAGE_URL_CASE = "TRUE_WIRELESS_IMAGE_URL_CASE";
+ private static final String TRUE_WIRELESS_IMAGE_URL_LEFT_BUD =
+ "TRUE_WIRELESS_IMAGE_URL_LEFT_BUD";
+ private static final String TRUE_WIRELESS_IMAGE_URL_RIGHT_BUD =
+ "TRUE_WIRELESS_IMAGE_URL_RIGHT_BUD";
+ private static final String UNABLE_TO_CONNECT_DESCRIPTION = "UNABLE_TO_CONNECT_DESCRIPTION";
+ private static final String UNABLE_TO_CONNECT_TITLE = "UNABLE_TO_CONNECT_TITLE";
+ private static final String UPDATE_COMPANION_APP_DESCRIPTION =
+ "UPDATE_COMPANION_APP_DESCRIPTION";
+ private static final String WAIT_LAUNCH_COMPANION_APP_DESCRIPTION =
+ "WAIT_LAUNCH_COMPANION_APP_DESCRIPTION";
+ private static final byte[] ANTI_SPOOFING_KEY = new byte[] {4, 5, 6};
+ private static final String NAME = "NAME";
+
+ @Test
+ @SdkSuppress(minSdkVersion = 32, codeName = "T")
+ public void testSetGetFastPairAntispoofKeyDeviceMetadataNotNull() {
+ FastPairDeviceMetadata fastPairDeviceMetadata = genFastPairDeviceMetadata();
+ FastPairAntispoofKeyDeviceMetadata fastPairAntispoofKeyDeviceMetadata =
+ genFastPairAntispoofKeyDeviceMetadata(ANTI_SPOOFING_KEY, fastPairDeviceMetadata);
+
+ assertThat(fastPairAntispoofKeyDeviceMetadata.getAntispoofPublicKey()).isEqualTo(
+ ANTI_SPOOFING_KEY);
+ ensureFastPairDeviceMetadataAsExpected(
+ fastPairAntispoofKeyDeviceMetadata.getFastPairDeviceMetadata());
+ }
+
+ @Test
+ @SdkSuppress(minSdkVersion = 32, codeName = "T")
+ public void testSetGetFastPairAntispoofKeyDeviceMetadataNull() {
+ FastPairAntispoofKeyDeviceMetadata fastPairAntispoofKeyDeviceMetadata =
+ genFastPairAntispoofKeyDeviceMetadata(null, null);
+ assertThat(fastPairAntispoofKeyDeviceMetadata.getAntispoofPublicKey()).isEqualTo(
+ null);
+ assertThat(fastPairAntispoofKeyDeviceMetadata.getFastPairDeviceMetadata()).isEqualTo(
+ null);
+ }
+
+ /* Verifies DeviceMetadata. */
+ private static void ensureFastPairDeviceMetadataAsExpected(FastPairDeviceMetadata metadata) {
+ assertThat(metadata.getAssistantSetupHalfSheet()).isEqualTo(ASSISTANT_SETUP_HALFSHEET);
+ assertThat(metadata.getAssistantSetupNotification())
+ .isEqualTo(ASSISTANT_SETUP_NOTIFICATION);
+ assertThat(metadata.getBleTxPower()).isEqualTo(BLE_TX_POWER);
+ assertThat(metadata.getConfirmPinDescription()).isEqualTo(CONFIRM_PIN_DESCRIPTION);
+ assertThat(metadata.getConfirmPinTitle()).isEqualTo(CONFIRM_PIN_TITLE);
+ assertThat(metadata.getConnectSuccessCompanionAppInstalled())
+ .isEqualTo(CONNECT_SUCCESS_COMPANION_APP_INSTALLED);
+ assertThat(metadata.getConnectSuccessCompanionAppNotInstalled())
+ .isEqualTo(CONNECT_SUCCESS_COMPANION_APP_NOT_INSTALLED);
+ assertThat(metadata.getDeviceType()).isEqualTo(DEVICE_TYPE);
+ assertThat(metadata.getDownloadCompanionAppDescription())
+ .isEqualTo(DOWNLOAD_COMPANION_APP_DESCRIPTION);
+ assertThat(metadata.getFailConnectGoToSettingsDescription())
+ .isEqualTo(FAIL_CONNECT_GOTO_SETTINGS_DESCRIPTION);
+ assertThat(metadata.getFastPairTvConnectDeviceNoAccountDescription())
+ .isEqualTo(FAST_PAIR_TV_CONNECT_DEVICE_NO_ACCOUNT_DESCRIPTION);
+ assertThat(metadata.getImage()).isEqualTo(IMAGE);
+ assertThat(metadata.getImageUrl()).isEqualTo(IMAGE_URL);
+ assertThat(metadata.getInitialNotificationDescription())
+ .isEqualTo(INITIAL_NOTIFICATION_DESCRIPTION);
+ assertThat(metadata.getInitialNotificationDescriptionNoAccount())
+ .isEqualTo(INITIAL_NOTIFICATION_DESCRIPTION_NO_ACCOUNT);
+ assertThat(metadata.getInitialPairingDescription()).isEqualTo(INITIAL_PAIRING_DESCRIPTION);
+ assertThat(metadata.getIntentUri()).isEqualTo(INTENT_URI);
+ assertThat(metadata.getLocale()).isEqualTo(LOCALE);
+ assertThat(metadata.getName()).isEqualTo(NAME);
+ assertThat(metadata.getOpenCompanionAppDescription())
+ .isEqualTo(OPEN_COMPANION_APP_DESCRIPTION);
+ assertThat(metadata.getRetroactivePairingDescription())
+ .isEqualTo(RETRO_ACTIVE_PAIRING_DESCRIPTION);
+ assertThat(metadata.getSubsequentPairingDescription())
+ .isEqualTo(SUBSEQUENT_PAIRING_DESCRIPTION);
+ assertThat(metadata.getSyncContactsDescription()).isEqualTo(SYNC_CONTACT_DESCRPTION);
+ assertThat(metadata.getSyncContactsTitle()).isEqualTo(SYNC_CONTACTS_TITLE);
+ assertThat(metadata.getSyncSmsDescription()).isEqualTo(SYNC_SMS_DESCRIPTION);
+ assertThat(metadata.getSyncSmsTitle()).isEqualTo(SYNC_SMS_TITLE);
+ assertThat(metadata.getTriggerDistance()).isWithin(DELTA).of(TRIGGER_DISTANCE);
+ assertThat(metadata.getTrueWirelessImageUrlCase()).isEqualTo(TRUE_WIRELESS_IMAGE_URL_CASE);
+ assertThat(metadata.getTrueWirelessImageUrlLeftBud())
+ .isEqualTo(TRUE_WIRELESS_IMAGE_URL_LEFT_BUD);
+ assertThat(metadata.getTrueWirelessImageUrlRightBud())
+ .isEqualTo(TRUE_WIRELESS_IMAGE_URL_RIGHT_BUD);
+ assertThat(metadata.getUnableToConnectDescription())
+ .isEqualTo(UNABLE_TO_CONNECT_DESCRIPTION);
+ assertThat(metadata.getUnableToConnectTitle()).isEqualTo(UNABLE_TO_CONNECT_TITLE);
+ assertThat(metadata.getUpdateCompanionAppDescription())
+ .isEqualTo(UPDATE_COMPANION_APP_DESCRIPTION);
+ assertThat(metadata.getWaitLaunchCompanionAppDescription())
+ .isEqualTo(WAIT_LAUNCH_COMPANION_APP_DESCRIPTION);
+ }
+
+ /* Generates FastPairAntispoofKeyDeviceMetadata. */
+ private static FastPairAntispoofKeyDeviceMetadata genFastPairAntispoofKeyDeviceMetadata(
+ byte[] antispoofPublicKey, FastPairDeviceMetadata deviceMetadata) {
+ FastPairAntispoofKeyDeviceMetadata.Builder builder =
+ new FastPairAntispoofKeyDeviceMetadata.Builder();
+ builder.setAntispoofPublicKey(antispoofPublicKey);
+ builder.setFastPairDeviceMetadata(deviceMetadata);
+
+ return builder.build();
+ }
+
+ /* Generates FastPairDeviceMetadata. */
+ private static FastPairDeviceMetadata genFastPairDeviceMetadata() {
+ FastPairDeviceMetadata.Builder builder = new FastPairDeviceMetadata.Builder();
+ builder.setAssistantSetupHalfSheet(ASSISTANT_SETUP_HALFSHEET);
+ builder.setAssistantSetupNotification(ASSISTANT_SETUP_NOTIFICATION);
+ builder.setBleTxPower(BLE_TX_POWER);
+ builder.setConfirmPinDescription(CONFIRM_PIN_DESCRIPTION);
+ builder.setConfirmPinTitle(CONFIRM_PIN_TITLE);
+ builder.setConnectSuccessCompanionAppInstalled(CONNECT_SUCCESS_COMPANION_APP_INSTALLED);
+ builder.setConnectSuccessCompanionAppNotInstalled(
+ CONNECT_SUCCESS_COMPANION_APP_NOT_INSTALLED);
+ builder.setDeviceType(DEVICE_TYPE);
+ builder.setDownloadCompanionAppDescription(DOWNLOAD_COMPANION_APP_DESCRIPTION);
+ builder.setFailConnectGoToSettingsDescription(FAIL_CONNECT_GOTO_SETTINGS_DESCRIPTION);
+ builder.setFastPairTvConnectDeviceNoAccountDescription(
+ FAST_PAIR_TV_CONNECT_DEVICE_NO_ACCOUNT_DESCRIPTION);
+ builder.setImage(IMAGE);
+ builder.setImageUrl(IMAGE_URL);
+ builder.setInitialNotificationDescription(INITIAL_NOTIFICATION_DESCRIPTION);
+ builder.setInitialNotificationDescriptionNoAccount(
+ INITIAL_NOTIFICATION_DESCRIPTION_NO_ACCOUNT);
+ builder.setInitialPairingDescription(INITIAL_PAIRING_DESCRIPTION);
+ builder.setIntentUri(INTENT_URI);
+ builder.setLocale(LOCALE);
+ builder.setName(NAME);
+ builder.setOpenCompanionAppDescription(OPEN_COMPANION_APP_DESCRIPTION);
+ builder.setRetroactivePairingDescription(RETRO_ACTIVE_PAIRING_DESCRIPTION);
+ builder.setSubsequentPairingDescription(SUBSEQUENT_PAIRING_DESCRIPTION);
+ builder.setSyncContactsDescription(SYNC_CONTACT_DESCRPTION);
+ builder.setSyncContactsTitle(SYNC_CONTACTS_TITLE);
+ builder.setSyncSmsDescription(SYNC_SMS_DESCRIPTION);
+ builder.setSyncSmsTitle(SYNC_SMS_TITLE);
+ builder.setTriggerDistance(TRIGGER_DISTANCE);
+ builder.setTrueWirelessImageUrlCase(TRUE_WIRELESS_IMAGE_URL_CASE);
+ builder.setTrueWirelessImageUrlLeftBud(TRUE_WIRELESS_IMAGE_URL_LEFT_BUD);
+ builder.setTrueWirelessImageUrlRightBud(TRUE_WIRELESS_IMAGE_URL_RIGHT_BUD);
+ builder.setUnableToConnectDescription(UNABLE_TO_CONNECT_DESCRIPTION);
+ builder.setUnableToConnectTitle(UNABLE_TO_CONNECT_TITLE);
+ builder.setUpdateCompanionAppDescription(UPDATE_COMPANION_APP_DESCRIPTION);
+ builder.setWaitLaunchCompanionAppDescription(WAIT_LAUNCH_COMPANION_APP_DESCRIPTION);
+
+ return builder.build();
+ }
+}
diff --git a/nearby/tests/cts/fastpair/src/android/nearby/cts/FastPairDataProviderBaseTest.java b/nearby/tests/cts/fastpair/src/android/nearby/cts/FastPairDataProviderBaseTest.java
index 68418f2..17b2e36 100644
--- a/nearby/tests/cts/fastpair/src/android/nearby/cts/FastPairDataProviderBaseTest.java
+++ b/nearby/tests/cts/fastpair/src/android/nearby/cts/FastPairDataProviderBaseTest.java
@@ -536,11 +536,11 @@
new FastPairAccountDevicesMetadataRequestParcel();
requestParcel.account = ACCOUNTDEVICES_METADATA_ACCOUNT;
- requestParcel.accountKeys = new ByteArrayParcel[NUM_ACCOUNT_DEVICES];
- requestParcel.accountKeys[0] = new ByteArrayParcel();
- requestParcel.accountKeys[1] = new ByteArrayParcel();
- requestParcel.accountKeys[0].byteArray = ACCOUNT_KEY;
- requestParcel.accountKeys[1].byteArray = ACCOUNT_KEY_2;
+ requestParcel.deviceAccountKeys = new ByteArrayParcel[NUM_ACCOUNT_DEVICES];
+ requestParcel.deviceAccountKeys[0] = new ByteArrayParcel();
+ requestParcel.deviceAccountKeys[1] = new ByteArrayParcel();
+ requestParcel.deviceAccountKeys[0].byteArray = ACCOUNT_KEY;
+ requestParcel.deviceAccountKeys[1].byteArray = ACCOUNT_KEY_2;
return requestParcel;
}
@@ -584,7 +584,7 @@
genHappyPathFastPairAntispoofKeyDeviceMetadata() {
FastPairAntispoofKeyDeviceMetadata.Builder builder =
new FastPairAntispoofKeyDeviceMetadata.Builder();
- builder.setAntiSpoofPublicKey(ANTI_SPOOFING_KEY);
+ builder.setAntispoofPublicKey(ANTI_SPOOFING_KEY);
builder.setFastPairDeviceMetadata(genHappyPathFastPairDeviceMetadata());
return builder.build();
@@ -595,9 +595,9 @@
genHappyPathFastPairAccountkeyDeviceMetadata() {
FastPairAccountKeyDeviceMetadata.Builder builder =
new FastPairAccountKeyDeviceMetadata.Builder();
- builder.setAccountKey(ACCOUNT_KEY);
+ builder.setDeviceAccountKey(ACCOUNT_KEY);
builder.setFastPairDeviceMetadata(genHappyPathFastPairDeviceMetadata());
- builder.setSha256AccountKeyPublicAddress(SHA256_ACCOUNT_KEY_PUBLIC_ADDRESS);
+ builder.setSha256DeviceAccountKeyPublicAddress(SHA256_ACCOUNT_KEY_PUBLIC_ADDRESS);
builder.setFastPairDiscoveryItem(genHappyPathFastPairDiscoveryItem());
return builder.build();
@@ -608,9 +608,9 @@
genHappyPathFastPairAccountkeyDeviceMetadataParcel() {
FastPairAccountKeyDeviceMetadataParcel parcel =
new FastPairAccountKeyDeviceMetadataParcel();
- parcel.accountKey = ACCOUNT_KEY;
+ parcel.deviceAccountKey = ACCOUNT_KEY;
parcel.metadata = genHappyPathFastPairDeviceMetadataParcel();
- parcel.sha256AccountKeyPublicAddress = SHA256_ACCOUNT_KEY_PUBLIC_ADDRESS;
+ parcel.sha256DeviceAccountKeyPublicAddress = SHA256_ACCOUNT_KEY_PUBLIC_ADDRESS;
parcel.discoveryItem = genHappyPathFastPairDiscoveryItemParcel();
return parcel;
@@ -801,9 +801,9 @@
private static void ensureHappyPathAsExpected(
FastPairDataProviderBase.FastPairAccountDevicesMetadataRequest request) {
assertThat(request.getAccount()).isEqualTo(ACCOUNTDEVICES_METADATA_ACCOUNT);
- assertThat(request.getAccountKeys().size()).isEqualTo(ACCOUNTKEY_DEVICE_NUM);
- assertThat(request.getAccountKeys()).contains(ACCOUNT_KEY);
- assertThat(request.getAccountKeys()).contains(ACCOUNT_KEY_2);
+ assertThat(request.getDeviceAccountKeys().size()).isEqualTo(ACCOUNTKEY_DEVICE_NUM);
+ assertThat(request.getDeviceAccountKeys()).contains(ACCOUNT_KEY);
+ assertThat(request.getDeviceAccountKeys()).contains(ACCOUNT_KEY_2);
}
/* Verifies Happy Path FastPairEligibleAccountsRequest. */
@@ -833,7 +833,7 @@
private static void ensureHappyPathAsExpected(
FastPairAntispoofKeyDeviceMetadataParcel metadataParcel) {
assertThat(metadataParcel).isNotNull();
- assertThat(metadataParcel.antiSpoofPublicKey).isEqualTo(ANTI_SPOOFING_KEY);
+ assertThat(metadataParcel.antispoofPublicKey).isEqualTo(ANTI_SPOOFING_KEY);
ensureHappyPathAsExpected(metadataParcel.deviceMetadata);
}
@@ -851,8 +851,8 @@
private static void ensureHappyPathAsExpected(
FastPairAccountKeyDeviceMetadataParcel metadataParcel) {
assertThat(metadataParcel).isNotNull();
- assertThat(metadataParcel.accountKey).isEqualTo(ACCOUNT_KEY);
- assertThat(metadataParcel.sha256AccountKeyPublicAddress)
+ assertThat(metadataParcel.deviceAccountKey).isEqualTo(ACCOUNT_KEY);
+ assertThat(metadataParcel.sha256DeviceAccountKeyPublicAddress)
.isEqualTo(SHA256_ACCOUNT_KEY_PUBLIC_ADDRESS);
ensureHappyPathAsExpected(metadataParcel.metadata);
ensureHappyPathAsExpected(metadataParcel.discoveryItem);
@@ -861,8 +861,8 @@
/* Verifies Happy Path FastPairAccountKeyDeviceMetadata. */
private static void ensureHappyPathAsExpected(
FastPairAccountKeyDeviceMetadata metadata) {
- assertThat(metadata.getAccountKey()).isEqualTo(ACCOUNT_KEY);
- assertThat(metadata.getSha256AccountKeyPublicAddress())
+ assertThat(metadata.getDeviceAccountKey()).isEqualTo(ACCOUNT_KEY);
+ assertThat(metadata.getSha256DeviceAccountKeyPublicAddress())
.isEqualTo(SHA256_ACCOUNT_KEY_PUBLIC_ADDRESS);
ensureHappyPathAsExpected(metadata.getFastPairDeviceMetadata());
ensureHappyPathAsExpected(metadata.getFastPairDiscoveryItem());
diff --git a/nearby/tests/cts/fastpair/src/android/nearby/cts/FastPairEligibleAccountTest.java b/nearby/tests/cts/fastpair/src/android/nearby/cts/FastPairEligibleAccountTest.java
new file mode 100644
index 0000000..0d91d4e
--- /dev/null
+++ b/nearby/tests/cts/fastpair/src/android/nearby/cts/FastPairEligibleAccountTest.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2021 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.nearby.cts;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import android.accounts.Account;
+import android.nearby.FastPairEligibleAccount;
+
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.filters.SdkSuppress;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+@RunWith(AndroidJUnit4.class)
+public class FastPairEligibleAccountTest {
+
+ private static final Account ACCOUNT = new Account("abc@google.com", "type1");
+ private static final Account ACCOUNT_NULL = null;
+
+ private static final boolean OPT_IN_TRUE = true;
+
+ @Test
+ @SdkSuppress(minSdkVersion = 32, codeName = "T")
+ public void testSetGetFastPairEligibleAccountNotNull() {
+ FastPairEligibleAccount eligibleAccount =
+ genFastPairEligibleAccount(ACCOUNT, OPT_IN_TRUE);
+
+ assertThat(eligibleAccount.getAccount()).isEqualTo(ACCOUNT);
+ assertThat(eligibleAccount.isOptIn()).isEqualTo(OPT_IN_TRUE);
+ }
+
+ @Test
+ @SdkSuppress(minSdkVersion = 32, codeName = "T")
+ public void testSetGetFastPairEligibleAccountNull() {
+ FastPairEligibleAccount eligibleAccount =
+ genFastPairEligibleAccount(ACCOUNT_NULL, OPT_IN_TRUE);
+
+ assertThat(eligibleAccount.getAccount()).isEqualTo(ACCOUNT_NULL);
+ assertThat(eligibleAccount.isOptIn()).isEqualTo(OPT_IN_TRUE);
+ }
+
+ /* Generates FastPairEligibleAccount. */
+ private static FastPairEligibleAccount genFastPairEligibleAccount(
+ Account account, boolean optIn) {
+ FastPairEligibleAccount.Builder builder = new FastPairEligibleAccount.Builder();
+ builder.setAccount(account);
+ builder.setOptIn(optIn);
+
+ return builder.build();
+ }
+}
diff --git a/nearby/tests/multidevices/clients/src/android/nearby/multidevices/fastpair/seeker/dataprovider/FastPairTestDataCache.kt b/nearby/tests/multidevices/clients/src/android/nearby/multidevices/fastpair/seeker/dataprovider/FastPairTestDataCache.kt
index 481f407..3e9d6d3 100644
--- a/nearby/tests/multidevices/clients/src/android/nearby/multidevices/fastpair/seeker/dataprovider/FastPairTestDataCache.kt
+++ b/nearby/tests/multidevices/clients/src/android/nearby/multidevices/fastpair/seeker/dataprovider/FastPairTestDataCache.kt
@@ -58,16 +58,16 @@
@SerializedName("fast_pair_discovery_item") val discoveryItem: FastPairDiscoveryItemData?,
) {
constructor(meta: FastPairAccountKeyDeviceMetadata) : this(
- accountKey = meta.accountKey?.base64Encode(),
- accountKeyPublicAddress = meta.sha256AccountKeyPublicAddress?.base64Encode(),
+ accountKey = meta.deviceAccountKey?.base64Encode(),
+ accountKeyPublicAddress = meta.sha256DeviceAccountKeyPublicAddress?.base64Encode(),
deviceMeta = meta.fastPairDeviceMetadata?.let { FastPairDeviceMetadataData(it) },
discoveryItem = meta.fastPairDiscoveryItem?.let { FastPairDiscoveryItemData(it) },
)
fun toFastPairAccountKeyDeviceMetadata(): FastPairAccountKeyDeviceMetadata {
return FastPairAccountKeyDeviceMetadata.Builder()
- .setAccountKey(accountKey?.base64Decode())
- .setSha256AccountKeyPublicAddress(accountKeyPublicAddress?.base64Decode())
+ .setDeviceAccountKey(accountKey?.base64Decode())
+ .setSha256DeviceAccountKeyPublicAddress(accountKeyPublicAddress?.base64Decode())
.setFastPairDeviceMetadata(deviceMeta?.toFastPairDeviceMetadata())
.setFastPairDiscoveryItem(discoveryItem?.toFastPairDiscoveryItem())
.build()
@@ -75,12 +75,12 @@
}
data class FastPairAntispoofKeyDeviceMetadataData(
- @SerializedName("anti_spoofing_public_key_str") val antiSpoofPublicKey: String?,
+ @SerializedName("anti_spoofing_public_key_str") val antispoofPublicKey: String?,
@SerializedName("fast_pair_device_metadata") val deviceMeta: FastPairDeviceMetadataData?,
) {
fun toFastPairAntispoofKeyDeviceMetadata(): FastPairAntispoofKeyDeviceMetadata {
return FastPairAntispoofKeyDeviceMetadata.Builder()
- .setAntiSpoofPublicKey(antiSpoofPublicKey?.base64Decode())
+ .setAntispoofPublicKey(antispoofPublicKey?.base64Decode())
.setFastPairDeviceMetadata(deviceMeta?.toFastPairDeviceMetadata())
.build()
}
@@ -299,4 +299,4 @@
private fun String.base64Decode(): ByteArray = BaseEncoding.base64().decode(this)
private fun ByteArray.base64Encode(): String = BaseEncoding.base64().encode(this)
-}
\ No newline at end of file
+}
diff --git a/nearby/tests/multidevices/clients/src/android/nearby/multidevices/fastpair/seeker/dataprovider/FastPairTestDataProvider.kt b/nearby/tests/multidevices/clients/src/android/nearby/multidevices/fastpair/seeker/dataprovider/FastPairTestDataProvider.kt
index 3bfd73e..1b4aa10 100644
--- a/nearby/tests/multidevices/clients/src/android/nearby/multidevices/fastpair/seeker/dataprovider/FastPairTestDataProvider.kt
+++ b/nearby/tests/multidevices/clients/src/android/nearby/multidevices/fastpair/seeker/dataprovider/FastPairTestDataProvider.kt
@@ -44,7 +44,7 @@
callback: FastPairAccountDevicesMetadataCallback
) {
val requestedAccount = request.account
- val requestedAccountKeys = request.accountKeys
+ val requestedAccountKeys = request.deviceAccountKeys
Log.d(
TAG, "onLoadFastPairAccountDevicesMetadata(" +
"account: $requestedAccount, accountKeys:$requestedAccountKeys)"
@@ -107,4 +107,4 @@
private fun ByteArray.bytesToStringLowerCase(): String =
joinToString(separator = "") { eachByte -> "%02x".format(eachByte) }
}
-}
\ No newline at end of file
+}
diff --git a/nearby/tests/unit/src/com/android/server/nearby/provider/UtilsTest.java b/nearby/tests/unit/src/com/android/server/nearby/provider/UtilsTest.java
index 6d04f2b..205d5c2 100644
--- a/nearby/tests/unit/src/com/android/server/nearby/provider/UtilsTest.java
+++ b/nearby/tests/unit/src/com/android/server/nearby/provider/UtilsTest.java
@@ -300,8 +300,8 @@
private static void ensureHappyPathAsExpected(
FastPairAccountKeyDeviceMetadataParcel metadataParcel) {
assertThat(metadataParcel).isNotNull();
- assertThat(metadataParcel.accountKey).isEqualTo(ACCOUNT_KEY);
- assertThat(metadataParcel.sha256AccountKeyPublicAddress)
+ assertThat(metadataParcel.deviceAccountKey).isEqualTo(ACCOUNT_KEY);
+ assertThat(metadataParcel.sha256DeviceAccountKeyPublicAddress)
.isEqualTo(SHA256_ACCOUNT_KEY_PUBLIC_ADDRESS);
ensureHappyPathAsExpected(metadataParcel.metadata);
ensureHappyPathAsExpected(metadataParcel.discoveryItem);
@@ -450,9 +450,9 @@
genHappyPathFastPairAccountkeyDeviceMetadataParcel() {
FastPairAccountKeyDeviceMetadataParcel parcel =
new FastPairAccountKeyDeviceMetadataParcel();
- parcel.accountKey = ACCOUNT_KEY;
+ parcel.deviceAccountKey = ACCOUNT_KEY;
parcel.metadata = genHappyPathFastPairDeviceMetadataParcel();
- parcel.sha256AccountKeyPublicAddress = SHA256_ACCOUNT_KEY_PUBLIC_ADDRESS;
+ parcel.sha256DeviceAccountKeyPublicAddress = SHA256_ACCOUNT_KEY_PUBLIC_ADDRESS;
parcel.discoveryItem = genHappyPathFastPairDiscoveryItemParcel();
return parcel;
@@ -710,7 +710,7 @@
genHappyPathFastPairAntispoofKeyDeviceMetadataParcel() {
FastPairAntispoofKeyDeviceMetadataParcel parcel =
new FastPairAntispoofKeyDeviceMetadataParcel();
- parcel.antiSpoofPublicKey = ANTI_SPOOFING_KEY;
+ parcel.antispoofPublicKey = ANTI_SPOOFING_KEY;
parcel.deviceMetadata = genHappyPathFastPairDeviceMetadataParcel();
return parcel;
@@ -720,7 +720,7 @@
genFastPairAntispoofKeyDeviceMetadataParcelWithEmptyDeviceMetadata() {
FastPairAntispoofKeyDeviceMetadataParcel parcel =
new FastPairAntispoofKeyDeviceMetadataParcel();
- parcel.antiSpoofPublicKey = ANTI_SPOOFING_KEY;
+ parcel.antispoofPublicKey = ANTI_SPOOFING_KEY;
parcel.deviceMetadata = genEmptyFastPairDeviceMetadataParcel();
return parcel;