33
33
import static com .squareup .picasso .Picasso .LoadedFrom .DISK ;
34
34
35
35
class ContactsPhotoBitmapHunter extends BitmapHunter {
36
- /**
37
- a lookup uri (e.g. content://com.android.contacts/contacts/lookup/3570i61d948d30808e537 )
38
- */
36
+ /** A lookup uri (e.g. content://com.android.contacts/contacts/lookup/3570i61d948d30808e537) */
39
37
private static final int ID_LOOKUP = 1 ;
40
- /**
41
- a contact thumbnail uri (e.g. content://com.android.contacts/contacts/38/photo)
42
- */
38
+ /** A contact thumbnail uri (e.g. content://com.android.contacts/contacts/38/photo) */
43
39
private static final int ID_THUMBNAIL = 2 ;
44
- /**
45
- a contact uri (e.g. content://com.android.contacts/contacts/38)
46
- */
40
+ /** A contact uri (e.g. content://com.android.contacts/contacts/38) */
47
41
private static final int ID_CONTACT = 3 ;
48
42
/**
49
- a contact display photo (high resolution) uri
50
- (e.g. content://com.android.contacts/display_photo/5)
43
+ * A contact display photo (high resolution) uri
44
+ * (e.g. content://com.android.contacts/display_photo/5)
51
45
*/
52
46
private static final int ID_DISPLAY_PHOTO = 4 ;
53
47
54
- static final UriMatcher matcher ;
48
+ private static final UriMatcher matcher ;
55
49
56
50
static {
57
51
matcher = new UriMatcher (UriMatcher .NO_MATCH );
52
+ matcher .addURI (ContactsContract .AUTHORITY , "contacts/lookup/*/#" , ID_LOOKUP );
58
53
matcher .addURI (ContactsContract .AUTHORITY , "contacts/lookup/*" , ID_LOOKUP );
59
54
matcher .addURI (ContactsContract .AUTHORITY , "contacts/#/photo" , ID_THUMBNAIL );
60
55
matcher .addURI (ContactsContract .AUTHORITY , "contacts/#" , ID_CONTACT );
@@ -69,8 +64,7 @@ a contact display photo (high resolution) uri
69
64
this .context = context ;
70
65
}
71
66
72
- @ Override Bitmap decode (Request data )
73
- throws IOException {
67
+ @ Override Bitmap decode (Request data ) throws IOException {
74
68
InputStream is = null ;
75
69
try {
76
70
is = getInputStream ();
@@ -90,7 +84,7 @@ private InputStream getInputStream() throws IOException {
90
84
switch (matcher .match (uri )) {
91
85
case ID_LOOKUP :
92
86
uri = ContactsContract .Contacts .lookupContact (contentResolver , uri );
93
- if (null == uri ) {
87
+ if (uri == null ) {
94
88
return null ;
95
89
}
96
90
// Resolved the uri to a contact uri, intentionally fall through to process the resolved uri
0 commit comments