}
if (policies.size() > 1) {
- ALOGE("Something strange happened, more than one policy for (" << it->second.appId << ", " << it->second.user << ", " << privilege << ") exists");
+ ALOGE("Something strange happened, more than one policy for (" << it->second.appId << ", "
+ << it->second.user << ", " << privilege << ") exists");
m_serverChannel->popupResponse(fd, id, ASKUSER_DENY_ONCE);
return;
}
- if (policies.front().getLevel() == "Allow") {
+ std::string policyLevel = policies.front().getLevel();
+
+ if (policyLevel == "Allow") {
m_serverChannel->popupResponse(fd, id, ASKUSER_ALLOW_FOREVER);
return;
}
- if (policies.front().getLevel() == "Deny") {
+ if (policyLevel == "Deny") {
m_serverChannel->popupResponse(fd, id, ASKUSER_DENY_FOREVER);
return;
}
+ if (policyLevel != "Ask user") {
+ ALOGE("Unknown policy set : " << policyLevel << " for (" << it->second.appId << ", " << it->second.user
+ << ", " << privilege << ")" );
+ m_serverChannel->popupResponse(fd, id, ASKUSER_DENY_ONCE);
+ return;
+ }
auto &pkgId = it->second.pkgLabel;
addEvent({fd, id}, new EventPopupCheck(&m_popupper, pkgId, privilege));