summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2013-02-21 15:19:53 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-02-21 15:19:53 -0800
commitfb053cde74483f901462b5a034dd2be90a5af0da (patch)
tree155a463267f4540565a47693376de6c1d8524980 /core
parente96558879ec7008ddf5647ad29d69ec1fad68c67 (diff)
parentf7bf667d4a5e8e3fca75640f6352724826705128 (diff)
downloadframeworks_base-fb053cde74483f901462b5a034dd2be90a5af0da.zip
frameworks_base-fb053cde74483f901462b5a034dd2be90a5af0da.tar.gz
frameworks_base-fb053cde74483f901462b5a034dd2be90a5af0da.tar.bz2
am f7bf667d: am b5a1ce2f: Merge "Allow three digit phone numbers"
* commit 'f7bf667d4a5e8e3fca75640f6352724826705128': Allow three digit phone numbers
Diffstat (limited to 'core')
-rw-r--r--core/java/android/util/Patterns.java8
-rw-r--r--core/tests/coretests/src/android/util/PatternsTest.java2
2 files changed, 6 insertions, 4 deletions
diff --git a/core/java/android/util/Patterns.java b/core/java/android/util/Patterns.java
index 152827d..9522112 100644
--- a/core/java/android/util/Patterns.java
+++ b/core/java/android/util/Patterns.java
@@ -169,10 +169,10 @@ public class Patterns {
* </ul>
*/
public static final Pattern PHONE
- = Pattern.compile( // sdd = space, dot, or dash
- "(\\+[0-9]+[\\- \\.]*)?" // +<digits><sdd>*
- + "(\\([0-9]+\\)[\\- \\.]*)?" // (<digits>)<sdd>*
- + "([0-9][0-9\\- \\.][0-9\\- \\.]+[0-9])"); // <digit><digit|sdd>+<digit>
+ = Pattern.compile( // sdd = space, dot, or dash
+ "(\\+[0-9]+[\\- \\.]*)?" // +<digits><sdd>*
+ + "(\\([0-9]+\\)[\\- \\.]*)?" // (<digits>)<sdd>*
+ + "([0-9][0-9\\- \\.]+[0-9])"); // <digit><digit|sdd>+<digit>
/**
* Convenience method to take all of the non-null matching groups in a
diff --git a/core/tests/coretests/src/android/util/PatternsTest.java b/core/tests/coretests/src/android/util/PatternsTest.java
index 9519b9f..ebdbb0e 100644
--- a/core/tests/coretests/src/android/util/PatternsTest.java
+++ b/core/tests/coretests/src/android/util/PatternsTest.java
@@ -156,6 +156,8 @@ public class PatternsTest extends TestCase {
"Me: 16505551212 this\n",
"Me: 6505551212 this\n",
"Me: 5551212 this\n",
+ "Me: 2211 this\n",
+ "Me: 112 this\n",
"Me: 1-650-555-1212 this\n",
"Me: (650) 555-1212 this\n",