INFO(SINK, "Encryption started...");
engine->encrypt(MasterKey, options);
setOptions(options & getSupportedOptions());
- INFO(SINK, "Sync disk...");
- sync();
- INFO(SINK, "Encryption completed");
+ INFO(SINK, "Encryption completed");
::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "encrypted");
context.notify("InternalEncryption::mount");
+
+ INFO(SINK, "Syncing disk and rebooting...");
+ ::sync();
::reboot(RB_AUTOBOOT);
} catch (runtime::Exception &e) {
::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "error_partially_encrypted");
INFO(SINK, "Decryption started...");
engine->decrypt(MasterKey, getOptions());
- INFO(SINK, "Sync disk...");
- sync();
- INFO(SINK, "Decryption completed");
+ INFO(SINK, "Decryption completed");
::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "unencrypted");
+
+ INFO(SINK, "Syncing disk and rebooting...");
+ ::sync();
::reboot(RB_AUTOBOOT);
} catch (runtime::Exception &e) {
::vconf_set_str(INTERNAL_STATE_VCONF_KEY, "error_partially_encrypted");