diff options
author | calderwoodra <calderwoodra@google.com> | 2017-08-02 15:35:44 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-08-03 08:32:10 -0700 |
commit | 784739f73e968e33dbcae9e2a5951b78467c53ad (patch) | |
tree | 0cdc49a09b4295b0a0f0573049fbfbd14868264c | |
parent | 0b9c073c385bd9b3b6c133ec667f0104b89d2d5a (diff) |
Devices in other locales no longer crash in GalleryComposerFragment.
Devices with other default locales would translate '1' and this would cause an
no such column exception in SQLite.
Bug: 64137857
Test: manual
PiperOrigin-RevId: 164048836
Change-Id: I4ecd070f8d38a82ca6567fb23b660d5ebe1f1f18
-rw-r--r-- | java/com/android/dialer/callcomposer/GalleryCursorLoader.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/java/com/android/dialer/callcomposer/GalleryCursorLoader.java b/java/com/android/dialer/callcomposer/GalleryCursorLoader.java index 39d6a4a6d..d33bfb398 100644 --- a/java/com/android/dialer/callcomposer/GalleryCursorLoader.java +++ b/java/com/android/dialer/callcomposer/GalleryCursorLoader.java @@ -16,7 +16,6 @@ package com.android.dialer.callcomposer; -import android.annotation.SuppressLint; import android.content.Context; import android.net.Uri; import android.provider.MediaStore.Files; @@ -44,11 +43,10 @@ public class GalleryCursorLoader extends CursorLoader { SORT_ORDER); } - @SuppressLint("DefaultLocale") private static String createSelection() { - return String.format( - "mime_type IN ('image/jpeg', 'image/jpg', 'image/png', 'image/webp')" - + " AND media_type in (%d)", - FileColumns.MEDIA_TYPE_IMAGE); + return "mime_type IN ('image/jpeg', 'image/jpg', 'image/png', 'image/webp')" + + " AND media_type in (" + + FileColumns.MEDIA_TYPE_IMAGE + + ")"; } } |