Skip to content

Commit c8459dc

Browse files
author
Christopher Tate
committed
Settings provider needs to send notifications as itself
... and not as its ultimate caller, who may be a less-privileged application. Fixes bug 7188309 Change-Id: Iffd37b8da84f683bf665bf3d48c0b7fbc8dd721d
1 parent 21dfd7c commit c8459dc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,12 @@ private void sendNotify(Uri uri, int userHandle) {
344344
String notify = uri.getQueryParameter("notify");
345345
if (notify == null || "true".equals(notify)) {
346346
final int notifyTarget = isGlobal ? UserHandle.USER_ALL : userHandle;
347-
getContext().getContentResolver().notifyChange(uri, null, true, notifyTarget);
347+
final long oldId = Binder.clearCallingIdentity();
348+
try {
349+
getContext().getContentResolver().notifyChange(uri, null, true, notifyTarget);
350+
} finally {
351+
Binder.restoreCallingIdentity(oldId);
352+
}
348353
if (LOCAL_LOGV) Log.v(TAG, "notifying for " + notifyTarget + ": " + uri);
349354
} else {
350355
if (LOCAL_LOGV) Log.v(TAG, "notification suppressed: " + uri);

0 commit comments

Comments
 (0)