diff -r 7516d6d86cf5 -r ed14f46c0e55 src/hbplugins/devicedialogs/devicemessageboxplugin/hbdevicemessageboxplugin.cpp --- a/src/hbplugins/devicedialogs/devicemessageboxplugin/hbdevicemessageboxplugin.cpp Mon Oct 04 17:49:30 2010 +0300 +++ b/src/hbplugins/devicedialogs/devicemessageboxplugin/hbdevicemessageboxplugin.cpp Mon Oct 18 18:23:13 2010 +0300 @@ -24,6 +24,9 @@ ****************************************************************************/ #include +#ifdef Q_OS_SYMBIAN +#include +#endif // Q_OS_SYMBIAN #include #include @@ -40,6 +43,7 @@ {"com.nokia.hb.devicemessagebox/1.0"} }; +/// \cond class HbDeviceMessageBoxPluginPrivate { public: @@ -47,6 +51,7 @@ int mError; }; +/// \endcond // Constructor HbDeviceMessageBoxPlugin::HbDeviceMessageBoxPlugin() @@ -70,13 +75,20 @@ { TRACE_ENTRY Q_UNUSED(deviceDialogType) + +#ifdef Q_OS_SYMBIAN + // If show group is higher than normal, a swEvent capability is required + if (showLevel(parameters) != NormalLevel) { + return (securityInfo["sym-caps"].toInt() >> ECapabilitySwEvent) & 1; + } else { + return true; // all clients are allowed to use. + } +#else Q_UNUSED(parameters) Q_UNUSED(securityInfo) - - // This plugin doesn't perform operations that may compromise security. // All clients are allowed to use. return true; - TRACE_EXIT +#endif // Q_OS_SYMBIAN } // Create device dialog widget @@ -128,13 +140,16 @@ const QVariantMap ¶meters, DeviceDialogInfo *info) const { TRACE_ENTRY - Q_UNUSED(parameters) Q_UNUSED(deviceDialogType) + unsigned int level = static_cast(showLevel(parameters)); + if (level > CriticalLevel) { + return false; + } + info->group = GenericDeviceDialogGroup; - info->flags = NoDeviceDialogFlags; - info->priority = DefaultPriority; - TRACE_EXIT + info->flags = level == NormalLevel ? NoDeviceDialogFlags : SecurityCheck; + info->showLevel = static_cast(level); return true; } @@ -166,3 +181,14 @@ TRACE_EXIT return d->mError; } + +// Search parameters for show group +int HbDeviceMessageBoxPlugin::showLevel(const QVariantMap ¶meters) +{ + int level = NormalLevel; + const QString propertyName("showLevel"); + if (parameters.contains(propertyName)) { + level = parameters[propertyName].toInt(); + } + return level; +}