return name;
}
+static void create_external_apps_directory(void)
+{
+ int ret;
+
+ ret = dbus_method_async(PKGDIR_BUS_NAME, PKGDIR_PATH,
+ PKGDIR_INTERFACE, "CreateExternalDirsForAllPkgs",
+ NULL, NULL);
+ if (ret)
+ _E("Fail to create external directory");
+}
+
static int pipe_trigger(enum block_dev_operation op,
struct block_device *bdev, int result)
{
}
goto out;
}
+ if (pdata.op == BLOCK_DEV_MOUNT &&
+ pdata.bdev->data->state == BLOCK_MOUNT &&
+ pdata.bdev->data->block_type == BLOCK_MMC_DEV &&
+ pdata.bdev->data->primary)
+ create_external_apps_directory();
/* Broadcast to mmc and usb storage module */
broadcast_block_info(pdata.op, pdata.bdev->data, pdata.result);
static int mount_start(struct block_device *bdev)
{
- DBusMessage *msg;
- DBusError err;
struct block_data *data;
- int r;
int ret;
- bool ret_val;
+ int r;
assert(bdev);
assert(bdev->data);
data->state = BLOCK_MOUNT;
if (data->block_type == BLOCK_MMC_DEV) {
+ /* app2ext_migrate_legacy_all has dbus method call to deviced */
ret = app2ext_migrate_legacy_all();
if (ret < 0)
_E("app2ext failed");
-
- msg = dbus_method_sync_with_reply(PKGDIR_BUS_NAME, PKGDIR_PATH,
- PKGDIR_INTERFACE, "CreateExternalDirsForAllPkgs",
- NULL, NULL);
- if (!msg) {
- _E("Fail to create external directory");
- goto out;
- }
-
- dbus_error_init(&err);
-
- ret = dbus_message_get_args(msg, &err, DBUS_TYPE_BOOLEAN, &ret_val, DBUS_TYPE_INVALID);
- if (!ret) {
- _E("no message : [%s:%s]", err.name, err.message);
- dbus_error_free(&err);
- }
}
out:
if (bdev->on_private_op == REQ_NORMAL)
signal_device_blocked(bdev);
- /* Need to disble app2ext whenever unmounting mmc */
- if (data->block_type == BLOCK_MMC_DEV && data->primary)
- if (app2ext_disable_all_external_pkgs() < 0)
- _E("app2ext_disable_all_external_pkgs() failed");
-
/* it must called before unmounting mmc */
r = mmc_check_and_unmount(data->mount_point);
if (!r)
time.tv_nsec = 500 * NANO_SECOND_MULTIPLIER;
nanosleep(&time, NULL);
- /* Need to disble app2ext whenever unmounting mmc */
- if (data->block_type == BLOCK_MMC_DEV && data->primary)
- if (app2ext_disable_all_external_pkgs() < 0)
- _E("app2ext_disable_all_external_pkgs() failed");
-
print_open_files(data->mount_point);
r = mmc_check_and_unmount(data->mount_point);
pthread_mutex_unlock(&(th_manager[thread_id].mutex));
/* UNLOCK */
+ /* Need to disble app2ext whenever unmounting mmc */
+ if (op->op == BLOCK_DEV_UNMOUNT &&
+ bdev->data->state == BLOCK_MOUNT &&
+ bdev->data->block_type == BLOCK_MMC_DEV &&
+ bdev->data->primary)
+ if (app2ext_disable_all_external_pkgs() < 0)
+ _E("app2ext_disable_all_external_pkgs() failed");
+
+
if (start_th) {
_D("Start New thread for block device");
th_manager[thread_id].start_th = false;