summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-07-08 18:09:09 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-07-08 18:09:09 +0000
commit28a5c00429c52d139ec52a373c0c064e58c1f80b (patch)
tree34d9c7b69471d0ff1207417980e982c680b472b6 /src/com/android/settings
parent05ae65b7b00e1abff004fef72927692282f74861 (diff)
parenteaf1564d9fcb644825d2f0275564f039c52fc4ea (diff)
downloadpackages_apps_Settings-28a5c00429c52d139ec52a373c0c064e58c1f80b.tar.gz
packages_apps_Settings-28a5c00429c52d139ec52a373c0c064e58c1f80b.tar.bz2
packages_apps_Settings-28a5c00429c52d139ec52a373c0c064e58c1f80b.zip
Merge "Guard against SecurityException of accessing to slice uri" into rvc-dev
Diffstat (limited to 'src/com/android/settings')
-rw-r--r--src/com/android/settings/homepage/contextualcards/EligibleCardChecker.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/settings/homepage/contextualcards/EligibleCardChecker.java b/src/com/android/settings/homepage/contextualcards/EligibleCardChecker.java
index 46b4c869ec..f98d795521 100644
--- a/src/com/android/settings/homepage/contextualcards/EligibleCardChecker.java
+++ b/src/com/android/settings/homepage/contextualcards/EligibleCardChecker.java
@@ -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;
}