Browser not working 4.0.1->4.0.3 / Solution

674 views
Skip to first unread message

Daniel Fages

unread,
Dec 26, 2011, 5:17:42 PM12/26/11
to android-porting
Hello,
I'm working on building AOSP for VirtualBox.
When upgrading from 4.0.1 to 4.0.3, the Browser and the WebView
component don't work anymore - HTML pages are just loading and loading
without anything showing up...
After some hours studying the diff between the 2 versions, I realized
that some code remove between 4.0.1 and 4.0.3 was responsible for
this : in /frameworks/base/core/java/android/webkit/BrowserFrame.java
at line 875 the call to loader.executeLoad() has been removed and the
page is never loaded..

After puting back the loader.executeLoad() call in my 4.0.3 source
code, everything works fine.

Has anyone else seen this ?

Best regards,
Dan.

Alvin Ong

unread,
Dec 27, 2011, 1:29:30 PM12/27/11
to android...@googlegroups.com
Dan, can you direct me how to change this and where?   thanks much!

Al Sutton

unread,
Dec 27, 2011, 4:50:01 AM12/27/11
to dfa...@gmail.com, android-porting
Looks like Change-Id If6efd11f5032141dadbfcd0b3215e89b464e5f35 (AOSP commit aefc28a1b666f3e9b19eb5a8955e70297119f03d) is to blame.

As part of the removal of some performance checking code the conditional which loaded the page as well as triggering a performance message was removed. The specific section was;

diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webkit/BrowserFrame.java
index 2cc928f..388920c 100644 (file)
--- a/core/java/android/webkit/BrowserFrame.java
+++ b/core/java/android/webkit/BrowserFrame.java
@@ -872,11 +870,6 @@ class BrowserFrame extends Handler {
|| headers.containsKey("If-None-Match") ?
WebSettings.LOAD_NO_CACHE : cacheMode);
// Set referrer to current URL?
- if (!loader.executeLoad()) {
- checker.responseAlert("startLoadingResource fail");
- }
- checker.responseAlert("startLoadingResource succeed");
-
return !synchronous ? loadListener : null;
}

So adding back in the loader.executeLoad() with the following patch will, as you've already pointed out, fix things;

diff --git a/core/java/android/webkit/BrowserFrame.java b/core/java/android/webk
index c194559..dfa8aa5 100644
--- a/core/java/android/webkit/BrowserFrame.java
+++ b/core/java/android/webkit/BrowserFrame.java
@@ -869,6 +869,8 @@ class BrowserFrame extends Handler {
loader.setCacheMode(headers.containsKey("If-Modified-Since")
|| headers.containsKey("If-None-Match") ?
WebSettings.LOAD_NO_CACHE : cacheMode);
+ // Load the page
+ loader.executeLoad();
// Set referrer to current URL?
return !synchronous ? loadListener : null;
}


Al.
--
T: @alsutton W: www.funkyandroid.com

The views expressed in this email are those of the author and not necessarily those of Funky Android Limited, it's associates, or it's subsidiaries.

> --
> unsubscribe: android-porti...@googlegroups.com
> website: http://groups.google.com/group/android-porting

John Reck

unread,
Jan 11, 2012, 4:16:48 PM1/11/12
to android...@googlegroups.com, dfa...@gmail.com
Yes, this is the right fix. However, you should consider this stack deprecated and switch as soon as possible to the Chromium HTTP stack. This method is only used in the Apache HTTP stack path. I would not be surprised if other aspects of the Apache stack are broken or missing features.

The change I submitted to master that hasn't been pushed yet is:

         loader.setCacheMode(headers.containsKey("If-Modified-Since")
                 || headers.containsKey("If-None-Match") ? 
                         WebSettings.LOAD_NO_CACHE : cacheMode);
+        loader.executeLoad();

John Reck

unread,
Jan 11, 2012, 9:46:26 PM1/11/12
to android...@googlegroups.com, dfa...@gmail.com
And FYI, the patch landed in AOSP master in framework/base with SHA-1 of 0a3fcc3eed15ed50bcaa7808b6ccb170fb137210

Chih-Wei Huang

unread,
Jan 12, 2012, 2:11:19 AM1/12/12
to android...@googlegroups.com, dfa...@gmail.com
Thanks, John.

As we discussed privately,
the problem to enable chrome stack for x86 is v8 engine.
I've uploaded two patches to fix that:

https://android-review.googlesource.com/30890
https://android-review.googlesource.com/30891

Please take a look if you can.

John Reck於 2012年1月12日星期四UTC+8上午5時16分48秒寫道:

Al Sutton

unread,
Jan 12, 2012, 2:28:56 AM1/12/12
to jr...@android.com, android...@googlegroups.com
John,

The android-x86 group have tried switching to chromium, but it appears to have a dependancy on the v8 engine which in turn requires the ARM platform (see http://groups.google.com/group/android-x86/msg/f99f379337585667 for details).

Do you have a recommendation for what groups porting to non-ARM platforms should do?

Al.
-- 
T: @alsutton W: www.funkyandroid.com 

The views expressed in this email are those of the author and not necessarily those of Funky Android Limited, it's associates, or it's subsidiaries. 

Reply all
Reply to author
Forward
0 new messages