summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/SearchDialog.java28
-rw-r--r--core/java/android/provider/Settings.java6
-rw-r--r--core/java/android/webkit/GearsPermissionsManager.java42
3 files changed, 55 insertions, 21 deletions
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java
index 13eb034..1283b8f 100644
--- a/core/java/android/app/SearchDialog.java
+++ b/core/java/android/app/SearchDialog.java
@@ -337,16 +337,7 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
mActivityContext = mSearchable.getActivityContext(getContext());
// show the dialog. this will call onStart().
- if (!isShowing()) {
- // First make sure the keyboard is showing (if needed), so that we get the right height
- // for the dropdown to respect the IME.
- if (getContext().getResources().getConfiguration().hardKeyboardHidden ==
- Configuration.HARDKEYBOARDHIDDEN_YES) {
- InputMethodManager inputManager = (InputMethodManager)
- getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
- inputManager.showSoftInputUnchecked(0, null);
- }
-
+ if (!isShowing()) {
// The Dialog uses a ContextThemeWrapper for the context; use this to change the
// theme out from underneath us, between the global search theme and the in-app
// search theme. They are identical except that the global search theme does not
@@ -1535,7 +1526,22 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
@Override
public void performCompletion() {
}
-
+
+ /**
+ * We override this method to be sure and show the soft keyboard if appropriate when
+ * the TextView has focus.
+ */
+ @Override
+ public void onWindowFocusChanged(boolean hasWindowFocus) {
+ super.onWindowFocusChanged(hasWindowFocus);
+
+ if (hasWindowFocus) {
+ InputMethodManager inputManager = (InputMethodManager)
+ getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
+ inputManager.showSoftInput(this, 0);
+ }
+ }
+
/**
* We override this method so that we can allow a threshold of zero, which ACTV does not.
*/
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 6ed1ac8..bf6003e 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -2692,6 +2692,12 @@ public final class Settings {
public static final String GMAIL_NUM_RETRY_UPHILL_OP = "gmail_discard_error_uphill_op";
/**
+ * Controls if the protocol buffer version of the protocol will use a multipart request for
+ * attachment uploads. Value must be an integer where non-zero means true. Defaults to 0.
+ */
+ public static final String GMAIL_USE_MULTIPART_PROTOBUF = "gmail_use_multipart_protobuf";
+
+ /**
* the transcoder URL for mobile devices.
*/
public static final String TRANSCODER_URL = "mobile_transcoder_url";
diff --git a/core/java/android/webkit/GearsPermissionsManager.java b/core/java/android/webkit/GearsPermissionsManager.java
index 876f3d7..e70e449 100644
--- a/core/java/android/webkit/GearsPermissionsManager.java
+++ b/core/java/android/webkit/GearsPermissionsManager.java
@@ -55,6 +55,8 @@ class GearsPermissionsManager {
// The Gears permissions db schema version table.
private final static String GEARS_SCHEMA_VERSION_TABLE_NAME =
"VersionInfo";
+ // The Gears permission value that denotes "allow access to location".
+ private static final int GEARS_ALLOW_LOCATION_ACCESS = 1;
// The shared pref name.
private static final String LAST_KNOWN_LOCATION_SETTING =
"lastKnownLocationSystemSetting";
@@ -119,8 +121,14 @@ class GearsPermissionsManager {
}
private void setGearsPermissionForGoogleDomains(int systemPermission) {
- // Transform the system permission into a Gears permission
- int gearsPermission = (systemPermission == 1 ? 1 : 2);
+ // Transform the system permission into a boolean flag. When this
+ // flag is true, it means the origins in gGearsWhiteList are added
+ // to the Gears location permission table with permission 1 (allowed).
+ // When the flag is false, the origins in gGearsWhiteList are removed
+ // from the Gears location permission table. Next time the user
+ // navigates to one of these origins, she will see the normal Gears
+ // permission prompt.
+ boolean addToGearsLocationTable = (systemPermission == 1 ? true : false);
// Build the path to the Gears library.
File file = new File(mGearsPath).getParentFile();
@@ -132,6 +140,13 @@ class GearsPermissionsManager {
+ GEARS_DATABASE_DIR + File.separator + GEARS_DATABASE_FILE);
// Remember whether or not we need to create the LocationAccess table.
boolean needToCreateTables = !file.exists();
+ // If the database file does not yet exist and the system location
+ // setting says that the Gears origins need to be removed from the
+ // location permission table, it means that we don't actually need
+ // to do anything at all.
+ if (needToCreateTables && !addToGearsLocationTable) {
+ return;
+ }
// Try opening the Gears database.
SQLiteDatabase permissions;
try {
@@ -177,14 +192,21 @@ class GearsPermissionsManager {
schema);
}
- ContentValues permissionValues = new ContentValues();
-
- for (String url : sGearsWhiteList) {
- permissionValues.put("Name", url);
- permissionValues.put("Value", gearsPermission);
- permissions.replace(GEARS_LOCATION_ACCESS_TABLE_NAME, null,
- permissionValues);
- permissionValues.clear();
+ if (addToGearsLocationTable) {
+ ContentValues permissionValues = new ContentValues();
+
+ for (String url : sGearsWhiteList) {
+ permissionValues.put("Name", url);
+ permissionValues.put("Value", GEARS_ALLOW_LOCATION_ACCESS);
+ permissions.replace(GEARS_LOCATION_ACCESS_TABLE_NAME, null,
+ permissionValues);
+ permissionValues.clear();
+ }
+ } else {
+ for (String url : sGearsWhiteList) {
+ permissions.delete(GEARS_LOCATION_ACCESS_TABLE_NAME, "Name=?",
+ new String[] { url });
+ }
}
// Commit the transaction.
permissions.setTransactionSuccessful();