Vasu Nori | e5fb911 | 2017-11-17 10:23:02 -0800 | [diff] [blame^] | 1 | package com.android.car; |
| 2 | |
| 3 | import android.bluetooth.BluetoothDevice; |
| 4 | import android.bluetooth.BluetoothProfile; |
| 5 | |
| 6 | /** |
| 7 | * Some potentially useful static methods. |
| 8 | */ |
| 9 | public class Utils { |
| 10 | static final Boolean DBG = false; |
| 11 | |
| 12 | static String getDeviceDebugInfo(BluetoothDevice device) { |
| 13 | return "(name = " + device.getName() + ", addr = " + device.getAddress() + ")"; |
| 14 | } |
| 15 | |
| 16 | static String getProfileName(int profile) { |
| 17 | switch(profile) { |
| 18 | case BluetoothProfile.A2DP_SINK: |
| 19 | return "A2DP_SINK"; |
| 20 | case BluetoothProfile.HEADSET_CLIENT: |
| 21 | return "HFP"; |
| 22 | case BluetoothProfile.PBAP_CLIENT: |
| 23 | return "PBAP"; |
| 24 | case BluetoothProfile.MAP_CLIENT: |
| 25 | return "MAP"; |
| 26 | case BluetoothProfile.AVRCP_CONTROLLER: |
| 27 | return "AVRCP"; |
| 28 | default: |
| 29 | return profile + ""; |
| 30 | |
| 31 | } |
| 32 | } |
| 33 | } |