Update the Fast Pair account key index to 9.

This follows the current spec and be consistent wih the NanoApp side.

Bug: 225486915
Test: atest NearbyUnitTests and end-to-end device tests
Ignore-AOSP-First: nearby_not_in_aosp_yet

Change-Id: I1d28c663af078fc993fb96f1fc5c7ec147e07e86
diff --git a/nearby/service/java/com/android/server/nearby/provider/ChreDiscoveryProvider.java b/nearby/service/java/com/android/server/nearby/provider/ChreDiscoveryProvider.java
index 44a3a23..392f02d 100644
--- a/nearby/service/java/com/android/server/nearby/provider/ChreDiscoveryProvider.java
+++ b/nearby/service/java/com/android/server/nearby/provider/ChreDiscoveryProvider.java
@@ -130,7 +130,7 @@
             PresenceScanFilter presenceScanFilter = (PresenceScanFilter) scanFilter;
             Blefilter.BleFilter.Builder filterBuilder = Blefilter.BleFilter.newBuilder();
             for (PublicCredential credential : presenceScanFilter.getCredentials()) {
-                filterBuilder.addCertficate(toProtoPublicCredential(credential));
+                filterBuilder.addCertificate(toProtoPublicCredential(credential));
             }
             for (DataElement dataElement : presenceScanFilter.getExtendedProperties()) {
                 if (dataElement.getKey() == DataElement.DataType.ACCOUNT_KEY_DATA) {
@@ -149,11 +149,14 @@
     }
 
     private Blefilter.PublicateCertificate toProtoPublicCredential(PublicCredential credential) {
+        Log.d(TAG, String.format("Returns a PublicCertificate with authenticity key size %d and"
+                + " encrypted metadata key tag size %d", credential.getAuthenticityKey().length,
+                credential.getEncryptedMetadataKeyTag().length));
         return Blefilter.PublicateCertificate.newBuilder()
-                        .setAuthenticityKey(ByteString.copyFrom(credential.getAuthenticityKey()))
-                        .setMetadataEncryptionKeyTag(
-                                ByteString.copyFrom(credential.getEncryptedMetadataKeyTag()))
-                        .build();
+                .setAuthenticityKey(ByteString.copyFrom(credential.getAuthenticityKey()))
+                .setMetadataEncryptionKeyTag(
+                        ByteString.copyFrom(credential.getEncryptedMetadataKeyTag()))
+                .build();
     }
 
     private Blefilter.DataElement toProtoDataElement(DataElement dataElement) {
diff --git a/nearby/service/proto/src/presence/blefilter.proto b/nearby/service/proto/src/presence/blefilter.proto
index a4f479b..6e1ba6d 100644
--- a/nearby/service/proto/src/presence/blefilter.proto
+++ b/nearby/service/proto/src/presence/blefilter.proto
@@ -59,7 +59,7 @@
 message DataElement {
   enum ElementType {
     DE_NONE = 0;
-    DE_FAST_PAIR_ACCOUNT_KEY = 1;
+    DE_FAST_PAIR_ACCOUNT_KEY = 9;
     DE_CONNECTION_STATUS = 10;
     DE_BATTERY_STATUS = 11;
   }
@@ -86,7 +86,7 @@
   // the period of latency defined above.
   optional float distance_m = 7;
   // Used to verify the list of trusted devices.
-  repeated PublicateCertificate certficate = 8;
+  repeated PublicateCertificate certificate = 8;
   // Data Elements for extended properties.
   repeated DataElement data_element = 9;
 }
@@ -97,14 +97,21 @@
 
 // FilterResult is returned to host when a BLE event matches a Filter.
 message BleFilterResult {
+  enum ResultType {
+    RESULT_NONE = 0;
+    RESULT_PRESENCE = 1;
+    RESULT_FAST_PAIR = 2;
+  }
+
   optional uint32 id = 1;  // id of the matched Filter.
-  optional uint32 tx_power = 2;
-  optional uint32 rssi = 3;
+  optional int32 tx_power = 2;
+  optional int32 rssi = 3;
   optional uint32 intent = 4;
   optional bytes bluetooth_address = 5;
   optional PublicCredential public_credential = 6;
   repeated DataElement data_element = 7;
   optional bytes ble_service_data = 8;
+  optional ResultType result_type = 9;
 }
 
 message BleFilterResults {