diff options
18 files changed, 524 insertions, 242 deletions
diff --git a/res/menu/folder_choice.xml b/res/layout/add_to_option.xml index c62e2f8..4cfa9f8 100644 --- a/res/menu/folder_choice.xml +++ b/res/layout/add_to_option.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2010 The Android Open Source Project +<!-- 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. @@ -13,15 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. --> - -<menu xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:id="@+id/home_screen" - android:icon="@*android:drawable/ic_menu_home" - android:title="@string/add_to_homescreen_menu_option"/> - <item android:id="@+id/bookmarks" - android:icon="@drawable/ic_menu_bookmarks" - android:title="@string/add_to_bookmarks_menu_option"/> - <item android:id="@+id/other" - android:icon="@*android:drawable/ic_menu_archive" - android:title="@string/add_to_other_folder_menu_option"/> -</menu> +<TextView xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:textAppearance="?android:attr/textAppearanceMedium" + android:gravity="center_vertical" + android:minHeight="?android:attr/listPreferredItemHeight" /> diff --git a/res/layout/browser_add_bookmark.xml b/res/layout/browser_add_bookmark.xml index 8adf4b6..e25f903 100644 --- a/res/layout/browser_add_bookmark.xml +++ b/res/layout/browser_add_bookmark.xml @@ -131,19 +131,15 @@ android:text="@string/containing_folder" android:textAppearance="?android:attr/textAppearanceMedium" /> - <TextView + <view class="com.android.browser.addbookmark.FolderSpinner" android:id="@+id/folder" android:layout_height="wrap_content" - android:layout_width="250dip" + android:layout_width="wrap_content" android:layout_marginRight="20dip" android:layout_marginLeft="20dip" + android:spinnerMode="dropdown" android:gravity="center_vertical" - android:singleLine="true" - android:ellipsize="start" - android:text="@string/bookmarks" - android:drawableLeft="@drawable/ic_menu_bookmarks" - android:layout_marginBottom="40dip" - android:textAppearance="?android:attr/textAppearanceMedium" /> + /> </TableRow> </TableLayout> diff --git a/res/values-es-rUS-xlarge/strings.xml b/res/values-es-rUS-xlarge/strings.xml index 7f9e8b6..508f3fe 100644 --- a/res/values-es-rUS-xlarge/strings.xml +++ b/res/values-es-rUS-xlarge/strings.xml @@ -1,24 +1,106 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Copyright (C) 2010 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. - --> - <resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> - <string name="new_tab" msgid="7275656655054293038">"Pestaña nueva"</string> - <string name="new_incognito_tab" msgid="5149742197322201152">"Nueva pestaña de incógnito"</string> - <string name="active_tabs" msgid="5324492165541331128">"Pestañas"</string> - <!-- no translation found for contextmenu_openlink_newwindow (1061831678814826192) --> - <skip /> + <!-- XL xlarge --> + <string name="new_tab" msgid="7211896313409251144">"Pestaña nueva"</string> + <!-- XL xlarge --> + <string name="new_incognito_tab" msgid="8067945824740306172">"Nueva pestaña de incógnito"</string> + <!-- XL xlarge --> + <string name="active_tabs" msgid="5948496827915445500">"Pestañas"</string> + <!-- XL --> + <string name="tab_bookmarks" msgid="2107205776996598691">"Favoritos"</string> + <!-- XL --> + <string name="added_to_bookmarks" msgid="8889115451085864249">"Agregado a favoritos"</string> + <!-- XL --> + <string name="removed_from_bookmarks" msgid="7846438980097184281">"Suprimido de Favoritos"</string> + <!-- XL --> + <string name="sign_in_to" msgid="1214184176627571479">"Acceder a <xliff:g id="HOSTNAME">%s1</xliff:g> \"<xliff:g id="REALM">%s2</xliff:g>\""</string> + <!-- XL --> + <string name="action" msgid="4943864730966939961">"Acceder"</string> + <!-- XL --> + <string name="add_to_bookmarks_menu_option" msgid="7552383875291126013">"Favoritos"</string> + <!-- XL --> + <string name="remove_from_bookmarks" msgid="7311939805508190918">"Eliminar de Favoritos"</string> + <!-- XL --> + <string name="bookmark_saved" msgid="1806548159693236924">"Guardado en los favoritos."</string> + <!-- XL --> + <string name="bookmark_cannot_save_url" msgid="8417203985466903497">"No se puede agregar esta URL a los favoritos."</string> + <!-- XL --> + <string name="bookmarks" msgid="8254231548777487838">"Favoritos"</string> + <!-- XL --> + <string name="copy_page_url" msgid="7121286358832939849">"Copiar la URL de la página"</string> + <!-- XL --> + <string name="contextheader_folder_bookmarkcount" msgid="7867101902984210591">"<xliff:g id="BOOKMARK_COUNT">%d</xliff:g> favoritos"</string> + <!-- XL --> + <string name="contextheader_folder_empty" msgid="8989453566115363329">"Carpeta vacía"</string> + <!-- XL xlarge --> + <string name="contextmenu_openlink_newwindow" msgid="8177825954953587540">"Abrir en una ventana nueva"</string> + <!-- XL --> + <string name="contextmenu_map" msgid="3809951100283548665">"Mapa"</string> + <!-- XL --> + <string name="browser_bookmarks_page_bookmarks_text" msgid="4676739439702068160">"Favoritos"</string> + <!-- XL --> + <string name="menu_preferences" msgid="3003635465914395516">"Configuración"</string> + <!-- XL --> + <string name="pref_content_block_popups" msgid="6871160654981179930">"Bloquear ventanas emergentes"</string> + <!-- XL --> + <string name="pref_content_open_in_background" msgid="7928143573209470961">"Abrir en modo subordinado"</string> + <!-- XL --> + <string name="pref_content_homepage" msgid="6044903119907405007">"Definir página principal"</string> + <!-- XL --> + <string name="pref_content_autofit" msgid="152292940099720429">"Ajuste automático de páginas"</string> + <!-- XL --> + <string name="pref_autofill_profile_editor_summary" msgid="6606678927956330022">"Configurar & administrar datos para los formularios de autollenado"</string> + <!-- XL --> + <string name="autofill_profile_editor_heading" msgid="376355900106687672">"La función Autocompletar utilizará tu perfil para ayudarte a completar los formularios web con solo un clic."</string> + <!-- XL --> + <string name="autofill_setup_dialog_negative_toast" msgid="8606640740851832808">"Autocomp se configura en cualquier momento con Configuración del navegador -> Configuración personal"</string> + <!-- XL --> + <string name="pref_privacy_clear_cookies" msgid="2430066169979191550">"Borrar todos los datos de las cookies"</string> + <!-- XL --> + <string name="pref_security_save_form_data" msgid="4687632734841414584">"Recordar datos del formulario"</string> + <!-- XL --> + <string name="pref_security_show_security_warning" msgid="237213216450431926">"Mostrar advertencias de seguridad"</string> + <!-- XL --> + <string-array name="pref_text_size_choices"> + <item msgid="9175838437528854188">"Diminuto"</item> + <item msgid="8310610720691502080">"Pequeño"</item> + <item msgid="577786719596429685">"Normal"</item> + <item msgid="1882099825378500373">"Grande"</item> + <item msgid="2624955515232921031">"Enorme"</item> + </string-array> + <!-- XL --> + <string name="pref_default_zoom" msgid="7937970520334948703">"Zoom predeterminado"</string> + <!-- XL --> + <string-array name="pref_default_zoom_choices"> + <item msgid="7308170040893292647">"Lejos"</item> + <item msgid="2127686869768024870">"Medio"</item> + <item msgid="6369171816013236032">"Cerrar"</item> + </string-array> + <!-- XL --> + <string name="pref_default_zoom_dialogtitle" msgid="8698964985032801767">"Zoom predeterminado"</string> + <!-- XL --> + <string name="pref_content_load_page" msgid="7460666469137362825">"Abrir las páginas en visión general"</string> + <!-- XL --> + <!-- outdated translation 3239395481036882698 --> <string name="pref_extras_title" msgid="7223601187104530963">"Configuración avanzada"</string> + <!-- XL --> + <string name="pref_extras_reset_default" msgid="113675796607112935">"Restablecer a la forma predeterminada"</string> + <!-- XL --> + <string name="pref_extras_reset_default_dlg_title" msgid="5686450294662109619">"Restablecer a la forma predeterminada"</string> + <!-- XL --> + <string name="search_settings_description" msgid="8504084593679367617">"Favoritos e historial web"</string> + <!-- XL --> + <string name="search_the_web" msgid="3493318001113588865">"Buscar en la Web"</string> + <!-- XL --> + <string name="defaultBookmarksUpButton" msgid="5051877462652364478">"Favoritos"</string> + <!-- XL --> + <string name="max_tabs_warning" msgid="1283136201153746764">"No hay más etiquetas disponibles"</string> + <!-- XL --> + <string name="pref_lab_title" msgid="209824994106188072">"Lab"</string> + <!-- XL --> + <string name="pref_lab_quick_controls" msgid="1617774508416113544">"Controles rápidos"</string> + <!-- XL --> + <string name="pref_lab_quick_controls_summary" msgid="1067572298315336767">"Desliza el pulgar del borde izquierdo/derecho y accede a los controles rápidos."</string> + <!-- XL --> + <string name="account_picker_title" msgid="19248413027956627">"Seleccionar una cuenta o cancelar el acceso manual"</string> </resources> diff --git a/res/values/strings.xml b/res/values/strings.xml index 2a00f1d..b8a45bf 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -522,7 +522,7 @@ <string name="pref_content_load_page">Open pages in overview</string> <!-- Settings summary --> <string name="pref_content_load_page_summary">Show overview of newly opened pages</string> - <!-- Settings screen, section title --> + <!-- Settings screen, section title [CHAR LIMIT=50] --> <string name="pref_extras_title">Advanced</string> <!-- Settings label --> <string name="pref_extras_website_settings">Website settings</string> diff --git a/src/com/android/browser/AddBookmarkPage.java b/src/com/android/browser/AddBookmarkPage.java index d3c147c..9d8c73c 100644 --- a/src/com/android/browser/AddBookmarkPage.java +++ b/src/com/android/browser/AddBookmarkPage.java @@ -17,6 +17,7 @@ package com.android.browser; import com.android.browser.provider.BrowserProvider2; +import com.android.browser.addbookmark.FolderSpinnerAdapter; import android.app.Activity; import android.app.LoaderManager; @@ -44,7 +45,6 @@ import android.text.TextUtils; import android.util.AttributeSet; import android.view.KeyEvent; import android.view.LayoutInflater; -import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.view.Window; @@ -55,7 +55,7 @@ import android.widget.AdapterView; import android.widget.CursorAdapter; import android.widget.EditText; import android.widget.ListView; -import android.widget.PopupMenu; +import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; @@ -66,7 +66,7 @@ import java.util.Stack; public class AddBookmarkPage extends Activity implements View.OnClickListener, TextView.OnEditorActionListener, AdapterView.OnItemClickListener, LoaderManager.LoaderCallbacks<Cursor>, - BreadCrumbView.Controller, PopupMenu.OnMenuItemClickListener { + BreadCrumbView.Controller, AdapterView.OnItemSelectedListener { public static final long DEFAULT_FOLDER_ID = -1; public static final String TOUCH_ICON_URL = "touch_icon_url"; @@ -94,7 +94,7 @@ public class AddBookmarkPage extends Activity private Bundle mMap; private String mTouchIconUrl; private String mOriginalUrl; - private TextView mFolder; + private Spinner mFolder; private View mDefaultView; private View mFolderSelector; private EditText mFolderNamer; @@ -112,7 +112,9 @@ public class AddBookmarkPage extends Activity private long mRootFolder; private TextView mTopLevelLabel; private Drawable mHeaderIcon; - + // We manually change the spinner's selection if the edited bookmark is not + // in the root folder. This makes sure our listener ignores this change. + private boolean mIgnoreSelectionChange; private static class Folder { String Name; long Id; @@ -198,11 +200,22 @@ public class AddBookmarkPage extends Activity if (data != null) { Folder folder = (Folder) data; mCurrentFolder = folder.Id; - int resource = mCurrentFolder == mRootFolder ? - R.drawable.ic_menu_bookmarks : - com.android.internal.R.drawable.ic_menu_archive; - Drawable drawable = getResources().getDrawable(resource); - updateFolderLabel(folder.Name, drawable); + if (mCurrentFolder == mRootFolder) { + // The Spinner changed to show "Other folder ..." Change + // it back to "Bookmarks", which is position 0 if we are + // editing a folder, 1 otherwise. + mFolder.setSelection(mEditingFolder ? 0 : 1); + } else { + ((TextView) mFolder.getSelectedView()).setText(folder.Name); + } + } + } else { + // The user canceled selecting a folder. Revert back to the earlier + // selection. + if (mSaveToHomeScreen) { + mFolder.setSelection(0); + } else { + mFolder.setSelection(mEditingFolder ? 0 : 1); } } } @@ -230,15 +243,6 @@ public class AddBookmarkPage extends Activity } else { finish(); } - } else if (v == mFolder) { - PopupMenu popup = new PopupMenu(this, mFolder); - popup.getMenuInflater().inflate(R.menu.folder_choice, - popup.getMenu()); - if (mEditingFolder) { - popup.getMenu().removeItem(R.id.home_screen); - } - popup.setOnMenuItemClickListener(this); - popup.show(); } else if (v == mAddNewFolder) { setShowFolderNamer(true); mFolderNamer.setText(R.string.new_folder); @@ -254,25 +258,32 @@ public class AddBookmarkPage extends Activity } @Override - public boolean onMenuItemClick(MenuItem item) { - switch(item.getItemId()) { - case R.id.bookmarks: + public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { + if (mIgnoreSelectionChange) { + mIgnoreSelectionChange = false; + return; + } + // In response to the spinner changing. + int intId = (int) id; + switch (intId) { + case FolderSpinnerAdapter.ROOT_FOLDER: mCurrentFolder = mRootFolder; - updateFolderLabel(item.getTitle(), item.getIcon()); mSaveToHomeScreen = false; break; - case R.id.home_screen: + case FolderSpinnerAdapter.HOME_SCREEN: // Create a short cut to the home screen mSaveToHomeScreen = true; - updateFolderLabel(item.getTitle(), item.getIcon()); break; - case R.id.other: + case FolderSpinnerAdapter.OTHER_FOLDER: switchToFolderSelector(); break; default: - return false; + break; } - return true; + } + + @Override + public void onNothingSelected(AdapterView<?> parent) { } private void completeOrCancelFolderNaming(boolean cancel) { @@ -317,6 +328,8 @@ public class AddBookmarkPage extends Activity } private void switchToFolderSelector() { + // Set the list to the top in case it is scrolled. + mListView.setSelection(0); mDefaultView.setVisibility(View.GONE); mFolderSelector.setVisibility(View.VISIBLE); mCrumbHolder.setVisibility(View.VISIBLE); @@ -399,9 +412,7 @@ public class AddBookmarkPage extends Activity moveCursorToFolder(cursor, parent, idIndex); String name = cursor.getString(titleIndex); if (parent == mCurrentFolder) { - Drawable draw = getResources().getDrawable( - com.android.internal.R.drawable.ic_menu_archive); - updateFolderLabel(name, draw); + ((TextView) mFolder.getSelectedView()).setText(name); } folderStack.push(new Folder(name, parent)); parent = cursor.getLong(parentIndex); @@ -448,18 +459,6 @@ public class AddBookmarkPage extends Activity } } - /** - * Update the name and image to show where the bookmark will be added - * @param name Name of the location to save (folder name, bookmarks, or home - * screen. - * @param drawable Image to show corresponding to the save location. - */ - void updateFolderLabel(CharSequence name, Drawable drawable) { - mFolder.setText(name); - mFolder.setCompoundDrawablesWithIntrinsicBounds(drawable, null, null, - null); - } - @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { @@ -573,8 +572,15 @@ public class AddBookmarkPage extends Activity mCancelButton = findViewById(R.id.cancel); mCancelButton.setOnClickListener(this); - mFolder = (TextView) findViewById(R.id.folder); - mFolder.setOnClickListener(this); + mFolder = (Spinner) findViewById(R.id.folder); + mFolder.setAdapter(new FolderSpinnerAdapter(!mEditingFolder)); + if (!mEditingFolder) { + // Initially the "Bookmarks" folder should be showing, rather than + // the home screen. In the editing folder case, home screen is not + // an option, so "Bookmarks" folder is already at the top. + mFolder.setSelection(FolderSpinnerAdapter.ROOT_FOLDER); + } + mFolder.setOnItemSelectedListener(this); mDefaultView = findViewById(R.id.default_view); mFolderSelector = findViewById(R.id.folder_selector); @@ -609,6 +615,11 @@ public class AddBookmarkPage extends Activity if (mCurrentFolder != mRootFolder) { // Find all the folders manager.initLoader(LOADER_ID_ALL_FOLDERS, null, this); + // Since we're not in the root folder, change the selection to other + // folder now. The text will get changed once we select the correct + // folder. + mIgnoreSelectionChange = true; + mFolder.setSelection(mEditingFolder ? 1 : 2); } else { setShowBookmarkIcon(true); } diff --git a/src/com/android/browser/BookmarkUtils.java b/src/com/android/browser/BookmarkUtils.java index f261cb3..b548607 100644 --- a/src/com/android/browser/BookmarkUtils.java +++ b/src/com/android/browser/BookmarkUtils.java @@ -206,12 +206,10 @@ public class BookmarkUtils { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); String accountType = prefs.getString(BrowserBookmarksPage.PREF_ACCOUNT_TYPE, null); String accountName = prefs.getString(BrowserBookmarksPage.PREF_ACCOUNT_NAME, null); - if (!TextUtils.isEmpty(accountName) && !TextUtils.isEmpty(accountType)) { - ub.appendQueryParameter( - BrowserContract.Bookmarks.PARAM_ACCOUNT_NAME,accountName); - ub.appendQueryParameter( - BrowserContract.Bookmarks.PARAM_ACCOUNT_TYPE, accountType); - } + ub.appendQueryParameter( + BrowserContract.Bookmarks.PARAM_ACCOUNT_NAME,accountName); + ub.appendQueryParameter( + BrowserContract.Bookmarks.PARAM_ACCOUNT_TYPE, accountType); return ub; } } diff --git a/src/com/android/browser/Bookmarks.java b/src/com/android/browser/Bookmarks.java index 9a5b6f0..beea489 100644 --- a/src/com/android/browser/Bookmarks.java +++ b/src/com/android/browser/Bookmarks.java @@ -100,8 +100,8 @@ import java.io.ByteArrayOutputStream; * will remain in the database, but only as a history item, and not as a * bookmarked site. * @param context Context of the calling Activity. This is used to make - * Toast confirming that the bookmark has been removed. If the - * caller provides null, the Toast will not be shown. + * Toast confirming that the bookmark has been removed and to + * lookup the correct content uri. It must not be null. * @param cr The ContentResolver being used to remove the bookmark. * @param url URL of the website to be removed. */ @@ -127,7 +127,8 @@ import java.io.ByteArrayOutputStream; cursor.getLong(0)); cr.delete(uri, null, null); if (context != null) { - Toast.makeText(context, R.string.removed_from_bookmarks, Toast.LENGTH_LONG).show(); + Toast.makeText(context, R.string.removed_from_bookmarks, + Toast.LENGTH_LONG).show(); } } catch (IllegalStateException e) { Log.e(LOGTAG, "removeFromBookmarks", e); diff --git a/src/com/android/browser/BookmarksLoader.java b/src/com/android/browser/BookmarksLoader.java index 650c3ca..e2f8941 100644 --- a/src/com/android/browser/BookmarksLoader.java +++ b/src/com/android/browser/BookmarksLoader.java @@ -66,10 +66,7 @@ public class BookmarksLoader extends CursorLoader { } static Uri addAccount(Uri uri, String accountType, String accountName) { - if (!TextUtils.isEmpty(accountType) && !TextUtils.isEmpty(accountName)) { - return uri.buildUpon().appendQueryParameter(Bookmarks.PARAM_ACCOUNT_TYPE, accountType). - appendQueryParameter(Bookmarks.PARAM_ACCOUNT_NAME, accountName).build(); - } - return uri; + return uri.buildUpon().appendQueryParameter(Bookmarks.PARAM_ACCOUNT_TYPE, accountType). + appendQueryParameter(Bookmarks.PARAM_ACCOUNT_NAME, accountName).build(); } } diff --git a/src/com/android/browser/BrowserHistoryPage.java b/src/com/android/browser/BrowserHistoryPage.java index d8e8177..41d3749 100644 --- a/src/com/android/browser/BrowserHistoryPage.java +++ b/src/com/android/browser/BrowserHistoryPage.java @@ -126,10 +126,8 @@ public class BrowserHistoryPage extends Fragment String accountType = prefs.getString(BrowserBookmarksPage.PREF_ACCOUNT_TYPE, null); String accountName = prefs.getString(BrowserBookmarksPage.PREF_ACCOUNT_NAME, null); Uri.Builder combinedBuilder = Combined.CONTENT_URI.buildUpon(); - if (!TextUtils.isEmpty(accountName) && !TextUtils.isEmpty(accountName)) { - combinedBuilder.appendQueryParameter(BrowserContract.Bookmarks.PARAM_ACCOUNT_TYPE, accountType); - combinedBuilder.appendQueryParameter(BrowserContract.Bookmarks.PARAM_ACCOUNT_NAME, accountName); - } + combinedBuilder.appendQueryParameter(BrowserContract.Bookmarks.PARAM_ACCOUNT_TYPE, accountType); + combinedBuilder.appendQueryParameter(BrowserContract.Bookmarks.PARAM_ACCOUNT_NAME, accountName); switch (id) { case LOADER_HISTORY: { diff --git a/src/com/android/browser/DataController.java b/src/com/android/browser/DataController.java index aa233fd..a56fce8 100644 --- a/src/com/android/browser/DataController.java +++ b/src/com/android/browser/DataController.java @@ -100,7 +100,12 @@ public class DataController { } public void queryBookmarkStatus(String url, OnQueryUrlIsBookmark replyTo) { - mDataHandler.sendMessage(QUERY_URL_IS_BOOKMARK, url, replyTo); + if (url == null || url.trim().length() == 0) { + // null or empty url is never a bookmark + replyTo.onQueryUrlIsBookmark(url, false); + return; + } + mDataHandler.sendMessage(QUERY_URL_IS_BOOKMARK, url.trim(), replyTo); } // The standard Handler and Message classes don't allow the queue manipulation diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java index c4edda6..320d3b3 100644 --- a/src/com/android/browser/Tab.java +++ b/src/com/android/browser/Tab.java @@ -546,6 +546,9 @@ class Tab { mInPageLoad = false; // Sync state (in case of stop/timeout) mCurrentState.mUrl = view.getUrl(); + if (mCurrentState.mUrl == null) { + mCurrentState.mUrl = url != null ? url : ""; + } mCurrentState.mTitle = view.getTitle(); mCurrentState.mFavicon = view.getFavicon(); if (!URLUtil.isHttpsUrl(mCurrentState.mUrl)) { diff --git a/src/com/android/browser/TabScrollView.java b/src/com/android/browser/TabScrollView.java index 04ed5a3..f501e64 100644 --- a/src/com/android/browser/TabScrollView.java +++ b/src/com/android/browser/TabScrollView.java @@ -124,7 +124,6 @@ public class TabScrollView extends HorizontalScrollView { void addTab(View tab) { mContentView.addView(tab); - animateIn(tab); tab.setActivated(false); } @@ -135,7 +134,7 @@ public class TabScrollView extends HorizontalScrollView { } else if (ix < mSelected) { mSelected--; } - animateOut(tab); + mContentView.removeView(tab); } private void ensureChildVisible(View child) { @@ -172,25 +171,27 @@ public class TabScrollView extends HorizontalScrollView { } } - private void animateIn(View tab) { - ObjectAnimator animator = ObjectAnimator.ofInt(tab, "TranslationX", 500, 0); - animator.setDuration(mAnimationDuration); - animator.start(); - } - - private void animateOut(final View tab) { - ObjectAnimator animator = ObjectAnimator.ofInt( - tab, "TranslationX", 0, getScrollX() - tab.getRight()); - animator.setDuration(mAnimationDuration); - animator.addListener(new AnimatorListenerAdapter() { - @Override - public void onAnimationEnd(Animator animation) { - mContentView.removeView(tab); - } - }); - animator.setInterpolator(new AccelerateInterpolator()); - animator.start(); - } +// TODO: These animations are broken and don't work correctly, removing for now +// as animateOut is actually causing issues +// private void animateIn(View tab) { +// ObjectAnimator animator = ObjectAnimator.ofInt(tab, "TranslationX", 500, 0); +// animator.setDuration(mAnimationDuration); +// animator.start(); +// } +// +// private void animateOut(final View tab) { +// ObjectAnimator animator = ObjectAnimator.ofInt( +// tab, "TranslationX", 0, getScrollX() - tab.getRight()); +// animator.setDuration(mAnimationDuration); +// animator.addListener(new AnimatorListenerAdapter() { +// @Override +// public void onAnimationEnd(Animator animation) { +// mContentView.removeView(tab); +// } +// }); +// animator.setInterpolator(new AccelerateInterpolator()); +// animator.start(); +// } private void animateScroll(int newscroll) { ObjectAnimator animator = ObjectAnimator.ofInt(this, "scroll", getScrollX(), newscroll); diff --git a/src/com/android/browser/UrlHandler.java b/src/com/android/browser/UrlHandler.java index 6cdd071..cd0afeb 100644 --- a/src/com/android/browser/UrlHandler.java +++ b/src/com/android/browser/UrlHandler.java @@ -133,51 +133,8 @@ public class UrlHandler { } } - Intent intent; - // perform generic parsing of the URI to turn it into an Intent. - try { - intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME); - } catch (URISyntaxException ex) { - Log.w("Browser", "Bad URI " + url + ": " + ex.getMessage()); - return false; - } - - // check whether the intent can be resolved. If not, we will see - // whether we can download it from the Market. - if (mActivity.getPackageManager().resolveActivity(intent, 0) == null) { - String packagename = intent.getPackage(); - if (packagename != null) { - intent = new Intent(Intent.ACTION_VIEW, Uri - .parse("market://search?q=pname:" + packagename)); - intent.addCategory(Intent.CATEGORY_BROWSABLE); - mActivity.startActivity(intent); - // before leaving BrowserActivity, close the empty child tab. - // If a new tab is created through JavaScript open to load this - // url, we would like to close it as we will load this url in a - // different Activity. - mController.closeEmptyChildTab(); - return true; - } else { - return false; - } - } - - // sanitize the Intent, ensuring web pages can not bypass browser - // security (only access to BROWSABLE activities). - intent.addCategory(Intent.CATEGORY_BROWSABLE); - intent.setComponent(null); - try { - if (mActivity.startActivityIfNeeded(intent, -1)) { - // before leaving BrowserActivity, close the empty child tab. - // If a new tab is created through JavaScript open to load this - // url, we would like to close it as we will load this url in a - // different Activity. - mController.closeEmptyChildTab(); - return true; - } - } catch (ActivityNotFoundException ex) { - // ignore the error. If no application can handle the URL, - // eg about:blank, assume the browser can handle it. + if (startActivityForUrl(url)) { + return true; } if (mController.isMenuDown()) { @@ -185,9 +142,62 @@ public class UrlHandler { mActivity.closeOptionsMenu(); return true; } + return false; } + boolean startActivityForUrl(String url) + { + Intent intent; + // perform generic parsing of the URI to turn it into an Intent. + try { + intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME); + } catch (URISyntaxException ex) { + Log.w("Browser", "Bad URI " + url + ": " + ex.getMessage()); + return false; + } + + // check whether the intent can be resolved. If not, we will see + // whether we can download it from the Market. + if (mActivity.getPackageManager().resolveActivity(intent, 0) == null) { + String packagename = intent.getPackage(); + if (packagename != null) { + intent = new Intent(Intent.ACTION_VIEW, Uri + .parse("market://search?q=pname:" + packagename)); + intent.addCategory(Intent.CATEGORY_BROWSABLE); + mActivity.startActivity(intent); + // before leaving BrowserActivity, close the empty child tab. + // If a new tab is created through JavaScript open to load this + // url, we would like to close it as we will load this url in a + // different Activity. + mController.closeEmptyChildTab(); + return true; + } else { + return false; + } + } + + // sanitize the Intent, ensuring web pages can not bypass browser + // security (only access to BROWSABLE activities). + intent.addCategory(Intent.CATEGORY_BROWSABLE); + intent.setComponent(null); + try { + if (mActivity.startActivityIfNeeded(intent, -1)) { + // before leaving BrowserActivity, close the empty child tab. + // If a new tab is created through JavaScript open to load this + // url, we would like to close it as we will load this url in a + // different Activity. + mController.closeEmptyChildTab(); + return true; + } + } catch (ActivityNotFoundException ex) { + // ignore the error. If no application can handle the URL, + // eg about:blank, assume the browser can handle it. + } + + return false; + } + // Url for issuing the uber token. private final static Uri ISSUE_AUTH_TOKEN_URL = Uri.parse( "https://www.google.com/accounts/IssueAuthToken?service=gaia&Session=false"); @@ -373,7 +383,7 @@ public class UrlHandler { } protected void onPostExecute(String result) { - mController.loadUrl(mWebView, result); + startActivityForUrl(result); } } diff --git a/src/com/android/browser/WebStorageSizeManager.java b/src/com/android/browser/WebStorageSizeManager.java index 5f76f72..bd7f8e6 100644 --- a/src/com/android/browser/WebStorageSizeManager.java +++ b/src/com/android/browser/WebStorageSizeManager.java @@ -141,11 +141,11 @@ public class WebStorageSizeManager { } public long getFreeSpaceSizeBytes() { - return mFs.getAvailableBlocks() * mFs.getBlockSize(); + return (long)(mFs.getAvailableBlocks()) * mFs.getBlockSize(); } public long getTotalSizeBytes() { - return mFs.getBlockCount() * mFs.getBlockSize(); + return (long)(mFs.getBlockCount()) * mFs.getBlockSize(); } }; diff --git a/src/com/android/browser/addbookmark/FolderSpinner.java b/src/com/android/browser/addbookmark/FolderSpinner.java new file mode 100644 index 0000000..789c1f1 --- /dev/null +++ b/src/com/android/browser/addbookmark/FolderSpinner.java @@ -0,0 +1,45 @@ +/* + * 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. + */ + +package com.android.browser.addbookmark; + +import android.content.Context; +import android.view.View; +import android.util.AttributeSet; +import android.widget.Spinner; + +/** + * Special Spinner class which calls onItemSelected even if the item selected + * was already selected. In that case, it passes null for the View. + */ +public class FolderSpinner extends Spinner { + public FolderSpinner(Context context, AttributeSet attrs) { + super(context, attrs); + } + + @Override + public void setSelection(int position) { + int oldPosition = getSelectedItemPosition(); + super.setSelection(position); + if (oldPosition == position) { + // Normally this is not called because the item did not actually + // change, but in this case, we still want it to be called. + long id = getAdapter().getItemId(position); + getOnItemSelectedListener().onItemSelected(this, null, position, id); + } + } +} + diff --git a/src/com/android/browser/addbookmark/FolderSpinnerAdapter.java b/src/com/android/browser/addbookmark/FolderSpinnerAdapter.java new file mode 100644 index 0000000..5c17bfa --- /dev/null +++ b/src/com/android/browser/addbookmark/FolderSpinnerAdapter.java @@ -0,0 +1,135 @@ +/* + * 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. + */ + +package com.android.browser.addbookmark; + +import com.android.browser.R; + +import android.content.Context; +import android.content.res.Resources; +import android.database.DataSetObserver; +import android.graphics.drawable.Drawable; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Adapter; +import android.widget.SpinnerAdapter; +import android.widget.TextView; + +/** + * SpinnerAdapter used in the AddBookmarkPage to select where to save a + * bookmark/folder. + */ +public class FolderSpinnerAdapter implements SpinnerAdapter { + private boolean mIncludeHomeScreen; + + public static final int HOME_SCREEN = 0; + public static final int ROOT_FOLDER = 1; + public static final int OTHER_FOLDER = 2; + + public FolderSpinnerAdapter(boolean includeHomeScreen) { + mIncludeHomeScreen = includeHomeScreen; + } + + @Override + public View getDropDownView(int position, View convertView, ViewGroup parent) { + int labelResource; + int drawableResource; + if (!mIncludeHomeScreen) { + position++; + } + switch (position) { + case HOME_SCREEN: + labelResource = R.string.add_to_homescreen_menu_option; + drawableResource = com.android.internal.R.drawable.ic_menu_home; + break; + case ROOT_FOLDER: + labelResource = R.string.add_to_bookmarks_menu_option; + drawableResource = R.drawable.ic_menu_bookmarks; + break; + case OTHER_FOLDER: + labelResource = R.string.add_to_other_folder_menu_option; + drawableResource = com.android.internal.R.drawable.ic_menu_archive; + break; + default: + labelResource = 0; + drawableResource = 0; + // assert + break; + } + Context context = parent.getContext(); + LayoutInflater factory = LayoutInflater.from(context); + TextView textView = (TextView) factory.inflate(R.layout.add_to_option, null); + textView.setText(labelResource); + Drawable drawable = context.getResources().getDrawable(drawableResource); + textView.setCompoundDrawablesWithIntrinsicBounds(drawable, null, + null, null); + return textView; + } + + @Override + public void registerDataSetObserver(DataSetObserver observer) { + } + + @Override + public void unregisterDataSetObserver(DataSetObserver observer) { + } + + @Override + public int getCount() { + return mIncludeHomeScreen ? 3 : 2; + } + + @Override + public Object getItem(int position) { + return null; + } + + @Override + public long getItemId(int position) { + long id = position; + if (!mIncludeHomeScreen) { + id++; + } + return id; + } + + @Override + public boolean hasStableIds() { + return true; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + return getDropDownView(position, convertView, parent); + } + + @Override + public int getItemViewType(int position) { + // Never want to recycle views + return Adapter.IGNORE_ITEM_VIEW_TYPE; + } + + @Override + public int getViewTypeCount() { + return 1; + } + + @Override + public boolean isEmpty() { + return false; + } +} diff --git a/src/com/android/browser/provider/BrowserProvider2.java b/src/com/android/browser/provider/BrowserProvider2.java index 358ee2d..919a135 100644 --- a/src/com/android/browser/provider/BrowserProvider2.java +++ b/src/com/android/browser/provider/BrowserProvider2.java @@ -65,7 +65,8 @@ import java.util.HashMap; public class BrowserProvider2 extends SQLiteContentProvider { static final String LEGACY_AUTHORITY = "browser"; - static final Uri LEGACY_AUTHORITY_URI = new Uri.Builder().authority(LEGACY_AUTHORITY).build(); + static final Uri LEGACY_AUTHORITY_URI = new Uri.Builder() + .authority(LEGACY_AUTHORITY).scheme("content").build(); static final String TABLE_BOOKMARKS = "bookmarks"; static final String TABLE_HISTORY = "history"; @@ -593,6 +594,33 @@ public class BrowserProvider2 extends SQLiteContentProvider { return null; } + boolean isNullAccount(String account) { + if (account == null) return true; + account = account.trim(); + return account.length() == 0 || account.equals("null"); + } + + Object[] getSelectionWithAccounts(Uri uri, String selection, String[] selectionArgs) { + // Look for account info + String accountType = uri.getQueryParameter(Bookmarks.PARAM_ACCOUNT_TYPE); + String accountName = uri.getQueryParameter(Bookmarks.PARAM_ACCOUNT_NAME); + boolean hasAccounts = false; + if (accountType != null && accountName != null) { + if (!isNullAccount(accountType) && !isNullAccount(accountName)) { + selection = DatabaseUtils.concatenateWhere(selection, + Bookmarks.ACCOUNT_TYPE + "=? AND " + Bookmarks.ACCOUNT_NAME + "=? "); + selectionArgs = DatabaseUtils.appendSelectionArgs(selectionArgs, + new String[] { accountType, accountName }); + hasAccounts = true; + } else { + selection = DatabaseUtils.concatenateWhere(selection, + Bookmarks.ACCOUNT_NAME + " IS NULL AND " + + Bookmarks.ACCOUNT_TYPE + " IS NULL"); + } + } + return new Object[] { selection, selectionArgs, hasAccounts }; + } + @Override public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { @@ -632,29 +660,14 @@ public class BrowserProvider2 extends SQLiteContentProvider { new String[] { Long.toString(ContentUris.parseId(uri)) }); } - // Look for account info - String accountType = uri.getQueryParameter(Bookmarks.PARAM_ACCOUNT_TYPE); - String accountName = uri.getQueryParameter(Bookmarks.PARAM_ACCOUNT_NAME); - // Only add it if it isn't already in the selection - if (selection == null || - (!selection.contains(Bookmarks.ACCOUNT_NAME) - && !selection.contains(Bookmarks.ACCOUNT_TYPE))) { - if (!TextUtils.isEmpty(accountType) && !TextUtils.isEmpty(accountName)) { - selection = DatabaseUtils.concatenateWhere(selection, - Bookmarks.ACCOUNT_TYPE + "=? AND " + Bookmarks.ACCOUNT_NAME + "=? "); - selectionArgs = DatabaseUtils.appendSelectionArgs(selectionArgs, - new String[] { accountType, accountName }); - } else { - selection = DatabaseUtils.concatenateWhere(selection, - Bookmarks.ACCOUNT_TYPE + " IS NULL AND " + - Bookmarks.ACCOUNT_NAME + " IS NULL "); - } - } + Object[] withAccount = getSelectionWithAccounts(uri, selection, selectionArgs); + selection = (String) withAccount[0]; + selectionArgs = (String[]) withAccount[1]; + boolean hasAccounts = (Boolean) withAccount[2]; // Set a default sort order if one isn't specified if (TextUtils.isEmpty(sortOrder)) { - if (!TextUtils.isEmpty(accountType) - && !TextUtils.isEmpty(accountName)) { + if (hasAccounts) { sortOrder = DEFAULT_BOOKMARKS_SORT_ORDER_SYNC; } else { sortOrder = DEFAULT_BOOKMARKS_SORT_ORDER; @@ -671,7 +684,7 @@ public class BrowserProvider2 extends SQLiteContentProvider { boolean useAccount = false; String accountType = uri.getQueryParameter(Bookmarks.PARAM_ACCOUNT_TYPE); String accountName = uri.getQueryParameter(Bookmarks.PARAM_ACCOUNT_NAME); - if (!TextUtils.isEmpty(accountType) && !TextUtils.isEmpty(accountName)) { + if (!isNullAccount(accountType) && !isNullAccount(accountName)) { useAccount = true; } @@ -805,6 +818,10 @@ public class BrowserProvider2 extends SQLiteContentProvider { && projection == null) { projection = Browser.HISTORY_PROJECTION; } + if (match == LEGACY) { + uri = BookmarkUtils.addAccountInfo(getContext(), + uri.buildUpon()).build(); + } String[] args = createCombinedQuery(uri, projection, qb); if (selectionArgs == null) { selectionArgs = args; @@ -876,25 +893,22 @@ public class BrowserProvider2 extends SQLiteContentProvider { private String[] createCombinedQuery( Uri uri, String[] projection, SQLiteQueryBuilder qb) { String[] args = null; - // Look for account info - String accountType = uri.getQueryParameter(Bookmarks.PARAM_ACCOUNT_TYPE); - String accountName = uri.getQueryParameter(Bookmarks.PARAM_ACCOUNT_NAME); StringBuilder whereBuilder = new StringBuilder(128); whereBuilder.append(Bookmarks.IS_DELETED); - whereBuilder.append(" = 0 AND "); - if (!TextUtils.isEmpty(accountName) && !TextUtils.isEmpty(accountType)) { - whereBuilder.append(Bookmarks.ACCOUNT_NAME); - whereBuilder.append("=? AND "); - whereBuilder.append(Bookmarks.ACCOUNT_TYPE); - whereBuilder.append("=?"); - // We use this where twice - args = new String[] { accountName, accountType, - accountName, accountType}; - } else { - whereBuilder.append(Bookmarks.ACCOUNT_NAME); - whereBuilder.append(" IS NULL AND "); - whereBuilder.append(Bookmarks.ACCOUNT_TYPE); - whereBuilder.append(" IS NULL"); + whereBuilder.append(" = 0"); + // Look for account info + Object[] withAccount = getSelectionWithAccounts(uri, null, null); + String selection = (String) withAccount[0]; + String[] selectionArgs = (String[]) withAccount[1]; + if (selection != null) { + whereBuilder.append(" AND " + selection); + if (selectionArgs != null) { + // We use the selection twice, hence we need to duplicate the args + args = new String[selectionArgs.length * 2]; + System.arraycopy(selectionArgs, 0, args, 0, selectionArgs.length); + System.arraycopy(selectionArgs, 0, args, selectionArgs.length, + selectionArgs.length); + } } String where = whereBuilder.toString(); // Build the bookmark subquery for history union subquery @@ -921,31 +935,18 @@ public class BrowserProvider2 extends SQLiteContentProvider { return args; } - int deleteBookmarks(Uri uri, String selection, String[] selectionArgs, + int deleteBookmarks(String selection, String[] selectionArgs, boolean callerIsSyncAdapter) { //TODO cascade deletes down from folders final SQLiteDatabase db = mOpenHelper.getWritableDatabase(); - // Look for account info - String accountType = uri.getQueryParameter(Bookmarks.PARAM_ACCOUNT_TYPE); - String accountName = uri.getQueryParameter(Bookmarks.PARAM_ACCOUNT_NAME); - if (!TextUtils.isEmpty(accountType) && !TextUtils.isEmpty(accountName)) { - selection = DatabaseUtils.concatenateWhere(selection, - Bookmarks.ACCOUNT_TYPE + "=? AND " + Bookmarks.ACCOUNT_NAME + "=? "); - selectionArgs = DatabaseUtils.appendSelectionArgs(selectionArgs, - new String[] { accountType, accountName }); - } else { - selection = DatabaseUtils.concatenateWhere(selection, - Bookmarks.ACCOUNT_TYPE + " IS NULL AND " + - Bookmarks.ACCOUNT_NAME + " IS NULL "); - } if (callerIsSyncAdapter) { return db.delete(TABLE_BOOKMARKS, selection, selectionArgs); } ContentValues values = new ContentValues(); values.put(Bookmarks.DATE_MODIFIED, System.currentTimeMillis()); values.put(Bookmarks.IS_DELETED, 1); - return updateInTransaction(Bookmarks.CONTENT_URI, values, - selection, selectionArgs, callerIsSyncAdapter); + return updateBookmarksInTransaction(values, selection, selectionArgs, + callerIsSyncAdapter); } @Override @@ -962,7 +963,11 @@ public class BrowserProvider2 extends SQLiteContentProvider { // fall through } case BOOKMARKS: { - int deleted = deleteBookmarks(uri, selection, selectionArgs, callerIsSyncAdapter); + // Look for account info + Object[] withAccount = getSelectionWithAccounts(uri, selection, selectionArgs); + selection = (String) withAccount[0]; + selectionArgs = (String[]) withAccount[1]; + int deleted = deleteBookmarks(selection, selectionArgs, callerIsSyncAdapter); pruneImages(); return deleted; } @@ -1027,7 +1032,7 @@ public class BrowserProvider2 extends SQLiteContentProvider { boolean isBookmark = c.getInt(1) != 0; String url = c.getString(2); if (isBookmark) { - deleted += deleteBookmarks(uri, Bookmarks._ID + "=?", + deleted += deleteBookmarks(Bookmarks._ID + "=?", new String[] { Long.toString(id) }, callerIsSyncAdapter); db.delete(TABLE_HISTORY, History.URL + "=?", @@ -1041,7 +1046,7 @@ public class BrowserProvider2 extends SQLiteContentProvider { return deleted; } } - throw new UnsupportedOperationException("Unknown update URI " + uri); + throw new UnsupportedOperationException("Unknown delete URI " + uri); } long queryDefaultFolderId(String accountName, String accountType) { @@ -1287,6 +1292,9 @@ public class BrowserProvider2 extends SQLiteContentProvider { // fall through } case BOOKMARKS: { + Object[] withAccount = getSelectionWithAccounts(uri, selection, selectionArgs); + selection = (String) withAccount[0]; + selectionArgs = (String[]) withAccount[1]; int updated = updateBookmarksInTransaction(values, selection, selectionArgs, callerIsSyncAdapter); pruneImages(); @@ -1347,9 +1355,9 @@ public class BrowserProvider2 extends SQLiteContentProvider { String[] selectionArgs, boolean callerIsSyncAdapter) { int count = 0; final SQLiteDatabase db = mOpenHelper.getWritableDatabase(); - Cursor cursor = query(Bookmarks.CONTENT_URI, + Cursor cursor = db.query(TABLE_BOOKMARKS, new String[] { Bookmarks._ID, Bookmarks.VERSION, Bookmarks.URL }, - selection, selectionArgs, null); + selection, selectionArgs, null, null, null); try { String[] args = new String[1]; // Mark the bookmark dirty if the caller isn't a sync adapter diff --git a/src/com/android/browser/widget/BookmarkListWidgetService.java b/src/com/android/browser/widget/BookmarkListWidgetService.java index 39751e6..4d72d41 100644 --- a/src/com/android/browser/widget/BookmarkListWidgetService.java +++ b/src/com/android/browser/widget/BookmarkListWidgetService.java @@ -85,7 +85,7 @@ public class BookmarkListWidgetService extends RemoteViewsService { mUiHandler = new Handler(); mBookmarksObserver = new BookmarksObserver(mUiHandler); getContentResolver().registerContentObserver( - BrowserContract.AUTHORITY_URI, true, mBookmarksObserver); + BrowserContract.Bookmarks.CONTENT_URI, true, mBookmarksObserver); } @Override @@ -337,12 +337,10 @@ public class BookmarkListWidgetService extends RemoteViewsService { uri = BrowserContract.Bookmarks.CONTENT_URI; where = Bookmarks.IS_FOLDER + " == 0"; } - if (!TextUtils.isEmpty(mAccountType) && !TextUtils.isEmpty(mAccountName)) { - uri = uri.buildUpon() - .appendQueryParameter(Bookmarks.PARAM_ACCOUNT_TYPE, mAccountType) - .appendQueryParameter(Bookmarks.PARAM_ACCOUNT_NAME, mAccountName) - .build(); - } + uri = uri.buildUpon() + .appendQueryParameter(Bookmarks.PARAM_ACCOUNT_TYPE, mAccountType) + .appendQueryParameter(Bookmarks.PARAM_ACCOUNT_NAME, mAccountName) + .build(); Cursor c = null; try { c = mContext.getContentResolver().query(uri, PROJECTION, |