1syntax = "proto2"; 2 3option java_package = "com.android.dialer.phonelookup"; 4option java_multiple_files = true; 5option optimize_for = LITE_RUNTIME; 6 7 8package com.android.dialer.phonelookup; 9 10// Contains information about a phone number, possibly from many sources. 11// 12// This message is organized into sub-message fields where each one corresponds 13// to an implementation of PhoneLookup. For example, field 14// "cp2_info_in_default_directory" corresponds to class 15// Cp2DefaultDirectoryPhoneLookup, and class Cp2DefaultDirectoryPhoneLookup 16// alone is responsible for populating it. Next ID: 7 17message PhoneLookupInfo { 18 // Information about a PhoneNumber retrieved from CP2. 19 message Cp2Info { 20 // Information about a single contact. 21 // Next ID: 8 22 message Cp2ContactInfo { 23 // For a contact in the default directory: 24 // android.provider.ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME_PRIMARY 25 // For a contact in other directories: 26 // android.provider.ContactsContract.PhoneLookup.DISPLAY_NAME_PRIMARY 27 optional string name = 1; 28 29 // For a contact in the default directory: 30 // android.provider.ContactsContract.CommonDataKinds.Phone.PHOTO_THUMBNAIL_URI 31 // For a contact in other directories: 32 // android.provider.ContactsContract.PhoneLookup.PHOTO_THUMBNAIL_URI 33 optional string photo_thumbnail_uri = 2; 34 35 // For a contact in the default directory: 36 // android.provider.ContactsContract.CommonDataKinds.Phone.PHOTO_URI 37 // For a contact in other directories: 38 // android.provider.ContactsContract.PhoneLookup.PHOTO_URI 39 optional string photo_uri = 3; 40 41 // For a contact in the default directory: 42 // android.provider.ContactsContract.CommonDataKinds.Phone.PHOTO_ID 43 // For a contact in other directories: 44 // android.provider.ContactsContract.PhoneLookup.PHOTO_ID 45 optional fixed64 photo_id = 4; 46 47 // For a contact in the default directory: 48 // android.provider.ContactsContract.CommonDataKinds.Phone.LABEL 49 // For a contact in other directories: 50 // android.provider.ContactsContract.PhoneLookup.LABEL 51 // 52 // The value can be "Home", "Mobile", ect. 53 optional string label = 5; 54 55 // For a contact in the default directory: 56 // android.provider.ContactsContract.CommonDataKinds.Phone.CONTACT_ID 57 // For a contact in other directories: 58 // android.provider.ContactsContract.PhoneLookup.CONTACT_ID 59 optional fixed64 contact_id = 6; 60 61 // For a contact in the default directory: 62 // constructed based on 63 // android.provider.ContactsContract.CommonDataKinds.Phone.LOOKUP_KEY 64 // For a contact in other directories: 65 // constructed based on 66 // android.provider.ContactsContract.PhoneLookup.LOOKUP_KEY 67 optional string lookup_uri = 7; 68 } 69 // Repeated because one phone number can be associated with multiple CP2 70 // contacts. 71 // 72 // Empty if there is no CP2 contact information for the number. 73 repeated Cp2ContactInfo cp2_contact_info = 1; 74 75 // The information for this number is incomplete. This can happen when the 76 // call log is requested to be updated but there are many invalid numbers 77 // and the update cannot be performed efficiently. In this case, the call 78 // log needs to query for the CP2 information at render time. 79 optional bool is_incomplete = 2; 80 } 81 82 // Information about a contact in the default directory, retrieved via CP2. 83 // Cp2DefaultDirectoryPhoneLookup is responsible for populating this field. 84 optional Cp2Info default_cp2_info = 1; 85 86 // Information about a contact in other directories, retrieved via CP2. 87 // Cp2ExtendedDirectoryPhoneLookup is responsible for populating this field. 88 optional Cp2Info extended_cp2_info = 6; 89 90 // Message for spam info. 91 // SpamPhoneLookup is responsible for populating this message. 92 message SpamInfo { 93 optional bool is_spam = 1; 94 } 95 optional SpamInfo spam_info = 2; 96 97 // Message for PeopleApi, including G+ contacts and nearby places 98 message PeopleApiInfo { 99 // Best display name determined by people API if available, first display 100 // name otherwise. 101 optional string display_name = 1; 102 103 // The type of the number, for example "phone" or "home". 104 optional string number_type = 2; 105 106 // The number_type label in human readable string, for example "Phone". 107 // The UI should display known number_type with string resources if possible 108 // but if number_type is unrecognized formatted_number_type. For example 109 // if the user set an custom type label. 110 optional string formatted_number_type = 3; 111 112 // URL to the contact's full size photo. 113 optional string image_url = 4; 114 115 // The primary key of the contact in people API. 116 optional string person_id = 5; 117 118 enum InfoType { 119 UNKNOWN = 0; 120 CONTACT = 1; // the result is a saved contact in people API 121 NEARBY_BUSINESS = 2; // the result is found through nearby places 122 } 123 // The type of the lookup result, for example, a saved contact or a nearby 124 // business. 125 optional InfoType info_type = 6; 126 127 // A URI that contains encoded JSON about the number so contacts can 128 // populate the quick contact activity with name and numbers. This does not 129 // point to any real contact entry anywhere. 130 optional string lookup_uri = 7; 131 } 132 optional PeopleApiInfo people_api_info = 3; 133 134 // Whether a number is blocked or not. Used by both the system blacklist and 135 // dialer fallback 136 enum BlockedState { 137 UNKNOWN = 0; 138 BLOCKED = 1; 139 NOT_BLOCKED = 2; 140 } 141 142 // Message for the android system BlockedNumber lookup. Available starting in 143 // N. 144 message SystemBlockedNumberInfo { 145 optional BlockedState blocked_state = 1; 146 } 147 optional SystemBlockedNumberInfo system_blocked_number_info = 4; 148 149 // Message for the dialer fallback for blocked number. Used in M or when the 150 // migration to the system has not been completed. 151 message DialerBlockedNumberInfo { 152 optional BlockedState blocked_state = 1; 153 } 154 optional DialerBlockedNumberInfo dialer_blocked_number_info = 5; 155}