Clear calling identity when enabling WebView fallback logic.
Using the shell to enable/disable the WebView fallback logic would,
before this CL, fail because the package from where we update the actual
setting wouldn't match that of the calling UID.
Bug: 27957671
Change-Id: Iedf3be71aeef572ebf92c1db163eb8f461b8287a
diff --git a/services/core/java/com/android/server/webkit/WebViewUpdateService.java b/services/core/java/com/android/server/webkit/WebViewUpdateService.java
index 1f6fb2a..bbb4951 100644
--- a/services/core/java/com/android/server/webkit/WebViewUpdateService.java
+++ b/services/core/java/com/android/server/webkit/WebViewUpdateService.java
@@ -242,7 +242,12 @@
throw new SecurityException(msg);
}
- WebViewUpdateService.this.mImpl.enableFallbackLogic(enable);
+ long callingId = Binder.clearCallingIdentity();
+ try {
+ WebViewUpdateService.this.mImpl.enableFallbackLogic(enable);
+ } finally {
+ Binder.restoreCallingIdentity(callingId);
+ }
}
}
}