return privilege;
}
std::unique_ptr<char, decltype(free)*> displaNamePtr(displayName, free);
- return displayName;
+ return std::string(displayName);
}
std::string getPrivacyName(const std::string &privilege) {
int ret = privilege_info_get_privacy_by_privilege(privilege.c_str(), &privacyName);
if (ret != PRVMGR_ERR_NONE || !privacyName) {
ALOGE("Unable to get privacy group for privilege: <" << privilege << ">, err: <" << ret << ">");
- throw Exception("Can't get privacy group name for privilege " + privilege);
+ return privilege;
}
std::unique_ptr<char, decltype(free) *> privacyNamePtr(privacyName, free);
- return privacyName;
+ return std::string(privacyName);
}
+
std::vector<std::string> getPrivacyPrivileges(const std::string &privacy) {
GList *privilegeList = nullptr;
int ret = privilege_info_get_privilege_list_by_privacy(privacy.c_str(), &privilegeList);
if (ret != PRVMGR_ERR_NONE || !privilegeList) {
ALOGE("Unable to get privacy group list of privileges; err: <" << ret << ">" );
- return {};
+ return {privacy};
}
GListWrap privList(privilegeList);