diff options
author | zachh <zachh@google.com> | 2018-01-29 13:45:58 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-01-29 15:36:05 -0800 |
commit | 75a8d5170399b37d33bced7825a9f6d88a5ec233 (patch) | |
tree | 35a7e6ae0b6dbdae5ba84388a55853af78ac875f /java/com/android/dialer/phonenumberproto/dialer_phone_number.proto | |
parent | add7d143419d8ada612eb3e0bb2807b0e97dff35 (diff) |
Added is_valid and post_dial_portion fields to DialerPhoneNumber.
These are frequently used attributes of numbers that we can compute once at parse-time.
Also did some general cleanup of DialerPhoneNumberUtil:
-Removed unused Future version of parse()
-Remove formatToValidE164 now that the new fields are available
-Inlined normalizeNumber()
Bug: 72563861
Test: existing
PiperOrigin-RevId: 183720128
Change-Id: I702dc265360e590439c5352c493ae8a858f36812
Diffstat (limited to 'java/com/android/dialer/phonenumberproto/dialer_phone_number.proto')
-rw-r--r-- | java/com/android/dialer/phonenumberproto/dialer_phone_number.proto | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/java/com/android/dialer/phonenumberproto/dialer_phone_number.proto b/java/com/android/dialer/phonenumberproto/dialer_phone_number.proto index 941de0428..ad8a8f9fa 100644 --- a/java/com/android/dialer/phonenumberproto/dialer_phone_number.proto +++ b/java/com/android/dialer/phonenumberproto/dialer_phone_number.proto @@ -40,6 +40,11 @@ message DialerPhoneNumber { // number is a 7-digit US number (missing an area code) like "456-7890" which // would be stored as "4567890". // + // Note: Using this field without country_iso effectively loses country info + // when the number is not valid and no country prefix was prepended. This may + // cause numbers like {"456-7890", "US"} to be treated equivalently to + // {"456-7890", "DE"}, when they are not in fact equivalent. + // // See DialerPhoneNumberUtil#parse. optional string normalized_number = 1; @@ -47,4 +52,15 @@ message DialerPhoneNumber { // CallLog.Calls#COUNTRY: "The ISO 3166-1 two letters country code of the // country where the user received or made the call." optional string country_iso = 2; + + // True if the number is valid according to libphonenumber. + optional bool is_valid = 3; + + // The post dial portion of the number as described by + // PhoneNumberUtils#extractPostDialPortion. Note that this is also part of + // normalized_number, but this information is duplicated here for convenience. + // + // This includes pause and wait characters, but strips other characters, so + // for example would be ",123;456" given the raw input of "456-7890,123; 456". + optional string post_dial_portion = 4; } |