Merge pull request #729 from funk78/feature/use_getDeviceE164Number

FREEBIE reuse code
This commit is contained in:
Moxie Marlinspike 2014-02-25 15:15:26 -08:00
commit 0da1d8818e

View File

@ -107,13 +107,7 @@ public class RegistrationActivity extends SherlockActivity {
}
private void initializeNumber() {
String localNumber = ((TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE))
.getLine1Number();
if (!Util.isEmpty(localNumber) && !localNumber.startsWith("+")) {
if (localNumber.length() == 10) localNumber = "+1" + localNumber;
else localNumber = "+" + localNumber;
}
String localNumber = org.whispersystems.textsecure.util.Util.getDeviceE164Number(this);
try {
if (!Util.isEmpty(localNumber)) {