summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothProfile.java
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2019-11-19 18:04:03 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-11-19 18:04:03 +0000
commit735b5a5654993bca3b74f28177745c99a0b7e1e2 (patch)
treea535da9da79818c0b08afd7be82355aca8eb5d7e /framework/java/android/bluetooth/BluetoothProfile.java
parent1f887775275c394029fa12e52c831a368a922dab (diff)
parente521618ea3669e1a0d03363e4eb1fd8db2384f97 (diff)
Merge "Add method to convert profile ID into human readable string"
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothProfile.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothProfile.java50
1 files changed, 50 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothProfile.java b/framework/java/android/bluetooth/BluetoothProfile.java
index dabe0fdac3..f5aa014584 100644
--- a/framework/java/android/bluetooth/BluetoothProfile.java
+++ b/framework/java/android/bluetooth/BluetoothProfile.java
@@ -324,4 +324,54 @@ public interface BluetoothProfile {
return "STATE_UNKNOWN";
}
}
+
+ /**
+ * Convert an integer value of profile ID into human readable string
+ *
+ * @param profile profile ID
+ * @return profile name as String, UNKOWN_PROFILE if the profile ID is not defined.
+ * @hide
+ */
+ static String getProfileName(int profile) {
+ switch(profile) {
+ case HEADSET:
+ return "HEADSET";
+ case A2DP:
+ return "A2DP";
+ case HID_HOST:
+ return "HID_HOST";
+ case PAN:
+ return "PAN";
+ case PBAP:
+ return "PBAP";
+ case GATT:
+ return "GATT";
+ case GATT_SERVER:
+ return "GATT_SERVER";
+ case MAP:
+ return "MAP";
+ case SAP:
+ return "SAP";
+ case A2DP_SINK:
+ return "A2DP_SINK";
+ case AVRCP_CONTROLLER:
+ return "AVRCP_CONTROLLER";
+ case AVRCP:
+ return "AVRCP";
+ case HEADSET_CLIENT:
+ return "HEADSET_CLIENT";
+ case PBAP_CLIENT:
+ return "PBAP_CLIENT";
+ case MAP_CLIENT:
+ return "MAP_CLIENT";
+ case HID_DEVICE:
+ return "HID_DEVICE";
+ case OPP:
+ return "OPP";
+ case HEARING_AID:
+ return "HEARING_AID";
+ default:
+ return "UNKNOWN_PROFILE";
+ }
+ }
}