Copy of new files from 1599

Modified folder structure - added swe folder

Change-Id: I2b48a1635ad0a6406398aa9f1021a1f43baebeef
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..42a0adc
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+res/values/about.xml
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..e05b145
--- /dev/null
+++ b/VERSION
@@ -0,0 +1,6 @@
+1.0
+# base version, needs to be on first line of this file
+# if you need to change that, please also fix
+# tools/generate_about.sh
+
+
diff --git a/res/layout/browser_tab_crash.xml b/res/layout/browser_tab_crash.xml
new file mode 100644
index 0000000..4144d87
--- /dev/null
+++ b/res/layout/browser_tab_crash.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ # Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ #
+ # Redistribution and use in source and binary forms, with or without
+ # modification, are permitted provided that the following conditions are
+ # met:
+ #     * Redistributions of source code must retain the above copyright
+ #      notice, this list of conditions and the following disclaimer.
+ #    * Redistributions in binary form must reproduce the above
+ #      copyright notice, this list of conditions and the following
+ #      disclaimer in the documentation and/or other materials provided
+ #      with the distribution.
+ #    * Neither the name of The Linux Foundation nor the names of its
+ #      contributors may be used to endorse or promote products derived
+ #      from this software without specific prior written permission.
+ #
+ # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ # ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:background="@android:color/white">
+
+    <TextView
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:paddingTop="20dp"
+        android:paddingBottom="20dp"
+        android:textSize="20dp"
+        android:textColor="@android:color/black"
+        android:text="@string/browser_tab_crash_snap" />
+
+    <Button
+        android:id="@+id/browser_crash_reload_btn"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:background="@android:color/holo_green_dark"
+        android:text="Reload"/>
+
+    <TextView android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"
+        android:paddingLeft="10dp"
+        android:paddingRight="10dp"
+        android:paddingTop="20dp"
+        android:textSize="15dp"
+        android:textColor="@android:color/black"
+        android:text="@string/browser_tab_crash_message" />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/preference_widget_seekbar.xml b/res/layout/preference_widget_seekbar.xml
new file mode 100644
index 0000000..324eb99
--- /dev/null
+++ b/res/layout/preference_widget_seekbar.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<!-- Layout for a Preference in a PreferenceActivity. The
+     Preference is able to place a specific widget for its particular
+     type in the "widget_frame" layout. -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:minHeight="?android:attr/listPreferredItemHeight"
+    android:gravity="center_vertical"
+    android:paddingEnd="?android:attr/scrollbarSize">
+
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:gravity="center"
+        android:minWidth="0dp"
+        android:orientation="horizontal">
+        <ImageView
+            android:id="@+android:id/icon"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:minWidth="48dp"
+            />
+    </LinearLayout>
+
+    <RelativeLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="16dip"
+        android:layout_marginEnd="8dip"
+        android:layout_marginTop="6dip"
+        android:layout_marginBottom="6dip"
+        android:layout_weight="1">
+
+        <TextView android:id="@+android:id/title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:singleLine="true"
+            android:textAppearance="?android:attr/textAppearanceMedium"
+            android:ellipsize="marquee"
+            android:fadingEdge="horizontal" />
+
+        <TextView android:id="@+android:id/summary"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_below="@android:id/title"
+            android:layout_alignStart="@android:id/title"
+            android:textAppearance="?android:attr/textAppearanceSmall"
+            android:textColor="?android:attr/textColorSecondary"
+            android:maxLines="4" />
+
+        <!-- Preference should place its actual preference widget here. -->
+        <LinearLayout android:id="@+android:id/widget_frame"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:layout_below="@android:id/summary"
+            android:layout_alignStart="@android:id/title"
+            android:minWidth="@dimen/preference_widget_width"
+            android:gravity="center"
+            android:orientation="vertical" />
+
+        <SeekBar android:id="@+android:id/seekbar2"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_below="@android:id/summary"
+            android:layout_toEndOf="@android:id/widget_frame"
+            android:layout_alignParentEnd="true" />
+
+    </RelativeLayout>
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/raw/incognito_mode_start_page.html b/res/raw/incognito_mode_start_page.html
new file mode 100644
index 0000000..d3f0d65
--- /dev/null
+++ b/res/raw/incognito_mode_start_page.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+
+<!--
+ # Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ #
+ # Redistribution and use in source and binary forms, with or without
+ # modification, are permitted provided that the following conditions are
+ # met:
+ #     * Redistributions of source code must retain the above copyright
+ #      notice, this list of conditions and the following disclaimer.
+ #    * Redistributions in binary form must reproduce the above
+ #      copyright notice, this list of conditions and the following
+ #      disclaimer in the documentation and/or other materials provided
+ #      with the distribution.
+ #    * Neither the name of The Linux Foundation nor the names of its
+ #      contributors may be used to endorse or promote products derived
+ #      from this software without specific prior written permission.
+ #
+ # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ # ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+
+<html>
+  <head>
+    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"/>
+    <title>Incognito Page</title>
+  </head>
+  <body>
+    <p>
+    <p>
+    <strong>You've gone incognito</strong>.
+    <p> Pages you view in this window won't appear in your browser history or
+      search history, and they won't leave other traces, like cookies, on your
+      device after you close the incognito window. Any files you download or
+      bookmarks you create will be preserved.
+    </p>
+  </body>
+</html>
diff --git a/src/com/android/browser/AccountsChangedReceiver.java b/src/com/android/swe/browser/AccountsChangedReceiver.java
similarity index 100%
rename from src/com/android/browser/AccountsChangedReceiver.java
rename to src/com/android/swe/browser/AccountsChangedReceiver.java
diff --git a/src/com/android/browser/ActivityController.java b/src/com/android/swe/browser/ActivityController.java
similarity index 100%
rename from src/com/android/browser/ActivityController.java
rename to src/com/android/swe/browser/ActivityController.java
diff --git a/src/com/android/browser/AddBookmarkFolder.java b/src/com/android/swe/browser/AddBookmarkFolder.java
similarity index 100%
rename from src/com/android/browser/AddBookmarkFolder.java
rename to src/com/android/swe/browser/AddBookmarkFolder.java
diff --git a/src/com/android/browser/AddBookmarkPage.java b/src/com/android/swe/browser/AddBookmarkPage.java
similarity index 100%
rename from src/com/android/browser/AddBookmarkPage.java
rename to src/com/android/swe/browser/AddBookmarkPage.java
diff --git a/src/com/android/browser/AddNewBookmark.java b/src/com/android/swe/browser/AddNewBookmark.java
similarity index 100%
rename from src/com/android/browser/AddNewBookmark.java
rename to src/com/android/swe/browser/AddNewBookmark.java
diff --git a/src/com/android/browser/AutoFillProfileDatabase.java b/src/com/android/swe/browser/AutoFillProfileDatabase.java
similarity index 100%
rename from src/com/android/browser/AutoFillProfileDatabase.java
rename to src/com/android/swe/browser/AutoFillProfileDatabase.java
diff --git a/src/com/android/browser/AutoFillSettingsFragment.java b/src/com/android/swe/browser/AutoFillSettingsFragment.java
similarity index 100%
rename from src/com/android/browser/AutoFillSettingsFragment.java
rename to src/com/android/swe/browser/AutoFillSettingsFragment.java
diff --git a/src/com/android/browser/AutofillHandler.java b/src/com/android/swe/browser/AutofillHandler.java
similarity index 100%
rename from src/com/android/browser/AutofillHandler.java
rename to src/com/android/swe/browser/AutofillHandler.java
diff --git a/src/com/android/browser/AutologinBar.java b/src/com/android/swe/browser/AutologinBar.java
similarity index 100%
rename from src/com/android/browser/AutologinBar.java
rename to src/com/android/swe/browser/AutologinBar.java
diff --git a/src/com/android/browser/BackgroundHandler.java b/src/com/android/swe/browser/BackgroundHandler.java
similarity index 100%
rename from src/com/android/browser/BackgroundHandler.java
rename to src/com/android/swe/browser/BackgroundHandler.java
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/swe/browser/BaseUi.java
similarity index 100%
rename from src/com/android/browser/BaseUi.java
rename to src/com/android/swe/browser/BaseUi.java
diff --git a/src/com/android/browser/BookmarkItem.java b/src/com/android/swe/browser/BookmarkItem.java
similarity index 100%
rename from src/com/android/browser/BookmarkItem.java
rename to src/com/android/swe/browser/BookmarkItem.java
diff --git a/src/com/android/browser/BookmarkSearch.java b/src/com/android/swe/browser/BookmarkSearch.java
similarity index 100%
rename from src/com/android/browser/BookmarkSearch.java
rename to src/com/android/swe/browser/BookmarkSearch.java
diff --git a/src/com/android/browser/BookmarkUtils.java b/src/com/android/swe/browser/BookmarkUtils.java
similarity index 100%
rename from src/com/android/browser/BookmarkUtils.java
rename to src/com/android/swe/browser/BookmarkUtils.java
diff --git a/src/com/android/browser/Bookmarks.java b/src/com/android/swe/browser/Bookmarks.java
similarity index 100%
rename from src/com/android/browser/Bookmarks.java
rename to src/com/android/swe/browser/Bookmarks.java
diff --git a/src/com/android/browser/BookmarksLoader.java b/src/com/android/swe/browser/BookmarksLoader.java
similarity index 100%
rename from src/com/android/browser/BookmarksLoader.java
rename to src/com/android/swe/browser/BookmarksLoader.java
diff --git a/src/com/android/browser/BreadCrumbView.java b/src/com/android/swe/browser/BreadCrumbView.java
similarity index 100%
rename from src/com/android/browser/BreadCrumbView.java
rename to src/com/android/swe/browser/BreadCrumbView.java
diff --git a/src/com/android/browser/Browser.java b/src/com/android/swe/browser/Browser.java
similarity index 100%
rename from src/com/android/browser/Browser.java
rename to src/com/android/swe/browser/Browser.java
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/swe/browser/BrowserActivity.java
similarity index 100%
rename from src/com/android/browser/BrowserActivity.java
rename to src/com/android/swe/browser/BrowserActivity.java
diff --git a/src/com/android/browser/BrowserBackupAgent.java b/src/com/android/swe/browser/BrowserBackupAgent.java
similarity index 100%
rename from src/com/android/browser/BrowserBackupAgent.java
rename to src/com/android/swe/browser/BrowserBackupAgent.java
diff --git a/src/com/android/browser/BrowserBookmarksAdapter.java b/src/com/android/swe/browser/BrowserBookmarksAdapter.java
similarity index 100%
rename from src/com/android/browser/BrowserBookmarksAdapter.java
rename to src/com/android/swe/browser/BrowserBookmarksAdapter.java
diff --git a/src/com/android/browser/BrowserBookmarksAdapterItem.java b/src/com/android/swe/browser/BrowserBookmarksAdapterItem.java
similarity index 100%
rename from src/com/android/browser/BrowserBookmarksAdapterItem.java
rename to src/com/android/swe/browser/BrowserBookmarksAdapterItem.java
diff --git a/src/com/android/browser/BrowserBookmarksPage.java b/src/com/android/swe/browser/BrowserBookmarksPage.java
similarity index 100%
rename from src/com/android/browser/BrowserBookmarksPage.java
rename to src/com/android/swe/browser/BrowserBookmarksPage.java
diff --git a/src/com/android/browser/BrowserHistoryPage.java b/src/com/android/swe/browser/BrowserHistoryPage.java
similarity index 100%
rename from src/com/android/browser/BrowserHistoryPage.java
rename to src/com/android/swe/browser/BrowserHistoryPage.java
diff --git a/src/com/android/browser/BrowserPreferencesPage.java b/src/com/android/swe/browser/BrowserPreferencesPage.java
similarity index 100%
rename from src/com/android/browser/BrowserPreferencesPage.java
rename to src/com/android/swe/browser/BrowserPreferencesPage.java
diff --git a/src/com/android/browser/BrowserSettings.java b/src/com/android/swe/browser/BrowserSettings.java
similarity index 100%
rename from src/com/android/browser/BrowserSettings.java
rename to src/com/android/swe/browser/BrowserSettings.java
diff --git a/src/com/android/browser/BrowserSnapshotPage.java b/src/com/android/swe/browser/BrowserSnapshotPage.java
similarity index 100%
rename from src/com/android/browser/BrowserSnapshotPage.java
rename to src/com/android/swe/browser/BrowserSnapshotPage.java
diff --git a/src/com/android/browser/BrowserUtils.java b/src/com/android/swe/browser/BrowserUtils.java
similarity index 100%
rename from src/com/android/browser/BrowserUtils.java
rename to src/com/android/swe/browser/BrowserUtils.java
diff --git a/src/com/android/browser/BrowserWebView.java b/src/com/android/swe/browser/BrowserWebView.java
similarity index 100%
rename from src/com/android/browser/BrowserWebView.java
rename to src/com/android/swe/browser/BrowserWebView.java
diff --git a/src/com/android/browser/BrowserWebViewFactory.java b/src/com/android/swe/browser/BrowserWebViewFactory.java
similarity index 100%
rename from src/com/android/browser/BrowserWebViewFactory.java
rename to src/com/android/swe/browser/BrowserWebViewFactory.java
diff --git a/src/com/android/browser/BrowserYesNoPreference.java b/src/com/android/swe/browser/BrowserYesNoPreference.java
similarity index 100%
rename from src/com/android/browser/BrowserYesNoPreference.java
rename to src/com/android/swe/browser/BrowserYesNoPreference.java
diff --git a/src/com/android/browser/CombinedBookmarksCallbacks.java b/src/com/android/swe/browser/CombinedBookmarksCallbacks.java
similarity index 100%
rename from src/com/android/browser/CombinedBookmarksCallbacks.java
rename to src/com/android/swe/browser/CombinedBookmarksCallbacks.java
diff --git a/src/com/android/browser/ComboViewActivity.java b/src/com/android/swe/browser/ComboViewActivity.java
similarity index 100%
rename from src/com/android/browser/ComboViewActivity.java
rename to src/com/android/swe/browser/ComboViewActivity.java
diff --git a/src/com/android/browser/Controller.java b/src/com/android/swe/browser/Controller.java
similarity index 100%
rename from src/com/android/browser/Controller.java
rename to src/com/android/swe/browser/Controller.java
diff --git a/src/com/android/browser/CrashRecoveryHandler.java b/src/com/android/swe/browser/CrashRecoveryHandler.java
similarity index 100%
rename from src/com/android/browser/CrashRecoveryHandler.java
rename to src/com/android/swe/browser/CrashRecoveryHandler.java
diff --git a/src/com/android/browser/DataController.java b/src/com/android/swe/browser/DataController.java
similarity index 100%
rename from src/com/android/browser/DataController.java
rename to src/com/android/swe/browser/DataController.java
diff --git a/src/com/android/browser/DataUri.java b/src/com/android/swe/browser/DataUri.java
similarity index 100%
rename from src/com/android/browser/DataUri.java
rename to src/com/android/swe/browser/DataUri.java
diff --git a/src/com/android/browser/DateSortedExpandableListAdapter.java b/src/com/android/swe/browser/DateSortedExpandableListAdapter.java
similarity index 100%
rename from src/com/android/browser/DateSortedExpandableListAdapter.java
rename to src/com/android/swe/browser/DateSortedExpandableListAdapter.java
diff --git a/src/com/android/browser/DeviceAccountLogin.java b/src/com/android/swe/browser/DeviceAccountLogin.java
similarity index 100%
rename from src/com/android/browser/DeviceAccountLogin.java
rename to src/com/android/swe/browser/DeviceAccountLogin.java
diff --git a/src/com/android/browser/DownloadHandler.java b/src/com/android/swe/browser/DownloadHandler.java
similarity index 100%
rename from src/com/android/browser/DownloadHandler.java
rename to src/com/android/swe/browser/DownloadHandler.java
diff --git a/src/com/android/browser/DownloadSettings.java b/src/com/android/swe/browser/DownloadSettings.java
similarity index 100%
rename from src/com/android/browser/DownloadSettings.java
rename to src/com/android/swe/browser/DownloadSettings.java
diff --git a/src/com/android/browser/DownloadTouchIcon.java b/src/com/android/swe/browser/DownloadTouchIcon.java
similarity index 100%
rename from src/com/android/browser/DownloadTouchIcon.java
rename to src/com/android/swe/browser/DownloadTouchIcon.java
diff --git a/src/com/android/browser/ErrorConsoleView.java b/src/com/android/swe/browser/ErrorConsoleView.java
similarity index 100%
rename from src/com/android/browser/ErrorConsoleView.java
rename to src/com/android/swe/browser/ErrorConsoleView.java
diff --git a/src/com/android/browser/EventLogTags.logtags b/src/com/android/swe/browser/EventLogTags.logtags
similarity index 100%
rename from src/com/android/browser/EventLogTags.logtags
rename to src/com/android/swe/browser/EventLogTags.logtags
diff --git a/src/com/android/browser/FetchUrlMimeType.java b/src/com/android/swe/browser/FetchUrlMimeType.java
similarity index 100%
rename from src/com/android/browser/FetchUrlMimeType.java
rename to src/com/android/swe/browser/FetchUrlMimeType.java
diff --git a/src/com/android/browser/GeolocationPermissionsPrompt.java b/src/com/android/swe/browser/GeolocationPermissionsPrompt.java
similarity index 100%
rename from src/com/android/browser/GeolocationPermissionsPrompt.java
rename to src/com/android/swe/browser/GeolocationPermissionsPrompt.java
diff --git a/src/com/android/browser/GoogleAccountLogin.java b/src/com/android/swe/browser/GoogleAccountLogin.java
similarity index 100%
rename from src/com/android/browser/GoogleAccountLogin.java
rename to src/com/android/swe/browser/GoogleAccountLogin.java
diff --git a/src/com/android/browser/HistoryItem.java b/src/com/android/swe/browser/HistoryItem.java
similarity index 100%
rename from src/com/android/browser/HistoryItem.java
rename to src/com/android/swe/browser/HistoryItem.java
diff --git a/src/com/android/browser/HttpAuthenticationDialog.java b/src/com/android/swe/browser/HttpAuthenticationDialog.java
similarity index 100%
rename from src/com/android/browser/HttpAuthenticationDialog.java
rename to src/com/android/swe/browser/HttpAuthenticationDialog.java
diff --git a/src/com/android/browser/IntentHandler.java b/src/com/android/swe/browser/IntentHandler.java
similarity index 100%
rename from src/com/android/browser/IntentHandler.java
rename to src/com/android/swe/browser/IntentHandler.java
diff --git a/src/com/android/browser/KeyChainLookup.java b/src/com/android/swe/browser/KeyChainLookup.java
similarity index 100%
rename from src/com/android/browser/KeyChainLookup.java
rename to src/com/android/swe/browser/KeyChainLookup.java
diff --git a/src/com/android/browser/LogTag.java b/src/com/android/swe/browser/LogTag.java
similarity index 100%
rename from src/com/android/browser/LogTag.java
rename to src/com/android/swe/browser/LogTag.java
diff --git a/src/com/android/swe/browser/MemoryMonitor.java b/src/com/android/swe/browser/MemoryMonitor.java
new file mode 100644
index 0000000..c9be967
--- /dev/null
+++ b/src/com/android/swe/browser/MemoryMonitor.java
@@ -0,0 +1,133 @@
+/*
+    * Copyright (c) 2013, The Linux Foundation. All rights reserved.
+    *
+    * Redistribution and use in source and binary forms, with or without
+    * modification, are permitted provided that the following conditions are
+    * met:
+    * * Redistributions of source code must retain the above copyright
+    * notice, this list of conditions and the following disclaimer.
+    * * Redistributions in binary form must reproduce the above
+    * copyright notice, this list of conditions and the following
+    * disclaimer in the documentation and/or other materials provided
+    * with the distribution.
+    * * Neither the name of The Linux Foundation nor the names of its
+    * contributors may be used to endorse or promote products derived
+    * from this software without specific prior written permission.
+    *
+    * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+    * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+    * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+    * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+    * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+    * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+    * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+    * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+    * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+    * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+    * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+    *
+    */
+
+package com.android.swe.browser;
+
+import android.app.ActivityManager;
+import android.content.Context;
+import android.util.Log;
+import java.sql.Timestamp;
+
+public class MemoryMonitor {
+
+    //This number is used with device memory class to calculate max number
+    //of active tabs.
+    private static int sMaxActiveTabs = 0;
+    private static MemoryMonitor sMemoryMonitor;
+    private TabControl mTabControl;
+    private final static String LOGTAG = "MemoryMonitor";
+
+    // Should be called only once
+
+    public static MemoryMonitor getInstance(Context context,
+                                            Controller controller) {
+        if (sMemoryMonitor == null) {
+            sMemoryMonitor = new MemoryMonitor(context,controller);
+        }
+        return sMemoryMonitor;
+    }
+
+    MemoryMonitor(Context context,Controller controller) {
+        mTabControl = controller.getTabControl();
+        sMaxActiveTabs = getMaxActiveTabs(context);
+        Log.d(LOGTAG,"Max Active Tabs: "+ sMaxActiveTabs);
+    }
+
+    private int getActiveTabs() {
+        int numNativeActiveTab = 0;
+        int size = mTabControl.getTabCount();
+
+        for (int i = 0; i < size; i++) {
+           Tab tab =  mTabControl.getTab(i);
+           if (((Tab)tab).isNativeActive()){
+                numNativeActiveTab++;
+           }
+        }
+        return numNativeActiveTab;
+    }
+
+    /**
+      * if number of tabs whose native tab is active, is greater
+      * than MAX_ACTIVE_TABS destroy the nativetab of oldest used Tab
+      */
+
+    public void destroyLeastRecentlyActiveTab() {
+        int numActiveTabs = getActiveTabs();
+        int numActiveTabsToRelease = numActiveTabs - sMaxActiveTabs;
+
+        // The most common case will be that we need to delete one
+        // NativeTab to make room for a new one.  So, find the most-stale.
+        if (numActiveTabsToRelease == 1) {
+            Tab mostStaleTab = null;
+            for (Tab t : mTabControl.getTabs()) {
+                if (t.isNativeActive() && !(t.inForeground())) {
+                    if (mostStaleTab == null){
+                        mostStaleTab = t;
+                    }
+                    else {
+                        if (t.getTimestamp().compareTo(mostStaleTab.
+                            getTimestamp()) < 0) {
+                            mostStaleTab = t;
+                        }
+                    }
+                }
+            }
+            if (mostStaleTab != null) {
+                mostStaleTab.destroy();
+           }
+        } else if (numActiveTabsToRelease > 1) {
+            // Since there is more than 1 "extra" tab, just release all
+            // NativeTabs in the background. This would be true when
+            // tracking was turned on after multiple tabs already exists
+            for (Tab t : mTabControl.getTabs()) {
+                if (t.isNativeActive() && !(t.inForeground())) {
+                    t.destroy();
+                }
+            }
+        }
+    }
+
+    /**
+      * Returns the default max number of active tabs based on device's
+      * memory class.
+      */
+    static int getMaxActiveTabs(Context context) {
+        // We use device memory class to decide number of active tabs
+        // (minimum memory class is 16).
+        ActivityManager am =(ActivityManager)context.
+            getSystemService(Context.ACTIVITY_SERVICE);
+        if (am.getMemoryClass() < 33) {
+            return 1;   // only 1 Tab can be active at a time
+        }
+        else {
+            return 2;  // atleast 2 Tabs can be active at a time
+        }
+    }
+}
diff --git a/src/com/android/browser/MessagesReceiver.java b/src/com/android/swe/browser/MessagesReceiver.java
similarity index 100%
rename from src/com/android/browser/MessagesReceiver.java
rename to src/com/android/swe/browser/MessagesReceiver.java
diff --git a/src/com/android/browser/NavScreen.java b/src/com/android/swe/browser/NavScreen.java
similarity index 100%
rename from src/com/android/browser/NavScreen.java
rename to src/com/android/swe/browser/NavScreen.java
diff --git a/src/com/android/browser/NavTabScroller.java b/src/com/android/swe/browser/NavTabScroller.java
similarity index 100%
rename from src/com/android/browser/NavTabScroller.java
rename to src/com/android/swe/browser/NavTabScroller.java
diff --git a/src/com/android/browser/NavTabView.java b/src/com/android/swe/browser/NavTabView.java
similarity index 100%
rename from src/com/android/browser/NavTabView.java
rename to src/com/android/swe/browser/NavTabView.java
diff --git a/src/com/android/browser/NavigationBarBase.java b/src/com/android/swe/browser/NavigationBarBase.java
similarity index 100%
rename from src/com/android/browser/NavigationBarBase.java
rename to src/com/android/swe/browser/NavigationBarBase.java
diff --git a/src/com/android/browser/NavigationBarPhone.java b/src/com/android/swe/browser/NavigationBarPhone.java
similarity index 100%
rename from src/com/android/browser/NavigationBarPhone.java
rename to src/com/android/swe/browser/NavigationBarPhone.java
diff --git a/src/com/android/browser/NavigationBarTablet.java b/src/com/android/swe/browser/NavigationBarTablet.java
similarity index 100%
rename from src/com/android/browser/NavigationBarTablet.java
rename to src/com/android/swe/browser/NavigationBarTablet.java
diff --git a/src/com/android/browser/NetworkStateHandler.java b/src/com/android/swe/browser/NetworkStateHandler.java
similarity index 100%
rename from src/com/android/browser/NetworkStateHandler.java
rename to src/com/android/swe/browser/NetworkStateHandler.java
diff --git a/src/com/android/browser/NfcHandler.java b/src/com/android/swe/browser/NfcHandler.java
similarity index 100%
rename from src/com/android/browser/NfcHandler.java
rename to src/com/android/swe/browser/NfcHandler.java
diff --git a/src/com/android/browser/OpenDownloadReceiver.java b/src/com/android/swe/browser/OpenDownloadReceiver.java
similarity index 100%
rename from src/com/android/browser/OpenDownloadReceiver.java
rename to src/com/android/swe/browser/OpenDownloadReceiver.java
diff --git a/src/com/android/browser/OptionsMenuHandler.java b/src/com/android/swe/browser/OptionsMenuHandler.java
similarity index 100%
rename from src/com/android/browser/OptionsMenuHandler.java
rename to src/com/android/swe/browser/OptionsMenuHandler.java
diff --git a/src/com/android/browser/PageDialogsHandler.java b/src/com/android/swe/browser/PageDialogsHandler.java
similarity index 100%
rename from src/com/android/browser/PageDialogsHandler.java
rename to src/com/android/swe/browser/PageDialogsHandler.java
diff --git a/src/com/android/browser/PageProgressView.java b/src/com/android/swe/browser/PageProgressView.java
similarity index 100%
rename from src/com/android/browser/PageProgressView.java
rename to src/com/android/swe/browser/PageProgressView.java
diff --git a/src/com/android/browser/Performance.java b/src/com/android/swe/browser/Performance.java
similarity index 100%
rename from src/com/android/browser/Performance.java
rename to src/com/android/swe/browser/Performance.java
diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/swe/browser/PhoneUi.java
similarity index 100%
rename from src/com/android/browser/PhoneUi.java
rename to src/com/android/swe/browser/PhoneUi.java
diff --git a/src/com/android/browser/PieControl.java b/src/com/android/swe/browser/PieControl.java
similarity index 100%
rename from src/com/android/browser/PieControl.java
rename to src/com/android/swe/browser/PieControl.java
diff --git a/src/com/android/browser/PreferenceKeys.java b/src/com/android/swe/browser/PreferenceKeys.java
similarity index 100%
rename from src/com/android/browser/PreferenceKeys.java
rename to src/com/android/swe/browser/PreferenceKeys.java
diff --git a/src/com/android/browser/PreloadController.java b/src/com/android/swe/browser/PreloadController.java
similarity index 100%
rename from src/com/android/browser/PreloadController.java
rename to src/com/android/swe/browser/PreloadController.java
diff --git a/src/com/android/browser/PreloadRequestReceiver.java b/src/com/android/swe/browser/PreloadRequestReceiver.java
similarity index 100%
rename from src/com/android/browser/PreloadRequestReceiver.java
rename to src/com/android/swe/browser/PreloadRequestReceiver.java
diff --git a/src/com/android/browser/PreloadedTabControl.java b/src/com/android/swe/browser/PreloadedTabControl.java
similarity index 100%
rename from src/com/android/browser/PreloadedTabControl.java
rename to src/com/android/swe/browser/PreloadedTabControl.java
diff --git a/src/com/android/browser/Preloader.java b/src/com/android/swe/browser/Preloader.java
similarity index 100%
rename from src/com/android/browser/Preloader.java
rename to src/com/android/swe/browser/Preloader.java
diff --git a/src/com/android/browser/ShortcutActivity.java b/src/com/android/swe/browser/ShortcutActivity.java
similarity index 100%
rename from src/com/android/browser/ShortcutActivity.java
rename to src/com/android/swe/browser/ShortcutActivity.java
diff --git a/src/com/android/browser/SnapshotBar.java b/src/com/android/swe/browser/SnapshotBar.java
similarity index 100%
rename from src/com/android/browser/SnapshotBar.java
rename to src/com/android/swe/browser/SnapshotBar.java
diff --git a/src/com/android/browser/SnapshotTab.java b/src/com/android/swe/browser/SnapshotTab.java
similarity index 100%
rename from src/com/android/browser/SnapshotTab.java
rename to src/com/android/swe/browser/SnapshotTab.java
diff --git a/src/com/android/browser/SuggestionsAdapter.java b/src/com/android/swe/browser/SuggestionsAdapter.java
similarity index 100%
rename from src/com/android/browser/SuggestionsAdapter.java
rename to src/com/android/swe/browser/SuggestionsAdapter.java
diff --git a/src/com/android/browser/SystemAllowGeolocationOrigins.java b/src/com/android/swe/browser/SystemAllowGeolocationOrigins.java
similarity index 100%
rename from src/com/android/browser/SystemAllowGeolocationOrigins.java
rename to src/com/android/swe/browser/SystemAllowGeolocationOrigins.java
diff --git a/src/com/android/browser/Tab.java b/src/com/android/swe/browser/Tab.java
similarity index 100%
rename from src/com/android/browser/Tab.java
rename to src/com/android/swe/browser/Tab.java
diff --git a/src/com/android/browser/TabBar.java b/src/com/android/swe/browser/TabBar.java
similarity index 100%
rename from src/com/android/browser/TabBar.java
rename to src/com/android/swe/browser/TabBar.java
diff --git a/src/com/android/browser/TabControl.java b/src/com/android/swe/browser/TabControl.java
similarity index 100%
rename from src/com/android/browser/TabControl.java
rename to src/com/android/swe/browser/TabControl.java
diff --git a/src/com/android/browser/TabScrollView.java b/src/com/android/swe/browser/TabScrollView.java
similarity index 100%
rename from src/com/android/browser/TabScrollView.java
rename to src/com/android/swe/browser/TabScrollView.java
diff --git a/src/com/android/browser/TitleBar.java b/src/com/android/swe/browser/TitleBar.java
similarity index 100%
rename from src/com/android/browser/TitleBar.java
rename to src/com/android/swe/browser/TitleBar.java
diff --git a/src/com/android/browser/UI.java b/src/com/android/swe/browser/UI.java
similarity index 100%
rename from src/com/android/browser/UI.java
rename to src/com/android/swe/browser/UI.java
diff --git a/src/com/android/browser/UiController.java b/src/com/android/swe/browser/UiController.java
similarity index 100%
rename from src/com/android/browser/UiController.java
rename to src/com/android/swe/browser/UiController.java
diff --git a/src/com/android/browser/UploadHandler.java b/src/com/android/swe/browser/UploadHandler.java
similarity index 100%
rename from src/com/android/browser/UploadHandler.java
rename to src/com/android/swe/browser/UploadHandler.java
diff --git a/src/com/android/browser/UrlBarAutoShowManager.java b/src/com/android/swe/browser/UrlBarAutoShowManager.java
similarity index 100%
rename from src/com/android/browser/UrlBarAutoShowManager.java
rename to src/com/android/swe/browser/UrlBarAutoShowManager.java
diff --git a/src/com/android/browser/UrlHandler.java b/src/com/android/swe/browser/UrlHandler.java
similarity index 100%
rename from src/com/android/browser/UrlHandler.java
rename to src/com/android/swe/browser/UrlHandler.java
diff --git a/src/com/android/browser/UrlInputView.java b/src/com/android/swe/browser/UrlInputView.java
similarity index 100%
rename from src/com/android/browser/UrlInputView.java
rename to src/com/android/swe/browser/UrlInputView.java
diff --git a/src/com/android/browser/UrlSelectionActionMode.java b/src/com/android/swe/browser/UrlSelectionActionMode.java
similarity index 100%
rename from src/com/android/browser/UrlSelectionActionMode.java
rename to src/com/android/swe/browser/UrlSelectionActionMode.java
diff --git a/src/com/android/browser/UrlUtils.java b/src/com/android/swe/browser/UrlUtils.java
similarity index 100%
rename from src/com/android/browser/UrlUtils.java
rename to src/com/android/swe/browser/UrlUtils.java
diff --git a/src/com/android/browser/WallpaperHandler.java b/src/com/android/swe/browser/WallpaperHandler.java
similarity index 100%
rename from src/com/android/browser/WallpaperHandler.java
rename to src/com/android/swe/browser/WallpaperHandler.java
diff --git a/src/com/android/browser/WebStorageSizeManager.java b/src/com/android/swe/browser/WebStorageSizeManager.java
similarity index 100%
rename from src/com/android/browser/WebStorageSizeManager.java
rename to src/com/android/swe/browser/WebStorageSizeManager.java
diff --git a/src/com/android/browser/WebViewController.java b/src/com/android/swe/browser/WebViewController.java
similarity index 100%
rename from src/com/android/browser/WebViewController.java
rename to src/com/android/swe/browser/WebViewController.java
diff --git a/src/com/android/browser/WebViewFactory.java b/src/com/android/swe/browser/WebViewFactory.java
similarity index 100%
rename from src/com/android/browser/WebViewFactory.java
rename to src/com/android/swe/browser/WebViewFactory.java
diff --git a/src/com/android/browser/WebViewProperties.java b/src/com/android/swe/browser/WebViewProperties.java
similarity index 100%
rename from src/com/android/browser/WebViewProperties.java
rename to src/com/android/swe/browser/WebViewProperties.java
diff --git a/src/com/android/browser/WebViewTimersControl.java b/src/com/android/swe/browser/WebViewTimersControl.java
similarity index 100%
rename from src/com/android/browser/WebViewTimersControl.java
rename to src/com/android/swe/browser/WebViewTimersControl.java
diff --git a/src/com/android/browser/XLargeUi.java b/src/com/android/swe/browser/XLargeUi.java
similarity index 100%
rename from src/com/android/browser/XLargeUi.java
rename to src/com/android/swe/browser/XLargeUi.java
diff --git a/src/com/android/browser/addbookmark/FolderSpinner.java b/src/com/android/swe/browser/addbookmark/FolderSpinner.java
similarity index 100%
rename from src/com/android/browser/addbookmark/FolderSpinner.java
rename to src/com/android/swe/browser/addbookmark/FolderSpinner.java
diff --git a/src/com/android/browser/addbookmark/FolderSpinnerAdapter.java b/src/com/android/swe/browser/addbookmark/FolderSpinnerAdapter.java
similarity index 100%
rename from src/com/android/browser/addbookmark/FolderSpinnerAdapter.java
rename to src/com/android/swe/browser/addbookmark/FolderSpinnerAdapter.java
diff --git a/src/com/android/browser/homepages/HomeProvider.java b/src/com/android/swe/browser/homepages/HomeProvider.java
similarity index 100%
rename from src/com/android/browser/homepages/HomeProvider.java
rename to src/com/android/swe/browser/homepages/HomeProvider.java
diff --git a/src/com/android/browser/homepages/RequestHandler.java b/src/com/android/swe/browser/homepages/RequestHandler.java
similarity index 100%
rename from src/com/android/browser/homepages/RequestHandler.java
rename to src/com/android/swe/browser/homepages/RequestHandler.java
diff --git a/src/com/android/browser/homepages/Template.java b/src/com/android/swe/browser/homepages/Template.java
similarity index 100%
rename from src/com/android/browser/homepages/Template.java
rename to src/com/android/swe/browser/homepages/Template.java
diff --git a/src/com/android/browser/mynavigation/AddMyNavigationPage.java b/src/com/android/swe/browser/mynavigation/AddMyNavigationPage.java
similarity index 100%
rename from src/com/android/browser/mynavigation/AddMyNavigationPage.java
rename to src/com/android/swe/browser/mynavigation/AddMyNavigationPage.java
diff --git a/src/com/android/browser/mynavigation/MyNavigationRequestHandler.java b/src/com/android/swe/browser/mynavigation/MyNavigationRequestHandler.java
similarity index 100%
rename from src/com/android/browser/mynavigation/MyNavigationRequestHandler.java
rename to src/com/android/swe/browser/mynavigation/MyNavigationRequestHandler.java
diff --git a/src/com/android/browser/mynavigation/MyNavigationTemplate.java b/src/com/android/swe/browser/mynavigation/MyNavigationTemplate.java
similarity index 100%
rename from src/com/android/browser/mynavigation/MyNavigationTemplate.java
rename to src/com/android/swe/browser/mynavigation/MyNavigationTemplate.java
diff --git a/src/com/android/browser/mynavigation/MyNavigationUtil.java b/src/com/android/swe/browser/mynavigation/MyNavigationUtil.java
similarity index 100%
rename from src/com/android/browser/mynavigation/MyNavigationUtil.java
rename to src/com/android/swe/browser/mynavigation/MyNavigationUtil.java
diff --git a/src/com/android/swe/browser/platformsupport/BookmarkColumns.java b/src/com/android/swe/browser/platformsupport/BookmarkColumns.java
new file mode 100644
index 0000000..d63c81f
--- /dev/null
+++ b/src/com/android/swe/browser/platformsupport/BookmarkColumns.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2013 The Linux Foundation. All rights reserved.
+ * Not a contribution.
+ *
+ * Copyright (C) 2006 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.swe.browser.platformsupport;
+
+public class BookmarkColumns {
+    /**
+     * The URL of the bookmark or history item.
+     * <p>Type: TEXT (URL)</p>
+     */
+    public static final String URL = "url";
+
+    /**
+     * The number of time the item has been visited.
+     * <p>Type: NUMBER</p>
+     */
+    public static final String VISITS = "visits";
+
+    /**
+     * The date the item was last visited, in milliseconds since the epoch.
+     * <p>Type: NUMBER (date in milliseconds since January 1, 1970)</p>
+     */
+    public static final String DATE = "date";
+
+    /**
+     * Flag indicating that an item is a bookmark. A value of 1 indicates a bookmark, a value
+     * of 0 indicates a history item.
+     * <p>Type: INTEGER (boolean)</p>
+     */
+    public static final String BOOKMARK = "bookmark";
+
+    /**
+     * The user visible title of the bookmark or history item.
+     * <p>Type: TEXT</p>
+     */
+    public static final String TITLE = "title";
+
+    /**
+     * The date the item created, in milliseconds since the epoch.
+     * <p>Type: NUMBER (date in milliseconds since January 1, 1970)</p>
+     */
+    public static final String CREATED = "created";
+
+    /**
+     * The favicon of the bookmark. Must decode via {@link BitmapFactory#decodeByteArray}.
+     * <p>Type: BLOB (image)</p>
+     */
+    public static final String FAVICON = "favicon";
+
+    /**
+     * @hide
+     */
+    public static final String THUMBNAIL = "thumbnail";
+
+    /**
+     * @hide
+     */
+    public static final String TOUCH_ICON = "touch_icon";
+
+    /**
+     * @hide
+     */
+    public static final String USER_ENTERED = "user_entered";
+}
diff --git a/src/com/android/swe/browser/platformsupport/BrowserContract.java b/src/com/android/swe/browser/platformsupport/BrowserContract.java
new file mode 100644
index 0000000..29d1f87
--- /dev/null
+++ b/src/com/android/swe/browser/platformsupport/BrowserContract.java
@@ -0,0 +1,744 @@
+/*
+ * Copyright (c) 2013 The Linux Foundation. All rights reserved.
+ * Not a contribution.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License
+ */
+
+package com.android.swe.browser.platformsupport;
+
+import android.accounts.Account;
+import android.content.ContentProviderClient;
+import android.content.ContentProviderOperation;
+import android.content.ContentResolver;
+import android.content.ContentUris;
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.graphics.BitmapFactory;
+import android.net.Uri;
+import android.os.RemoteException;
+import android.util.Pair;
+import android.provider.SyncStateContract;
+/**
+ * <p>
+ * The contract between the browser provider and applications. Contains the definition
+ * for the supported URIS and columns.
+ * </p>
+ * <h3>Overview</h3>
+ * <p>
+ * BrowserContract defines an database of browser-related information which are bookmarks,
+ * history, images and the mapping between the image and URL.
+ * </p>
+ * @hide
+ */
+public class BrowserContract {
+    /** The authority for the browser provider */
+    public static final String AUTHORITY = "com.android.swe.browser";
+
+    /** A content:// style uri to the authority for the browser provider */
+    public static final Uri AUTHORITY_URI = Uri.parse("content://" + AUTHORITY);
+
+    /**
+     * An optional insert, update or delete URI parameter that allows the caller
+     * to specify that it is a sync adapter. The default value is false. If true
+     * the dirty flag is not automatically set and the "syncToNetwork" parameter
+     * is set to false when calling
+     * {@link ContentResolver#notifyChange(android.net.Uri, android.database.ContentObserver, boolean)}.
+     * @hide
+     */
+    public static final String CALLER_IS_SYNCADAPTER = "caller_is_syncadapter";
+
+    /**
+     * A parameter for use when querying any table that allows specifying a limit on the number
+     * of rows returned.
+     * @hide
+     */
+    public static final String PARAM_LIMIT = "limit";
+
+    /**
+     * Generic columns for use by sync adapters. The specific functions of
+     * these columns are private to the sync adapter. Other clients of the API
+     * should not attempt to either read or write these columns.
+     *
+     * @hide
+     */
+    interface BaseSyncColumns {
+        /** Generic column for use by sync adapters. */
+        public static final String SYNC1 = "sync1";
+        /** Generic column for use by sync adapters. */
+        public static final String SYNC2 = "sync2";
+        /** Generic column for use by sync adapters. */
+        public static final String SYNC3 = "sync3";
+        /** Generic column for use by sync adapters. */
+        public static final String SYNC4 = "sync4";
+        /** Generic column for use by sync adapters. */
+        public static final String SYNC5 = "sync5";
+    }
+
+    /**
+     * Convenience definitions for use in implementing chrome bookmarks sync in the Bookmarks table.
+     * @hide
+     */
+    public static final class ChromeSyncColumns {
+        private ChromeSyncColumns() {}
+
+        /** The server unique ID for an item */
+        public static final String SERVER_UNIQUE = BaseSyncColumns.SYNC3;
+
+        public static final String FOLDER_NAME_ROOT = "google_chrome";
+        public static final String FOLDER_NAME_BOOKMARKS = "google_chrome_bookmarks";
+        public static final String FOLDER_NAME_BOOKMARKS_BAR = "bookmark_bar";
+        public static final String FOLDER_NAME_OTHER_BOOKMARKS = "other_bookmarks";
+
+        /** The client unique ID for an item */
+        public static final String CLIENT_UNIQUE = BaseSyncColumns.SYNC4;
+    }
+
+    /**
+     * Columns that appear when each row of a table belongs to a specific
+     * account, including sync information that an account may need.
+     * @hide
+     */
+    interface SyncColumns extends BaseSyncColumns {
+        /**
+         * The name of the account instance to which this row belongs, which when paired with
+         * {@link #ACCOUNT_TYPE} identifies a specific account.
+         * <P>Type: TEXT</P>
+         */
+        public static final String ACCOUNT_NAME = "account_name";
+
+        /**
+         * The type of account to which this row belongs, which when paired with
+         * {@link #ACCOUNT_NAME} identifies a specific account.
+         * <P>Type: TEXT</P>
+         */
+        public static final String ACCOUNT_TYPE = "account_type";
+
+        /**
+         * String that uniquely identifies this row to its source account.
+         * <P>Type: TEXT</P>
+         */
+        public static final String SOURCE_ID = "sourceid";
+
+        /**
+         * Version number that is updated whenever this row or its related data
+         * changes.
+         * <P>Type: INTEGER</P>
+         */
+        public static final String VERSION = "version";
+
+        /**
+         * Flag indicating that {@link #VERSION} has changed, and this row needs
+         * to be synchronized by its owning account.
+         * <P>Type: INTEGER (boolean)</P>
+         */
+        public static final String DIRTY = "dirty";
+
+        /**
+         * The time that this row was last modified by a client (msecs since the epoch).
+         * <P>Type: INTEGER</P>
+         */
+        public static final String DATE_MODIFIED = "modified";
+    }
+
+    interface CommonColumns {
+        /**
+         * The unique ID for a row.
+         * <P>Type: INTEGER (long)</P>
+         */
+        public static final String _ID = "_id";
+
+        /**
+         * This column is valid when the row is a URL. The history table's URL
+         * can not be updated.
+         * <P>Type: TEXT (URL)</P>
+         */
+        public static final String URL = "url";
+
+        /**
+         * The user visible title.
+         * <P>Type: TEXT</P>
+         */
+        public static final String TITLE = "title";
+
+        /**
+         * The time that this row was created on its originating client (msecs
+         * since the epoch).
+         * <P>Type: INTEGER</P>
+         * @hide
+         */
+        public static final String DATE_CREATED = "created";
+    }
+
+    /**
+     * @hide
+     */
+    interface ImageColumns {
+        /**
+         * The favicon of the bookmark, may be NULL.
+         * Must decode via {@link BitmapFactory#decodeByteArray}.
+         * <p>Type: BLOB (image)</p>
+         */
+        public static final String FAVICON = "favicon";
+
+        /**
+         * A thumbnail of the page,may be NULL.
+         * Must decode via {@link BitmapFactory#decodeByteArray}.
+         * <p>Type: BLOB (image)</p>
+         */
+        public static final String THUMBNAIL = "thumbnail";
+
+        /**
+         * The touch icon for the web page, may be NULL.
+         * Must decode via {@link BitmapFactory#decodeByteArray}.
+         * <p>Type: BLOB (image)</p>
+         */
+        public static final String TOUCH_ICON = "touch_icon";
+    }
+
+    interface HistoryColumns {
+        /**
+         * The date the item was last visited, in milliseconds since the epoch.
+         * <p>Type: INTEGER (date in milliseconds since January 1, 1970)</p>
+         */
+        public static final String DATE_LAST_VISITED = "date";
+
+        /**
+         * The number of times the item has been visited.
+         * <p>Type: INTEGER</p>
+         */
+        public static final String VISITS = "visits";
+
+        /**
+         * @hide
+         */
+        public static final String USER_ENTERED = "user_entered";
+    }
+
+    interface ImageMappingColumns {
+        /**
+         * The ID of the image in Images. One image can map onto the multiple URLs.
+         * <P>Type: INTEGER (long)</P>
+         */
+        public static final String IMAGE_ID = "image_id";
+
+        /**
+         * The URL. The URL can map onto the different type of images.
+         * <P>Type: TEXT (URL)</P>
+         */
+        public static final String URL = "url";
+    }
+
+    /**
+     * The bookmarks table, which holds the user's browser bookmarks.
+     */
+    public static final class Bookmarks implements CommonColumns, ImageColumns, SyncColumns {
+        /**
+         * This utility class cannot be instantiated.
+         */
+        private Bookmarks() {}
+
+        /**
+         * The content:// style URI for this table
+         */
+        public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "bookmarks");
+
+        /**
+         * Used in {@link Bookmarks#TYPE} column and indicats the row is a bookmark.
+         */
+        public static final int BOOKMARK_TYPE_BOOKMARK = 1;
+
+        /**
+         * Used in {@link Bookmarks#TYPE} column and indicats the row is a folder.
+         */
+        public static final int BOOKMARK_TYPE_FOLDER = 2;
+
+        /**
+         * Used in {@link Bookmarks#TYPE} column and indicats the row is the bookmark bar folder.
+         */
+        public static final int BOOKMARK_TYPE_BOOKMARK_BAR_FOLDER = 3;
+
+        /**
+         * Used in {@link Bookmarks#TYPE} column and indicats the row is other folder and
+         */
+        public static final int BOOKMARK_TYPE_OTHER_FOLDER = 4;
+
+        /**
+         * Used in {@link Bookmarks#TYPE} column and indicats the row is other folder, .
+         */
+        public static final int BOOKMARK_TYPE_MOBILE_FOLDER = 5;
+
+        /**
+         * The type of the item.
+         * <P>Type: INTEGER</P>
+         * <p>Allowed values are:</p>
+         * <p>
+         * <ul>
+         * <li>{@link #BOOKMARK_TYPE_BOOKMARK}</li>
+         * <li>{@link #BOOKMARK_TYPE_FOLDER}</li>
+         * <li>{@link #BOOKMARK_TYPE_BOOKMARK_BAR_FOLDER}</li>
+         * <li>{@link #BOOKMARK_TYPE_OTHER_FOLDER}</li>
+         * <li>{@link #BOOKMARK_TYPE_MOBILE_FOLDER}</li>
+         * </ul>
+         * </p>
+         * <p> The TYPE_BOOKMARK_BAR_FOLDER, TYPE_OTHER_FOLDER and TYPE_MOBILE_FOLDER
+         * can not be updated or deleted.</p>
+         */
+        public static final String TYPE = "type";
+
+        /**
+         * The content:// style URI for the default folder
+         * @hide
+         */
+        public static final Uri CONTENT_URI_DEFAULT_FOLDER =
+                Uri.withAppendedPath(CONTENT_URI, "folder");
+
+        /**
+         * Query parameter used to specify an account name
+         * @hide
+         */
+        public static final String PARAM_ACCOUNT_NAME = "acct_name";
+
+        /**
+         * Query parameter used to specify an account type
+         * @hide
+         */
+        public static final String PARAM_ACCOUNT_TYPE = "acct_type";
+
+        /**
+         * Builds a URI that points to a specific folder.
+         * @param folderId the ID of the folder to point to
+         * @hide
+         */
+        public static final Uri buildFolderUri(long folderId) {
+            return ContentUris.withAppendedId(CONTENT_URI_DEFAULT_FOLDER, folderId);
+        }
+
+        /**
+         * The MIME type of {@link #CONTENT_URI} providing a directory of bookmarks.
+         */
+        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/bookmark";
+
+        /**
+         * The MIME type of a {@link #CONTENT_URI} of a single bookmark.
+         */
+        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/bookmark";
+
+        /**
+         * Query parameter to use if you want to see deleted bookmarks that are still
+         * around on the device and haven't been synced yet.
+         * @see #IS_DELETED
+         * @hide
+         */
+        public static final String QUERY_PARAMETER_SHOW_DELETED = "show_deleted";
+
+        /**
+         * Flag indicating if an item is a folder or bookmark. Non-zero values indicate
+         * a folder and zero indicates a bookmark.
+         * <P>Type: INTEGER (boolean)</P>
+         * @hide
+         */
+        public static final String IS_FOLDER = "folder";
+
+        /**
+         * The ID of the parent folder. ID 0 is the root folder.
+         * <P>Type: INTEGER (reference to item in the same table)</P>
+         */
+        public static final String PARENT = "parent";
+
+        /**
+         * The source ID for an item's parent. Read-only.
+         * @see #PARENT
+         * @hide
+         */
+        public static final String PARENT_SOURCE_ID = "parent_source";
+
+        /**
+         * The position of the bookmark in relation to it's siblings that share the same
+         * {@link #PARENT}. May be negative.
+         * <P>Type: INTEGER</P>
+         * @hide
+         */
+        public static final String POSITION = "position";
+
+        /**
+         * The item that the bookmark should be inserted after.
+         * May be negative.
+         * <P>Type: INTEGER</P>
+         * @hide
+         */
+        public static final String INSERT_AFTER = "insert_after";
+
+        /**
+         * The source ID for the item that the bookmark should be inserted after. Read-only.
+         * May be negative.
+         * <P>Type: INTEGER</P>
+         * @see #INSERT_AFTER
+         * @hide
+         */
+        public static final String INSERT_AFTER_SOURCE_ID = "insert_after_source";
+
+        /**
+         * A flag to indicate if an item has been deleted. Queries will not return deleted
+         * entries unless you add the {@link #QUERY_PARAMETER_SHOW_DELETED} query paramter
+         * to the URI when performing your query.
+         * <p>Type: INTEGER (non-zero if the item has been deleted, zero if it hasn't)
+         * @see #QUERY_PARAMETER_SHOW_DELETED
+         * @hide
+         */
+        public static final String IS_DELETED = "deleted";
+    }
+
+    /**
+     * Read-only table that lists all the accounts that are used to provide bookmarks.
+     * @hide
+     */
+    public static final class Accounts {
+        /**
+         * Directory under {@link Bookmarks#CONTENT_URI}
+         */
+        public static final Uri CONTENT_URI =
+                AUTHORITY_URI.buildUpon().appendPath("accounts").build();
+
+        /**
+         * The name of the account instance to which this row belongs, which when paired with
+         * {@link #ACCOUNT_TYPE} identifies a specific account.
+         * <P>Type: TEXT</P>
+         */
+        public static final String ACCOUNT_NAME = "account_name";
+
+        /**
+         * The type of account to which this row belongs, which when paired with
+         * {@link #ACCOUNT_NAME} identifies a specific account.
+         * <P>Type: TEXT</P>
+         */
+        public static final String ACCOUNT_TYPE = "account_type";
+
+        /**
+         * The ID of the account's root folder. This will be the ID of the folder
+         * returned when querying {@link Bookmarks#CONTENT_URI_DEFAULT_FOLDER}.
+         * <P>Type: INTEGER</P>
+         */
+        public static final String ROOT_ID = "root_id";
+    }
+
+    /**
+     * The history table, which holds the browsing history.
+     */
+    public static final class History implements CommonColumns, HistoryColumns, ImageColumns {
+        /**
+         * This utility class cannot be instantiated.
+         */
+        private History() {}
+
+        /**
+         * The content:// style URI for this table
+         */
+        public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "history");
+
+        /**
+         * The MIME type of {@link #CONTENT_URI} providing a directory of browser history items.
+         */
+        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/browser-history";
+
+        /**
+         * The MIME type of a {@link #CONTENT_URI} of a single browser history item.
+         */
+        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/browser-history";
+    }
+
+    /**
+     * The search history table.
+     * @hide
+     */
+    public static final class Searches {
+        private Searches() {}
+
+        /**
+         * The content:// style URI for this table
+         */
+        public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "searches");
+
+        /**
+         * The MIME type of {@link #CONTENT_URI} providing a directory of browser search items.
+         */
+        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/searches";
+
+        /**
+         * The MIME type of a {@link #CONTENT_URI} of a single browser search item.
+         */
+        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/searches";
+
+        /**
+         * The unique ID for a row.
+         * <P>Type: INTEGER (long)</P>
+         */
+        public static final String _ID = "_id";
+
+        /**
+         * The user entered search term.
+         */
+        public static final String SEARCH = "search";
+
+        /**
+         * The date the search was performed, in milliseconds since the epoch.
+         * <p>Type: NUMBER (date in milliseconds since January 1, 1970)</p>
+         */
+        public static final String DATE = "date";
+    }
+
+    /**
+     * A table provided for sync adapters to use for storing private sync state data.
+     *
+     * @see SyncStateContract
+     * @hide
+     */
+    public static final class SyncState implements SyncStateContract.Columns {
+        /**
+         * This utility class cannot be instantiated
+         */
+        private SyncState() {}
+
+        public static final String CONTENT_DIRECTORY =
+                SyncStateContract.Constants.CONTENT_DIRECTORY;
+
+        /**
+         * The content:// style URI for this table
+         */
+        public static final Uri CONTENT_URI =
+                Uri.withAppendedPath(AUTHORITY_URI, CONTENT_DIRECTORY);
+
+        /**
+         * @see android.provider.SyncStateContract.Helpers#get
+         */
+        public static byte[] get(ContentProviderClient provider, Account account)
+                throws RemoteException {
+            return SyncStateContract.Helpers.get(provider, CONTENT_URI, account);
+        }
+
+        /**
+         * @see android.provider.SyncStateContract.Helpers#get
+         */
+        public static Pair<Uri, byte[]> getWithUri(ContentProviderClient provider, Account account)
+                throws RemoteException {
+            return SyncStateContract.Helpers.getWithUri(provider, CONTENT_URI, account);
+        }
+
+        /**
+         * @see android.provider.SyncStateContract.Helpers#set
+         */
+        public static void set(ContentProviderClient provider, Account account, byte[] data)
+                throws RemoteException {
+            SyncStateContract.Helpers.set(provider, CONTENT_URI, account, data);
+        }
+
+        /**
+         * @see android.provider.SyncStateContract.Helpers#newSetOperation
+         */
+        public static ContentProviderOperation newSetOperation(Account account, byte[] data) {
+            return SyncStateContract.Helpers.newSetOperation(CONTENT_URI, account, data);
+        }
+    }
+
+    /**
+     * <p>
+     * Stores images for URLs.
+     * </p>
+     * <p>
+     * The rows in this table can not be updated since there might have multiple URLs mapping onto
+     * the same image. If you want to update a URL's image, you need to add the new image in this
+     * table, then update the mapping onto the added image.
+     * </p>
+     * <p>
+     * Every image should be at least associated with one URL, otherwise it will be removed after a
+     * while.
+     * </p>
+     */
+    public static final class Images implements ImageColumns {
+        /**
+         * This utility class cannot be instantiated
+         */
+        private Images() {}
+
+        /**
+         * The content:// style URI for this table
+         */
+        public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "images");
+
+        /**
+         * The MIME type of {@link #CONTENT_URI} providing a directory of images.
+         */
+        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/images";
+
+        /**
+         * The MIME type of a {@link #CONTENT_URI} of a single image.
+         */
+        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/images";
+
+        /**
+         * Used in {@link Images#TYPE} column and indicats the row is a favicon.
+         */
+        public static final int IMAGE_TYPE_FAVICON = 1;
+
+        /**
+         * Used in {@link Images#TYPE} column and indicats the row is a precomposed touch icon.
+         */
+        public static final int IMAGE_TYPE_PRECOMPOSED_TOUCH_ICON = 2;
+
+        /**
+         * Used in {@link Images#TYPE} column and indicats the row is a touch icon.
+         */
+        public static final int IMAGE_TYPE_TOUCH_ICON = 4;
+
+        /**
+         * The type of item in the table.
+         * <P>Type: INTEGER</P>
+         * <p>Allowed values are:</p>
+         * <p>
+         * <ul>
+         * <li>{@link #IMAGE_TYPE_FAVICON}</li>
+         * <li>{@link #IMAGE_TYPE_PRECOMPOSED_TOUCH_ICON}</li>
+         * <li>{@link #IMAGE_TYPE_TOUCH_ICON}</li>
+         * </ul>
+         * </p>
+         */
+        public static final String TYPE = "type";
+
+        /**
+         * The image data.
+         * <p>Type: BLOB (image)</p>
+         */
+        public static final String DATA = "data";
+
+        /**
+         * The URL the images came from.
+         * <P>Type: TEXT (URL)</P>
+         * @hide
+         */
+        public static final String URL = "url_key";
+    }
+
+    /**
+     * <p>
+     * A table that stores the mappings between the image and the URL.
+     * </p>
+     * <p>
+     * Deleting or Updating a mapping might also deletes the mapped image if there is no other URL
+     * maps onto it.
+     * </p>
+     */
+    public static final class ImageMappings implements ImageMappingColumns {
+        /**
+         * This utility class cannot be instantiated
+         */
+        private ImageMappings() {}
+
+        /**
+         * The content:// style URI for this table
+         */
+        public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "image_mappings");
+
+        /**
+         * The MIME type of {@link #CONTENT_URI} providing a directory of image mappings.
+         */
+        public static final String CONTENT_TYPE = "vnd.android.cursor.dir/image_mappings";
+
+        /**
+         * The MIME type of a {@link #CONTENT_URI} of a single image mapping.
+         */
+        public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/image_mappings";
+    }
+
+    /**
+     * A combined view of bookmarks and history. All bookmarks in all folders are included and
+     * no folders are included.
+     * @hide
+     */
+    public static final class Combined implements CommonColumns, HistoryColumns, ImageColumns {
+        /**
+         * This utility class cannot be instantiated
+         */
+        private Combined() {}
+
+        /**
+         * The content:// style URI for this table
+         */
+        public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "combined");
+
+        /**
+         * Flag indicating that an item is a bookmark. A value of 1 indicates a bookmark, a value
+         * of 0 indicates a history item.
+         * <p>Type: INTEGER (boolean)</p>
+         */
+        public static final String IS_BOOKMARK = "bookmark";
+    }
+
+    /**
+     * A table that stores settings specific to the browser. Only support query and insert.
+     * @hide
+     */
+    public static final class Settings {
+        /**
+         * This utility class cannot be instantiated
+         */
+        private Settings() {}
+
+        /**
+         * The content:// style URI for this table
+         */
+        public static final Uri CONTENT_URI = Uri.withAppendedPath(AUTHORITY_URI, "settings");
+
+        /**
+         * Key for a setting value.
+         */
+        public static final String KEY = "key";
+
+        /**
+         * Value for a setting.
+         */
+        public static final String VALUE = "value";
+
+        /**
+         * If set to non-0 the user has opted into bookmark sync.
+         */
+        public static final String KEY_SYNC_ENABLED = "sync_enabled";
+
+        /**
+         * Returns true if bookmark sync is enabled
+         */
+        static public boolean isSyncEnabled(Context context) {
+            Cursor cursor = null;
+            try {
+                cursor = context.getContentResolver().query(CONTENT_URI, new String[] { VALUE },
+                        KEY + "=?", new String[] { KEY_SYNC_ENABLED }, null);
+                if (cursor == null || !cursor.moveToFirst()) {
+                    return false;
+                }
+                return cursor.getInt(0) != 0;
+            } finally {
+                if (cursor != null) cursor.close();
+            }
+        }
+
+        /**
+         * Sets the bookmark sync enabled setting.
+         */
+        static public void setSyncEnabled(Context context, boolean enabled) {
+            ContentValues values = new ContentValues();
+            values.put(KEY, KEY_SYNC_ENABLED);
+            values.put(VALUE, enabled ? 1 : 0);
+            context.getContentResolver().insert(CONTENT_URI, values);
+        }
+    }
+}
diff --git a/src/com/android/swe/browser/platformsupport/Process.java b/src/com/android/swe/browser/platformsupport/Process.java
new file mode 100644
index 0000000..e33fd3c
--- /dev/null
+++ b/src/com/android/swe/browser/platformsupport/Process.java
@@ -0,0 +1,48 @@
+/*
+ *  Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are
+ *  met:
+ *      * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ *       copyright notice, this list of conditions and the following
+ *       disclaimer in the documentation and/or other materials provided
+ *       with the distribution.
+ *     * Neither the name of The Linux Foundation nor the names of its
+ *       contributors may be used to endorse or promote products derived
+ *       from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ *  ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ *  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ *  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ *  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ *  OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ *  IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+package com.android.swe.browser.platformsupport;
+
+public class Process {
+
+    public static final int PROC_SPACE_TERM = (int)' ';
+    public static final int PROC_COMBINE = 0x100;
+    public static final int PROC_OUT_LONG = 0x2000;
+
+
+    public static long getElapsedCpuTime() {
+        return 0;
+    }
+
+    public static boolean readProcFile(String s, int[] systemCpuFormat, Object o, long[]
+                                       sysCpu, Object o1) {
+        return false;
+    }
+}
diff --git a/src/com/android/swe/browser/platformsupport/SeekBarPreference.java b/src/com/android/swe/browser/platformsupport/SeekBarPreference.java
new file mode 100644
index 0000000..9801c0a
--- /dev/null
+++ b/src/com/android/swe/browser/platformsupport/SeekBarPreference.java
@@ -0,0 +1,238 @@
+package com.android.swe.browser.platformsupport;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.os.Parcel;
+import android.os.Parcelable;
+import android.preference.Preference;
+import android.util.AttributeSet;
+import android.view.KeyEvent;
+import android.view.View;
+import android.widget.SeekBar;
+import android.widget.SeekBar.OnSeekBarChangeListener;
+
+public class SeekBarPreference extends Preference
+        implements OnSeekBarChangeListener {
+
+    private int mProgress;
+    private int mMax;
+    private boolean mTrackingTouch;
+
+    public SeekBarPreference(
+            Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+
+        int[] attrs2 = new int[] { android.R.attr.indeterminateDrawable /* index 0 */};
+        TypedArray a = context.obtainStyledAttributes(android.R.style.Widget_ProgressBar, attrs2);
+        setMax(100);
+        a.recycle();
+        setLayoutResource(com.android.swe.browser.R.layout.preference_widget_seekbar);
+        /*SWE_TODO: Fix w Reflection
+          TypedArray a = context.obtainStyledAttributes(attrs,
+                com.android.internal.R.styleable.ProgressBar, defStyle, 0);
+        setMax(a.getInt(com.android.internal.R.styleable.ProgressBar_max, mMax));
+        a.recycle();
+       setLayoutResource(com.android.internal.R.layout.preference_widget_seekbar);
+       */
+    }
+
+    public SeekBarPreference(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public SeekBarPreference(Context context) {
+        this(context, null);
+    }
+
+    @Override
+    protected void onBindView(View view) {
+        super.onBindView(view);
+        SeekBar seekBar = (SeekBar) view.findViewById(
+                          com.android.swe.browser.R.id.seekbar2);
+        seekBar.setOnSeekBarChangeListener(this);
+        seekBar.setMax(mMax);
+        seekBar.setProgress(mProgress);
+        seekBar.setEnabled(isEnabled());
+     }
+
+    @Override
+    public CharSequence getSummary() {
+        return null;
+    }
+
+    @Override
+    protected void onSetInitialValue(boolean restoreValue, Object defaultValue) {
+        setProgress(restoreValue ? getPersistedInt(mProgress)
+                : (Integer) defaultValue);
+    }
+
+    @Override
+    protected Object onGetDefaultValue(TypedArray a, int index) {
+        return a.getInt(index, 0);
+    }
+
+    //@Override
+    //TODO : Verify the interface and Uncommend the override
+    public boolean onKey(View v, int keyCode, KeyEvent event) {
+        if (event.getAction() != KeyEvent.ACTION_UP) {
+            if (keyCode == KeyEvent.KEYCODE_PLUS
+                    || keyCode == KeyEvent.KEYCODE_EQUALS) {
+                setProgress(getProgress() + 1);
+                return true;
+            }
+            if (keyCode == KeyEvent.KEYCODE_MINUS) {
+                setProgress(getProgress() - 1);
+                return true;
+            }
+        }
+        return false;
+    }
+
+   public void setMax(int max) {
+        if (max != mMax) {
+            mMax = max;
+            notifyChanged();
+        }
+    }
+
+    public void setProgress(int progress) {
+        setProgress(progress, true);
+    }
+
+    private void setProgress(int progress, boolean notifyChanged) {
+        if (progress > mMax) {
+            progress = mMax;
+        }
+        if (progress < 0) {
+            progress = 0;
+        }
+        if (progress != mProgress) {
+            mProgress = progress;
+            persistInt(progress);
+            if (notifyChanged) {
+                notifyChanged();
+            }
+        }
+    }
+
+    public int getProgress() {
+        return mProgress;
+    }
+
+    /**
+     * Persist the seekBar's progress value if callChangeListener
+     * returns true, otherwise set the seekBar's progress to the stored value
+     */
+    void syncProgress(SeekBar seekBar) {
+        int progress = seekBar.getProgress();
+        if (progress != mProgress) {
+            if (callChangeListener(progress)) {
+                setProgress(progress, false);
+            } else {
+                seekBar.setProgress(mProgress);
+            }
+        }
+    }
+
+    @Override
+    public void onProgressChanged(
+            SeekBar seekBar, int progress, boolean fromUser) {
+        if (fromUser && !mTrackingTouch) {
+            syncProgress(seekBar);
+        }
+    }
+
+    @Override
+    public void onStartTrackingTouch(SeekBar seekBar) {
+        mTrackingTouch = true;
+    }
+
+    @Override
+    public void onStopTrackingTouch(SeekBar seekBar) {
+        mTrackingTouch = false;
+        if (seekBar.getProgress() != mProgress) {
+            syncProgress(seekBar);
+        }
+    }
+
+    @Override
+    protected Parcelable onSaveInstanceState() {
+        /*
+         * Suppose a client uses this preference type without persisting. We
+         * must save the instance state so it is able to, for example, survive
+         * orientation changes.
+         */
+
+        final Parcelable superState = super.onSaveInstanceState();
+        if (isPersistent()) {
+            // No need to save instance state since it's persistent
+            return superState;
+        }
+
+        // Save the instance state
+        final SavedState myState = new SavedState(superState);
+        myState.progress = mProgress;
+        myState.max = mMax;
+        return myState;
+    }
+
+    @Override
+    protected void onRestoreInstanceState(Parcelable state) {
+        if (!state.getClass().equals(SavedState.class)) {
+            // Didn't save state for us in onSaveInstanceState
+            super.onRestoreInstanceState(state);
+            return;
+        }
+
+        // Restore the instance state
+        SavedState myState = (SavedState) state;
+        super.onRestoreInstanceState(myState.getSuperState());
+        mProgress = myState.progress;
+        mMax = myState.max;
+        notifyChanged();
+    }
+
+    /**
+     * SavedState, a subclass of {@link BaseSavedState}, will store the state
+    * of MyPreference, a subclass of Preference.
+     * <p>
+     * It is important to always call through to super methods.
+     */
+    private static class SavedState extends BaseSavedState {
+        int progress;
+        int max;
+
+        public SavedState(Parcel source) {
+            super(source);
+
+            // Restore the click counter
+            progress = source.readInt();
+            max = source.readInt();
+        }
+
+        @Override
+        public void writeToParcel(Parcel dest, int flags) {
+            super.writeToParcel(dest, flags);
+
+            // Save the click counter
+            dest.writeInt(progress);
+            dest.writeInt(max);
+        }
+
+        public SavedState(Parcelable superState) {
+            super(superState);
+        }
+
+        @SuppressWarnings("unused")
+        public static final Parcelable.Creator<SavedState> CREATOR =
+                new Parcelable.Creator<SavedState>() {
+            public SavedState createFromParcel(Parcel in) {
+                return new SavedState(in);
+            }
+
+            public SavedState[] newArray(int size) {
+                return new SavedState[size];
+            }
+        };
+    }
+}
diff --git a/src/com/android/swe/browser/platformsupport/SyncStateContentProviderHelper.java b/src/com/android/swe/browser/platformsupport/SyncStateContentProviderHelper.java
new file mode 100644
index 0000000..4fd4e1a
--- /dev/null
+++ b/src/com/android/swe/browser/platformsupport/SyncStateContentProviderHelper.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright (c) 2013 The Linux Foundation. All rights reserved.
+ * Not a contribution.
+ *
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.swe.browser.platformsupport;
+
+import android.accounts.Account;
+import android.content.ContentValues;
+import android.database.Cursor;
+import android.database.DatabaseUtils;
+import android.database.sqlite.SQLiteDatabase;
+import android.provider.SyncStateContract;
+
+/**
+ * Extends the schema of a ContentProvider to include the _sync_state table
+ * and implements query/insert/update/delete to access that table using the
+ * authority "syncstate". This can be used to store the sync state for a
+ * set of accounts.
+ */
+public class SyncStateContentProviderHelper {
+    private static final String SELECT_BY_ACCOUNT =
+            SyncStateContract.Columns.ACCOUNT_NAME + "=? AND "
+                    + SyncStateContract.Columns.ACCOUNT_TYPE + "=?";
+
+    private static final String SYNC_STATE_TABLE = "_sync_state";
+    private static final String SYNC_STATE_META_TABLE = "_sync_state_metadata";
+    private static final String SYNC_STATE_META_VERSION_COLUMN = "version";
+
+    private static long DB_VERSION = 1;
+
+    private static final String[] ACCOUNT_PROJECTION =
+            new String[]{SyncStateContract.Columns.ACCOUNT_NAME,
+                    SyncStateContract.Columns.ACCOUNT_TYPE};
+
+    public static final String PATH = "syncstate";
+
+    private static final String QUERY_COUNT_SYNC_STATE_ROWS =
+            "SELECT count(*)"
+                    + " FROM " + SYNC_STATE_TABLE
+                    + " WHERE " + SyncStateContract.Columns._ID + "=?";
+
+    public void createDatabase(SQLiteDatabase db) {
+        db.execSQL("DROP TABLE IF EXISTS " + SYNC_STATE_TABLE);
+        db.execSQL("CREATE TABLE " + SYNC_STATE_TABLE + " ("
+                + SyncStateContract.Columns._ID + " INTEGER PRIMARY KEY,"
+                + SyncStateContract.Columns.ACCOUNT_NAME + " TEXT NOT NULL,"
+                + SyncStateContract.Columns.ACCOUNT_TYPE + " TEXT NOT NULL,"
+                + SyncStateContract.Columns.DATA + " TEXT,"
+                + "UNIQUE(" + SyncStateContract.Columns.ACCOUNT_NAME + ", "
+                + SyncStateContract.Columns.ACCOUNT_TYPE + "));");
+
+        db.execSQL("DROP TABLE IF EXISTS " + SYNC_STATE_META_TABLE);
+        db.execSQL("CREATE TABLE " + SYNC_STATE_META_TABLE + " ("
+                + SYNC_STATE_META_VERSION_COLUMN + " INTEGER);");
+        ContentValues values = new ContentValues();
+        values.put(SYNC_STATE_META_VERSION_COLUMN, DB_VERSION);
+        db.insert(SYNC_STATE_META_TABLE, SYNC_STATE_META_VERSION_COLUMN, values);
+    }
+
+    public void onDatabaseOpened(SQLiteDatabase db) {
+        long version = DatabaseUtils.longForQuery(db,
+                "SELECT " + SYNC_STATE_META_VERSION_COLUMN + " FROM " + SYNC_STATE_META_TABLE,
+                null);
+        if (version != DB_VERSION) {
+            createDatabase(db);
+        }
+    }
+
+    public Cursor query(SQLiteDatabase db, String[] projection,
+                        String selection, String[] selectionArgs, String sortOrder) {
+        return db.query(SYNC_STATE_TABLE, projection, selection, selectionArgs,
+                null, null, sortOrder);
+    }
+
+    public long insert(SQLiteDatabase db, ContentValues values) {
+        return db.replace(SYNC_STATE_TABLE, SyncStateContract.Columns.ACCOUNT_NAME, values);
+    }
+
+    public int delete(SQLiteDatabase db, String userWhere, String[] whereArgs) {
+        return db.delete(SYNC_STATE_TABLE, userWhere, whereArgs);
+    }
+
+    public int update(SQLiteDatabase db, ContentValues values,
+                      String selection, String[] selectionArgs) {
+        return db.update(SYNC_STATE_TABLE, values, selection, selectionArgs);
+    }
+
+    public int update(SQLiteDatabase db, long rowId, Object data) {
+        if (DatabaseUtils.longForQuery(db, QUERY_COUNT_SYNC_STATE_ROWS,
+                new String[]{Long.toString(rowId)}) < 1) {
+            return 0;
+        }
+        db.execSQL("UPDATE " + SYNC_STATE_TABLE
+                + " SET " + SyncStateContract.Columns.DATA + "=?"
+                + " WHERE " + SyncStateContract.Columns._ID + "=" + rowId,
+                new Object[]{data});
+        // assume a row was modified since we know it exists
+        return 1;
+    }
+
+    public void onAccountsChanged(SQLiteDatabase db, Account[] accounts) {
+        Cursor c = db.query(SYNC_STATE_TABLE, ACCOUNT_PROJECTION, null, null, null, null, null);
+        try {
+            while (c.moveToNext()) {
+                final String accountName = c.getString(0);
+                final String accountType = c.getString(1);
+                Account account = new Account(accountName, accountType);
+                if (!contains(accounts, account)) {
+                    db.delete(SYNC_STATE_TABLE, SELECT_BY_ACCOUNT,
+                            new String[]{accountName, accountType});
+                }
+            }
+        } finally {
+            c.close();
+        }
+    }
+
+    /**
+     * Checks that value is present as at least one of the elements of the array.
+     * @param array the array to check in
+     * @param value the value to check for
+     * @return true if the value is present in the array
+     */
+    private static <T> boolean contains(T[] array, T value) {
+        for (T element : array) {
+            if (element == null) {
+                if (value == null) return true;
+            } else {
+                if (value != null && element.equals(value)) return true;
+            }
+        }
+        return false;
+    }
+}
diff --git a/src/com/android/swe/browser/platformsupport/WebAddress.java b/src/com/android/swe/browser/platformsupport/WebAddress.java
new file mode 100644
index 0000000..2fbf20a
--- /dev/null
+++ b/src/com/android/swe/browser/platformsupport/WebAddress.java
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2013 The Linux Foundation. All rights reserved.
+ * Not a contribution.
+ *
+ * Copyright (C) 2006 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.swe.browser.platformsupport;
+
+import static android.util.Patterns.GOOD_IRI_CHAR;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * {@hide}
+ *
+ * Web Address Parser
+ *
+ * This is called WebAddress, rather than URL or URI, because it
+ * attempts to parse the stuff that a user will actually type into a
+ * browser address widget.
+ *
+ * Unlike java.net.uri, this parser will not choke on URIs missing
+ * schemes.  It will only throw a ParseException if the input is
+ * really hosed.
+ *
+ * If given an https scheme but no port, fills in port
+ *
+ */
+public class WebAddress {
+
+    private String mScheme;
+    private String mHost;
+    private int mPort;
+    private String mPath;
+    private String mAuthInfo;
+
+    static final int MATCH_GROUP_SCHEME = 1;
+    static final int MATCH_GROUP_AUTHORITY = 2;
+    static final int MATCH_GROUP_HOST = 3;
+    static final int MATCH_GROUP_PORT = 4;
+    static final int MATCH_GROUP_PATH = 5;
+
+    /* ENRICO: imported the ParseExeption here */
+    public static class ParseException extends RuntimeException {
+        public String response;
+
+        ParseException(String response) {
+            this.response = response;
+        }
+    }
+
+    static Pattern sAddressPattern = Pattern.compile(
+            /* scheme    */ "(?:(http|https|file)\\:\\/\\/)?" +
+            /* authority */ "(?:([-A-Za-z0-9$_.+!*'(),;?&=]+(?:\\:[-A-Za-z0-9$_.+!*'(),;?&=]+)?)@)?" +
+            /* host      */ "([" + GOOD_IRI_CHAR + "%_-][" + GOOD_IRI_CHAR + "%_\\.-]*|\\[[0-9a-fA-F:\\.]+\\])?" +
+            /* port      */ "(?:\\:([0-9]*))?" +
+            /* path      */ "(\\/?[^#]*)?" +
+            /* anchor    */ ".*", Pattern.CASE_INSENSITIVE);
+
+    /** parses given uriString. */
+    public WebAddress(String address) throws ParseException {
+        if (address == null) {
+            throw new NullPointerException();
+        }
+
+        // android.util.Log.d(LOGTAG, "WebAddress: " + address);
+
+        mScheme = "";
+        mHost = "";
+        mPort = -1;
+        mPath = "/";
+        mAuthInfo = "";
+
+        Matcher m = sAddressPattern.matcher(address);
+        String t;
+        if (m.matches()) {
+            t = m.group(MATCH_GROUP_SCHEME);
+            if (t != null) mScheme = t.toLowerCase();
+            t = m.group(MATCH_GROUP_AUTHORITY);
+            if (t != null) mAuthInfo = t;
+            t = m.group(MATCH_GROUP_HOST);
+            if (t != null) mHost = t;
+            t = m.group(MATCH_GROUP_PORT);
+            if (t != null && t.length() > 0) {
+                // The ':' character is not returned by the regex.
+                try {
+                    mPort = Integer.parseInt(t);
+                } catch (NumberFormatException ex) {
+                    throw new ParseException("Bad port");
+                }
+            }
+            t = m.group(MATCH_GROUP_PATH);
+            if (t != null && t.length() > 0) {
+                /* handle busted myspace frontpage redirect with
+                   missing initial "/" */
+                if (t.charAt(0) == '/') {
+                    mPath = t;
+                } else {
+                    mPath = "/" + t;
+                }
+            }
+
+        } else {
+            // nothing found... outa here
+            throw new ParseException("Bad address");
+        }
+
+        /* Get port from scheme or scheme from port, if necessary and
+           possible */
+        if (mPort == 443 && mScheme.equals("")) {
+            mScheme = "https";
+        } else if (mPort == -1) {
+            if (mScheme.equals("https"))
+                mPort = 443;
+            else
+                mPort = 80; // default
+        }
+        if (mScheme.equals("")) mScheme = "http";
+    }
+
+    @Override
+    public String toString() {
+        String port = "";
+        if ((mPort != 443 && mScheme.equals("https")) ||
+            (mPort != 80 && mScheme.equals("http"))) {
+            port = ":" + Integer.toString(mPort);
+        }
+        String authInfo = "";
+        if (mAuthInfo.length() > 0) {
+            authInfo = mAuthInfo + "@";
+        }
+
+        return mScheme + "://" + authInfo + mHost + port + mPath;
+    }
+
+    public void setScheme(String scheme) {
+      mScheme = scheme;
+    }
+
+    public String getScheme() {
+      return mScheme;
+    }
+
+    public void setHost(String host) {
+      mHost = host;
+    }
+
+    public String getHost() {
+      return mHost;
+    }
+
+    public void setPort(int port) {
+      mPort = port;
+    }
+
+    public int getPort() {
+      return mPort;
+    }
+
+    public void setPath(String path) {
+      mPath = path;
+    }
+
+    public String getPath() {
+      return mPath;
+    }
+
+    public void setAuthInfo(String authInfo) {
+      mAuthInfo = authInfo;
+    }
+
+    public String getAuthInfo() {
+      return mAuthInfo;
+    }
+}
diff --git a/src/com/android/browser/preferences/AccessibilityPreferencesFragment.java b/src/com/android/swe/browser/preferences/AccessibilityPreferencesFragment.java
similarity index 100%
rename from src/com/android/browser/preferences/AccessibilityPreferencesFragment.java
rename to src/com/android/swe/browser/preferences/AccessibilityPreferencesFragment.java
diff --git a/src/com/android/browser/preferences/AdvancedPreferencesFragment.java b/src/com/android/swe/browser/preferences/AdvancedPreferencesFragment.java
similarity index 100%
rename from src/com/android/browser/preferences/AdvancedPreferencesFragment.java
rename to src/com/android/swe/browser/preferences/AdvancedPreferencesFragment.java
diff --git a/src/com/android/browser/preferences/BandwidthPreferencesFragment.java b/src/com/android/swe/browser/preferences/BandwidthPreferencesFragment.java
similarity index 100%
rename from src/com/android/browser/preferences/BandwidthPreferencesFragment.java
rename to src/com/android/swe/browser/preferences/BandwidthPreferencesFragment.java
diff --git a/src/com/android/browser/preferences/DebugPreferencesFragment.java b/src/com/android/swe/browser/preferences/DebugPreferencesFragment.java
similarity index 100%
rename from src/com/android/browser/preferences/DebugPreferencesFragment.java
rename to src/com/android/swe/browser/preferences/DebugPreferencesFragment.java
diff --git a/src/com/android/browser/preferences/FontSizePreview.java b/src/com/android/swe/browser/preferences/FontSizePreview.java
similarity index 100%
rename from src/com/android/browser/preferences/FontSizePreview.java
rename to src/com/android/swe/browser/preferences/FontSizePreview.java
diff --git a/src/com/android/browser/preferences/GeneralPreferencesFragment.java b/src/com/android/swe/browser/preferences/GeneralPreferencesFragment.java
similarity index 100%
rename from src/com/android/browser/preferences/GeneralPreferencesFragment.java
rename to src/com/android/swe/browser/preferences/GeneralPreferencesFragment.java
diff --git a/src/com/android/browser/preferences/InvertedContrastPreview.java b/src/com/android/swe/browser/preferences/InvertedContrastPreview.java
similarity index 100%
rename from src/com/android/browser/preferences/InvertedContrastPreview.java
rename to src/com/android/swe/browser/preferences/InvertedContrastPreview.java
diff --git a/src/com/android/browser/preferences/LabPreferencesFragment.java b/src/com/android/swe/browser/preferences/LabPreferencesFragment.java
similarity index 100%
rename from src/com/android/browser/preferences/LabPreferencesFragment.java
rename to src/com/android/swe/browser/preferences/LabPreferencesFragment.java
diff --git a/src/com/android/browser/preferences/NonformattingListPreference.java b/src/com/android/swe/browser/preferences/NonformattingListPreference.java
similarity index 100%
rename from src/com/android/browser/preferences/NonformattingListPreference.java
rename to src/com/android/swe/browser/preferences/NonformattingListPreference.java
diff --git a/src/com/android/browser/preferences/PrivacySecurityPreferencesFragment.java b/src/com/android/swe/browser/preferences/PrivacySecurityPreferencesFragment.java
similarity index 100%
rename from src/com/android/browser/preferences/PrivacySecurityPreferencesFragment.java
rename to src/com/android/swe/browser/preferences/PrivacySecurityPreferencesFragment.java
diff --git a/src/com/android/browser/preferences/SeekBarSummaryPreference.java b/src/com/android/swe/browser/preferences/SeekBarSummaryPreference.java
similarity index 100%
rename from src/com/android/browser/preferences/SeekBarSummaryPreference.java
rename to src/com/android/swe/browser/preferences/SeekBarSummaryPreference.java
diff --git a/src/com/android/browser/preferences/WebViewPreview.java b/src/com/android/swe/browser/preferences/WebViewPreview.java
similarity index 100%
rename from src/com/android/browser/preferences/WebViewPreview.java
rename to src/com/android/swe/browser/preferences/WebViewPreview.java
diff --git a/src/com/android/browser/preferences/WebsiteSettingsFragment.java b/src/com/android/swe/browser/preferences/WebsiteSettingsFragment.java
similarity index 100%
rename from src/com/android/browser/preferences/WebsiteSettingsFragment.java
rename to src/com/android/swe/browser/preferences/WebsiteSettingsFragment.java
diff --git a/src/com/android/browser/provider/BrowserProvider.java b/src/com/android/swe/browser/provider/BrowserProvider.java
similarity index 100%
rename from src/com/android/browser/provider/BrowserProvider.java
rename to src/com/android/swe/browser/provider/BrowserProvider.java
diff --git a/src/com/android/browser/provider/BrowserProvider2.java b/src/com/android/swe/browser/provider/BrowserProvider2.java
similarity index 100%
rename from src/com/android/browser/provider/BrowserProvider2.java
rename to src/com/android/swe/browser/provider/BrowserProvider2.java
diff --git a/src/com/android/browser/provider/MyNavigationProvider.java b/src/com/android/swe/browser/provider/MyNavigationProvider.java
similarity index 100%
rename from src/com/android/browser/provider/MyNavigationProvider.java
rename to src/com/android/swe/browser/provider/MyNavigationProvider.java
diff --git a/src/com/android/browser/provider/SQLiteContentProvider.java b/src/com/android/swe/browser/provider/SQLiteContentProvider.java
similarity index 100%
rename from src/com/android/browser/provider/SQLiteContentProvider.java
rename to src/com/android/swe/browser/provider/SQLiteContentProvider.java
diff --git a/src/com/android/browser/provider/SnapshotProvider.java b/src/com/android/swe/browser/provider/SnapshotProvider.java
similarity index 100%
rename from src/com/android/browser/provider/SnapshotProvider.java
rename to src/com/android/swe/browser/provider/SnapshotProvider.java
diff --git a/src/com/android/browser/search/DefaultSearchEngine.java b/src/com/android/swe/browser/search/DefaultSearchEngine.java
similarity index 100%
rename from src/com/android/browser/search/DefaultSearchEngine.java
rename to src/com/android/swe/browser/search/DefaultSearchEngine.java
diff --git a/src/com/android/browser/search/OpenSearchSearchEngine.java b/src/com/android/swe/browser/search/OpenSearchSearchEngine.java
similarity index 100%
rename from src/com/android/browser/search/OpenSearchSearchEngine.java
rename to src/com/android/swe/browser/search/OpenSearchSearchEngine.java
diff --git a/src/com/android/browser/search/SearchEngine.java b/src/com/android/swe/browser/search/SearchEngine.java
similarity index 100%
rename from src/com/android/browser/search/SearchEngine.java
rename to src/com/android/swe/browser/search/SearchEngine.java
diff --git a/src/com/android/browser/search/SearchEngineInfo.java b/src/com/android/swe/browser/search/SearchEngineInfo.java
similarity index 100%
rename from src/com/android/browser/search/SearchEngineInfo.java
rename to src/com/android/swe/browser/search/SearchEngineInfo.java
diff --git a/src/com/android/browser/search/SearchEnginePreference.java b/src/com/android/swe/browser/search/SearchEnginePreference.java
similarity index 100%
rename from src/com/android/browser/search/SearchEnginePreference.java
rename to src/com/android/swe/browser/search/SearchEnginePreference.java
diff --git a/src/com/android/browser/search/SearchEngines.java b/src/com/android/swe/browser/search/SearchEngines.java
similarity index 100%
rename from src/com/android/browser/search/SearchEngines.java
rename to src/com/android/swe/browser/search/SearchEngines.java
diff --git a/src/com/android/browser/stub/NullController.java b/src/com/android/swe/browser/stub/NullController.java
similarity index 100%
rename from src/com/android/browser/stub/NullController.java
rename to src/com/android/swe/browser/stub/NullController.java
diff --git a/src/com/android/browser/util/ThreadedCursorAdapter.java b/src/com/android/swe/browser/util/ThreadedCursorAdapter.java
similarity index 100%
rename from src/com/android/browser/util/ThreadedCursorAdapter.java
rename to src/com/android/swe/browser/util/ThreadedCursorAdapter.java
diff --git a/src/com/android/browser/view/BasePieView.java b/src/com/android/swe/browser/view/BasePieView.java
similarity index 100%
rename from src/com/android/browser/view/BasePieView.java
rename to src/com/android/swe/browser/view/BasePieView.java
diff --git a/src/com/android/browser/view/BookmarkContainer.java b/src/com/android/swe/browser/view/BookmarkContainer.java
similarity index 100%
rename from src/com/android/browser/view/BookmarkContainer.java
rename to src/com/android/swe/browser/view/BookmarkContainer.java
diff --git a/src/com/android/browser/view/BookmarkExpandableView.java b/src/com/android/swe/browser/view/BookmarkExpandableView.java
similarity index 100%
rename from src/com/android/browser/view/BookmarkExpandableView.java
rename to src/com/android/swe/browser/view/BookmarkExpandableView.java
diff --git a/src/com/android/browser/view/CustomScreenLinearLayout.java b/src/com/android/swe/browser/view/CustomScreenLinearLayout.java
similarity index 100%
rename from src/com/android/browser/view/CustomScreenLinearLayout.java
rename to src/com/android/swe/browser/view/CustomScreenLinearLayout.java
diff --git a/src/com/android/browser/view/EventRedirectingFrameLayout.java b/src/com/android/swe/browser/view/EventRedirectingFrameLayout.java
similarity index 100%
rename from src/com/android/browser/view/EventRedirectingFrameLayout.java
rename to src/com/android/swe/browser/view/EventRedirectingFrameLayout.java
diff --git a/src/com/android/browser/view/PieItem.java b/src/com/android/swe/browser/view/PieItem.java
similarity index 100%
rename from src/com/android/browser/view/PieItem.java
rename to src/com/android/swe/browser/view/PieItem.java
diff --git a/src/com/android/browser/view/PieListView.java b/src/com/android/swe/browser/view/PieListView.java
similarity index 100%
rename from src/com/android/browser/view/PieListView.java
rename to src/com/android/swe/browser/view/PieListView.java
diff --git a/src/com/android/browser/view/PieMenu.java b/src/com/android/swe/browser/view/PieMenu.java
similarity index 100%
rename from src/com/android/browser/view/PieMenu.java
rename to src/com/android/swe/browser/view/PieMenu.java
diff --git a/src/com/android/browser/view/PieStackView.java b/src/com/android/swe/browser/view/PieStackView.java
similarity index 100%
rename from src/com/android/browser/view/PieStackView.java
rename to src/com/android/swe/browser/view/PieStackView.java
diff --git a/src/com/android/browser/view/ScrollerView.java b/src/com/android/swe/browser/view/ScrollerView.java
similarity index 100%
rename from src/com/android/browser/view/ScrollerView.java
rename to src/com/android/swe/browser/view/ScrollerView.java
diff --git a/src/com/android/browser/view/SnapshotGridView.java b/src/com/android/swe/browser/view/SnapshotGridView.java
similarity index 100%
rename from src/com/android/browser/view/SnapshotGridView.java
rename to src/com/android/swe/browser/view/SnapshotGridView.java
diff --git a/src/com/android/browser/view/StopProgressView.java b/src/com/android/swe/browser/view/StopProgressView.java
similarity index 100%
rename from src/com/android/browser/view/StopProgressView.java
rename to src/com/android/swe/browser/view/StopProgressView.java
diff --git a/src/com/android/browser/widget/BookmarkThumbnailWidgetProvider.java b/src/com/android/swe/browser/widget/BookmarkThumbnailWidgetProvider.java
similarity index 100%
rename from src/com/android/browser/widget/BookmarkThumbnailWidgetProvider.java
rename to src/com/android/swe/browser/widget/BookmarkThumbnailWidgetProvider.java
diff --git a/src/com/android/browser/widget/BookmarkThumbnailWidgetService.java b/src/com/android/swe/browser/widget/BookmarkThumbnailWidgetService.java
similarity index 100%
rename from src/com/android/browser/widget/BookmarkThumbnailWidgetService.java
rename to src/com/android/swe/browser/widget/BookmarkThumbnailWidgetService.java
diff --git a/src/com/android/browser/widget/BookmarkWidgetConfigure.java b/src/com/android/swe/browser/widget/BookmarkWidgetConfigure.java
similarity index 100%
rename from src/com/android/browser/widget/BookmarkWidgetConfigure.java
rename to src/com/android/swe/browser/widget/BookmarkWidgetConfigure.java
diff --git a/src/com/android/browser/widget/BookmarkWidgetProxy.java b/src/com/android/swe/browser/widget/BookmarkWidgetProxy.java
similarity index 100%
rename from src/com/android/browser/widget/BookmarkWidgetProxy.java
rename to src/com/android/swe/browser/widget/BookmarkWidgetProxy.java
diff --git a/swe_android_browser.gypi b/swe_android_browser.gypi
new file mode 100644
index 0000000..a200a28
--- /dev/null
+++ b/swe_android_browser.gypi
@@ -0,0 +1,35 @@
+{
+  'targets' : [
+    {
+      'target_name': 'swe_android_browser_apk',
+      'type': 'none',
+      'dependencies': [
+        'swe_engine_java',
+        'android-support-v13',
+        '<@(libnetxt_dependencies)',
+      ],
+      'variables': {
+        'apk_name': 'SWE_AndroidBrowser',
+        'manifest_package_name': 'com.android.swe.browser',
+        'app_manifest_version_name': '<!(../swe/browser/tools/generate_about.sh --quiet --name --about)',
+        'app_manifest_version_code': '<!(../swe/browser/tools/generate_about.sh --quiet --code)',
+        'java_in_dir': '.',
+        'resource_dir': '../../swe/browser/res',
+        'native_lib_target': 'libswewebviewchromium',
+        'additional_input_paths': ['<(PRODUCT_DIR)/android_webview_apk/assets/webviewchromium.pak'],
+        'additional_native_libs': ['<@(libnetxt_native_libs)',
+                                   '<@(libsweadrenoext_native_libs)',
+                                   '<(SHARED_LIB_DIR)/libswewebviewchromium/libswenetxt_plugin_proxy.so',]
+      },
+      'copies': [
+        {
+              'destination': '<(PRODUCT_DIR)/swe_android_browser_apk/assets/',
+              'files': [
+                '<(PRODUCT_DIR)/android_webview_apk/assets/webviewchromium.pak'
+              ],
+        },
+      ],
+      'includes': [ '../../build/java_apk.gypi' ],
+    },
+  ],
+}
diff --git a/tools/generate_about.sh b/tools/generate_about.sh
new file mode 100755
index 0000000..c44072a
--- /dev/null
+++ b/tools/generate_about.sh
@@ -0,0 +1,195 @@
+#!/bin/bash
+#
+# Copyright (c) 2013, The Linux Foundation. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#     * Redistributions of source code must retain the above copyright
+#      notice, this list of conditions and the following disclaimer.
+#    * Redistributions in binary form must reproduce the above
+#      copyright notice, this list of conditions and the following
+#      disclaimer in the documentation and/or other materials provided
+#      with the distribution.
+#    * Neither the name of The Linux Foundation nor the names of its
+#      contributors may be used to endorse or promote products derived
+#      from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+# ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Construct the XML entity for the &about; entity in
+#  res/values/about.xml.
+#
+# Usage:
+#  generate_about.sh [OPTIONS]
+#
+# Generates SWE Android Browser's About box XML resource and
+#   emits manifest version name/code values
+#
+# Options:
+#  --name : emit suitable manifest version name
+#  --code : emit suitable manifest version code
+#  --about : generate res/values/about.xml
+#
+#
+me=${0##*/}
+mydir=${0%/*}
+
+# input/output files
+VERSIONFILE=${mydir}/../VERSION
+ABOUTFILE=${mydir}/../res/values/about.xml
+
+# default
+NAME=0
+CODE=0
+ABOUT=0
+QUIET=0
+
+# poor man's getopt()
+[[ " ${*} " =~ " --name " ]] && NAME=1
+[[ " ${*} " =~ " --code " ]] && CODE=1
+[[ " ${*} " =~ " --quiet " ]] && QUIET=1
+[[ " ${*} " =~ " --about " ]] && ABOUT=1
+
+function warning()
+{
+    (( ${QUIET} )) || echo "Warning: ${me}: $@" >&2
+}
+
+function error()
+{
+    ret=$1
+    shift
+    echo "Error: ${me}: $@" >&2
+    exit ${retval}
+}
+
+
+BASEVERSION=$(cat ${VERSIONFILE}) || error 1 "couldn't read \"${VERSIONFILE}\""
+BASEVERSION=( ${BASEVERSION//./ } )
+MAJOR=${BASEVERSION[0]}
+MINOR=${BASEVERSION[1]}
+BRANCH=unknown
+BUILDID=unknown
+VERSION=${MAJOR}.${MINOR}
+
+# defaults
+HASH=unknown
+
+DATE=$(date) || warning "unable to get date"
+
+# collect information about branch, version, etc. from CHROME_SRC
+while [[ -d "${CHROME_SRC}" ]]
+do
+    pushd "${CHROME_SRC}" >/dev/null || error 1 "can't pushd ${CHROME_SRC}.."
+
+    # this had better work..
+    if ! HASH=$(git rev-parse --short HEAD)
+    then
+        HASH=unknown
+        warning "${CHROME_SRC} apparently not under git?"
+        break
+    fi
+
+    # collect branch and clean it up
+    BRANCH=$(git branch | awk '/^\*/')
+    BRANCH=${BRANCH#\* }
+
+    # try to get the best form of the branch, to
+    # catch detached HEADs, etc.
+    while read
+    do
+        REPLY=${REPLY// /}
+        [[ ${REPLY:0:1} == "(" ]] && continue
+        REPLY=${REPLY%->*}
+        git log -1 --oneline ${REPLY} | grep ${HASH} >/dev/null 2>/dev/null && BRANCH=${REPLY} && break;
+    done < <(git branch -a | grep -v ^\*)
+
+    if [[ ${BRANCH//(/} == ${BRANCH} ]]
+    then
+        # trim branch to a num, or a smaller name
+        BRANCH=${BRANCH##*/}
+    fi
+
+    # tack on branch
+    VERSION=${VERSION}.${BRANCH}
+
+    # construct a version, start with a default
+    MERGE_BASE=$(git merge-base remotes/origin/master "${HASH}") || warning "can't find a merge-base with master for hash \"$HASH\""
+
+    # requires grafted tree and numeric branch name
+    if [[ -n ${MERGE_BASE} ]]
+    then
+        BUILDID=$(git log --oneline ${MERGE_BASE}.. | wc -l)
+        VERSION=${VERSION}.${BUILDID}
+    else
+        warning "using version ${VERSION}.. merge-base:\"${MERGE_BASE}\" branch: \"${BRANCH}\""
+    fi
+
+    if (( ${ABOUT} ))
+    then
+        # collect diffs (just in case.  this will normally be NULL)
+        DIFFS=$(gclient recurse git diff)
+        DIFFS=${DIFFS//&/&amp;}
+        DIFFS=${DIFFS//</&lt;}
+        DIFFS=${DIFFS//$'\x5c'/$'\x5c'$'\x5c'} # \ -> \\
+        DIFFS=${DIFFS//$'\x27'/$'\x5c'$'\x27'} # ' -> \'
+        DIFFS=${DIFFS//$'\n'/$'\n'\\n}         # newline to newline\n
+        if [[ -n ${DIFFS} ]]
+        then
+            DIFFS="Diffs:\n<tt><font size=\"4\">${DIFFS}</font></tt>"
+            warning "including diffs in about box" >&2
+        fi
+    fi
+    popd >/dev/null || error 1 "popd from $CHROME_SRC failed?"
+    break
+done
+
+if (( ${ABOUT} ))
+then
+   # add a support link, if configured
+    if [[ -n ${SWE_APK_SUPPORT} ]]
+    then
+        CONTACT="Please help us make your experience better by contacting the
+team at <a href=\"mailto:${SWE_APK_SUPPORT}\">${SWE_APK_SUPPORT}</a>\n"
+    fi
+
+    printf %s "<?xml version=\"1.0\" encoding=\"utf-8\"?>
+<resources xmlns:xliff=\"urn:oasis:names:tc:xliff:document:1.2\">
+   <!-- Menu item to display browser information -->
+   <string name=\"about\">About</string>
+   <!-- Text to display in about dialog -->
+   <string name=\"about_text\" formatted=\"false\">
+${CONTACT}
+Version: ${VERSION}\n
+Built: ${DATE}\n
+Host: ${HOSTNAME}\n
+User: ${USER}\n
+Hash: ${HASH} (${BRANCH})\n
+${DIFFS}
+</string>
+</resources>
+" > "${ABOUTFILE}" || error 1 "could not write to ${ABOUTFILE}"
+fi
+
+(( ${NAME} )) && echo "${VERSION} (${HASH})"
+
+# decimal-ify for printf
+[[ -n ${MAJOR//[0-9]/} ]] && MAJOR=0
+[[ -n ${MINOR//[0-9]/} ]] && MINOR=0
+[[ -n ${BRANCH//[0-9]/} ]] && BRANCH=0
+[[ -n ${BUILDID//[0-9]/} ]] && BUILDID=0
+
+(( ${CODE} )) && printf "%d%02d%06d%05d\n" $((${MAJOR})) $((${MINOR})) $((${BRANCH})) $((${BUILDID}))
+
+exit 0