Skip to content

Commit b5dc215

Browse files
committed
Pass webview instance when getting base layer / color, and prevent null value
Depends on external/webkit change: https://android-git.corp.google.com/g/#/c/188470/ bug:6429897 Change-Id: Ic948f102034dbe57c61d7fc6de73a4ddd062f686
1 parent 87156c9 commit b5dc215

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

core/java/android/webkit/WebViewClassic.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3299,7 +3299,8 @@ public int getContentWidth() {
32993299
}
33003300

33013301
public int getPageBackgroundColor() {
3302-
return nativeGetBackgroundColor();
3302+
if (mNativeClass == 0) return Color.WHITE;
3303+
return nativeGetBackgroundColor(mNativeClass);
33033304
}
33043305

33053306
/**
@@ -4456,7 +4457,7 @@ int getBaseLayer() {
44564457
if (mNativeClass == 0) {
44574458
return 0;
44584459
}
4459-
return nativeGetBaseLayer();
4460+
return nativeGetBaseLayer(mNativeClass);
44604461
}
44614462

44624463
private void onZoomAnimationStart() {
@@ -8593,7 +8594,7 @@ private native void nativeUpdateDrawGLFunction(int nativeInstance, Rect invS
85938594
private native void nativeSetHeightCanMeasure(boolean measure);
85948595
private native boolean nativeSetBaseLayer(int nativeInstance,
85958596
int layer, boolean showVisualIndicator, boolean isPictureAfterFirstLayout);
8596-
private native int nativeGetBaseLayer();
8597+
private native int nativeGetBaseLayer(int nativeInstance);
85978598
private native void nativeCopyBaseContentToPicture(Picture pict);
85988599
private native boolean nativeHasContent();
85998600
private native void nativeStopGL();
@@ -8621,7 +8622,7 @@ private native int nativeScrollableLayer(int nativeInstance, int x, int y,
86218622
*/
86228623
private native boolean nativeScrollLayer(int nativeInstance, int layer, int newX, int newY);
86238624
private native void nativeSetIsScrolling(boolean isScrolling);
8624-
private native int nativeGetBackgroundColor();
8625+
private native int nativeGetBackgroundColor(int nativeInstance);
86258626
native boolean nativeSetProperty(String key, String value);
86268627
native String nativeGetProperty(String key);
86278628
/**

0 commit comments

Comments
 (0)