MSG_DEBUG("Messaging is restricted by DPM policy.");
MsgDbHandler *dbHandle = getDbHandle();
MsgStoUpdateNetworkStatus(dbHandle, &(pReqInfo->msgInfo), MSG_NETWORK_SEND_FAIL);
+ if (pReqInfo->msgInfo.msgType.subType != MSG_RETRIEVE_MMS)
+ /* sending popup */
+ msg_syspopup_message(true);
+ else
+ /* retrieving popup */
+ msg_syspopup_message(false);
+
return MSG_ERR_DPM_RESTRICT;
}
#include <ctype.h>
#include <aul.h>
#include <aul_svc.h>
+#include <gio/gio.h>
typedef struct _msg_launch_app_data {
char *app_id;
#define DEFAULT_MIN_MATCH_DIGIT 8
+#define SYSPOPUP_BUS_NAME "org.tizen.DevicePolicyManager"
+#define SYSPOPUP_OBJECT_PATH "/org/tizen/DevicePolicyManager/Syspopup"
+#define SYSPOPUP_INTERFACE "org.tizen.DevicePolicyManager.Syspopup"
+#define SYSPOPUP_METHOD_SHOW "show"
+
enum _FEATURE_INDEX_E {
FEATURE_INDEX_SMS = 0,
FEATURE_INDEX_MMS = 1,
// return dpm_policy_enable[type];
}
+
+void msg_syspopup_message(bool is_sending)
+{
+ MSG_DEBUG("popup toast for dpm restriction. is_sending [%d]", is_sending);
+
+ GDBusConnection *connection = NULL;
+ GDBusProxy *dbus_proxy = NULL;
+ GVariant *result = NULL;
+ GError *error = NULL;
+
+ connection = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
+ if (error) {
+ MSG_ERR("Connecting to system bus failed: %s\n", error->message);
+ goto _DBUS_ERROR;
+ }
+
+ dbus_proxy = g_dbus_proxy_new_sync(connection, G_DBUS_PROXY_FLAGS_NONE, NULL,
+ SYSPOPUP_BUS_NAME, SYSPOPUP_OBJECT_PATH, SYSPOPUP_INTERFACE, NULL, &error);
+ if (error) {
+ MSG_ERR("Connecting to proxy failed: %s\n", error->message);
+ goto _DBUS_ERROR;
+ }
+
+ result = g_dbus_proxy_call_sync(dbus_proxy, SYSPOPUP_METHOD_SHOW,
+ g_variant_new("(s)", is_sending ? "message-sending" : "message-retrieving"),
+ G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
+ if (error) {
+ MSG_ERR("invoking proxy call failed: %s\n", error->message);
+ goto _DBUS_ERROR;
+ }
+
+_DBUS_ERROR:
+ if (error) {
+ g_error_free(error);
+ error = NULL;
+ }
+
+ if (connection) {
+ g_object_unref(connection);
+ connection = NULL;
+ }
+
+ if (dbus_proxy) {
+ g_object_unref(dbus_proxy);
+ dbus_proxy = NULL;
+ }
+
+ if (result) {
+ g_object_unref(result);
+ result = NULL;
+ }
+}