-
-
Notifications
You must be signed in to change notification settings - Fork 45
User photo and name #3134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User photo and name #3134
Conversation
| String username = personalIdSessionDataViewModel.getPersonalIdSessionData().getUsername(); | ||
| String photoBase64 = personalIdSessionDataViewModel.getPersonalIdSessionData().getPhotoBase64(); | ||
|
|
||
| if (!TextUtils.isEmpty(username)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this as username can't be empty at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (!TextUtils.isEmpty(photoBase64)) { | ||
| try { | ||
| byte[] decodedBytes = Base64.decode(photoBase64, Base64.DEFAULT); | ||
| Bitmap bitmap = BitmapFactory.decodeByteArray(decodedBytes, 0, decodedBytes.length); | ||
| binding.userPhoto.setImageBitmap(bitmap); | ||
| } catch (IllegalArgumentException e) { | ||
| Logger.log("photo-decode-error", "Invalid Base64 image: " + e.getMessage()); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can reuse displayImage by moving it to MediaUtil.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
|
|
||
| private void displayImage(String photoAsBase64) { | ||
| String imageData = photoAsBase64.replace(MicroImageActivity.BASE_64_IMAGE_PREFIX, ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this code now ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Remove the metadata prefix if it exists | ||
| if (base64Image.startsWith("data:image")) { | ||
| int commaIndex = base64Image.indexOf(','); | ||
| if (commaIndex != -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw an IllegalStateException if commaIndex == -1 instead.
| byte[] decodedString = Base64.decode(base64Image, Base64.DEFAULT); | ||
| return BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length); | ||
| } catch(Exception e){ | ||
| } catch (Exception e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets remove the generic catch from here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Product Description
Added user name and photo at the time of recovery of pin at the backup code page
Technical Summary
Feature Flag
Safety Assurance
Safety story
Automated test coverage
QA Plan
Labels and Review