Merge "Guard against SecurityException of accessing to slice uri" into rvc-dev

This commit is contained in:
TreeHugger Robot
2020-07-08 18:09:09 +00:00
committed by Android (Google) Code Review

View File

@@ -120,9 +120,13 @@ public class EligibleCardChecker implements Callable<ContextualCard> {
// Workaround of unpinning slice in the same SerialExecutor of AsyncTask as SliceCallback's // Workaround of unpinning slice in the same SerialExecutor of AsyncTask as SliceCallback's
// observer. // observer.
ThreadUtils.postOnMainThread(() -> ThreadUtils.postOnMainThread(() -> AsyncTask.execute(() -> {
AsyncTask.execute(() -> manager.unregisterSliceCallback(uri, callback)) try {
); manager.unregisterSliceCallback(uri, callback);
} catch (SecurityException e) {
Log.d(TAG, "No permission currently: " + e);
}
}));
return slice; return slice;
} }