VAccountManagerService.java 文件源码

java
阅读 35 收藏 0 点赞 0 评论 0

项目:VirtualHook 作者:
private Account renameAccountInternal(int userId, Account accountToRename, String newName) {
    // TODO: Cancel Notification
    synchronized (accountsByUserId) {
        VAccount vAccount = getAccount(userId, accountToRename);
        if (vAccount != null) {
            vAccount.previousName = vAccount.name;
            vAccount.name = newName;
            saveAllAccounts();
            Account newAccount = new Account(vAccount.name, vAccount.type);
            synchronized (authTokenRecords) {
                for (AuthTokenRecord record : authTokenRecords) {
                    if (record.userId == userId && record.account.equals(accountToRename)) {
                        record.account = newAccount;
                    }
                }
            }
            sendAccountsChangedBroadcast(userId);
            return newAccount;
        }
    }
    return accountToRename;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号