commit | f2d9199bfbe13f47dd7e29454174cc96ade1487f | [log] [tgz] |
---|---|---|
author | Taesu Lee <taesu82.lee@samsung.com> | Mon Jun 29 14:31:18 2020 +0900 |
committer | Taesu Lee <taesu82.lee@samsung.com> | Mon Jun 29 15:51:07 2020 +0900 |
tree | 0595f4ba0ffb2ef649d044aec5e890e70d9a57ef | |
parent | 392850a825dc6a15c20ff96c794854f61a5d8385 [diff] |
Fix NoSuchMethodError for getTypeInfo() Load an icon image for audio files from app resources instead because ContentResolver#getTypeInfo() is for API level >= 29. And it includes size-fit ic_photo_library_light images also. Bug: 159987488 Test: Manual Change-Id: Ie8f766f148a30e105e598e4b7e6b1b22bccda6ae Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
diff --git a/res/drawable-hdpi/ic_music.png b/res/drawable-hdpi/ic_music.png new file mode 100644 index 0000000..033b402 --- /dev/null +++ b/res/drawable-hdpi/ic_music.png Binary files differ
diff --git a/res/drawable-hdpi/ic_photo_library_light.png b/res/drawable-hdpi/ic_photo_library_light.png index 1f71a62..55b956a 100644 --- a/res/drawable-hdpi/ic_photo_library_light.png +++ b/res/drawable-hdpi/ic_photo_library_light.png Binary files differ
diff --git a/res/drawable-mdpi/ic_music.png b/res/drawable-mdpi/ic_music.png new file mode 100644 index 0000000..106f912 --- /dev/null +++ b/res/drawable-mdpi/ic_music.png Binary files differ
diff --git a/res/drawable-mdpi/ic_photo_library_light.png b/res/drawable-mdpi/ic_photo_library_light.png index 322d486..26c58f3 100644 --- a/res/drawable-mdpi/ic_photo_library_light.png +++ b/res/drawable-mdpi/ic_photo_library_light.png Binary files differ
diff --git a/res/drawable-xhdpi/ic_music.png b/res/drawable-xhdpi/ic_music.png new file mode 100644 index 0000000..1de4c3b --- /dev/null +++ b/res/drawable-xhdpi/ic_music.png Binary files differ
diff --git a/res/drawable-xhdpi/ic_photo_library_light.png b/res/drawable-xhdpi/ic_photo_library_light.png index 1f5a69c..627ff48 100644 --- a/res/drawable-xhdpi/ic_photo_library_light.png +++ b/res/drawable-xhdpi/ic_photo_library_light.png Binary files differ
diff --git a/res/drawable-xxhdpi/ic_music.png b/res/drawable-xxhdpi/ic_music.png new file mode 100644 index 0000000..f8016cc --- /dev/null +++ b/res/drawable-xxhdpi/ic_music.png Binary files differ
diff --git a/res/drawable-xxhdpi/ic_photo_library_light.png b/res/drawable-xxhdpi/ic_photo_library_light.png index f61bb58..cd72bdf 100644 --- a/res/drawable-xxhdpi/ic_photo_library_light.png +++ b/res/drawable-xxhdpi/ic_photo_library_light.png Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_music.png b/res/drawable-xxxhdpi/ic_music.png new file mode 100644 index 0000000..11d67ae --- /dev/null +++ b/res/drawable-xxxhdpi/ic_music.png Binary files differ
diff --git a/res/drawable-xxxhdpi/ic_photo_library_light.png b/res/drawable-xxxhdpi/ic_photo_library_light.png index 8627f42..9fe62f4 100644 --- a/res/drawable-xxxhdpi/ic_photo_library_light.png +++ b/res/drawable-xxxhdpi/ic_photo_library_light.png Binary files differ
diff --git a/src/com/android/messaging/ui/mediapicker/GalleryGridItemView.java b/src/com/android/messaging/ui/mediapicker/GalleryGridItemView.java index 48eaa5d..6cf509b 100644 --- a/src/com/android/messaging/ui/mediapicker/GalleryGridItemView.java +++ b/src/com/android/messaging/ui/mediapicker/GalleryGridItemView.java
@@ -161,14 +161,9 @@ } else { final String contentType = mData.getContentType(); if (ContentType.isAudioType(contentType)) { - final Context context = getContext(); setBackgroundColor( getResources().getColor(R.color.gallery_image_default_background)); - mIcon.setImageDrawable( - context.getContentResolver() - .getTypeInfo(contentType) - .getIcon() - .loadDrawable(context)); + mIcon.setImageResource(R.drawable.ic_music); mIcon.setColorFilter( ConversationDrawables.get().getConversationThemeColor(), PorterDuff.Mode.SRC_IN);