summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorVivek Sekhar <vsekhar@codeaurora.org>2014-08-01 12:30:35 -0700
committerWebTech Code Review <code-review@localhost>2014-08-05 15:16:10 -0700
commit0989b45c12b64b28750c9df1389c6003aa0d1d65 (patch)
tree3689a2d8adc395474aacc8d2eec657df5c0bd528 /src/com
parent10daf89d192c9da985e380524f13bdaa562d51f6 (diff)
downloadandroid_packages_apps_Gello-0989b45c12b64b28750c9df1389c6003aa0d1d65.tar.gz
android_packages_apps_Gello-0989b45c12b64b28750c9df1389c6003aa0d1d65.tar.bz2
android_packages_apps_Gello-0989b45c12b64b28750c9df1389c6003aa0d1d65.zip
Browser Fixes.
- Move the browser targeted verion to SDK 19. - Remove hack to create dummy webview to call into singleton classes and use Engine class. - Add missing methods to compile for API 19. Change-Id: Ie765921f1227eb5de314ed29c5ce909bee6aea93
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/browser/Browser.java18
-rw-r--r--src/com/android/browser/BrowserPreferencesPage.java18
-rw-r--r--src/com/android/browser/Preloader.java5
3 files changed, 27 insertions, 14 deletions
diff --git a/src/com/android/browser/Browser.java b/src/com/android/browser/Browser.java
index 54284945..01b97064 100644
--- a/src/com/android/browser/Browser.java
+++ b/src/com/android/browser/Browser.java
@@ -22,7 +22,7 @@ import android.content.pm.PackageManager;
import android.util.Log;
import android.os.Process;
-import org.codeaurora.swe.CookieSyncManager;
+import org.codeaurora.swe.Engine;
import com.android.browser.BrowserConfig;
@@ -45,16 +45,16 @@ public class Browser extends Application {
// SWE: Avoid initializing databases for sandboxed processes.
// Must have INITIALIZE_DATABASE permission in AndroidManifest.xml only for browser process
- final String INITIALIZE_DATABASE= BrowserConfig.AUTHORITY +
+ final String INITIALIZE_DATABASE = BrowserConfig.AUTHORITY +
".permission.INITIALIZE_DATABASE";
final Context context = getApplicationContext();
- if (context.checkPermission(INITIALIZE_DATABASE,
- Process.myPid(), Process.myUid()) == PackageManager.PERMISSION_GRANTED) {
-
- // create CookieSyncManager with current Context
- CookieSyncManager.createInstance(this);
- BrowserSettings.initialize(getApplicationContext());
- Preloader.initialize(getApplicationContext());
+ boolean isActivityContext = (context.checkPermission(INITIALIZE_DATABASE,
+ Process.myPid(), Process.myUid()) == PackageManager.PERMISSION_GRANTED);
+ if (isActivityContext) {
+ // Initialize the SWE engine.
+ Engine.initialize(context);
+ BrowserSettings.initialize(context);
+ Preloader.initialize(context);
}
}
}
diff --git a/src/com/android/browser/BrowserPreferencesPage.java b/src/com/android/browser/BrowserPreferencesPage.java
index ebc08a40..9e19d118 100644
--- a/src/com/android/browser/BrowserPreferencesPage.java
+++ b/src/com/android/browser/BrowserPreferencesPage.java
@@ -26,7 +26,10 @@ import com.android.browser.R;
import com.android.browser.preferences.BandwidthPreferencesFragment;
import com.android.browser.preferences.DebugPreferencesFragment;
+import java.util.Arrays;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
public class BrowserPreferencesPage extends PreferenceActivity {
@@ -99,4 +102,19 @@ public class BrowserPreferencesPage extends PreferenceActivity {
return intent;
}
+ private static final Set<String> sKnownFragments = new HashSet<String>(Arrays.asList(
+ "com.android.browser.preferences.GeneralPreferencesFragment",
+ "com.android.browser.preferences.PrivacySecurityPreferencesFragment",
+ "com.android.browser.preferences.AccessibilityPreferencesFragment",
+ "com.android.browser.preferences.AdvancedPreferencesFragment",
+ "com.android.browser.preferences.BandwidthPreferencesFragment",
+ "com.android.browser.preferences.LabPreferencesFragment",
+ "com.android.browser.preferences.AboutPreferencesFragment"));
+
+ @Override
+ protected boolean isValidFragment(String fragmentName) {
+ return sKnownFragments.contains(fragmentName);
+ }
+
+
}
diff --git a/src/com/android/browser/Preloader.java b/src/com/android/browser/Preloader.java
index 99909b35..5f90487e 100644
--- a/src/com/android/browser/Preloader.java
+++ b/src/com/android/browser/Preloader.java
@@ -53,11 +53,6 @@ public class Preloader {
mHandler = new Handler(Looper.getMainLooper());
mSession = null;
mFactory = new BrowserWebViewFactory(context);
-
- // Creating dummy Webview for browser to force loading of library;
- // This will thereby prevent any singleton calls invoked directly
- // even without the webview creation
- (mFactory.instantiateWebView(null, android.R.attr.webViewStyle, false)).destroy();
}
private PreloaderSession getSession(String id) {