Merge "Add data level CTS test for FastPairDataProviderBase to ensure getter/setter correctness."
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 867774c..ca0a390 100644
--- a/nearby/service/java/com/android/server/nearby/provider/Utils.java
+++ b/nearby/service/java/com/android/server/nearby/provider/Utils.java
@@ -27,19 +27,69 @@
     static Rpcs.GetObservedDeviceResponse convert(
             FastPairAntispoofkeyDeviceMetadataParcel metadata) {
         return Rpcs.GetObservedDeviceResponse.newBuilder()
-          .setDevice(
-              Rpcs.Device.newBuilder()
-              .setAntiSpoofingKeyPair(
-                  Rpcs.AntiSpoofingKeyPair.newBuilder()
-                  .setPublicKey(ByteString.copyFrom(metadata.antiSpoofPublicKey))
+          .setDevice(Rpcs.Device.newBuilder()
+                  .setAntiSpoofingKeyPair(Rpcs.AntiSpoofingKeyPair.newBuilder()
+                          .setPublicKey(ByteString.copyFrom(metadata.antiSpoofPublicKey))
+                          .build())
+                  .setTrueWirelessImages(
+                          Rpcs.TrueWirelessHeadsetImages.newBuilder()
+                                  .setLeftBudUrl(
+                                          metadata.deviceMetadata.trueWirelessImageUrlLeftBud)
+                                  .setRightBudUrl(
+                                          metadata.deviceMetadata.trueWirelessImageUrlRightBud)
+                                  .setCaseUrl(metadata.deviceMetadata.trueWirelessImageUrlCase)
+                                  .build())
+                  .setImageUrl(metadata.deviceMetadata.imageUrl)
+                  .setIntentUri(metadata.deviceMetadata.intentUri)
+                  .setBleTxPower(metadata.deviceMetadata.bleTxPower)
+                  .setTriggerDistance(metadata.deviceMetadata.triggerDistance)
+                  .setDeviceType(Rpcs.DeviceType.forNumber(metadata.deviceMetadata.deviceType))
                   .build())
-              .setImageUrl(metadata.deviceMetadata.imageUrl)
-              .setIntentUri(metadata.deviceMetadata.intentUri)
-              .setBleTxPower(metadata.deviceMetadata.bleTxPower)
-              .setTriggerDistance(metadata.deviceMetadata.triggerDistance)
-              .setDeviceType(Rpcs.DeviceType.forNumber(metadata.deviceMetadata.deviceType))
-              .build())
           .setImage(ByteString.copyFrom(metadata.deviceMetadata.image))
-          .build();
+          .setStrings(Rpcs.ObservedDeviceStrings.newBuilder()
+                  .setAssistantSetupHalfSheet(metadata.deviceMetadata.assistantSetupHalfSheet)
+                  .setAssistantSetupNotification(metadata.deviceMetadata.assistantSetupNotification)
+                  .setConfirmPinDescription(metadata.deviceMetadata.confirmPinDescription)
+                  .setConfirmPinTitle(metadata.deviceMetadata.confirmPinTitle)
+                  .setConnectSuccessCompanionAppInstalled(
+                          metadata.deviceMetadata.connectSuccessCompanionAppInstalled)
+                  .setConnectSuccessCompanionAppNotInstalled(
+                          metadata.deviceMetadata.connectSuccessCompanionAppNotInstalled)
+                  .setDownloadCompanionAppDescription(
+                          metadata.deviceMetadata.downloadCompanionAppDescription)
+                  .setFailConnectGoToSettingsDescription(
+                          metadata.deviceMetadata.failConnectGoToSettingsDescription)
+                  .setFastPairTvConnectDeviceNoAccountDescription(
+                          metadata.deviceMetadata.fastPairTvConnectDeviceNoAccountDescription)
+                  .setInitialNotificationDescription(
+                          metadata.deviceMetadata.initialNotificationDescription)
+                  .setInitialNotificationDescriptionNoAccount(
+                          metadata.deviceMetadata.initialNotificationDescriptionNoAccount)
+                  .setInitialPairingDescription(metadata.deviceMetadata.initialPairingDescription)
+                  .setLocale(metadata.deviceMetadata.locale)
+                  .setOpenCompanionAppDescription(
+                          metadata.deviceMetadata.openCompanionAppDescription)
+                  .setRetroactivePairingDescription(
+                          metadata.deviceMetadata.retroactivePairingDescription)
+                  .setSubsequentPairingDescription(
+                          metadata.deviceMetadata.subsequentPairingDescription)
+                  .setSyncContactsDescription(
+                          metadata.deviceMetadata.syncContactsDescription)
+                  .setSyncContactsTitle(
+                          metadata.deviceMetadata.syncContactsTitle)
+                  .setSyncSmsDescription(
+                          metadata.deviceMetadata.syncSmsDescription)
+                  .setSyncSmsTitle(
+                          metadata.deviceMetadata.syncSmsTitle)
+                  .setUnableToConnectDescription(
+                          metadata.deviceMetadata.unableToConnectDescription)
+                  .setUnableToConnectTitle(
+                          metadata.deviceMetadata.unableToConnectTitle)
+                  .setUpdateCompanionAppDescription(
+                          metadata.deviceMetadata.updateCompanionAppDescription)
+                  .setWaitLaunchCompanionAppDescription(
+                          metadata.deviceMetadata.waitLaunchCompanionAppDescription)
+                  .build())
+                .build();
     }
 }
diff --git a/nearby/tests/integration/OWNERS b/nearby/tests/integration/OWNERS
new file mode 100644
index 0000000..f4dbde2
--- /dev/null
+++ b/nearby/tests/integration/OWNERS
@@ -0,0 +1,4 @@
+# Bug component: 1092133
+
+ericth@google.com
+ryancllin@google.com
\ No newline at end of file
diff --git a/nearby/tests/robotests/src/com/android/libraries/testing/deviceshadower/shadows/bluetooth/ShadowBluetoothAdapter.java b/nearby/tests/robotests/src/com/android/libraries/testing/deviceshadower/shadows/bluetooth/ShadowBluetoothAdapter.java
index c9f83a6..394afbc 100644
--- a/nearby/tests/robotests/src/com/android/libraries/testing/deviceshadower/shadows/bluetooth/ShadowBluetoothAdapter.java
+++ b/nearby/tests/robotests/src/com/android/libraries/testing/deviceshadower/shadows/bluetooth/ShadowBluetoothAdapter.java
@@ -17,6 +17,7 @@
 package com.android.libraries.testing.deviceshadower.shadows.bluetooth;
 
 import android.bluetooth.BluetoothAdapter;
+import android.content.AttributionSource;
 
 import com.android.libraries.testing.deviceshadower.internal.DeviceShadowEnvironmentImpl;
 import com.android.libraries.testing.deviceshadower.internal.bluetooth.BlueletImpl;
@@ -49,4 +50,16 @@
         BlueletImpl localBluelet = DeviceShadowEnvironmentImpl.getLocalBlueletImpl();
         return localBluelet.getAdapter();
     }
+
+    @Implementation
+    public static BluetoothAdapter createAdapter(AttributionSource attributionSource) {
+        // Add a device and set local devicelet in case no local bluelet set
+        if (!DeviceShadowEnvironmentImpl.hasLocalDeviceletImpl()) {
+            String address = MacAddressGenerator.get().generateMacAddress();
+            DeviceShadowEnvironmentImpl.addDevice(address);
+            DeviceShadowEnvironmentImpl.setLocalDevice(address);
+        }
+        BlueletImpl localBluelet = DeviceShadowEnvironmentImpl.getLocalBlueletImpl();
+        return localBluelet.getAdapter();
+    }
 }