Browser: add homepage and bookmark feature
Add specified homepage and bookmarks for carrier.
CRs-Fixed: 516137 516140 516141
Change-Id: I923e41e376685e0d5c45b8ce8f2e523d56492680
diff --git a/src/com/android/browser/TabControl.java b/src/com/android/browser/TabControl.java
index 150ece0..10de8a1 100644
--- a/src/com/android/browser/TabControl.java
+++ b/src/com/android/browser/TabControl.java
@@ -17,6 +17,7 @@
package com.android.browser;
import android.os.Bundle;
+import android.os.SystemProperties;
import android.util.Log;
import android.webkit.WebView;
@@ -408,6 +409,22 @@
// sNextId to be set correctly.
continue;
}
+
+ // add for carrier homepage feature
+ // If the webview restore successfully, add javascript interface again.
+ WebView view = t.getWebView();
+ if (view != null) {
+ String browserRes = SystemProperties.get("persist.env.c.browser.resource",
+ "default");
+ if ("ct".equals(browserRes)) {
+ view.getSettings().setJavaScriptEnabled(true);
+ if (mController.getActivity() instanceof BrowserActivity) {
+ view.addJavascriptInterface(mController.getActivity(),
+ "default_homepage");
+ }
+ }
+ }
+
tabMap.put(id, t);
// Me must set the current tab before restoring the state
// so that all the client classes are set.