diff options
author | shubang <shubang@google.com> | 2018-05-08 15:55:05 -0700 |
---|---|---|
committer | Nick Chalko <nchalko@google.com> | 2018-05-18 10:26:34 -0700 |
commit | 6aa5442626556435e47007846041df302530e1fd (patch) | |
tree | 4ea4ef00ee4be13e33e2ac0efa2428882c5b4398 | |
parent | a21e1889617314d7db73b12370a01f45a8693980 (diff) | |
download | TV-6aa5442626556435e47007846041df302530e1fd.tar.gz |
Fix IllegalArgumentException at TvProviderUtils.getExistingColumns
PiperOrigin-RevId: 195890612
Change-Id: I81b916a6f4785904a027bc8dd336e92d47f80f90
-rw-r--r-- | src/com/android/tv/util/TvProviderUtils.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/com/android/tv/util/TvProviderUtils.java b/src/com/android/tv/util/TvProviderUtils.java index ccf012d5..f4a3355d 100644 --- a/src/com/android/tv/util/TvProviderUtils.java +++ b/src/com/android/tv/util/TvProviderUtils.java @@ -23,6 +23,7 @@ import android.media.tv.TvContract; import android.net.Uri; import android.os.Build; import android.os.Bundle; +import android.support.annotation.VisibleForTesting; import android.support.annotation.WorkerThread; import android.util.Log; import com.android.tv.data.BaseProgram; @@ -109,10 +110,16 @@ public final class TvProviderUtils { * * @param uri the corresponding URI of the table */ - private static Set<String> getExistingColumns(Context context, Uri uri) { - Bundle result = - context.getContentResolver() - .call(uri, TvContract.METHOD_GET_COLUMNS, uri.toString(), null); + @VisibleForTesting + static Set<String> getExistingColumns(Context context, Uri uri) { + Bundle result = null; + try { + result = + context.getContentResolver() + .call(uri, TvContract.METHOD_GET_COLUMNS, uri.toString(), null); + } catch (Exception e) { + Log.e(TAG, "Error trying to get existing columns.", e); + } if (result != null) { String[] columns = result.getStringArray(TvContract.EXTRA_EXISTING_COLUMN_NAMES); if (columns != null) { |