Load of rework on EncryptActivity, still some TODOs
This commit is contained in:
1 parent
bc9922263c
commit
2913a78b18
11 files changed
+610
-591
No files matched your search
+13
-8
@@ -236,14 +236,19 @@ public class ContactHelper {
|
||||
}
|
||||
|
||||
public static Bitmap photoFromFingerprint(ContentResolver contentResolver, String fingerprint) {
|
||||
int rawContactId = findRawContactId(contentResolver, fingerprint);
|
||||
if (rawContactId == -1) return null;
|
||||
Uri rawContactUri = ContentUris.withAppendedId(ContactsContract.RawContacts.CONTENT_URI, rawContactId);
|
||||
Uri contactUri = ContactsContract.RawContacts.getContactLookupUri(contentResolver, rawContactUri);
|
||||
InputStream photoInputStream =
|
||||
ContactsContract.Contacts.openContactPhotoInputStream(contentResolver, contactUri);
|
||||
if (photoInputStream == null) return null;
|
||||
return BitmapFactory.decodeStream(photoInputStream);
|
||||
if (fingerprint == null) return null;
|
||||
try {
|
||||
int rawContactId = findRawContactId(contentResolver, fingerprint);
|
||||
if (rawContactId == -1) return null;
|
||||
Uri rawContactUri = ContentUris.withAppendedId(ContactsContract.RawContacts.CONTENT_URI, rawContactId);
|
||||
Uri contactUri = ContactsContract.RawContacts.getContactLookupUri(contentResolver, rawContactUri);
|
||||
InputStream photoInputStream =
|
||||
ContactsContract.Contacts.openContactPhotoInputStream(contentResolver, contactUri);
|
||||
if (photoInputStream == null) return null;
|
||||
return BitmapFactory.decodeStream(photoInputStream);
|
||||
} catch (Throwable ignored) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user