#define EXTENDED_INTERNAL_PATH "/run/extended-internal-sd"
#define PATH_LEN 55
+#define LUKS_NAME "crypto_LUKS"
+
static dd_list *cb_list[STORAGE_CALLBACK_MAX];
static int storage_ext_get_dev_state(storage_ext_device *dev,
storage_state_e state;
int ret;
storage_dev_e strdev;
+ storage_type_e storage_type;
const char *fstype, *fsuuid, *mountpath;
if (!dev)
return ret;
}
- if (dev->type == STORAGE_EXT_SCSI)
+ if (dev->type == STORAGE_EXT_SCSI) {
strdev = STORAGE_DEV_EXT_USB_MASS_STORAGE;
- else if (dev->type == STORAGE_EXT_MMC)
+ storage_type = STORAGE_TYPE_EXTERNAL;
+ } else if (dev->type == STORAGE_EXT_MMC) {
strdev = STORAGE_DEV_EXT_SDCARD;
- else if (dev->type == STORAGE_EXT_MMC_EXTENDED_INTERNAL)
+ storage_type = STORAGE_TYPE_EXTERNAL;
+ } else if (dev->type == STORAGE_EXT_MMC_EXTENDED_INTERNAL) {
strdev = STORAGE_DEV_EXTENDED_INTERNAL;
- else {
+ storage_type = STORAGE_TYPE_EXTENDED_INTERNAL;
+ } else {
_E("Invalid dev type (%d)", dev->type);
return -EINVAL;
}
fsuuid = (dev->fs_uuid ? (const char *)dev->fs_uuid : "");
mountpath = (dev->mount_point ? (const char *)dev->mount_point : "");
- DD_LIST_FOREACH(cb_list[STORAGE_CALLBACK_TYPE], elem, cb_info)
+ if (!strncmp(fstype, LUKS_NAME, strlen(LUKS_NAME)))
+ storage_type = STORAGE_TYPE_EXTENDED_INTERNAL;
+
+ DD_LIST_FOREACH(cb_list[STORAGE_CALLBACK_TYPE], elem, cb_info) {
+ if (cb_info->type != storage_type)
+ continue;
if (cb_info->type_cb)
cb_info->type_cb(dev->storage_id, strdev, state,
fstype, fsuuid, mountpath, dev->primary,
dev->flags, cb_info->user_data);
+ }
return 0;
}