generating avatar as fallback

Signed-off-by: tobiaskaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiaskaminsky 2018-03-08 15:10:01 +01:00 committed by AndyScherzinger
parent f428c8140c
commit be3086c2f4
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B

View file

@ -896,7 +896,11 @@ public class ThumbnailsCacheManager {
}
} catch (Exception e) {
Log_OC.e(TAG, "Error downloading avatar", e);
try {
return TextDrawable.createAvatar(mAccount.name, mAvatarRadius);
} catch (Exception e1) {
Log_OC.e(TAG, "Error generating fallback avatar");
}
} finally {
if (get != null) {
get.releaseConnection();
@ -904,6 +908,12 @@ public class ThumbnailsCacheManager {
}
} else {
Log_OC.d(TAG, "Server too old");
try {
return TextDrawable.createAvatar(mAccount.name, mAvatarRadius);
} catch (Exception e) {
Log_OC.e(TAG, "Error generating fallback avatar");
}
}
}
return BitmapUtils.bitmapToCircularBitmapDrawable(mResources, avatar);