Add guest mode functionality (2/3)

Add a flag to enable() to start Bluetooth in restricted
mode. In restricted mode, all devices that are paired during
restricted mode are deleted upon leaving restricted mode.
Right now restricted mode is only entered while a guest
user is active.

Bug: 27410683
Change-Id: I8f23d28ef0aa3a8df13d469c73005c8e1b894d19

bool btif_config_get_bin(const char *section, const char *key, uint8_t *value, size_t *length) {
  assert(config != NULL);
  assert(section != NULL);
  assert(key != NULL);
  assert(value != NULL);
  assert(length != NULL);

  pthread_mutex_lock(&lock);
 const char *value_str = config_get_string(config, section, key, NULL);
  pthread_mutex_unlock(&lock);

 if (!value_str)
 return false;

 size_t value_len = strlen(value_str);
 if ((value_len % 2) != 0 || *length < (value_len / 2))
 return false;

 for (size_t i = 0; i < value_len; ++i)
 if (!isxdigit(value_str[i]))
 return false;

 for (*length = 0; *value_str; value_str += 2, *length += 1)
    sscanf(value_str, "%02hhx", &value[*length]);

 return true;
}

bool btif_config_get_bin(const char *section, const char *key, uint8_t *value, size_t *length) {
  assert(config != NULL);
  assert(section != NULL);
  assert(key != NULL);
  assert(value != NULL);
  assert(length != NULL);

  pthread_mutex_lock(&lock);
 const char *value_str = config_get_string(config, section, key, NULL);
  pthread_mutex_unlock(&lock);

 if (!value_str)
 return false;

 size_t value_len = strlen(value_str);
 if ((value_len % 2) != 0 || *length < (value_len / 2))
 return false;

 for (size_t i = 0; i < value_len; ++i)
 if (!isxdigit(value_str[i]))
 return false;

 for (*length = 0; *value_str; value_str += 2, *length += 1)
    sscanf(value_str, "%02hhx", &value[*length]);

 return true;
}
