Skip to content

Commit

Permalink
Fix issue with phone number normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
bezloginu committed Jun 21, 2017
1 parent c562804 commit 53b4d24
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ android {
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.f1x.mtcdialer"
minSdkVersion 19
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.2"
versionName "1.2.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/f1x/mtcdialer/DialActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.net.Uri;
import android.os.Bundle;
import android.os.RemoteException;
import android.telephony.PhoneNumberUtils;
import android.widget.Toast;

/**
Expand Down Expand Up @@ -37,7 +38,7 @@ String extractPhoneNumber(Intent intent) {
Uri uri = intent.getData();

if(uri != null && uri.getScheme().matches("tel|sms|smsto|mms|mmsto")) {
return uri.getSchemeSpecificPart().replaceAll("\\s+", "");
return PhoneNumberUtils.normalizeNumber(uri.getSchemeSpecificPart());
} else {
return null;
}
Expand Down

0 comments on commit 53b4d24

Please sign in to comment.