javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/rt/installer/ApplicationUtilsImpl.java
branchRCL_3
changeset 27 d5e927d5853b
parent 26 2455ef1f5bbc
equal deleted inserted replaced
26:2455ef1f5bbc 27:d5e927d5853b
   171         {
   171         {
   172             if (userPromptAllowed)
   172             if (userPromptAllowed)
   173             {
   173             {
   174                 if (iSilent)
   174                 if (iSilent)
   175                 {
   175                 {
   176                     // Do not prompt the user in case of silent installation.
   176                     // Do not prompt the user in case of silent installation 
       
   177                     // -> don't enforce security, just query the permission 
       
   178                     // to see if it is not allowed
   177                     int permissionResult =
   179                     int permissionResult =
   178                         iAccessController.checkPermission(aPermission.toString());
   180                         iAccessController.checkPermission(aPermission.toString());
   179                     Log.log("ApplicationUtilsImpl.checkPermission: appUid: " +
   181                     Log.log("ApplicationUtilsImpl.checkPermission: appUid: " +
   180                             aAppUid + ", " + aPermission.toString() +
   182                             aAppUid + ", " + aPermission.toString() +
   181                             " result " + permissionResult);
   183                             " result " + permissionResult);
   186                             "Permission " + aPermission.toString() + " not allowed");
   188                             "Permission " + aPermission.toString() + " not allowed");
   187                     }
   189                     }
   188                 }
   190                 }
   189                 else
   191                 else
   190                 {
   192                 {
   191                     // Not a silent installation, display user prompt.
   193                     // Not a silent installation -> enforce security (an user
       
   194                     // prompt might be displayed)
   192                     iAccessController.checkPermission(aPermission);
   195                     iAccessController.checkPermission(aPermission);
   193                     Log.log("ApplicationUtilsImpl.checkPermission: appUid: " +
   196                     Log.log("ApplicationUtilsImpl.checkPermission: appUid: " +
   194                             aAppUid + ", " + aPermission.toString() + " ok");
   197                             aAppUid + ", " + aPermission.toString() + " ok");
   195                 }
   198                 }
   196             }
   199             }
   197             else
   200             else
   198             {
   201             {
   199                 // No user prompt allowed for this permission.
   202                 // No user prompt allowed for this permission -> don't enforce
       
   203                 // security, just query the permission to see if it is not 
       
   204                 // allowed
   200                 int permissionResult =
   205                 int permissionResult =
   201                     iAccessController.checkPermission(aPermission.toString());
   206                     iAccessController.checkPermission(aPermission.toString());
   202                 Log.log("ApplicationUtilsImpl.checkPermission: appUid: " +
   207                 Log.log("ApplicationUtilsImpl.checkPermission: appUid: " +
   203                         aAppUid + ", " + aPermission.toString() +
   208                         aAppUid + ", " + aPermission.toString() +
   204                         " result " + permissionResult);
   209                         " result " + permissionResult);
   205                 if (permissionResult <= 0)
   210                 if (permissionResult == 0)
   206                 {
   211                 {
   207                     // Permission is either denied or requires user prompt.
   212                     // Permission is denied
   208                     throw new AccessControlException(
   213                     throw new AccessControlException(
   209                         "Permission " + aPermission.toString() + " not allowed");
   214                         "Permission " + aPermission.toString() + " not allowed");
   210                 }
   215                 }
   211             }
   216             }
   212         }
   217         }