summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBo Liu <boliu@google.com>2014-03-18 02:16:07 -0700
committerBo Liu <boliu@google.com>2014-03-18 03:35:16 -0700
commitb3d255b84ff3ae8c3924e349560cfdabdb312145 (patch)
tree6760ea1e3f8bebaf2835c0a4cc570d080f58b166
parent8b40943e64e797e59b6dc037daab9b5c87d61242 (diff)
downloadandroid_frameworks_webview-b3d255b84ff3ae8c3924e349560cfdabdb312145.tar.gz
android_frameworks_webview-b3d255b84ff3ae8c3924e349560cfdabdb312145.tar.bz2
android_frameworks_webview-b3d255b84ff3ae8c3924e349560cfdabdb312145.zip
Fix check when setLayerType is called in constructor
BUG: 13514997 Change-Id: I8414b7caf3a7fb6770242dd4d1640ff89c9be26a
-rw-r--r--chromium/java/com/android/webview/chromium/WebViewChromium.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/chromium/java/com/android/webview/chromium/WebViewChromium.java b/chromium/java/com/android/webview/chromium/WebViewChromium.java
index 2927416..316ccdb 100644
--- a/chromium/java/com/android/webview/chromium/WebViewChromium.java
+++ b/chromium/java/com/android/webview/chromium/WebViewChromium.java
@@ -257,6 +257,9 @@ class WebViewChromium implements WebViewProvider,
// old apps use to enable that behavior is deprecated.
AwContents.setShouldDownloadFavicons();
}
+
+ // TODO: This assumes AwContents ignores second Paint param.
+ mAwContents.setLayerType(mWebView.getLayerType(), null);
}
void startYourEngine() {
@@ -1916,7 +1919,9 @@ class WebViewChromium implements WebViewProvider,
@Override
public void setLayerType(final int layerType, final Paint paint) {
- mFactory.startYourEngines(false);
+ // This can be called from WebView constructor in which case mAwContents
+ // is still null. We set the layer type in initForReal in that case.
+ if (mAwContents == null) return;
if (checkNeedsPost()) {
ThreadUtils.postOnUiThread(new Runnable() {
@Override