FastPairClient
Stay organized with collections
Save and categorize content based on your preferences.
Interface to Fast Pair APIs. It includes Smart Audio Source Switching (SASS) APIs through
which the client can implement Audio Switch
functionalities.
Public Methods
public abstract Task< Boolean
>
isSassDeviceAvailable
(int audioUsage)
public abstract Task< Boolean
>
triggerSassForUsage
(int
audioUsage)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eFastPairClient\u003c/code\u003e provides an interface for interacting with Fast Pair APIs, including Smart Audio Source Switching (SASS).\u003c/p\u003e\n"],["\u003cp\u003eIt allows developers to check for the availability of SASS-supported Bluetooth devices for specific audio usage scenarios.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etriggerSassForUsage\u003c/code\u003e method enables initiating SASS functionality for a given audio usage context.\u003c/p\u003e\n"],["\u003cp\u003eProper Bluetooth and location permissions are required for using these functionalities, varying by Android version.\u003c/p\u003e\n"]]],[],null,["# FastPairClient\n\npublic interface **FastPairClient** implements [HasApiKey](/android/reference/com/google/android/gms/common/api/HasApiKey)\\\u003c[Api.ApiOptions.NoOptions](/android/reference/com/google/android/gms/common/api/Api.ApiOptions.NoOptions)\\\u003e \nInterface to Fast Pair APIs. It includes Smart Audio Source Switching (SASS) APIs through\nwhich the client can implement [Audio Switch](//developers.google.com/nearby/fast-pair/specifications/extensions/sass)\nfunctionalities. \n\n### Public Method Summary\n\n|--------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract Task\\\u003c[Boolean](//developer.android.com/reference/java/lang/Boolean.html)\\\u003e | [isSassDeviceAvailable](/android/reference/com/google/android/gms/nearby/fastpair/FastPairClient#isSassDeviceAvailable(int))(int audioUsage) Queries if any SASS-supported Bluetooth device is available for a specific [AudioUsage](/android/reference/com/google/android/gms/nearby/fastpair/AudioUsage) or not. |\n| abstract Task\\\u003c[Boolean](//developer.android.com/reference/java/lang/Boolean.html)\\\u003e | [triggerSassForUsage](/android/reference/com/google/android/gms/nearby/fastpair/FastPairClient#triggerSassForUsage(int))(int audioUsage) Triggers SASS with a specific [AudioUsage](/android/reference/com/google/android/gms/nearby/fastpair/AudioUsage). |\n\nPublic Methods\n--------------\n\n#### public abstract Task\\\u003c[Boolean](//developer.android.com/reference/java/lang/Boolean.html)\\\u003e\n**isSassDeviceAvailable** (int audioUsage)\n\nQueries if any SASS-supported Bluetooth device is available for a specific\n[AudioUsage](/android/reference/com/google/android/gms/nearby/fastpair/AudioUsage)\nor not.\n\nClient must declare the following permissions depending on platform:\n\n- [Manifest.permission.ACCESS_FINE_LOCATION](//developer.android.com/reference/android/Manifest.permission.html#ACCESS_FINE_LOCATION) (Deprecated from Android S)\n- [Manifest.permission.BLUETOOTH_SCAN](//developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_SCAN) (Required for devices running S+)\n\nOtherwise returns [FastPairStatusCodes.FAILED_PERMISSION_DENIED](/android/reference/com/google/android/gms/nearby/fastpair/FastPairStatusCodes#FAILED_PERMISSION_DENIED) error code. For other status\ncodes, check [FastPairStatusCodes](/android/reference/com/google/android/gms/nearby/fastpair/FastPairStatusCodes). \n\n#### public abstract Task\\\u003c[Boolean](//developer.android.com/reference/java/lang/Boolean.html)\\\u003e\n**triggerSassForUsage** (int audioUsage)\n\nTriggers SASS with a specific [AudioUsage](/android/reference/com/google/android/gms/nearby/fastpair/AudioUsage).\nReturns true if the trigger is accepted, and the connection established successfully,\notherwise false.\n\nClient must declare the following permissions depending on platform:\n\n- [Manifest.permission.BLUETOOTH](//developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH) (Deprecated from Android S)\n- [Manifest.permission.ACCESS_FINE_LOCATION](//developer.android.com/reference/android/Manifest.permission.html#ACCESS_FINE_LOCATION) (Deprecated from Android S)\n- [Manifest.permission.BLUETOOTH_SCAN](//developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_SCAN) (Required for devices running S+)\n- [Manifest.permission.BLUETOOTH_CONNECT](//developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_CONNECT) (Required for devices running S+)\n\nOtherwise returns [FastPairStatusCodes.FAILED_PERMISSION_DENIED](/android/reference/com/google/android/gms/nearby/fastpair/FastPairStatusCodes#FAILED_PERMISSION_DENIED) error code. For other status\ncodes, check [FastPairStatusCodes](/android/reference/com/google/android/gms/nearby/fastpair/FastPairStatusCodes)."]]