Skip to content
Snippets Groups Projects
Commit f7a6b84b authored by Adrien Béraud's avatar Adrien Béraud
Browse files

account: cache username

Change-Id: Ieea171bd1084ca04fb7d4f161ad67827c5ecfcf1
parent 911b1c87
No related branches found
No related tags found
No related merge requests found
...@@ -58,6 +58,8 @@ public class Account { ...@@ -58,6 +58,8 @@ public class Account {
private AccountConfig mVolatileDetails; private AccountConfig mVolatileDetails;
private AccountConfig mDetails; private AccountConfig mDetails;
private String mUsername;
private final ArrayList<AccountCredentials> credentialsDetails = new ArrayList<>(); private final ArrayList<AccountCredentials> credentialsDetails = new ArrayList<>();
private Map<String, String> devices = new HashMap<>(); private Map<String, String> devices = new HashMap<>();
private final Map<String, CallContact> mContacts = new HashMap<>(); private final Map<String, CallContact> mContacts = new HashMap<>();
...@@ -128,7 +130,7 @@ public class Account { ...@@ -128,7 +130,7 @@ public class Account {
final List<Map<String, String>> credentials, final List<Map<String, String>> credentials,
final Map<String, String> volDetails) { final Map<String, String> volDetails) {
accountID = bAccountID; accountID = bAccountID;
mDetails = new AccountConfig(details); setDetails(details);
mVolatileDetails = new AccountConfig(volDetails); mVolatileDetails = new AccountConfig(volDetails);
setCredentials(credentials); setCredentials(credentials);
} }
...@@ -371,7 +373,8 @@ public class Account { ...@@ -371,7 +373,8 @@ public class Account {
} }
public void setDetails(Map<String, String> details) { public void setDetails(Map<String, String> details) {
this.mDetails = new AccountConfig(details); mDetails = new AccountConfig(details);
mUsername = mDetails.get(ConfigKey.ACCOUNT_USERNAME);
} }
public void setDetail(ConfigKey key, String val) { public void setDetail(ConfigKey key, String val) {
...@@ -395,7 +398,7 @@ public class Account { ...@@ -395,7 +398,7 @@ public class Account {
} }
public String getUsername() { public String getUsername() {
return mDetails.get(ConfigKey.ACCOUNT_USERNAME); return mUsername;
} }
public String getDisplayname() { public String getDisplayname() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment