mirror of
https://gitee.com/openharmony/applications_screenlock
synced 2024-11-23 06:19:47 +00:00
commit
7fee3db0dc
@ -111,12 +111,10 @@ export default class AccountsModel {
|
||||
|
||||
private addAllUsers() {
|
||||
Log.showInfo(TAG, "start getAllUsers")
|
||||
let tempLink = AppStorage.SetAndLink('userList', []);
|
||||
let accountList = tempLink.get();
|
||||
let accountMap = new Map();
|
||||
Log.showInfo(TAG, "start query")
|
||||
osAccount.getAccountManager().queryAllCreatedOsAccounts().then((list) => {
|
||||
Log.showInfo(TAG, "start sort")
|
||||
let accountList = [];
|
||||
let accountMap = new Map();
|
||||
list.sort(this.sortAccount.bind(this));
|
||||
for (const user of list) {
|
||||
Log.showInfo(TAG, "start get user" + JSON.stringify(user))
|
||||
@ -135,6 +133,7 @@ export default class AccountsModel {
|
||||
accountMap.get(user.localId).userIconPath = path
|
||||
})
|
||||
}
|
||||
AppStorage.SetOrCreate('userList', accountList);
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -97,8 +97,8 @@ export class ScreenLockService {
|
||||
//The device is going to sleep
|
||||
this.screenLockModel.eventListener(EVENT_BEGIN_SLEEP, () => {
|
||||
Log.showInfo(TAG, `EVENT_BEGIN_SLEEP event`);
|
||||
this.accountModel.updateAllUsers()
|
||||
this.lockScreen();
|
||||
this.accountModel.updateAllUsers()
|
||||
AppStorage.SetOrCreate('deviceStatus', EVENT_BEGIN_SLEEP);
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user