#define __EXTENSION_ENCRYPTION_H__
#include <string>
-#include <mutex>
-
-#include <klay/dbus/connection.h>
#include "context.h"
int getState();
private:
- enum Operation {
- ADDED = 0,
- CHANGED,
- REMOVED,
-
- OPERATION_MAX
- };
-
- enum Device {
- MMC = 0,
- MAP,
-
- DEVICE_MAX
- };
-
- enum Request {
- NONE = 0,
- MOUNT,
- UMOUNT
- };
-
- struct DevInfo {
- std::string mntPath;
- std::string fsType;
- std::string sysPath;
- bool mounted;
- int storagedId;
-
- DevInfo() : mounted(false), storagedId(-1) {}
- ~DevInfo() {}
-
- void clear() {
- mntPath.clear();
- fsType.clear();
- sysPath.clear();
- mounted = false;
- storagedId = -1;
- }
- };
-
- void logStoragedEvent(Operation op, Device d);
- void handleDevice(Operation op,
- const std::vector<int> &intparams,
- const std::vector<char*> &strparams);
- void parseVariant(Operation op, dbus::Variant parameters);
- void queryStoraged();
- void subscribeToStoraged();
- void unsubscribeFromStoraged();
-
- bool storagedMount(std::unique_lock<std::mutex> &lock);
- bool storagedUnmount(std::unique_lock<std::mutex> &lock);
-
- int getStatePriv() const;
- bool isInserted() const;
- bool isOpened() const;
- bool isMounted() const;
-
ODEControlContext& context;
-
- // currently inserted card information, empty if no card:
- DevInfo info[DEVICE_MAX];
-
- dbus::Connection::SubscriptionId subId[OPERATION_MAX];
-
- Request currentReq;
};
} // namespace ode