summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/ActivityManager.java1
-rw-r--r--core/java/android/content/SyncManager.java4
-rw-r--r--core/java/android/database/sqlite/SQLiteCursor.java12
-rw-r--r--core/java/android/os/Environment.java2
-rw-r--r--core/java/android/provider/MediaStore.java4
-rw-r--r--core/java/android/provider/Settings.java1125
-rw-r--r--core/java/android/util/EventLog.java2
-rw-r--r--core/java/android/util/EventLogTags.java4
-rw-r--r--core/java/android/util/Log.java3
-rw-r--r--core/java/android/webkit/CallbackProxy.java29
-rw-r--r--core/java/android/webkit/DateSorter.java28
-rw-r--r--core/java/android/webkit/WebStorage.java4
-rw-r--r--core/java/android/webkit/WebView.java13
-rw-r--r--core/java/android/webkit/WebViewClient.java2
-rw-r--r--core/java/com/google/android/util/GoogleWebContentHelper.java281
15 files changed, 202 insertions, 1312 deletions
diff --git a/core/java/android/app/ActivityManager.java b/core/java/android/app/ActivityManager.java
index 930ab65..932ad53 100644
--- a/core/java/android/app/ActivityManager.java
+++ b/core/java/android/app/ActivityManager.java
@@ -622,7 +622,6 @@ public class ActivityManager {
/**
* The stack trace where the error originated. May be null.
- * @pending
*/
public String stackTrace;
diff --git a/core/java/android/content/SyncManager.java b/core/java/android/content/SyncManager.java
index d436365..a9c61dc 100644
--- a/core/java/android/content/SyncManager.java
+++ b/core/java/android/content/SyncManager.java
@@ -859,8 +859,8 @@ class SyncManager implements OnAccountsUpdateListener {
}
// Cap the delay
- long maxSyncRetryTimeInSeconds = Settings.Gservices.getLong(mContext.getContentResolver(),
- Settings.Gservices.SYNC_MAX_RETRY_DELAY_IN_SECONDS,
+ long maxSyncRetryTimeInSeconds = Settings.Secure.getLong(mContext.getContentResolver(),
+ Settings.Secure.SYNC_MAX_RETRY_DELAY_IN_SECONDS,
DEFAULT_MAX_SYNC_RETRY_TIME_IN_SECONDS);
if (newDelayInMs > maxSyncRetryTimeInSeconds * 1000) {
newDelayInMs = maxSyncRetryTimeInSeconds * 1000;
diff --git a/core/java/android/database/sqlite/SQLiteCursor.java b/core/java/android/database/sqlite/SQLiteCursor.java
index 70b9b83..b178d4f 100644
--- a/core/java/android/database/sqlite/SQLiteCursor.java
+++ b/core/java/android/database/sqlite/SQLiteCursor.java
@@ -582,21 +582,23 @@ public class SQLiteCursor extends AbstractWindowedCursor {
@Override
protected void finalize() {
try {
+ // if the cursor hasn't been closed yet, close it first
if (mWindow != null) {
close();
- String message = "Finalizing cursor " + this + " on " + mEditTable
- + " that has not been deactivated or closed";
+ Log.e(TAG, "Finalizing cursor that has not been deactivated or closed."
+ + " database = " + mDatabase.getPath() + ", table = " + mEditTable
+ + ", query = " + mQuery.mSql);
if (SQLiteDebug.DEBUG_ACTIVE_CURSOR_FINALIZATION) {
- Log.d(TAG, message + "\nThis cursor was created in:");
+ Log.d(TAG, "This cursor was created in:");
for (StackTraceElement ste : mStackTraceElements) {
Log.d(TAG, " " + ste);
}
}
SQLiteDebug.notifyActiveCursorFinalized();
- throw new IllegalStateException(message);
} else {
if (Config.LOGV) {
- Log.v(TAG, "Finalizing cursor " + this + " on " + mEditTable);
+ Log.v(TAG, "Finalizing cursor on database = " + mDatabase.getPath() +
+ ", table = " + mEditTable + ", query = " + mQuery.mSql);
}
}
} finally {
diff --git a/core/java/android/os/Environment.java b/core/java/android/os/Environment.java
index eed2af7..9491bd4 100644
--- a/core/java/android/os/Environment.java
+++ b/core/java/android/os/Environment.java
@@ -181,7 +181,7 @@ public class Environment {
.getService("mount"));
}
return mMntSvc.getVolumeState(getExternalStorageDirectory().toString());
- } catch (android.os.RemoteException rex) {
+ } catch (Exception rex) {
return Environment.MEDIA_REMOVED;
}
}
diff --git a/core/java/android/provider/MediaStore.java b/core/java/android/provider/MediaStore.java
index 6d1fef6..1b938ee 100644
--- a/core/java/android/provider/MediaStore.java
+++ b/core/java/android/provider/MediaStore.java
@@ -96,14 +96,12 @@ public final class MediaStore {
/**
* The name of an Intent-extra used to control the UI of a ViewImage.
* This is a boolean property that overrides the activity's default fullscreen state.
- * @hide
*/
public static final String EXTRA_FULL_SCREEN = "android.intent.extra.fullScreen";
/**
* The name of an Intent-extra used to control the UI of a ViewImage.
* This is a boolean property that specifies whether or not to show action icons.
- * @hide
*/
public static final String EXTRA_SHOW_ACTION_ICONS = "android.intent.extra.showActionIcons";
@@ -162,13 +160,11 @@ public final class MediaStore {
/**
* Specify the maximum allowed size.
- * @hide
*/
public final static String EXTRA_SIZE_LIMIT = "android.intent.extra.sizeLimit";
/**
* Specify the maximum allowed recording duration in seconds.
- * @hide
*/
public final static String EXTRA_DURATION_LIMIT = "android.intent.extra.durationLimit";
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 4b5cff6..e19810b 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -2579,914 +2579,112 @@ public final class Settings {
public static final String REBOOT_WINDOW = "reboot_window";
/**
+ * Threshold values for the duration and level of a discharge cycle, under
+ * which we log discharge cycle info.
* @hide
*/
- public static final String[] SETTINGS_TO_BACKUP = {
- ADB_ENABLED,
- ALLOW_MOCK_LOCATION,
- PARENTAL_CONTROL_ENABLED,
- PARENTAL_CONTROL_REDIRECT_URL,
- USB_MASS_STORAGE_ENABLED,
- ACCESSIBILITY_ENABLED,
- ENABLED_ACCESSIBILITY_SERVICES,
- TTS_USE_DEFAULTS,
- TTS_DEFAULT_RATE,
- TTS_DEFAULT_PITCH,
- TTS_DEFAULT_SYNTH,
- TTS_DEFAULT_LANG,
- TTS_DEFAULT_COUNTRY,
- WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
- WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
- WIFI_NUM_ALLOWED_CHANNELS,
- WIFI_NUM_OPEN_NETWORKS_KEPT,
- };
+ public static final String BATTERY_DISCHARGE_DURATION_THRESHOLD =
+ "battery_discharge_duration_threshold";
+ /** @hide */
+ public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
/**
- * Helper method for determining if a location provider is enabled.
- * @param cr the content resolver to use
- * @param provider the location provider to query
- * @return true if the provider is enabled
- *
+ * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR intents
+ * on application crashes and ANRs. If this is disabled, the crash/ANR dialog
+ * will never display the "Report" button.
+ * Type: int ( 0 = disallow, 1 = allow )
* @hide
*/
- public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
- String allowedProviders = Settings.Secure.getString(cr, LOCATION_PROVIDERS_ALLOWED);
- if (allowedProviders != null) {
- return (allowedProviders.equals(provider) ||
- allowedProviders.contains("," + provider + ",") ||
- allowedProviders.startsWith(provider + ",") ||
- allowedProviders.endsWith("," + provider));
- }
- return false;
- }
+ public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
/**
- * Thread-safe method for enabling or disabling a single location provider.
- * @param cr the content resolver to use
- * @param provider the location provider to enable or disable
- * @param enabled true if the provider should be enabled
- *
+ * Nonzero causes Log.wtf() to crash.
* @hide
*/
- public static final void setLocationProviderEnabled(ContentResolver cr,
- String provider, boolean enabled) {
- // to ensure thread safety, we write the provider name with a '+' or '-'
- // and let the SettingsProvider handle it rather than reading and modifying
- // the list of enabled providers.
- if (enabled) {
- provider = "+" + provider;
- } else {
- provider = "-" + provider;
- }
- putString(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider);
- }
- }
-
- /**
- * Gservices settings, containing the network names for Google's
- * various services. This table holds simple name/addr pairs.
- * Addresses can be accessed through the getString() method.
- *
- * TODO: This should move to partner/google/... somewhere.
- *
- * @hide
- */
- public static final class Gservices extends NameValueTable {
- public static final String SYS_PROP_SETTING_VERSION = "sys.settings_gservices_version";
-
- /**
- * Intent action broadcast when the Gservices table is updated by the server.
- * This is broadcast once after settings change (so many values may have been updated).
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String CHANGED_ACTION =
- "com.google.gservices.intent.action.GSERVICES_CHANGED";
-
- /**
- * Intent action to override Gservices for testing. (Requires WRITE_GSERVICES permission.)
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String OVERRIDE_ACTION =
- "com.google.gservices.intent.action.GSERVICES_OVERRIDE";
-
- /**
- * Intent action to set Gservices with new values. (Requires WRITE_GSERVICES permission.)
- */
- @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
- public static final String UPDATE_ACTION =
- "com.google.gservices.intent.action.GSERVICES_UPDATE";
-
- private static volatile NameValueCache mNameValueCache = null;
- private static final Object mNameValueCacheLock = new Object();
-
- /**
- * Look up a name in the database.
- * @param resolver to access the database with
- * @param name to look up in the table
- * @return the corresponding value, or null if not present
- */
- public static String getString(ContentResolver resolver, String name) {
- synchronized (mNameValueCacheLock) {
- if (mNameValueCache == null) {
- mNameValueCache = new NameValueCache(SYS_PROP_SETTING_VERSION, CONTENT_URI);
- }
- return mNameValueCache.getString(resolver, name);
- }
- }
-
- /**
- * Store a name/value pair into the database.
- * @param resolver to access the database with
- * @param name to store
- * @param value to associate with the name
- * @return true if the value was set, false on database errors
- */
- public static boolean putString(ContentResolver resolver,
- String name, String value) {
- return putString(resolver, CONTENT_URI, name, value);
- }
-
- /**
- * Look up the value for name in the database, convert it to an int using Integer.parseInt
- * and return it. If it is null or if a NumberFormatException is caught during the
- * conversion then return defValue.
- */
- public static int getInt(ContentResolver resolver, String name, int defValue) {
- String valString = getString(resolver, name);
- int value;
- try {
- value = valString != null ? Integer.parseInt(valString) : defValue;
- } catch (NumberFormatException e) {
- value = defValue;
- }
- return value;
- }
-
- /**
- * Look up the value for name in the database, convert it to a long using Long.parseLong
- * and return it. If it is null or if a NumberFormatException is caught during the
- * conversion then return defValue.
- */
- public static long getLong(ContentResolver resolver, String name, long defValue) {
- String valString = getString(resolver, name);
- long value;
- try {
- value = valString != null ? Long.parseLong(valString) : defValue;
- } catch (NumberFormatException e) {
- value = defValue;
- }
- return value;
- }
-
- /**
- * Construct the content URI for a particular name/value pair,
- * useful for monitoring changes with a ContentObserver.
- * @param name to look up in the table
- * @return the corresponding content URI, or null if not present
- */
- public static Uri getUriFor(String name) {
- return getUriFor(CONTENT_URI, name);
- }
-
- /**
- * The content:// style URL for this table
- */
- public static final Uri CONTENT_URI =
- Uri.parse("content://" + AUTHORITY + "/gservices");
-
- /**
- * MMS - URL to use for HTTP "x-wap-profile" header
- */
- public static final String MMS_X_WAP_PROFILE_URL
- = "mms_x_wap_profile_url";
-
- /**
- * YouTube - the flag to indicate whether to use proxy
- */
- public static final String YOUTUBE_USE_PROXY
- = "youtube_use_proxy";
-
- /**
- * MMS - maximum message size in bytes for a MMS message.
- */
- public static final String MMS_MAXIMUM_MESSAGE_SIZE
- = "mms_maximum_message_size";
-
- /**
- * Event tags from the kernel event log to upload during checkin.
- */
- public static final String CHECKIN_EVENTS = "checkin_events";
-
- /**
- * Comma-separated list of service names to dump and upload during checkin.
- */
- public static final String CHECKIN_DUMPSYS_LIST = "checkin_dumpsys_list";
-
- /**
- * Comma-separated list of packages to specify for each service that is
- * dumped (currently only meaningful for user activity).
- */
- public static final String CHECKIN_PACKAGE_LIST = "checkin_package_list";
-
- /**
- * The interval (in seconds) between periodic checkin attempts.
- */
- public static final String CHECKIN_INTERVAL = "checkin_interval";
-
- /**
- * The interval (in seconds) between event log aggregation runs.
- */
- public static final String AGGREGATION_INTERVAL_SECONDS = "aggregation_interval_seconds";
-
- /**
- * Boolean indicating if the market app should force market only checkins on
- * install/uninstall. Any non-0 value is considered true.
- */
- public static final String MARKET_FORCE_CHECKIN = "market_force_checkin";
-
- /**
- * The minimum version of the server that is required in order for the device to accept
- * the server's recommendations about the initial sync settings to use. When this is unset,
- * blank or can't be interpreted as an integer then we will not ask the server for a
- * recommendation.
- */
- public static final String GMAIL_CONFIG_INFO_MIN_SERVER_VERSION =
- "gmail_config_info_min_server_version";
-
- /**
- * Controls whether Gmail offers a preview button for images.
- */
- public static final String GMAIL_DISALLOW_IMAGE_PREVIEWS = "gmail_disallow_image_previews";
-
- /**
- * The maximal size in bytes allowed for attachments when composing messages in Gmail
- */
- public static final String GMAIL_MAX_ATTACHMENT_SIZE = "gmail_max_attachment_size_bytes";
-
- /**
- * The timeout in milliseconds that Gmail uses when opening a connection and reading
- * from it. A missing value or a value of -1 instructs Gmail to use the defaults provided
- * by GoogleHttpClient.
- */
- public static final String GMAIL_TIMEOUT_MS = "gmail_timeout_ms";
-
- /**
- * Controls whether Gmail will request an expedited sync when a message is sent. Value must
- * be an integer where non-zero means true. Defaults to 1.
- */
- public static final String GMAIL_SEND_IMMEDIATELY = "gmail_send_immediately";
-
- /**
- * Controls whether gmail buffers server responses. Possible values are "memory", for a
- * memory-based buffer, or "file", for a temp-file-based buffer. All other values
- * (including not set) disable buffering.
- */
- public static final String GMAIL_BUFFER_SERVER_RESPONSE = "gmail_buffer_server_response";
-
- /**
- * The maximum size in bytes allowed for the provider to gzip a protocol buffer uploaded to
- * the server.
- */
- public static final String GMAIL_MAX_GZIP_SIZE = "gmail_max_gzip_size_bytes";
-
- /**
- * Controls whether Gmail will discard uphill operations that repeatedly fail. Value must be
- * an integer where non-zero means true. Defaults to 1. This flag controls Donut devices.
- */
- public static final String GMAIL_DISCARD_ERROR_UPHILL_OP = "gmail_discard_error_uphill_op";
-
- /**
- * Controls whether Gmail will discard uphill operations that repeatedly fail. Value must be
- * an integer where non-zero means true. Defaults to 1. This flag controls Eclair and
- * future devices.
- */
- public static final String GMAIL_DISCARD_ERROR_UPHILL_OP_NEW =
- "gmail_discard_error_uphill_op_new";
-
- /**
- * Controls how many attempts Gmail will try to upload an uphill operations before it
- * abandons the operation. Defaults to 20.
- */
- public static final String GMAIL_NUM_RETRY_UPHILL_OP = "gmail_num_retry_uphill_op";
-
- /**
- * How much time in seconds Gmail will try to upload an uphill operations before it
- * abandons the operation. Defaults to 36400 (one day).
- */
- public static final String GMAIL_WAIT_TIME_RETRY_UPHILL_OP =
- "gmail_wait_time_retry_uphill_op";
-
- /**
- * Controls if Gmail should delay sending operations that have previously failed.
- */
- public static final String GMAIL_DELAY_BAD_OP = "gmail_delay_bad_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";
-
- /**
- * URL that points to the privacy terms of the Google Talk service.
- */
- public static final String GTALK_TERMS_OF_SERVICE_URL = "gtalk_terms_of_service_url";
-
- /**
- * Hostname of the GTalk server.
- */
- public static final String GTALK_SERVICE_HOSTNAME = "gtalk_hostname";
-
- /**
- * Secure port of the GTalk server.
- */
- public static final String GTALK_SERVICE_SECURE_PORT = "gtalk_secure_port";
-
- /**
- * The server configurable RMQ acking interval
- */
- public static final String GTALK_SERVICE_RMQ_ACK_INTERVAL = "gtalk_rmq_ack_interval";
-
- /**
- * The minimum reconnect delay for short network outages or when the network is suspended
- * due to phone use.
- */
- public static final String GTALK_SERVICE_MIN_RECONNECT_DELAY_SHORT =
- "gtalk_min_reconnect_delay_short";
-
- /**
- * The reconnect variant range for short network outages or when the network is suspended
- * due to phone use. A random number between 0 and this constant is computed and
- * added to {@link #GTALK_SERVICE_MIN_RECONNECT_DELAY_SHORT} to form the initial reconnect
- * delay.
- */
- public static final String GTALK_SERVICE_RECONNECT_VARIANT_SHORT =
- "gtalk_reconnect_variant_short";
-
- /**
- * The minimum reconnect delay for long network outages
- */
- public static final String GTALK_SERVICE_MIN_RECONNECT_DELAY_LONG =
- "gtalk_min_reconnect_delay_long";
-
- /**
- * The reconnect variant range for long network outages. A random number between 0 and this
- * constant is computed and added to {@link #GTALK_SERVICE_MIN_RECONNECT_DELAY_LONG} to
- * form the initial reconnect delay.
- */
- public static final String GTALK_SERVICE_RECONNECT_VARIANT_LONG =
- "gtalk_reconnect_variant_long";
-
- /**
- * The maximum reconnect delay time, in milliseconds.
- */
- public static final String GTALK_SERVICE_MAX_RECONNECT_DELAY =
- "gtalk_max_reconnect_delay";
-
- /**
- * The network downtime that is considered "short" for the above calculations,
- * in milliseconds.
- */
- public static final String GTALK_SERVICE_SHORT_NETWORK_DOWNTIME =
- "gtalk_short_network_downtime";
-
- /**
- * How frequently we send heartbeat pings to the GTalk server. Receiving a server packet
- * will reset the heartbeat timer. The away heartbeat should be used when the user is
- * logged into the GTalk app, but not actively using it.
- */
- public static final String GTALK_SERVICE_AWAY_HEARTBEAT_INTERVAL_MS =
- "gtalk_heartbeat_ping_interval_ms"; // keep the string backward compatible
-
- /**
- * How frequently we send heartbeat pings to the GTalk server. Receiving a server packet
- * will reset the heartbeat timer. The active heartbeat should be used when the user is
- * actively using the GTalk app.
- */
- public static final String GTALK_SERVICE_ACTIVE_HEARTBEAT_INTERVAL_MS =
- "gtalk_active_heartbeat_ping_interval_ms";
-
- /**
- * How frequently we send heartbeat pings to the GTalk server. Receiving a server packet
- * will reset the heartbeat timer. The sync heartbeat should be used when the user isn't
- * logged into the GTalk app, but auto-sync is enabled.
- */
- public static final String GTALK_SERVICE_SYNC_HEARTBEAT_INTERVAL_MS =
- "gtalk_sync_heartbeat_ping_interval_ms";
-
- /**
- * How frequently we send heartbeat pings to the GTalk server. Receiving a server packet
- * will reset the heartbeat timer. The no sync heartbeat should be used when the user isn't
- * logged into the GTalk app, and auto-sync is not enabled.
- */
- public static final String GTALK_SERVICE_NOSYNC_HEARTBEAT_INTERVAL_MS =
- "gtalk_nosync_heartbeat_ping_interval_ms";
-
- /**
- * The maximum heartbeat interval used while on the WIFI network.
- */
- public static final String GTALK_SERVICE_WIFI_MAX_HEARTBEAT_INTERVAL_MS =
- "gtalk_wifi_max_heartbeat_ping_interval_ms";
-
- /**
- * How long we wait to receive a heartbeat ping acknowledgement (or another packet)
- * from the GTalk server, before deeming the connection dead.
- */
- public static final String GTALK_SERVICE_HEARTBEAT_ACK_TIMEOUT_MS =
- "gtalk_heartbeat_ack_timeout_ms";
-
- /**
- * How long after screen is turned off before we consider the user to be idle.
- */
- public static final String GTALK_SERVICE_IDLE_TIMEOUT_MS =
- "gtalk_idle_timeout_ms";
-
- /**
- * By default, GTalkService will always connect to the server regardless of the auto-sync
- * setting. However, if this parameter is true, then GTalkService will only connect
- * if auto-sync is enabled. Using the GTalk app will trigger the connection too.
- */
- public static final String GTALK_SERVICE_CONNECT_ON_AUTO_SYNC =
- "gtalk_connect_on_auto_sync";
-
- /**
- * GTalkService holds a wakelock while broadcasting the intent for data message received.
- * It then automatically release the wakelock after a timeout. This setting controls what
- * the timeout should be.
- */
- public static final String GTALK_DATA_MESSAGE_WAKELOCK_MS =
- "gtalk_data_message_wakelock_ms";
-
- /**
- * The socket read timeout used to control how long ssl handshake wait for reads before
- * timing out. This is needed so the ssl handshake doesn't hang for a long time in some
- * circumstances.
- */
- public static final String GTALK_SSL_HANDSHAKE_TIMEOUT_MS =
- "gtalk_ssl_handshake_timeout_ms";
-
- /**
- * Compress the gtalk stream.
- */
- public static final String GTALK_COMPRESS = "gtalk_compress";
-
- /**
- * This is the timeout for which Google Talk will send the message using bareJID. In a
- * established chat between two XMPP endpoints, Google Talk uses fullJID in the format
- * of user@domain/resource in order to send the message to the specific client. However,
- * if Google Talk hasn't received a message from that client after some time, it would
- * fall back to use the bareJID, which would broadcast the message to all clients for
- * the other user.
- */
- public static final String GTALK_USE_BARE_JID_TIMEOUT_MS = "gtalk_use_barejid_timeout_ms";
-
- /**
- * This is the threshold of retry number when there is an authentication expired failure
- * for Google Talk. In some situation, e.g. when a Google Apps account is disabled chat
- * service, the connection keeps failing. This threshold controls when we should stop
- * the retrying.
- */
- public static final String GTALK_MAX_RETRIES_FOR_AUTH_EXPIRED =
- "gtalk_max_retries_for_auth_expired";
-
- /**
- * a boolean setting indicating whether the GTalkService should use RMQ2 protocol or not.
- */
- public static final String GTALK_USE_RMQ2_PROTOCOL =
- "gtalk_use_rmq2";
-
- /**
- * a boolean setting indicating whether the GTalkService should support both RMQ and
- * RMQ2 protocols. This setting is true for the transitional period when we need to
- * support both protocols.
- */
- public static final String GTALK_SUPPORT_RMQ_AND_RMQ2_PROTOCOLS =
- "gtalk_support_rmq_and_rmq2";
-
- /**
- * a boolean setting controlling whether the rmq2 protocol will include stream ids in
- * the protobufs. This is used for debugging.
- */
- public static final String GTALK_RMQ2_INCLUDE_STREAM_ID =
- "gtalk_rmq2_include_stream_id";
-
- /**
- * when receiving a chat message from the server, the message could be an older message
- * whose "time sent" is x seconds from now. If x is significant enough, we want to flag
- * it so the UI can give it some special treatment when displaying the "time sent" for
- * it. This setting is to control what x is.
- */
- public static final String GTALK_OLD_CHAT_MESSAGE_THRESHOLD_IN_SEC =
- "gtalk_old_chat_msg_threshold_in_sec";
-
- /**
- * a setting to control the max connection history record GTalkService stores.
- */
- public static final String GTALK_MAX_CONNECTION_HISTORY_RECORDS =
- "gtalk_max_conn_history_records";
-
- /**
- * This is gdata url to lookup album and picture info from picasa web. It also controls
- * whether url scraping for picasa is enabled (NULL to disable).
- */
- public static final String GTALK_PICASA_ALBUM_URL =
- "gtalk_picasa_album_url";
-
- /**
- * This is the url to lookup picture info from flickr. It also controls
- * whether url scraping for flickr is enabled (NULL to disable).
- */
- public static final String GTALK_FLICKR_PHOTO_INFO_URL =
- "gtalk_flickr_photo_info_url";
-
- /**
- * This is the url to lookup an actual picture from flickr.
- */
- public static final String GTALK_FLICKR_PHOTO_URL =
- "gtalk_flickr_photo_url";
-
- /**
- * This is the gdata url to lookup info on a youtube video. It also controls
- * whether url scraping for youtube is enabled (NULL to disable).
- */
- public static final String GTALK_YOUTUBE_VIDEO_URL =
- "gtalk_youtube_video_url";
-
- /**
- * Enable/disable GTalk URL scraping for JPG images ("true" to enable).
- */
- public static final String GTALK_URL_SCRAPING_FOR_JPG =
- "gtalk_url_scraping_for_jpg";
-
- /**
- * Chat message lifetime (for pruning old chat messages).
- */
- public static final String GTALK_CHAT_MESSAGE_LIFETIME =
- "gtalk_chat_message_lifetime";
-
- /**
- * OTR message lifetime (for pruning old otr messages).
- */
- public static final String GTALK_OTR_MESSAGE_LIFETIME =
- "gtalk_otr_message_lifetime";
-
- /**
- * Chat expiration time, i.e., time since last message in the chat (for pruning old chats).
- */
- public static final String GTALK_CHAT_EXPIRATION_TIME =
- "gtalk_chat_expiration_time";
-
- /**
- * This is the url for getting the app token for server-to-device push messaging.
- */
- public static final String PUSH_MESSAGING_REGISTRATION_URL =
- "push_messaging_registration_url";
-
- /**
- * Use android://<it> routing infos for Google Sync Server subcriptions.
- */
- public static final String GSYNC_USE_RMQ2_ROUTING_INFO = "gsync_use_rmq2_routing_info";
-
- /**
- * Enable use of ssl session caching.
- * 'db' - save each session in a (per process) database
- * 'file' - save each session in a (per process) file
- * not set or any other value - normal java in-memory caching
- */
- public static final String SSL_SESSION_CACHE = "ssl_session_cache";
-
- /**
- * How many bytes long a message has to be, in order to be gzipped.
- */
- public static final String SYNC_MIN_GZIP_BYTES =
- "sync_min_gzip_bytes";
-
- /**
- * The hash value of the current provisioning settings
- */
- public static final String PROVISIONING_DIGEST = "digest";
-
- /**
- * Provisioning keys to block from server update
- */
- public static final String PROVISIONING_OVERRIDE = "override";
-
- /**
- * "Generic" service name for authentication requests.
- */
- public static final String GOOGLE_LOGIN_GENERIC_AUTH_SERVICE
- = "google_login_generic_auth_service";
-
- /**
- * Duration in milliseconds after setup at which market does not reconcile applications
- * which are installed during restore.
- */
- public static final String VENDING_RESTORE_WINDOW_MS = "vending_restore_window_ms";
-
-
- /**
- * Frequency in milliseconds at which we should sync the locally installed Vending Machine
- * content with the server.
- */
- public static final String VENDING_SYNC_FREQUENCY_MS = "vending_sync_frequency_ms";
-
- /**
- * Support URL that is opened in a browser when user clicks on 'Help and Info' in Vending
- * Machine.
- */
- public static final String VENDING_SUPPORT_URL = "vending_support_url";
-
- /**
- * Indicates if Vending Machine requires a SIM to be in the phone to allow a purchase.
- *
- * true = SIM is required
- * false = SIM is not required
- */
- public static final String VENDING_REQUIRE_SIM_FOR_PURCHASE =
- "vending_require_sim_for_purchase";
-
- /**
- * Indicates the Vending Machine backup state. It is set if the
- * Vending application has been backed up at least once.
- */
- public static final String VENDING_BACKUP_STATE = "vending_backup_state";
-
- /**
- * The current version id of the Vending Machine terms of service.
- */
- public static final String VENDING_TOS_VERSION = "vending_tos_version";
-
- /**
- * URL that points to the terms of service for Vending Machine.
- */
- public static final String VENDING_TOS_URL = "vending_tos_url";
-
- /**
- * URL to navigate to in browser (not Market) when the terms of service
- * for Vending Machine could not be accessed due to bad network
- * connection.
- */
- public static final String VENDING_TOS_MISSING_URL = "vending_tos_missing_url";
-
- /**
- * Whether to use sierraqa instead of sierra tokens for the purchase flow in
- * Vending Machine.
- *
- * true = use sierraqa
- * false = use sierra (default)
- */
- public static final String VENDING_USE_CHECKOUT_QA_SERVICE =
- "vending_use_checkout_qa_service";
-
- /**
- * Default value to use for all/free/priced filter in Market.
- * Valid values: ALL, FREE, PAID (case insensitive)
- */
- public static final String VENDING_DEFAULT_FILTER = "vending_default_filter";
- /**
- * Ranking type value to use for the first category tab (currently popular)
- */
- public static final String VENDING_TAB_1_RANKING_TYPE = "vending_tab_1_ranking_type";
-
- /**
- * Title string to use for first category tab.
- */
- public static final String VENDING_TAB_1_TITLE = "vending_tab_1_title";
-
- /**
- * Ranking type value to use for the second category tab (currently newest)
- */
- public static final String VENDING_TAB_2_RANKING_TYPE = "vending_tab_2_ranking_type";
-
- /**
- * Title string to use for second category tab.
- */
- public static final String VENDING_TAB_2_TITLE = "vending_tab_2_title";
-
- /**
- * Frequency in milliseconds at which we should request MCS heartbeats
- * from the Vending Machine client.
- */
- public static final String VENDING_HEARTBEAT_FREQUENCY_MS =
- "vending_heartbeat_frequency_ms";
-
- /**
- * Frequency in milliseconds at which we should resend pending download
- * requests to the API Server from the Vending Machine client.
- */
- public static final String VENDING_PENDING_DOWNLOAD_RESEND_FREQUENCY_MS =
- "vending_pd_resend_frequency_ms";
-
- /**
- * Time before an asset in the 'DOWNLOADING' state is considered ready
- * for an install kick on the client.
- */
- public static final String VENDING_DOWNLOADING_KICK_TIMEOUT_MS =
- "vending_downloading_kick_ms";
-
- /**
- * Size of buffer in bytes for Vending to use when reading cache files.
- */
- public static final String VENDING_DISK_INPUT_BUFFER_BYTES =
- "vending_disk_input_buffer_bytes";
-
- /**
- * Size of buffer in bytes for Vending to use when writing cache files.
- */
- public static final String VENDING_DISK_OUTPUT_BUFFER_BYTES =
- "vending_disk_output_buffer_bytes";
-
- /**
- * Frequency in milliseconds at which we should cycle through the promoted applications
- * on the home screen or the categories page.
- */
- public static final String VENDING_PROMO_REFRESH_FREQUENCY_MS =
- "vending_promo_refresh_freq_ms";
-
- /**
- * Frequency in milliseconds when we should refresh the provisioning information from
- * the carrier backend.
- */
- public static final String VENDING_CARRIER_PROVISIONING_REFRESH_FREQUENCY_MS =
- "vending_carrier_ref_freq_ms";
-
- /**
- * Interval in milliseconds after which a failed provisioning request should be retried.
- */
- public static final String VENDING_CARRIER_PROVISIONING_RETRY_MS =
- "vending_carrier_prov_retry_ms";
-
- /**
- * Buffer in milliseconds for carrier credentials to be considered valid.
- */
- public static final String VENDING_CARRIER_CREDENTIALS_BUFFER_MS =
- "vending_carrier_cred_buf_ms";
-
- /**
- * Whether to turn on performance logging in the Market client.
- */
- public static final String VENDING_LOG_PERFORMANCE =
- "vending_log_perf";
-
- /**
- * URL that points to the legal terms of service to display in Settings.
- * <p>
- * This should be a https URL. For a pretty user-friendly URL, use
- * {@link #SETTINGS_TOS_PRETTY_URL}.
- */
- public static final String SETTINGS_TOS_URL = "settings_tos_url";
-
- /**
- * URL that points to the legal terms of service to display in Settings.
- * <p>
- * This should be a pretty http URL. For the URL the device will access
- * via Settings, use {@link #SETTINGS_TOS_URL}.
- */
- public static final String SETTINGS_TOS_PRETTY_URL = "settings_tos_pretty_url";
-
- /**
- * URL that points to the contributors to display in Settings.
- * <p>
- * This should be a https URL. For a pretty user-friendly URL, use
- * {@link #SETTINGS_CONTRIBUTORS_PRETTY_URL}.
- */
- public static final String SETTINGS_CONTRIBUTORS_URL = "settings_contributors_url";
-
- /**
- * URL that points to the contributors to display in Settings.
- * <p>
- * This should be a pretty http URL. For the URL the device will access
- * via Settings, use {@link #SETTINGS_CONTRIBUTORS_URL}.
- */
- public static final String SETTINGS_CONTRIBUTORS_PRETTY_URL =
- "settings_contributors_pretty_url";
-
- /**
- * URL that points to the Terms Of Service for the device.
- * <p>
- * This should be a pretty http URL.
- */
- public static final String SETUP_GOOGLE_TOS_URL = "setup_google_tos_url";
-
- /**
- * URL that points to the Android privacy policy for the device.
- * <p>
- * This should be a pretty http URL.
- */
- public static final String SETUP_ANDROID_PRIVACY_URL = "setup_android_privacy_url";
+ public static final String WTF_IS_FATAL = "wtf_is_fatal";
/**
- * URL that points to the Google privacy policy for the device.
- * <p>
- * This should be a pretty http URL.
+ * Maximum age of entries kept by {@link android.os.IDropBox}.
+ * @hide
*/
- public static final String SETUP_GOOGLE_PRIVACY_URL = "setup_google_privacy_url";
-
+ public static final String DROPBOX_AGE_SECONDS =
+ "dropbox_age_seconds";
/**
- * Request an MSISDN token for various Google services.
+ * Maximum amount of disk space used by {@link android.os.IDropBox} no matter what.
+ * @hide
*/
- public static final String USE_MSISDN_TOKEN = "use_msisdn_token";
-
+ public static final String DROPBOX_QUOTA_KB =
+ "dropbox_quota_kb";
/**
- * RSA public key used to encrypt passwords stored in the database.
+ * Percent of free disk (excluding reserve) which {@link android.os.IDropBox} will use.
+ * @hide
*/
- public static final String GLS_PUBLIC_KEY = "google_login_public_key";
-
+ public static final String DROPBOX_QUOTA_PERCENT =
+ "dropbox_quota_percent";
/**
- * Only check parental control status if this is set to "true".
+ * Percent of total disk which {@link android.os.IDropBox} will never dip into.
+ * @hide
*/
- public static final String PARENTAL_CONTROL_CHECK_ENABLED =
- "parental_control_check_enabled";
-
+ public static final String DROPBOX_RESERVE_PERCENT =
+ "dropbox_reserve_percent";
/**
- * The list of applications we need to block if parental control is
- * enabled.
+ * Prefix for per-tag dropbox disable/enable settings.
+ * @hide
*/
- public static final String PARENTAL_CONTROL_APPS_LIST =
- "parental_control_apps_list";
+ public static final String DROPBOX_TAG_PREFIX =
+ "dropbox:";
- /**
- * Duration in which parental control status is valid.
- */
- public static final String PARENTAL_CONTROL_TIMEOUT_IN_MS =
- "parental_control_timeout_in_ms";
/**
- * When parental control is off, we expect to get this string from the
- * litmus url.
+ * Screen timeout in milliseconds corresponding to the
+ * PowerManager's POKE_LOCK_SHORT_TIMEOUT flag (i.e. the fastest
+ * possible screen timeout behavior.)
+ * @hide
*/
- public static final String PARENTAL_CONTROL_EXPECTED_RESPONSE =
- "parental_control_expected_response";
+ public static final String SHORT_KEYLIGHT_DELAY_MS =
+ "short_keylight_delay_ms";
/**
- * When the litmus url returns a 302, declare parental control to be on
- * only if the redirect url matches this regular expression.
+ * The interval in minutes after which the amount of free storage left on the
+ * device is logged to the event log
+ * @hide
*/
- public static final String PARENTAL_CONTROL_REDIRECT_REGEX =
- "parental_control_redirect_regex";
+ public static final String SYS_FREE_STORAGE_LOG_INTERVAL =
+ "sys_free_storage_log_interval";
/**
* Threshold for the amount of change in disk free space required to report the amount of
* free space. Used to prevent spamming the logs when the disk free space isn't changing
* frequently.
+ * @hide
*/
public static final String DISK_FREE_CHANGE_REPORTING_THRESHOLD =
"disk_free_change_reporting_threshold";
- /**
- * Prefix for new Google services published by the checkin
- * server.
- */
- public static final String GOOGLE_SERVICES_PREFIX
- = "google_services:";
-
- /**
- * The maximum reconnect delay for short network outages or when the network is suspended
- * due to phone use.
- */
- public static final String SYNC_MAX_RETRY_DELAY_IN_SECONDS =
- "sync_max_retry_delay_in_seconds";
/**
* Minimum percentage of free storage on the device that is used to determine if
* the device is running low on storage.
* Say this value is set to 10, the device is considered running low on storage
* if 90% or more of the device storage is filled up.
+ * @hide
*/
public static final String SYS_STORAGE_THRESHOLD_PERCENTAGE =
"sys_storage_threshold_percentage";
/**
- * The interval in minutes after which the amount of free storage left on the
- * device is logged to the event log
- */
- public static final String SYS_FREE_STORAGE_LOG_INTERVAL =
- "sys_free_storage_log_interval";
-
- /**
- * The interval in milliseconds at which to check the number of SMS sent
- * out without asking for use permit, to limit the un-authorized SMS
- * usage.
- */
- public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
- "sms_outgoing_check_interval_ms";
-
- /**
- * The number of outgoing SMS sent without asking for user permit
- * (of {@link #SMS_OUTGOING_CHECK_INTERVAL_MS}
+ * The interval in milliseconds after which Wi-Fi is considered idle.
+ * When idle, it is possible for the device to be switched from Wi-Fi to
+ * the mobile data network.
+ * @hide
*/
- public static final String SMS_OUTGOING_CEHCK_MAX_COUNT =
- "sms_outgoing_check_max_count";
+ public static final String WIFI_IDLE_MS = "wifi_idle_ms";
/**
* The interval in milliseconds at which to check packet counts on the
* mobile data interface when screen is on, to detect possible data
* connection problems.
+ * @hide
*/
public static final String PDP_WATCHDOG_POLL_INTERVAL_MS =
"pdp_watchdog_poll_interval_ms";
@@ -3495,6 +2693,7 @@ public final class Settings {
* The interval in milliseconds at which to check packet counts on the
* mobile data interface when screen is off, to detect possible data
* connection problems.
+ * @hide
*/
public static final String PDP_WATCHDOG_LONG_POLL_INTERVAL_MS =
"pdp_watchdog_long_poll_interval_ms";
@@ -3503,6 +2702,7 @@ public final class Settings {
* The interval in milliseconds at which to check packet counts on the
* mobile data interface after {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT}
* outgoing packets has been reached without incoming packets.
+ * @hide
*/
public static final String PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS =
"pdp_watchdog_error_poll_interval_ms";
@@ -3511,6 +2711,7 @@ public final class Settings {
* The number of outgoing packets sent without seeing an incoming packet
* that triggers a countdown (of {@link #PDP_WATCHDOG_ERROR_POLL_COUNT}
* device is logged to the event log
+ * @hide
*/
public static final String PDP_WATCHDOG_TRIGGER_PACKET_COUNT =
"pdp_watchdog_trigger_packet_count";
@@ -3519,6 +2720,7 @@ public final class Settings {
* The number of polls to perform (at {@link #PDP_WATCHDOG_ERROR_POLL_INTERVAL_MS})
* after hitting {@link #PDP_WATCHDOG_TRIGGER_PACKET_COUNT} before
* attempting data connection recovery.
+ * @hide
*/
public static final String PDP_WATCHDOG_ERROR_POLL_COUNT =
"pdp_watchdog_error_poll_count";
@@ -3526,6 +2728,7 @@ public final class Settings {
/**
* The number of failed PDP reset attempts before moving to something more
* drastic: re-registering to the network.
+ * @hide
*/
public static final String PDP_WATCHDOG_MAX_PDP_RESET_FAIL_COUNT =
"pdp_watchdog_max_pdp_reset_fail_count";
@@ -3533,12 +2736,14 @@ public final class Settings {
/**
* Address to ping as a last sanity check before attempting any recovery.
* Unset or set to "0.0.0.0" to skip this check.
+ * @hide
*/
public static final String PDP_WATCHDOG_PING_ADDRESS = "pdp_watchdog_ping_address";
/**
* The "-w deadline" parameter for the ping, ie, the max time in
* seconds to spend pinging.
+ * @hide
*/
public static final String PDP_WATCHDOG_PING_DEADLINE = "pdp_watchdog_ping_deadline";
@@ -3547,236 +2752,236 @@ public final class Settings {
* after the first registration mismatch of gprs and voice service,
* to detect possible data network registration problems.
*
+ * @hide
*/
public static final String GPRS_REGISTER_CHECK_PERIOD_MS =
"gprs_register_check_period_ms";
/**
- * The interval in milliseconds after which Wi-Fi is considered idle.
- * When idle, it is possible for the device to be switched from Wi-Fi to
- * the mobile data network.
- */
- public static final String WIFI_IDLE_MS = "wifi_idle_ms";
-
- /**
- * Screen timeout in milliseconds corresponding to the
- * PowerManager's POKE_LOCK_SHORT_TIMEOUT flag (i.e. the fastest
- * possible screen timeout behavior.)
+ * The length of time in milli-seconds that automatic small adjustments to
+ * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
+ * @hide
*/
- public static final String SHORT_KEYLIGHT_DELAY_MS =
- "short_keylight_delay_ms";
+ public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
/**
- * List of test suites (local disk filename) for the automatic instrumentation test runner.
- * The file format is similar to automated_suites.xml, see AutoTesterService.
- * If this setting is missing or empty, the automatic test runner will not start.
+ * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
+ * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
+ * exceeded.
+ * @hide
*/
- public static final String AUTOTEST_SUITES_FILE = "autotest_suites_file";
+ public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
/**
- * Interval between synchronous checkins forced by the automatic test runner.
- * If you set this to a value smaller than CHECKIN_INTERVAL, then the test runner's
- * frequent checkins will prevent asynchronous background checkins from interfering
- * with any performance measurements.
+ * The maximum reconnect delay for short network outages or when the network is suspended
+ * due to phone use.
+ * @hide
*/
- public static final String AUTOTEST_CHECKIN_SECONDS = "autotest_checkin_seconds";
+ public static final String SYNC_MAX_RETRY_DELAY_IN_SECONDS =
+ "sync_max_retry_delay_in_seconds";
/**
- * Interval between reboots forced by the automatic test runner.
+ * The interval in milliseconds at which to check the number of SMS sent
+ * out without asking for use permit, to limit the un-authorized SMS
+ * usage.
+ * @hide
*/
- public static final String AUTOTEST_REBOOT_SECONDS = "autotest_reboot_seconds";
-
+ public static final String SMS_OUTGOING_CHECK_INTERVAL_MS =
+ "sms_outgoing_check_interval_ms";
/**
- * Threshold values for the duration and level of a discharge cycle, under
- * which we log discharge cycle info.
+ * The number of outgoing SMS sent without asking for user permit
+ * (of {@link #SMS_OUTGOING_CHECK_INTERVAL_MS}
+ * @hide
*/
- public static final String BATTERY_DISCHARGE_DURATION_THRESHOLD =
- "battery_discharge_duration_threshold";
- public static final String BATTERY_DISCHARGE_THRESHOLD = "battery_discharge_threshold";
+ public static final String SMS_OUTGOING_CHECK_MAX_COUNT =
+ "sms_outgoing_check_max_count";
/**
- * An email address that anr bugreports should be sent to.
+ * Enable use of ssl session caching.
+ * 'db' - save each session in a (per process) database
+ * 'file' - save each session in a (per process) file
+ * not set or any other value - normal java in-memory caching
+ * @hide
*/
- public static final String ANR_BUGREPORT_RECIPIENT = "anr_bugreport_recipient";
+ public static final String SSL_SESSION_CACHE = "ssl_session_cache";
/**
- * Flag for allowing service provider to use location information to improve products and
- * services.
- * Type: int ( 0 = disallow, 1 = allow )
- * @deprecated
+ * How many bytes long a message has to be, in order to be gzipped.
+ * @hide
*/
- public static final String USE_LOCATION_FOR_SERVICES = "use_location";
+ public static final String SYNC_MIN_GZIP_BYTES =
+ "sync_min_gzip_bytes";
/**
* The number of promoted sources in GlobalSearch.
+ * @hide
*/
public static final String SEARCH_NUM_PROMOTED_SOURCES = "search_num_promoted_sources";
/**
* The maximum number of suggestions returned by GlobalSearch.
+ * @hide
*/
public static final String SEARCH_MAX_RESULTS_TO_DISPLAY = "search_max_results_to_display";
/**
* The number of suggestions GlobalSearch will ask each non-web search source for.
+ * @hide
*/
public static final String SEARCH_MAX_RESULTS_PER_SOURCE = "search_max_results_per_source";
/**
* The number of suggestions the GlobalSearch will ask the web search source for.
+ * @hide
*/
public static final String SEARCH_WEB_RESULTS_OVERRIDE_LIMIT =
"search_web_results_override_limit";
/**
* The number of milliseconds that GlobalSearch will wait for suggestions from
* promoted sources before continuing with all other sources.
+ * @hide
*/
public static final String SEARCH_PROMOTED_SOURCE_DEADLINE_MILLIS =
"search_promoted_source_deadline_millis";
/**
* The number of milliseconds before GlobalSearch aborts search suggesiton queries.
+ * @hide
*/
public static final String SEARCH_SOURCE_TIMEOUT_MILLIS = "search_source_timeout_millis";
/**
* The maximum number of milliseconds that GlobalSearch shows the previous results
* after receiving a new query.
+ * @hide
*/
public static final String SEARCH_PREFILL_MILLIS = "search_prefill_millis";
/**
* The maximum age of log data used for shortcuts in GlobalSearch.
+ * @hide
*/
public static final String SEARCH_MAX_STAT_AGE_MILLIS = "search_max_stat_age_millis";
/**
* The maximum age of log data used for source ranking in GlobalSearch.
+ * @hide
*/
public static final String SEARCH_MAX_SOURCE_EVENT_AGE_MILLIS =
"search_max_source_event_age_millis";
/**
* The minimum number of impressions needed to rank a source in GlobalSearch.
+ * @hide
*/
public static final String SEARCH_MIN_IMPRESSIONS_FOR_SOURCE_RANKING =
"search_min_impressions_for_source_ranking";
/**
* The minimum number of clicks needed to rank a source in GlobalSearch.
+ * @hide
*/
public static final String SEARCH_MIN_CLICKS_FOR_SOURCE_RANKING =
"search_min_clicks_for_source_ranking";
/**
* The maximum number of shortcuts shown by GlobalSearch.
+ * @hide
*/
public static final String SEARCH_MAX_SHORTCUTS_RETURNED = "search_max_shortcuts_returned";
/**
* The size of the core thread pool for suggestion queries in GlobalSearch.
+ * @hide
*/
public static final String SEARCH_QUERY_THREAD_CORE_POOL_SIZE =
"search_query_thread_core_pool_size";
/**
* The maximum size of the thread pool for suggestion queries in GlobalSearch.
+ * @hide
*/
public static final String SEARCH_QUERY_THREAD_MAX_POOL_SIZE =
"search_query_thread_max_pool_size";
/**
* The size of the core thread pool for shortcut refreshing in GlobalSearch.
+ * @hide
*/
public static final String SEARCH_SHORTCUT_REFRESH_CORE_POOL_SIZE =
"search_shortcut_refresh_core_pool_size";
/**
* The maximum size of the thread pool for shortcut refreshing in GlobalSearch.
+ * @hide
*/
public static final String SEARCH_SHORTCUT_REFRESH_MAX_POOL_SIZE =
"search_shortcut_refresh_max_pool_size";
/**
* The maximun time that excess threads in the GlobalSeach thread pools will
* wait before terminating.
+ * @hide
*/
public static final String SEARCH_THREAD_KEEPALIVE_SECONDS =
"search_thread_keepalive_seconds";
/**
* The maximum number of concurrent suggestion queries to each source.
+ * @hide
*/
public static final String SEARCH_PER_SOURCE_CONCURRENT_QUERY_LIMIT =
"search_per_source_concurrent_query_limit";
- /**
- * Flag for allowing ActivityManagerService to send ACTION_APP_ERROR intents
- * on application crashes and ANRs. If this is disabled, the crash/ANR dialog
- * will never display the "Report" button.
- * Type: int ( 0 = disallow, 1 = allow )
- */
- public static final String SEND_ACTION_APP_ERROR = "send_action_app_error";
-
- /**
- * Maximum size of /proc/last_kmsg content to upload after reboot.
- */
- public static final String LAST_KMSG_KB = "last_kmsg_kb";
-
- /**
- * Maximum age of entries kept by {@link android.os.IDropBox}.
- */
- public static final String DROPBOX_AGE_SECONDS =
- "dropbox_age_seconds";
- /**
- * Maximum amount of disk space used by {@link android.os.IDropBox} no matter what.
- */
- public static final String DROPBOX_QUOTA_KB =
- "dropbox_quota_kb";
- /**
- * Percent of free disk (excluding reserve) which {@link android.os.IDropBox} will use.
- */
- public static final String DROPBOX_QUOTA_PERCENT =
- "dropbox_quota_percent";
- /**
- * Percent of total disk which {@link android.os.IDropBox} will never dip into.
- */
- public static final String DROPBOX_RESERVE_PERCENT =
- "dropbox_reserve_percent";
- /**
- * Prefix for per-tag dropbox disable/enable settings.
- */
- public static final String DROPBOX_TAG_PREFIX =
- "dropbox:";
- /**
- * Nonzero causes Log.wtf() to crash.
- */
- public static final String WTF_IS_FATAL = "wtf_is_fatal";
+
/**
- * The length of time in milli-seconds that automatic small adjustments to
- * SystemClock are ignored if NITZ_UPDATE_DIFF is not exceeded.
+ * @hide
*/
- public static final String NITZ_UPDATE_SPACING = "nitz_update_spacing";
+ public static final String[] SETTINGS_TO_BACKUP = {
+ ADB_ENABLED,
+ ALLOW_MOCK_LOCATION,
+ PARENTAL_CONTROL_ENABLED,
+ PARENTAL_CONTROL_REDIRECT_URL,
+ USB_MASS_STORAGE_ENABLED,
+ ACCESSIBILITY_ENABLED,
+ ENABLED_ACCESSIBILITY_SERVICES,
+ TTS_USE_DEFAULTS,
+ TTS_DEFAULT_RATE,
+ TTS_DEFAULT_PITCH,
+ TTS_DEFAULT_SYNTH,
+ TTS_DEFAULT_LANG,
+ TTS_DEFAULT_COUNTRY,
+ WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
+ WIFI_NETWORKS_AVAILABLE_REPEAT_DELAY,
+ WIFI_NUM_ALLOWED_CHANNELS,
+ WIFI_NUM_OPEN_NETWORKS_KEPT,
+ };
/**
- * If the NITZ_UPDATE_DIFF time is exceeded then an automatic adjustment
- * to SystemClock will be allowed even if NITZ_UPDATE_SPACING has not been
- * exceeded.
+ * Helper method for determining if a location provider is enabled.
+ * @param cr the content resolver to use
+ * @param provider the location provider to query
+ * @return true if the provider is enabled
+ *
+ * @hide
*/
- public static final String NITZ_UPDATE_DIFF = "nitz_update_diff";
+ public static final boolean isLocationProviderEnabled(ContentResolver cr, String provider) {
+ String allowedProviders = Settings.Secure.getString(cr, LOCATION_PROVIDERS_ALLOWED);
+ if (allowedProviders != null) {
+ return (allowedProviders.equals(provider) ||
+ allowedProviders.contains("," + provider + ",") ||
+ allowedProviders.startsWith(provider + ",") ||
+ allowedProviders.endsWith("," + provider));
+ }
+ return false;
+ }
/**
- * @deprecated
+ * Thread-safe method for enabling or disabling a single location provider.
+ * @param cr the content resolver to use
+ * @param provider the location provider to enable or disable
+ * @param enabled true if the provider should be enabled
+ *
* @hide
*/
- @Deprecated // Obviated by NameValueCache: just fetch the value directly.
- public static class QueryMap extends ContentQueryMap {
-
- public QueryMap(ContentResolver contentResolver, Cursor cursor, boolean keepUpdated,
- Handler handlerForUpdateNotifications) {
- super(cursor, NAME, keepUpdated, handlerForUpdateNotifications);
- }
-
- public QueryMap(ContentResolver contentResolver, boolean keepUpdated,
- Handler handlerForUpdateNotifications) {
- this(contentResolver,
- contentResolver.query(CONTENT_URI, null, null, null, null),
- keepUpdated, handlerForUpdateNotifications);
- }
-
- public String getString(String name) {
- ContentValues cv = getValues(name);
- if (cv == null) return null;
- return cv.getAsString(VALUE);
+ public static final void setLocationProviderEnabled(ContentResolver cr,
+ String provider, boolean enabled) {
+ // to ensure thread safety, we write the provider name with a '+' or '-'
+ // and let the SettingsProvider handle it rather than reading and modifying
+ // the list of enabled providers.
+ if (enabled) {
+ provider = "+" + provider;
+ } else {
+ provider = "-" + provider;
}
+ putString(cr, Settings.Secure.LOCATION_PROVIDERS_ALLOWED, provider);
}
-
}
/**
diff --git a/core/java/android/util/EventLog.java b/core/java/android/util/EventLog.java
index a5029c0..b596d32 100644
--- a/core/java/android/util/EventLog.java
+++ b/core/java/android/util/EventLog.java
@@ -40,8 +40,6 @@ import java.util.regex.Pattern;
* <p>Events use integer tag codes corresponding to /system/etc/event-log-tags.
* They carry a payload of one or more int, long, or String values. The
* event-log-tags file defines the payload contents for each type code.
- *
- * @pending
*/
public class EventLog {
private static final String TAG = "EventLog";
diff --git a/core/java/android/util/EventLogTags.java b/core/java/android/util/EventLogTags.java
index 075c84e..5cf5332 100644
--- a/core/java/android/util/EventLogTags.java
+++ b/core/java/android/util/EventLogTags.java
@@ -26,8 +26,8 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
- * to-be-deprecated: This class is no longer functional.
- * Use {to-be-link android.util.EventLog} instead.
+ * @deprecated This class is no longer functional.
+ * Use {@link android.util.EventLog} instead.
*/
public class EventLogTags {
public static class Description {
diff --git a/core/java/android/util/Log.java b/core/java/android/util/Log.java
index 7a959a6..75b1b90 100644
--- a/core/java/android/util/Log.java
+++ b/core/java/android/util/Log.java
@@ -234,7 +234,6 @@ public final class Log {
* immediately with an error dialog.
* @param tag Used to identify the source of a log message.
* @param msg The message you would like logged.
- * @pending
*/
public static int wtf(String tag, String msg) {
return wtf(tag, msg, null);
@@ -245,7 +244,6 @@ public final class Log {
* Similar to {@link #wtf(String, String)}, with an exception to log.
* @param tag Used to identify the source of a log message.
* @param tr An exception to log.
- * @pending
*/
public static int wtf(String tag, Throwable tr) {
return wtf(tag, tr.getMessage(), tr);
@@ -257,7 +255,6 @@ public final class Log {
* @param tag Used to identify the source of a log message.
* @param msg The message you would like logged.
* @param tr An exception to log. May be null.
- * @pending
*/
public static int wtf(String tag, String msg, Throwable tr) {
tr = new TerribleFailure(msg, tr);
diff --git a/core/java/android/webkit/CallbackProxy.java b/core/java/android/webkit/CallbackProxy.java
index fb369d3..6790c5d 100644
--- a/core/java/android/webkit/CallbackProxy.java
+++ b/core/java/android/webkit/CallbackProxy.java
@@ -90,7 +90,6 @@ class CallbackProxy extends Handler {
private static final int JS_PROMPT = 114;
private static final int JS_UNLOAD = 115;
private static final int ASYNC_KEYEVENTS = 116;
- private static final int TOO_MANY_REDIRECTS = 117;
private static final int DOWNLOAD_FILE = 118;
private static final int REPORT_ERROR = 119;
private static final int RESEND_POST_DATA = 120;
@@ -276,19 +275,6 @@ class CallbackProxy extends Handler {
}
break;
- case TOO_MANY_REDIRECTS:
- Message cancelMsg =
- (Message) msg.getData().getParcelable("cancelMsg");
- Message continueMsg =
- (Message) msg.getData().getParcelable("continueMsg");
- if (mWebViewClient != null) {
- mWebViewClient.onTooManyRedirects(mWebView, cancelMsg,
- continueMsg);
- } else {
- cancelMsg.sendToTarget();
- }
- break;
-
case REPORT_ERROR:
if (mWebViewClient != null) {
int reasonCode = msg.arg1;
@@ -790,19 +776,10 @@ class CallbackProxy extends Handler {
sendMessage(msg);
}
+ // Because this method is public and because CallbackProxy is mistakenly
+ // party of the public classes, we cannot remove this method.
public void onTooManyRedirects(Message cancelMsg, Message continueMsg) {
- // Do an unsynchronized quick check to avoid posting if no callback has
- // been set.
- if (mWebViewClient == null) {
- cancelMsg.sendToTarget();
- return;
- }
-
- Message msg = obtainMessage(TOO_MANY_REDIRECTS);
- Bundle bundle = msg.getData();
- bundle.putParcelable("cancelMsg", cancelMsg);
- bundle.putParcelable("continueMsg", continueMsg);
- sendMessage(msg);
+ // deprecated.
}
public void onReceivedError(int errorCode, String description,
diff --git a/core/java/android/webkit/DateSorter.java b/core/java/android/webkit/DateSorter.java
index c46702e..16feaa9 100644
--- a/core/java/android/webkit/DateSorter.java
+++ b/core/java/android/webkit/DateSorter.java
@@ -38,7 +38,7 @@ public class DateSorter {
/** must be >= 3 */
public static final int DAY_COUNT = 5;
- private long [] mBins = new long[DAY_COUNT];
+ private long [] mBins = new long[DAY_COUNT-1];
private String [] mLabels = new String[DAY_COUNT];
private static final int NUM_DAYS_AGO = 5;
@@ -54,15 +54,13 @@ public class DateSorter {
// Create the bins
mBins[0] = c.getTimeInMillis(); // Today
- c.roll(Calendar.DAY_OF_YEAR, -1);
+ c.add(Calendar.DAY_OF_YEAR, -1);
mBins[1] = c.getTimeInMillis(); // Yesterday
- c.roll(Calendar.DAY_OF_YEAR, -(NUM_DAYS_AGO - 1));
+ c.add(Calendar.DAY_OF_YEAR, -(NUM_DAYS_AGO - 1));
mBins[2] = c.getTimeInMillis(); // Five days ago
- c.roll(Calendar.DAY_OF_YEAR, NUM_DAYS_AGO); // move back to today
- c.roll(Calendar.MONTH, -1);
+ c.add(Calendar.DAY_OF_YEAR, NUM_DAYS_AGO); // move back to today
+ c.add(Calendar.MONTH, -1);
mBins[3] = c.getTimeInMillis(); // One month ago
- c.roll(Calendar.MONTH, -1);
- mBins[4] = c.getTimeInMillis(); // Over one month ago
// build labels
mLabels[0] = context.getText(com.android.internal.R.string.today).toString();
@@ -84,11 +82,11 @@ public class DateSorter {
* date bin this date belongs to
*/
public int getIndex(long time) {
- // Lame linear search
- for (int i = 0; i < DAY_COUNT; i++) {
+ int lastDay = DAY_COUNT - 1;
+ for (int i = 0; i < lastDay; i++) {
if (time > mBins[i]) return i;
}
- return DAY_COUNT - 1;
+ return lastDay;
}
/**
@@ -96,6 +94,7 @@ public class DateSorter {
* @return string label suitable for display to user
*/
public String getLabel(int index) {
+ if (index < 0 || index >= DAY_COUNT) return "";
return mLabels[index];
}
@@ -105,17 +104,22 @@ public class DateSorter {
* @return date boundary at given index
*/
public long getBoundary(int index) {
+ int lastDay = DAY_COUNT - 1;
+ // Error case
+ if (index < 0 || index > lastDay) index = 0;
+ // Since this provides a lower boundary on dates that will be included
+ // in the given bin, provide the smallest value
+ if (index == lastDay) return Long.MIN_VALUE;
return mBins[index];
}
/**
* Calcuate 12:00am by zeroing out hour, minute, second, millisecond
*/
- private Calendar beginningOfDay(Calendar c) {
+ private void beginningOfDay(Calendar c) {
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
c.set(Calendar.MILLISECOND, 0);
- return c;
}
}
diff --git a/core/java/android/webkit/WebStorage.java b/core/java/android/webkit/WebStorage.java
index a182287..cf71a84 100644
--- a/core/java/android/webkit/WebStorage.java
+++ b/core/java/android/webkit/WebStorage.java
@@ -389,8 +389,8 @@ public final class WebStorage {
mOrigins = new HashMap<String, Origin>();
for (String origin : tmp) {
Origin website = new Origin(origin,
- nativeGetUsageForOrigin(origin),
- nativeGetQuotaForOrigin(origin));
+ nativeGetQuotaForOrigin(origin),
+ nativeGetUsageForOrigin(origin));
mOrigins.put(origin, website);
}
}
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index a6a48cb..2c716b3 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -3663,9 +3663,6 @@ public class WebView extends AbsoluteLayout
nativeHideCursor();
}
- /**
- * @hide
- */
public void emulateShiftHeld() {
if (0 == mNativeClass) return; // client isn't initialized
setUpSelectXY();
@@ -5739,11 +5736,6 @@ public class WebView extends AbsoluteLayout
hideSoftKeyboard();
} else {
displaySoftKeyboard(false);
- if (DebugFlags.WEB_VIEW) {
- Log.v(LOGTAG, "REQUEST_KEYBOARD"
- + " focusCandidateIsPlugin="
- + nativeFocusCandidateIsPlugin());
- }
}
break;
@@ -6342,7 +6334,7 @@ public class WebView extends AbsoluteLayout
private native void nativeCreate(int ptr);
private native int nativeCursorFramePointer();
private native Rect nativeCursorNodeBounds();
- /* package */ native int nativeCursorNodePointer();
+ private native int nativeCursorNodePointer();
/* package */ native boolean nativeCursorMatchesFocus();
private native boolean nativeCursorIntersects(Rect visibleRect);
private native boolean nativeCursorIsAnchor();
@@ -6374,13 +6366,12 @@ public class WebView extends AbsoluteLayout
private native void nativeFindNext(boolean forward);
/* package */ native int nativeFocusCandidateFramePointer();
private native boolean nativeFocusCandidateIsPassword();
- private native boolean nativeFocusCandidateIsPlugin();
private native boolean nativeFocusCandidateIsRtlText();
private native boolean nativeFocusCandidateIsTextInput();
/* package */ native int nativeFocusCandidateMaxLength();
/* package */ native String nativeFocusCandidateName();
private native Rect nativeFocusCandidateNodeBounds();
- /* package */ native int nativeFocusCandidatePointer();
+ private native int nativeFocusCandidatePointer();
private native String nativeFocusCandidateText();
private native int nativeFocusCandidateTextSize();
/**
diff --git a/core/java/android/webkit/WebViewClient.java b/core/java/android/webkit/WebViewClient.java
index 032295d..02c7210 100644
--- a/core/java/android/webkit/WebViewClient.java
+++ b/core/java/android/webkit/WebViewClient.java
@@ -86,6 +86,8 @@ public class WebViewClient {
* @param view The WebView that is initiating the callback.
* @param cancelMsg The message to send if the host wants to cancel
* @param continueMsg The message to send if the host wants to continue
+ * @deprecated This method is no longer called. When the WebView encounters
+ * a redirect loop, it will cancel the load.
*/
public void onTooManyRedirects(WebView view, Message cancelMsg,
Message continueMsg) {
diff --git a/core/java/com/google/android/util/GoogleWebContentHelper.java b/core/java/com/google/android/util/GoogleWebContentHelper.java
deleted file mode 100644
index 8291e29..0000000
--- a/core/java/com/google/android/util/GoogleWebContentHelper.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Copyright (C) 2008 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.google.android.util;
-
-import android.content.ContentResolver;
-import android.content.Context;
-import android.net.http.SslError;
-import android.os.Message;
-import android.provider.Settings;
-import android.text.TextUtils;
-import android.view.KeyEvent;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.webkit.HttpAuthHandler;
-import android.webkit.SslErrorHandler;
-import android.webkit.WebSettings;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-import android.widget.TextView;
-
-import java.util.Locale;
-
-/**
- * Helper to display Google web content, and fallback on a static message if the
- * web content is unreachable. For example, this can be used to display
- * "Legal terms".
- * <p>
- * The typical usage pattern is to have two Gservices settings defined:
- * <ul>
- * <li>A secure URL that will be displayed on the device. This should be HTTPS
- * so hotspots won't intercept it giving us a false positive that the page
- * loaded successfully.
- * <li>A pretty human-readable URL that will be displayed to the user in case we
- * cannot reach the above URL.
- * </ul>
- * <p>
- * The typical call sequence is {@link #setUrlsFromGservices(String, String)},
- * {@link #setUnsuccessfulMessage(String)}, and {@link #loadUrl()}. At some
- * point, you'll want to display the layout via {@link #getLayout()}.
- */
-public class GoogleWebContentHelper {
-
- private Context mContext;
-
- private String mSecureUrl;
- private String mPrettyUrl;
-
- private String mUnsuccessfulMessage;
-
- private ViewGroup mLayout;
- private WebView mWebView;
- private View mProgressBar;
- private TextView mTextView;
-
- private boolean mReceivedResponse;
-
- public GoogleWebContentHelper(Context context) {
- mContext = context;
- }
-
- /**
- * Fetches the URLs from Gservices.
- *
- * @param secureSetting The setting key whose value contains the HTTPS URL.
- * @param prettySetting The setting key whose value contains the pretty URL.
- * @return This {@link GoogleWebContentHelper} so methods can be chained.
- */
- public GoogleWebContentHelper setUrlsFromGservices(String secureSetting, String prettySetting) {
- ContentResolver contentResolver = mContext.getContentResolver();
- mSecureUrl = fillUrl(Settings.Gservices.getString(contentResolver, secureSetting),
- mContext);
- mPrettyUrl = fillUrl(Settings.Gservices.getString(contentResolver, prettySetting),
- mContext);
- return this;
- }
-
- /**
- * Fetch directly from provided urls.
- *
- * @param secureUrl The HTTPS URL.
- * @param prettyUrl The pretty URL.
- * @return This {@link GoogleWebContentHelper} so methods can be chained.
- */
- public GoogleWebContentHelper setUrls(String secureUrl, String prettyUrl) {
- mSecureUrl = fillUrl(secureUrl, mContext);
- mPrettyUrl = fillUrl(prettyUrl, mContext);
- return this;
- }
-
-
- /**
- * Sets the message that will be shown if we are unable to load the page.
- * <p>
- * This should be called after {@link #setUrlsFromGservices(String, String)}
- * .
- *
- * @param message The message to load. The first argument, according to
- * {@link java.util.Formatter}, will be substituted with the pretty
- * URL.
- * @return This {@link GoogleWebContentHelper} so methods can be chained.
- */
- public GoogleWebContentHelper setUnsuccessfulMessage(String message) {
- Locale locale = mContext.getResources().getConfiguration().locale;
- mUnsuccessfulMessage = String.format(locale, message, mPrettyUrl);
- return this;
- }
-
- /**
- * Begins loading the secure URL.
- *
- * @return This {@link GoogleWebContentHelper} so methods can be chained.
- */
- public GoogleWebContentHelper loadUrl() {
- ensureViews();
- mWebView.loadUrl(mSecureUrl);
- return this;
- }
-
- /**
- * Loads data into the webview and also provides a failback url
- * @return This {@link GoogleWebContentHelper} so methods can be chained.
- */
- public GoogleWebContentHelper loadDataWithFailUrl(String base, String data,
- String mimeType, String encoding, String failUrl) {
- ensureViews();
- mWebView.loadDataWithBaseURL(base, data, mimeType, encoding, failUrl);
- return this;
- }
-
- /**
- * Helper to handle the back key. Returns true if the back key was handled,
- * otherwise returns false.
- * @param event the key event sent to {@link Activity#dispatchKeyEvent()}
- */
- public boolean handleKey(KeyEvent event) {
- if (event.getKeyCode() == KeyEvent.KEYCODE_BACK
- && event.getAction() == KeyEvent.ACTION_DOWN) {
- if (mWebView.canGoBack()) {
- mWebView.goBack();
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns the layout containing the web view, progress bar, and text view.
- * This class takes care of setting each one's visibility based on current
- * state.
- *
- * @return The layout you should display.
- */
- public ViewGroup getLayout() {
- ensureViews();
- return mLayout;
- }
-
- private synchronized void ensureViews() {
- if (mLayout == null) {
- initializeViews();
- }
- }
-
- /**
- * Fills the URL with the locale.
- *
- * @param url The URL in Formatter style for the extra info to be filled in.
- * @return The filled URL.
- */
- private static String fillUrl(String url, Context context) {
-
- if (TextUtils.isEmpty(url)) {
- return "";
- }
-
- /* We add another layer of indirection here to allow mcc's to fill
- * in Locales for TOS. TODO - REMOVE when needed locales supported
- * natively (when not shipping devices to country X without support
- * for their locale).
- */
- String localeReplacement = context.
- getString(com.android.internal.R.string.locale_replacement);
- if (localeReplacement != null && localeReplacement.length() != 0) {
- url = String.format(url, localeReplacement);
- }
-
- Locale locale = Locale.getDefault();
- String tmp = locale.getLanguage() + "_" + locale.getCountry().toLowerCase();
- return String.format(url, tmp);
- }
-
- private void initializeViews() {
-
- LayoutInflater inflater =
- (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
-
- mLayout = (ViewGroup) inflater.inflate(
- com.android.internal.R.layout.google_web_content_helper_layout, null);
-
- mWebView = (WebView) mLayout.findViewById(com.android.internal.R.id.web);
- mWebView.setWebViewClient(new MyWebViewClient());
- WebSettings settings = mWebView.getSettings();
- settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
-
- mProgressBar = mLayout.findViewById(com.android.internal.R.id.progressContainer);
- TextView message = (TextView) mProgressBar.findViewById(com.android.internal.R.id.message);
- message.setText(com.android.internal.R.string.googlewebcontenthelper_loading);
-
- mTextView = (TextView) mLayout.findViewById(com.android.internal.R.id.text);
- mTextView.setText(mUnsuccessfulMessage);
- }
-
- private synchronized void handleWebViewCompletion(boolean success) {
-
- if (mReceivedResponse) {
- return;
- } else {
- mReceivedResponse = true;
- }
-
- // In both cases, remove the progress bar
- ((ViewGroup) mProgressBar.getParent()).removeView(mProgressBar);
-
- // Remove the view that isn't relevant
- View goneView = success ? mTextView : mWebView;
- ((ViewGroup) goneView.getParent()).removeView(goneView);
-
- // Show the next view, which depends on success
- View visibleView = success ? mWebView : mTextView;
- visibleView.setVisibility(View.VISIBLE);
- }
-
- private class MyWebViewClient extends WebViewClient {
-
- @Override
- public void onPageFinished(WebView view, String url) {
- handleWebViewCompletion(true);
- }
-
- @Override
- public void onReceivedError(WebView view, int errorCode,
- String description, String failingUrl) {
- handleWebViewCompletion(false);
- }
-
- @Override
- public void onReceivedHttpAuthRequest(WebView view,
- HttpAuthHandler handler, String host, String realm) {
- handleWebViewCompletion(false);
- }
-
- @Override
- public void onReceivedSslError(WebView view, SslErrorHandler handler,
- SslError error) {
- handleWebViewCompletion(false);
- }
-
- @Override
- public void onTooManyRedirects(WebView view, Message cancelMsg,
- Message continueMsg) {
- handleWebViewCompletion(false);
- }
-
- }
-
-}