Revert "Revert "Fix SecurityException while accessing Slice Uris""

This reverts commit 52ac47d9c8.

Reason for revert: This CL is what we wanted to merge in RVC and has already got Code-Review +2, Owner-Approval, and DrNo-Review from other folks regardless of the accident.

Bug: 159195420
Change-Id: I6c646269cd3e13e015dcc06418e21db66372e680
This commit is contained in:
Jason Chiu
2020-06-20 07:02:06 +00:00
parent 52ac47d9c8
commit ad9a214fff

View File

@@ -110,9 +110,13 @@ public class EligibleCardChecker implements Callable<ContextualCard> {
@VisibleForTesting @VisibleForTesting
Slice bindSlice(Uri uri) { Slice bindSlice(Uri uri) {
final SliceViewManager manager = SliceViewManager.getInstance(mContext); final SliceViewManager manager = SliceViewManager.getInstance(mContext);
manager.pinSlice(uri); final SliceViewManager.SliceCallback callback = slice -> { };
// Register a trivial callback to pin the slice
manager.registerSliceCallback(uri, callback);
final Slice slice = manager.bindSlice(uri); final Slice slice = manager.bindSlice(uri);
manager.unpinSlice(uri); manager.unregisterSliceCallback(uri, callback);
return slice; return slice;
} }