Handle HW key input case from askuser popup. 96/123096/4
authorjin-gyu.kim <jin-gyu.kim@samsung.com>
Tue, 4 Apr 2017 11:03:25 +0000 (20:03 +0900)
committerjin-gyu.kim <jin-gyu.kim@samsung.com>
Tue, 4 Apr 2017 12:59:26 +0000 (21:59 +0900)
In case of HW key input, app should not be launched always.
Also, updating policy as DENY only for non-white list app.

Change-Id: I2956bc3b982a2ec68d9514e766366621530cfa27

src/client/client-security-manager.cpp

index dff5c46705b9fbc02e32f3c1cdfa3d85a4ee85f7..aae79257078b124cd03c2bc01dcedc149aa3adc7 100644 (file)
@@ -1748,6 +1748,16 @@ int security_manager_prepare_app_privacy(const char *app_name)
             ret = updateAppPrivacy(app_name, privacy, Config::PRIVACY_POLICY_ALLOW);
             break;
 
+        case ASKUSER_NONE:
+            LogDebug("H/W KEY Input, APP should not be launched in this case.");
+            launchAllowed = false;
+            ret = SECURITY_MANAGER_SUCCESS;
+            if (!PrivilegeInfo::isAppWhiteListed(pkgName)) {
+                LogDebug("This is non-white listed app. Update policy as PRIVACY_POLICY_DENY");
+                ret = updateAppPrivacy(app_name, privacy, Config::PRIVACY_POLICY_DENY);
+            }
+            break;
+
         default:
             LogError("Launch pop-up response: UNKNOWN");
             return SECURITY_MANAGER_ERROR_UNKNOWN;
@@ -1759,7 +1769,7 @@ int security_manager_prepare_app_privacy(const char *app_name)
         if (launchAllowed)
             return SECURITY_MANAGER_SUCCESS;
 
-        if (PrivilegeInfo::isAppWhiteListed(pkgName)) {
+        if (PrivilegeInfo::isAppWhiteListed(pkgName) && askResult != ASKUSER_NONE) {
             LogInfo("Launch pop-up denied privileges, whitelisted app - launching");
             return SECURITY_MANAGER_SUCCESS;
         }