From 275d13c2c6c2f055b41b14b1c7ba78b838f03b4d Mon Sep 17 00:00:00 2001 From: Gustav Sennton Date: Wed, 24 Feb 2016 10:58:09 +0000 Subject: [PATCH] Call webview updating logic with the system UID when setup done. After performing the webview setup we check whether we changed webview implementation during the setup and, if so, we rerun the updating-logic. This logic needs special permissions such as changing settings (Settings.Global) which the shared relro process doesn't have, therefore, when the shared relro process notifies us that the setup is done we need to switch to using the system uid when running the update-logic. Bug: 27262336 Change-Id: I68646884e31ba55c860ff98c3f30a520beb0ef95 --- .../android/server/webkit/WebViewUpdateService.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/webkit/WebViewUpdateService.java b/services/core/java/com/android/server/webkit/WebViewUpdateService.java index f3b120f944fdc..5d0c22edeaa90 100644 --- a/services/core/java/com/android/server/webkit/WebViewUpdateService.java +++ b/services/core/java/com/android/server/webkit/WebViewUpdateService.java @@ -364,9 +364,14 @@ public class WebViewUpdateService extends SystemService { return; } - synchronized (WebViewUpdateService.this) { - mNumRelroCreationsFinished++; - checkIfRelrosDoneLocked(); + long callingId = Binder.clearCallingIdentity(); + try { + synchronized (WebViewUpdateService.this) { + mNumRelroCreationsFinished++; + checkIfRelrosDoneLocked(); + } + } finally { + Binder.restoreCallingIdentity(callingId); } }