mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Small improvement
This commit is contained in:
parent
cc6ecd7fe1
commit
88336e16f4
1 changed files with 8 additions and 3 deletions
|
@ -47,6 +47,7 @@ import androidx.core.graphics.drawable.IconCompat;
|
|||
import androidx.lifecycle.LifecycleOwner;
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -228,9 +229,13 @@ class Shortcuts {
|
|||
if (avatar != null &&
|
||||
Helper.hasPermission(context, Manifest.permission.READ_CONTACTS)) {
|
||||
// Create icon from bitmap because launcher might not have contacts permission
|
||||
InputStream is = ContactsContract.Contacts.openContactPhotoInputStream(
|
||||
context.getContentResolver(), avatar);
|
||||
bitmap = BitmapFactory.decodeStream(is);
|
||||
ContentResolver resolver = context.getContentResolver();
|
||||
try (InputStream is = ContactsContract.Contacts
|
||||
.openContactPhotoInputStream(resolver, avatar)) {
|
||||
bitmap = BitmapFactory.decodeStream(is);
|
||||
} catch (IOException ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
}
|
||||
|
||||
boolean identicon = false;
|
||||
|
|
Loading…
Reference in a new issue