summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaesu Lee <taesu82.lee@samsung.com>2020-06-29 14:31:18 +0900
committerdoc HD <doc.divxm@gmail.com>2020-09-12 23:13:23 +0300
commit272a3cee6a8de10f9308670fd6c3829d3bf0efd0 (patch)
tree7a3db3b2209ecd54a952a1643c6ee880d047320f
parentbb23356ca8628edbb44edc6e3a5063545535babc (diff)
Fix NoSuchMethodError for getTypeInfo()q10.0
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>
-rw-r--r--res/drawable-hdpi/ic_music.pngbin0 -> 326 bytes
-rw-r--r--res/drawable-hdpi/ic_photo_library_light.pngbin994 -> 468 bytes
-rw-r--r--res/drawable-mdpi/ic_music.pngbin0 -> 230 bytes
-rw-r--r--res/drawable-mdpi/ic_photo_library_light.pngbin772 -> 339 bytes
-rw-r--r--res/drawable-xhdpi/ic_music.pngbin0 -> 431 bytes
-rw-r--r--res/drawable-xhdpi/ic_photo_library_light.pngbin1170 -> 579 bytes
-rw-r--r--res/drawable-xxhdpi/ic_music.pngbin0 -> 634 bytes
-rw-r--r--res/drawable-xxhdpi/ic_photo_library_light.pngbin1521 -> 816 bytes
-rw-r--r--res/drawable-xxxhdpi/ic_music.pngbin0 -> 759 bytes
-rw-r--r--res/drawable-xxxhdpi/ic_photo_library_light.pngbin553 -> 1041 bytes
-rw-r--r--src/com/android/messaging/ui/mediapicker/GalleryGridItemView.java7
11 files changed, 1 insertions, 6 deletions
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 @@ public class GalleryGridItemView extends FrameLayout {
} 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);