mirror of
https://gitee.com/openharmony/ability_dmsfwk
synced 2024-11-26 16:10:42 +00:00
根据进程获取用户然后获取管理类
Signed-off-by: 韦国庆 <weiguoqing2@huawei.com>
This commit is contained in:
parent
c8e4c4f4ef
commit
cfdbecf424
@ -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