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:
@@ -110,9 +110,13 @@ public class EligibleCardChecker implements Callable<ContextualCard> {
|
||||
@VisibleForTesting
|
||||
Slice bindSlice(Uri uri) {
|
||||
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);
|
||||
manager.unpinSlice(uri);
|
||||
manager.unregisterSliceCallback(uri, callback);
|
||||
|
||||
return slice;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user