#include "setting-storage-utils.h"
#include "setting-storage-async-worker.h"
#include "setting-storage-main.h"
+
+#include <dpm/restriction.h>
+
#if 0
#define SETTING_STORAGE_PIE_RECT_WIDTH (432 * WIDGET_SCALE_FACTOR)
#define SETTING_STORAGE_PIE_RECT_HEIGHT (414 * WIDGET_SCALE_FACTOR)
static setting_view setting_view_storage_main;
+static void dpm_usb_policy_changed_cb(const char* policy, const char* state, void* data)
+{
+ SETTING_TRACE_BEGIN;
+
+ SETTING_TRACE("External storag policy changed: %s : %s", policy, state);
+ SETTING_TRACE_END;
+}
+
+static int dpm_usb_mass_storage(int* enable)
+{
+ SETTING_TRACE_BEGIN;
+ dpm_context_h context;
+ dpm_restriction_policy_h policy;
+
+ int ret = 1;
+ context = dpm_context_create();
+ if (context == NULL) {
+ SETTING_TRACE_ERROR("Failed to create client context\n");
+ return 0;
+ }
+
+ policy = dpm_context_acquire_restriction_policy(context);
+ if (policy == NULL) {
+ SETTING_TRACE_ERROR("Failed to get storage policy interface\n");
+ dpm_context_destroy(context);
+ return 0;
+ }
+
+ int rval = 0;
+ ret = dpm_restriction_get_external_storage_state(policy, &rval);
+ *enable = rval;
+ SETTING_TRACE("dpm_restriction_get_external_storage_state : %d", *enable);
+
+ dpm_context_release_restriction_policy(context, policy);
+ dpm_context_destroy(context);
+ return ret;
+}
+
+
+
static inline void storageUg_main_pie_graph_cairo(Evas_Object *pie_image,
SettingStorageUG *ad)
{
Setting_GenGroupItem_Data *list_item = data;
int color = list_item->color;
- SETTING_TRACE_ERROR("part : %s", part);
+ //SETTING_TRACE_ERROR("part : %s", part);
if (!strcmp(part, "elm.swallow.icon")) {
Evas_Object *layout = elm_layout_add(obj);
SETTING_TRACE(" WIDGET_SCALE_FACTOR : %f", WIDGET_SCALE_FACTOR);
SETTING_TRACE("-----------------------------------------------");
+ int enable = 0;
+ dpm_usb_mass_storage(&enable);
+ SETTING_TRACE("------------------------------------------------------------------------------");
+ SETTING_TRACE(" DPM_USB_MASS_STORAGE : %d", enable);
+ SETTING_TRACE("------------------------------------------------------------------------------");
+
return SETTING_RETURN_SUCCESS;
}