pthread_mutex_unlock(&(th_manager[thread_id].mutex));
- ret = add_operation(bdev, BLOCK_DEV_INSERT, NULL, (void *)data);
- if (ret < 0) {
- _E("Failed to add operation (insert %s)", devnode);
- free_block_device(bdev);
- return ret;
- }
-
/* Check this sdcard is already formatted for extended internal sdcard */
if (block_conf[bdev->data->block_type].extendedinternal &&
bdev->data->block_type == BLOCK_MMC_DEV &&
- bdev->data->primary) {
+ bdev->data->primary) { // sdcard primary partition and extended internal option is on
_I("Check whether sdcard will be used as extended internal storage");
- if (!init) { // after booting is done
+ if (!init) { // after booting is done launch popup for setting
+ ret = add_operation(bdev, BLOCK_DEV_INSERT, NULL, (void *)data);
+ if (ret < 0) {
+ _E("Failed to add operation (insert %s)", devnode);
+ free_block_device(bdev);
+ return ret;
+ }
+
snprintf(id_string, PATH_LEN, "%d", bdev->data->id);
ret = launch_system_app(POPUP_DEFAULT, 4, POPUP_KEY_CONTENT, "sdcardsetup", POPUP_SDCARD_ID, id_string);
if (ret < 0)
ret = change_mount_point(bdev, EXTENDED_SD_PATH);
if (ret < 0) {
ret = -EPERM;
+ free_block_device(bdev);
return ret;
}
}
}
+ ret = add_operation(bdev, BLOCK_DEV_INSERT, NULL, (void *)data);
+ if (ret < 0) {
+ _E("Failed to add operation (insert %s)", devnode);
+ free_block_device(bdev);
+ return ret;
+ }
+
/* Create file for block device /run/external-storage/id */
if (bdev->data->block_type == BLOCK_MMC_EXTENDED_INTERNAL_DEV)
create_file(bdev->data->id, bdev->data->mount_point, true);