diff options
author | shubang <shubang@google.com> | 2018-07-20 15:59:18 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-07-25 07:21:51 -0700 |
commit | e86b242b66997b2a6ee81de5d782ded916dda26a (patch) | |
tree | e60dcae4693be826c83b45b2c6a1b1a827e07f57 | |
parent | 1bf1b4017f0a9aad803307ba0988c2925f11c8b0 (diff) | |
download | TV-android-live-tv.tar.gz |
Catch exceptions for METHOD_ADD_COLUMNandroid-live-tv
PiperOrigin-RevId: 205467779
Change-Id: Ie9b3896ba659ceebacd388e79e4f95a44a47c3dd
-rw-r--r-- | src/com/android/tv/util/TvProviderUtils.java | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/com/android/tv/util/TvProviderUtils.java b/src/com/android/tv/util/TvProviderUtils.java index f4a3355d..67290b39 100644 --- a/src/com/android/tv/util/TvProviderUtils.java +++ b/src/com/android/tv/util/TvProviderUtils.java @@ -140,13 +140,18 @@ public final class TvProviderUtils { extra.putCharSequence(TvContract.EXTRA_COLUMN_NAME, EXTRA_PROGRAM_COLUMN); extra.putCharSequence(TvContract.EXTRA_DATA_TYPE, "TEXT"); // If the add operation fails, the following just returns null without crashing. - Bundle allColumns = - context.getContentResolver() - .call( - contentUri, - TvContract.METHOD_ADD_COLUMN, - contentUri.toString(), - extra); + Bundle allColumns = null; + try { + allColumns = + context.getContentResolver() + .call( + contentUri, + TvContract.METHOD_ADD_COLUMN, + contentUri.toString(), + extra); + } catch (Exception e) { + Log.e(TAG, "Error trying to add column.", e); + } if (allColumns == null) { Log.w(TAG, "Adding new column failed. Uri=" + contentUri); } |