}
}
+int InternalEncryptionClient::isMounted()
+{
+ try {
+ return context->methodCall<int>("InternalEncryptionServer::isMounted");
+ } catch (runtime::Exception& e) {
+ return error::Unknown;
+ }
+}
+
int InternalEncryptionClient::umount()
{
try {
int mount(const std::vector<unsigned char> &mk, unsigned int options);
int umount();
+ int isMounted();
int encrypt(const std::string& password, unsigned int options);
int decrypt(const std::string& password);
return toApiError(internal.mount(key, options));
}
+int ode_internal_encryption_is_mounted(bool *result)
+{
+ ClientContext client;
+ RET_ON_FAILURE(client.connect() == 0, ODE_ERROR_CONNECTION_REFUSED);
+ InternalEncryptionClient internal = client.createInterface<InternalEncryptionClient>();
+ int ret = internal.isMounted();
+ if (ret < 0)
+ return toApiError(ret);
+
+ *result = ret == 1 ? true : false;
+
+ return ODE_ERROR_NONE;
+}
+
int ode_internal_encryption_umount()
{
ClientContext client;
ODE_API int ode_internal_encryption_mount_ex(const unsigned char *mk, unsigned int option);
/**
+ * @brief Check whether the encrypted internal storage is mounted
+ * @details Administrator can use this API to get the current mount state
+ * of encrypted internal storage.
+ * @since_tizen 4.0
+ * @param[out] result Whether the encrypted internal storage is mounted
+ * @return #ODE_ERROR_NONE on success, otherwise a negative value
+ * @retval #ODE_ERROR_NONE Successful
+ * @retval #ODE_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #ODE_ERROR_CONNECTION_REFUSED Connection to the server failed
+ * @retval #ODE_ERROR_UNKNOWN Unknown error
+ * @see ode_internal_encryption_mount()
+ */
+ODE_API int ode_internal_encryption_is_mounted(bool *result);
+
+/**
* @brief Umount internal storage
* @details Administrator can use this API to unmount internal storage.
* @since_tizen 4.0
virtual int mount(const std::vector<unsigned char>& mk, unsigned int options) = 0;
virtual int umount() = 0;
+ virtual int isMounted() = 0;
virtual int encrypt(const std::string& password, unsigned int options) = 0;
virtual int decrypt(const std::string& password) = 0;
server.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryptionServer::setMountPassword)(std::string));
server.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryptionServer::mount)(std::vector<unsigned char>, unsigned int));
server.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryptionServer::umount)());
+ server.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryptionServer::isMounted)());
server.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryptionServer::encrypt)(std::string, unsigned int));
server.expose(this, PRIVILEGE_PLATFORM, (int)(InternalEncryptionServer::decrypt)(std::string));
server.expose(this, "", (int)(InternalEncryptionServer::isPasswordInitialized)());
return error::None;
}
+int InternalEncryptionServer::isMounted()
+{
+ int ret = 0;
+ try {
+ ret = engine->isMounted() ? 1 : 0;
+ } catch (runtime::Exception &e) {
+ ERROR(SINK, "Failed to access the mount flag");
+ return error::Unknown;
+ }
+ return ret;
+}
+
int InternalEncryptionServer::umount()
{
if (getState() != State::Encrypted) {
int mount(const std::vector<unsigned char> &mk, unsigned int options);
int umount();
+ int isMounted();
int encrypt(const std::string& password, unsigned int options);
int decrypt(const std::string& password);