Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28a5c004 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

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

parents 05ae65b7 eaf1564d
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -120,9 +120,13 @@ public class EligibleCardChecker implements Callable<ContextualCard> {

        // Workaround of unpinning slice in the same SerialExecutor of AsyncTask as SliceCallback's
        // observer.
        ThreadUtils.postOnMainThread(() ->
                AsyncTask.execute(() -> manager.unregisterSliceCallback(uri, callback))
        );
        ThreadUtils.postOnMainThread(() -> AsyncTask.execute(() -> {
            try {
                manager.unregisterSliceCallback(uri, callback);
            } catch (SecurityException e) {
                Log.d(TAG, "No permission currently: " + e);
            }
        }));

        return slice;
    }