Set trusted profile/device in ACCEPT_ALWAYS authorization case
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / bluez_hal / src / bt-hal-device-dbus-handler.c
index fdf462c..a42671d 100644 (file)
@@ -488,7 +488,7 @@ int _bt_hal_device_set_trust(const bt_bdaddr_t *bd_addr, uint8_t trust)
                return BT_STATUS_PARM_INVALID;
        }
 
-       DBG("Set authotrize [%d]", authorize);
+       DBG("Set authorize [%d]", authorize);
        result = g_dbus_proxy_call_sync(device_proxy, "Set",
                        g_variant_new("(ssv)", BT_HAL_DEVICE_INTERFACE, "Trusted", g_variant_new("b", authorize)),
                        G_DBUS_CALL_FLAGS_NONE,
@@ -1374,6 +1374,18 @@ static char* __bt_hal_get_trusted_profile_uuid(bt_trusted_profile_t profile)
        return NULL;
 }
 
+bt_trusted_profile_t _bt_hal_get_trusted_profile_enum(const char *uuid)
+{
+       if (g_strcmp0("0000112f-0000-1000-8000-00805f9b34fb", uuid) == 0)
+               return BT_TRUSTED_PROFILE_PBAP;
+       else if (g_strcmp0("00001132-0000-1000-8000-00805f9b34fb", uuid) == 0)
+               return BT_TRUSTED_PROFILE_MAP;
+       else if (g_strcmp0("0000112D-0000-1000-8000-00805f9b34fb", uuid) == 0)
+               return BT_TRUSTED_PROFILE_SAP;
+
+       return 0; /* 0 - Unknown Profile */
+}
+
 int _bt_hal_device_set_trusted_profile(const bt_bdaddr_t *bd_addr,
                bt_trusted_profile_t profile, uint8_t trust)
 {