-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Feature/registration usability #724
Conversation
How does this work in devices that don't have SIM cards? |
@mcginty no idea, probably telephonyManager.getSimCountryIso() would return null? I did not know that the app works on devices without a sim card. How do you verify a device without a sim card via SMS or phone call? What type of device are you thinking of? |
The registration screen already populates the country code if the device has a sim card. Is there a problem with it? |
I tried the installation of the app today on a phone and it wouldn't automatically fill in the country code... About the installation process:
Same on the Galaxy s2 plus, don't know about the android version it's using. |
@moxie0 Are you having RegistrationActivity.initializeNumber() in mind? That did not work on my phone at all, i am using a german sim card. TelephonyManager.getLine1Number() may return null for some devices/sim cards. |
@funk78 the same is true for all other messengers though, hangouts can't autodetect my phone number either. I'd consider this a bug with German SIM cards, not TextSecure. |
The way it is working with this branch is that first it will auto-fill the country code and set the display name in the spinner. After that if possible the whole number is beeing auto-filled. Even if the TelephonyManager.getLine1Number() returns a valid number this feature helps to set the spinner to the correct country. From looking at the code I think at the moment the user would see "Select a country" in the spinner even if his number was auto-filled. |
so getLine1Number fails on your sim, but getcountryiso succeeds? |
@moxie0 Yes, exactly. It is not only my sim, there are several topics regarding that issue: https://www.google.de/search?q=getline1number&oq=get&aqs=chrome.0.69i59j69i57j69i59j69i61j0l2.967j0j7&sourceid=chrome&espv=210&es_sm=93&ie=UTF-8 |
@funk78 well, the most prominent result to your search link seems to be http://stackoverflow.com/a/5134725, so there's that. Hangouts asks too, for example. Some providers just don't store the phone number on the SIM. |
more people requesting this feature: #904 |
Yes, this happens with newer Vodafone PT SIMs as well. "My phone number" is "Unknown" in system settings. This number is stored locally on the SIM, and therein lies the problem. In the micro/nano SIM transitions you buy phone and it comes preloaded with a micro/nano SIM (and an associated phone number) which you can use right away. But you want to keep your old number, and you don't have a micro/nano SIM around. So the operator associates the new SIM with the old number, which would make having the number stored in the SIM wrong. So that field is empty for many newer SIMs. I've switched SIMs 3 times in the past 3 years; all of them had this field empty. Some older phones allow setting/changing this number, but no Android phones that I know of do. |
A friend of mine gets even returned an invalid number by the getLine1Number() function. If i remember it correctly it was 491760000000. So even if you get a number returned by getLine1Number() it may be invalid. @moxie0 Any specific reason why this PR is not beeing merged? Shall i merge the current master into it? |
@funk78 The current diff is pretty large. It seems like this could probably be done with two lines in the initializeNumber() method of RegistrationActivity? |
Thanks, I slimmed this down in df1c96a |
FREEBIE
#703 is now tested and works on my Galaxy Note 2.
It adds a feature so that the countrycode is automatically detected and the displayname and countrycode textfield is auto-filled.