After quick search and little testing I found the following
just remove
txt_phonenumber.addTextChangedListener(new PhoneNumberFormattingTextWatcher());
this line. Why because The formatting is based on the current system locale and future locale changes may not take effect on this instance
. For more detail see here. After removing this line you can enter 7 digits.
I hope this wil help you.