1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

Return user name when display name is unknown

This commit is contained in:
David A. Velasco 2016-06-06 18:26:55 +02:00
parent 743661ca90
commit afe65bdc3f
2 changed files with 11 additions and 5 deletions

View File

@ -128,7 +128,13 @@ public class OwnCloudAccount {
}
public String getDisplayName() {
if (mDisplayName != null && mDisplayName.length() > 0) {
return mDisplayName;
} else if (mCredentials != null) {
return mCredentials.getUsername();
} else {
return "NONE";
}
}
public void setDisplayName(String displayName) {

View File

@ -59,10 +59,10 @@ public class GetRemoteUserNameOperation extends RemoteOperation {
private static final String NODE_DISPLAY_NAME= "display-name";
private static final String NODE_EMAIL= "email";
private String mUserName;
private String mDisplayName;
public String getUserName() {
return mUserName;
public String getDisplayName() {
return mDisplayName;
}
@ -98,7 +98,7 @@ public class GetRemoteUserNameOperation extends RemoteOperation {
ArrayList<Object> data = new ArrayList<Object>();
data.add(displayName);
result.setData(data);
mUserName = displayName;
mDisplayName = displayName;
Log_OC.d(TAG, "*** Parsed user information: " + id + " - " + displayName + " - " + email);