mirror of
https://gitee.com/openharmony/ability_dmsfwk
synced 2024-11-22 22:09:58 +00:00
commit
917bf8d784
@ -26,7 +26,15 @@
|
||||
namespace OHOS {
|
||||
namespace DistributedSchedule {
|
||||
class MultiUserManager {
|
||||
DECLARE_SINGLE_INSTANCE(MultiUserManager);
|
||||
public:
|
||||
static MultiUserManager& GetInstance();
|
||||
private:
|
||||
MultiUserManager(const MultiUserManager&) = delete;
|
||||
MultiUserManager& operator= (const MultiUserManager&) = delete;
|
||||
MultiUserManager(MultiUserManager&&) = delete;
|
||||
MultiUserManager& operator= (MultiUserManager&&) = delete;
|
||||
MultiUserManager();
|
||||
~MultiUserManager() = default;
|
||||
|
||||
public:
|
||||
void Init();
|
||||
|
@ -31,7 +31,19 @@ namespace {
|
||||
const std::string TAG = "MultiUserManager";
|
||||
}
|
||||
|
||||
IMPLEMENT_SINGLE_INSTANCE(MultiUserManager);
|
||||
MultiUserManager& MultiUserManager::GetInstance()
|
||||
{
|
||||
static auto instance = new MultiUserManager();
|
||||
return *instance;
|
||||
}
|
||||
|
||||
MultiUserManager::MultiUserManager()
|
||||
{
|
||||
HILOGI("Start.");
|
||||
if (currentUserId_ <= 0) {
|
||||
Init();
|
||||
}
|
||||
}
|
||||
|
||||
void MultiUserManager::Init()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user