Signal-Android icon indicating copy to clipboard operation
Signal-Android copied to clipboard

Signal crashes on Android 8 when opening per-contact settings for an e-mail contact.

Open JacobHenner opened this issue 8 years ago • 4 comments

  • [x] I have searched open and closed issues for duplicates
  • [x] I am submitting a bug report for existing functionality that does not work as intended
  • [x] I have read https://github.com/signalapp/Signal-Android/wiki/Submitting-useful-bug-reports
  • [x] This isn't a feature request or a discussion topic

Bug description

Signal crashes on Android 8 when opening per-contact settings (e.g. ringtone settings) for an e-mail contact (sent through Verizon's SMS gateway). This occurs regardless of whether or not the e-mail address is stored as a contact in the phone.

Steps to reproduce

  • Send an SMS through phone provider's e-mail-to-SMS gateway.
  • Open message on phone.
  • Click top bar to reveal contact options. Signal will crash each time, before the menu is displayed.

Actual result: Signal crashes when trying to open the contact menu for an e-mail contact Expected result: Signal should display the contact menu, as it does for all other contacts.

Device info

Device: Pixel 2 XL Android version: 8.1.0 Signal version: 4.19.3

Link to debug log

Debug log

JacobHenner avatar May 31 '18 17:05 JacobHenner

This is a regression (not sure from which release), as I've previously set custom ringtone options for one of these contacts successfully.

JacobHenner avatar May 31 '18 22:05 JacobHenner

Looks like this was introduced in https://github.com/signalapp/Signal-Android/commit/e86a9ce7eb0e672dc7705873b2a5e6d70aea0a74

JacobHenner avatar May 31 '18 22:05 JacobHenner

@moxie0 Would something like this be ok?

RecipientPreferenceActivity.java

private void setSummaries(Recipient recipient) {
...
    aboutPreference.setTitle(getPhoneOrEmail(recipient));
...
}

private String getPhoneOrEmail(Recipient recipient) {
    Address address = recipient.getAddress();
    if (address.isPhone()) return PhoneNumberUtils.formatNumber(address.toPhoneString());
    if (address.isEmail()) return address.toEmailString();
    return null;
}

v-po avatar Jun 03 '18 07:06 v-po

Fixed in 4.22.

greyson-signal avatar Jun 22 '18 20:06 greyson-signal