aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshubang <shubang@google.com>2018-07-20 15:59:18 -0700
committerCopybara-Service <copybara-piper@google.com>2018-07-25 07:21:51 -0700
commite86b242b66997b2a6ee81de5d782ded916dda26a (patch)
treee60dcae4693be826c83b45b2c6a1b1a827e07f57
parent1bf1b4017f0a9aad803307ba0988c2925f11c8b0 (diff)
downloadTV-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.java19
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);
}