├── Phone 1: As Fast Pair seeker role, to scan, pair Fast Pair devices nearby
└── Phone 2: As Fast Pair provider role, to simulate a Fast Pair device (for example, a Bluetooth headset)
Note: These two phones need to be physically within 0.3 m of each other.
This is the phone to scan/pair Fast Pair devices nearby using the Nearby Mainline module. Test it by flashing with the Android T ROM.
This is the phone to simulate a Fast Pair device (for example, a Bluetooth headset). Flash it with a customized ROM with the following changes:
adb root adb shell am broadcast \ -a 'com.google.android.gms.phenotype.FLAG_OVERRIDE' \ --es package "com.google.android.gms.nearby" \ --es user "\*" \ --esa flags "enabled" \ --esa types "boolean" \ --esa values "false" \ com.google.android.gms
To run the tests, enter:
atest -v CtsNearbyMultiDevicesTestSuite
Use this testing with headsets such as Google Pixel buds.
The FastPairTestDataProviderService.apk
is a run-time configurable Fast Pair data provider service (FastPairDataProviderService
):
packages/modules/Connectivity/nearby/tests/multidevices/clients/test_service/fastpair_seeker_data_provider
It has a test data manager(FastPairTestDataManager
) to receive intent broadcasts to add or clear the test data cache (FastPairTestDataCache
). This cache provides the data to return to the Fast Pair module for onXXX calls (for example, onLoadFastPairAntispoofKeyDeviceMetadata
) so you can feed the metadata for your device.
Here are some sample uses:
./fast_pair_data_provider_shell.sh -m=718c17 -a=../test_data/fastpair/pixelbuds-a_antispoofkey_devicemeta_json.txt
./fast_pair_data_provider_shell.sh -d=../test_data/fastpair/pixelbuds-a_account_devicemeta_json.txt
./fast_pair_data_provider_shell.sh -m=00000c -a=../test_data/fastpair/simulator_antispoofkey_devicemeta_json.txt
./fast_pair_data_provider_shell.sh -d=../test_data/fastpair/simulator_account_devicemeta_json.txt
./fast_pair_data_provider_shell.sh -c
See host/tool/fast_pair_data_provider_shell.sh for more documentation.
To install the data provider as system private app, consider remounting the system partition:
adb root && adb remount
Push it in:
adb push ${ANDROID_PRODUCT_OUT}/system/app/NearbyFastPairSeekerDataProvider /system/priv-app/
Then reboot:
adb reboot
The NearbyFastPairProviderSimulatorApp.apk
is a simple Android app to let you control the state of the Fast Pair provider simulator. Install this app on phone 2 (Fast Pair provider role) to work correctly.
See clients/test_support/fastpair_provider/simulator_app/Android.bp for more documentation.