diff options
| author | 2017-08-11 15:29:40 -0600 | |
|---|---|---|
| committer | 2017-08-11 15:32:10 -0600 | |
| commit | 88f9d0b9c29e65a8eb57a711ad03dda84f72f6c3 (patch) | |
| tree | ba15c0c5650024793ff6f3d7ed95445b15de7a3e | |
| parent | 2593d707f78e72afa3fdbe98557497af0545ded3 (diff) | |
Catch exception when notifying Settings changes.
Since changes are dispatched through a separate thread, the target
user may have been removed by the time we try sending the change
notification, so log instead of crashing.
Bug: 64402212
Test: builds, boots
Change-Id: I0efdfabf24829bef7a1ecc7b3c97205f87e9769f
| -rw-r--r-- | packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java index 146b34947678..53ffe9503f4d 100644 --- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java @@ -2878,7 +2878,11 @@ public class SettingsProvider extends ContentProvider { case MSG_NOTIFY_URI_CHANGED: { final int userId = msg.arg1; Uri uri = (Uri) msg.obj; - getContext().getContentResolver().notifyChange(uri, null, true, userId); + try { + getContext().getContentResolver().notifyChange(uri, null, true, userId); + } catch (SecurityException e) { + Slog.w(LOG_TAG, "Failed to notify for " + userId + ": " + uri, e); + } if (DEBUG) { Slog.v(LOG_TAG, "Notifying for " + userId + ": " + uri); } |