Type: INTEGER (one of the constants below)
*/ public static final String TYPE = "type"; diff --git a/core/java/android/provider/Downloads.java b/core/java/android/provider/Downloads.java index 4c58e0d951bd8..790fe5c3af666 100644 --- a/core/java/android/provider/Downloads.java +++ b/core/java/android/provider/Downloads.java @@ -63,7 +63,7 @@ public final class Downloads implements BaseColumns { * that had initiated a download when that download completes. The * download's content: uri is specified in the intent's data. */ - public static final String DOWNLOAD_COMPLETED_ACTION = + public static final String ACTION_DOWNLOAD_COMPLETED = "android.intent.action.DOWNLOAD_COMPLETED"; /** @@ -76,7 +76,7 @@ public final class Downloads implements BaseColumns { * Note: this is not currently sent for downloads that have completed * successfully. */ - public static final String NOTIFICATION_CLICKED_ACTION = + public static final String ACTION_NOTIFICATION_CLICKED = "android.intent.action.DOWNLOAD_NOTIFICATION_CLICKED"; /** @@ -84,14 +84,14 @@ public final class Downloads implements BaseColumns { *Type: TEXT
*Owner can Init/Read
*/ - public static final String URI = "uri"; + public static final String COLUMN_URI = "uri"; /** * The name of the column containing application-specific data. *Type: TEXT
*Owner can Init/Read/Write
*/ - public static final String APP_DATA = "entity"; + public static final String COLUMN_APP_DATA = "entity"; /** * The name of the column containing the flags that indicates whether @@ -104,7 +104,7 @@ public final class Downloads implements BaseColumns { *Type: BOOLEAN
*Owner can Init
*/ - public static final String NO_INTEGRITY = "no_integrity"; + public static final String COLUMN_NO_INTEGRITY = "no_integrity"; /** * The name of the column containing the filename that the initiating @@ -113,7 +113,7 @@ public final class Downloads implements BaseColumns { *Type: TEXT
*Owner can Init
*/ - public static final String FILENAME_HINT = "hint"; + public static final String COLUMN_FILE_NAME_HINT = "hint"; /** * The name of the column containing the filename where the downloaded data @@ -128,7 +128,7 @@ public final class Downloads implements BaseColumns { *Type: TEXT
*Owner can Init/Read
*/ - public static final String MIMETYPE = "mimetype"; + public static final String COLUMN_MIME_TYPE = "mimetype"; /** * The name of the column containing the flag that controls the destination @@ -136,7 +136,7 @@ public final class Downloads implements BaseColumns { *Type: INTEGER
*Owner can Init
*/ - public static final String DESTINATION = "destination"; + public static final String COLUMN_DESTINATION = "destination"; /** * The name of the column containing the flags that controls whether the @@ -145,7 +145,7 @@ public final class Downloads implements BaseColumns { *Type: INTEGER
*Owner can Init/Read/Write
*/ - public static final String VISIBILITY = "visibility"; + public static final String COLUMN_VISIBILITY = "visibility"; /** * The name of the column containing the current control state of the download. @@ -154,7 +154,7 @@ public final class Downloads implements BaseColumns { *Type: INTEGER
*Owner can Read
*/ - public static final String CONTROL = "control"; + public static final String COLUMN_CONTROL = "control"; /** * The name of the column containing the current status of the download. @@ -163,7 +163,7 @@ public final class Downloads implements BaseColumns { *Type: INTEGER
*Owner can Read
*/ - public static final String STATUS = "status"; + public static final String COLUMN_STATUS = "status"; /** * The name of the column containing the date at which some interesting @@ -172,7 +172,7 @@ public final class Downloads implements BaseColumns { *Type: BIGINT
*Owner can Read
*/ - public static final String LAST_MODIFICATION = "lastmod"; + public static final String COLUMN_LAST_MODIFICATION = "lastmod"; /** * The name of the column containing the package name of the application @@ -181,7 +181,7 @@ public final class Downloads implements BaseColumns { *Type: TEXT
*Owner can Init/Read
*/ - public static final String NOTIFICATION_PACKAGE = "notificationpackage"; + public static final String COLUMN_NOTIFICATION_PACKAGE = "notificationpackage"; /** * The name of the column containing the component name of the class that @@ -191,7 +191,7 @@ public final class Downloads implements BaseColumns { *Type: TEXT
*Owner can Init/Read
*/ - public static final String NOTIFICATION_CLASS = "notificationclass"; + public static final String COLUMN_NOTIFICATION_CLASS = "notificationclass"; /** * If extras are specified when requesting a download they will be provided in the intent that @@ -199,7 +199,7 @@ public final class Downloads implements BaseColumns { *Type: TEXT
*Owner can Init
*/ - public static final String NOTIFICATION_EXTRAS = "notificationextras"; + public static final String COLUMN_NOTIFICATION_EXTRAS = "notificationextras"; /** * The name of the column contain the values of the cookie to be used for @@ -208,7 +208,7 @@ public final class Downloads implements BaseColumns { *Type: TEXT
*Owner can Init
*/ - public static final String COOKIE_DATA = "cookiedata"; + public static final String COLUMN_COOKIE_DATA = "cookiedata"; /** * The name of the column containing the user agent that the initiating @@ -216,7 +216,7 @@ public final class Downloads implements BaseColumns { *Type: TEXT
*Owner can Init
*/ - public static final String USER_AGENT = "useragent"; + public static final String COLUMN_USER_AGENT = "useragent"; /** * The name of the column containing the referer (sic) that the initiating @@ -224,7 +224,7 @@ public final class Downloads implements BaseColumns { *Type: TEXT
*Owner can Init
*/ - public static final String REFERER = "referer"; + public static final String COLUMN_REFERER = "referer"; /** * The name of the column containing the total size of the file being @@ -232,7 +232,7 @@ public final class Downloads implements BaseColumns { *Type: INTEGER
*Owner can Read
*/ - public static final String TOTAL_BYTES = "total_bytes"; + public static final String COLUMN_TOTAL_BYTES = "total_bytes"; /** * The name of the column containing the size of the part of the file that @@ -240,7 +240,7 @@ public final class Downloads implements BaseColumns { *Type: INTEGER
*Owner can Read
*/ - public static final String CURRENT_BYTES = "current_bytes"; + public static final String COLUMN_CURRENT_BYTES = "current_bytes"; /** * The name of the column where the initiating application can provide the @@ -252,7 +252,7 @@ public final class Downloads implements BaseColumns { *Type: INTEGER
*Owner can Init
*/ - public static final String OTHER_UID = "otheruid"; + public static final String COLUMN_OTHER_UID = "otheruid"; /** * The name of the column where the initiating application can provided the @@ -261,7 +261,7 @@ public final class Downloads implements BaseColumns { *Type: TEXT
*Owner can Init/Read/Write
*/ - public static final String TITLE = "title"; + public static final String COLUMN_TITLE = "title"; /** * The name of the column where the initiating application can provide the @@ -270,7 +270,7 @@ public final class Downloads implements BaseColumns { *Type: TEXT
*Owner can Init/Read/Write
*/ - public static final String DESCRIPTION = "description"; + public static final String COLUMN_DESCRIPTION = "description"; /* * Lists the destinations that an application can specify for a download. diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index e928998b6d00a..03ae6dc6a3aa4 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -30,8 +30,9 @@ import android.os.ParcelFileDescriptor; import android.util.AttributeSet; import android.util.Config; import android.util.Log; -import java.util.ArrayList; +import java.lang.ref.WeakReference; +import java.util.ArrayList; import java.util.concurrent.locks.ReentrantLock; import java.lang.ref.WeakReference; diff --git a/core/java/android/webkit/CookieSyncManager.java b/core/java/android/webkit/CookieSyncManager.java index f2511d84d18f2..e37dc5622b3e3 100644 --- a/core/java/android/webkit/CookieSyncManager.java +++ b/core/java/android/webkit/CookieSyncManager.java @@ -25,30 +25,39 @@ import java.util.ArrayList; import java.util.Iterator; /** - * The class CookieSyncManager is used to synchronize the browser cookies - * between RAM and FLASH. To get the best performance, browser cookie is saved - * in RAM. We use a separate thread to sync the cookies between RAM and FLASH on - * a timer base. + * The CookieSyncManager is used to synchronize the browser cookie store + * between RAM and permanent storage. To get the best performance, browser cookies are + * saved in RAM. A separate thread saves the cookies between, driven by a timer. *+ * * To use the CookieSyncManager, the host application has to call the following - * when the application starts. + * when the application starts: *
- * CookieSyncManager.createInstance(context) - *
- * To set up for sync, the host application has to call - *
- * CookieSyncManager.getInstance().startSync() - *
- * in its Activity.onResume(), and call + * + *
CookieSyncManager.createInstance(context)
+ * + * To set up for sync, the host application has to call
+ *
CookieSyncManager.getInstance().startSync()
+ * + * in Activity.onResume(), and call *
+ * + *
* CookieSyncManager.getInstance().stopSync() - *- * in its Activity.onStop(). - *
+ *
+ * + * in Activity.onPause().
+ * * To get instant sync instead of waiting for the timer to trigger, the host can * call *
- * CookieSyncManager.getInstance().sync() + *
CookieSyncManager.getInstance().sync()
+ * + * The sync interval is 5 minutes, so you will want to force syncs + * manually anyway, for instance in {@link + * WebViewClient#onPageFinished}. Note that even sync() happens + * asynchronously, so don't do it just as your activity is shutting + * down. */ public final class CookieSyncManager extends WebSyncManager { @@ -91,7 +100,7 @@ public final class CookieSyncManager extends WebSyncManager { } /** - * Package level api, called from CookieManager Get all the cookies which + * Package level api, called from CookieManager. Get all the cookies which * matches a given base domain. * @param domain * @return A list of Cookie diff --git a/core/java/android/webkit/WebSettings.java b/core/java/android/webkit/WebSettings.java index 025e6bb819cca..bc8e3d97fa47c 100644 --- a/core/java/android/webkit/WebSettings.java +++ b/core/java/android/webkit/WebSettings.java @@ -111,9 +111,13 @@ public class WebSettings { private boolean mSyncPending = false; // Custom handler that queues messages until the WebCore thread is active. private final EventHandler mEventHandler; + // Private settings so we don't have to go into native code to // retrieve the values. After setXXX, postSync() needs to be called. - // XXX: The default values need to match those in WebSettings.cpp + // + // The default values need to match those in WebSettings.cpp + // If the defaults change, please also update the JavaDocs so developers + // know what they are. private LayoutAlgorithm mLayoutAlgorithm = LayoutAlgorithm.NARROW_COLUMNS; private Context mContext; private TextSize mTextSize = TextSize.NORMAL; @@ -459,24 +463,21 @@ public class WebSettings { } /** - * Tell the WebView to use the double tree rendering algorithm. - * @param use True if the WebView is to use double tree rendering, false - * otherwise. + * @deprecated This setting controlled a rendering optimization + * that is no longer present. Setting it now has no effect. */ + @Deprecated public synchronized void setUseDoubleTree(boolean use) { - if (mUseDoubleTree != use) { - mUseDoubleTree = use; - postSync(); - } + return; } /** - * Return true if the WebView is using the double tree rendering algorithm. - * @return True if the WebView is using the double tree rendering - * algorithm. + * @deprecated This setting controlled a rendering optimization + * that is no longer present. Setting it now has no effect. */ + @Deprecated public synchronized boolean getUseDoubleTree() { - return mUseDoubleTree; + return false; } /** @@ -581,7 +582,7 @@ public class WebSettings { } /** - * Return the current layout algorithm. + * Return the current layout algorithm. The default is NARROW_COLUMNS. * @return LayoutAlgorithm enum value describing the layout algorithm * being used. * @see WebSettings.LayoutAlgorithm @@ -602,7 +603,7 @@ public class WebSettings { } /** - * Get the standard font family name. + * Get the standard font family name. The default is "sans-serif". * @return The standard font family name as a string. */ public synchronized String getStandardFontFamily() { @@ -621,7 +622,7 @@ public class WebSettings { } /** - * Get the fixed font family name. + * Get the fixed font family name. The default is "monospace". * @return The fixed font family name as a string. */ public synchronized String getFixedFontFamily() { @@ -648,7 +649,7 @@ public class WebSettings { } /** - * Set the serif font family name. + * Set the serif font family name. The default is "sans-serif". * @param font A font family name. */ public synchronized void setSerifFontFamily(String font) { @@ -659,7 +660,7 @@ public class WebSettings { } /** - * Get the serif font family name. + * Get the serif font family name. The default is "serif". * @return The serif font family name as a string. */ public synchronized String getSerifFontFamily() { @@ -678,7 +679,7 @@ public class WebSettings { } /** - * Get the cursive font family name. + * Get the cursive font family name. The default is "cursive". * @return The cursive font family name as a string. */ public synchronized String getCursiveFontFamily() { @@ -697,7 +698,7 @@ public class WebSettings { } /** - * Get the fantasy font family name. + * Get the fantasy font family name. The default is "fantasy". * @return The fantasy font family name as a string. */ public synchronized String getFantasyFontFamily() { @@ -718,7 +719,7 @@ public class WebSettings { } /** - * Get the minimum font size. + * Get the minimum font size. The default is 8. * @return A non-negative integer between 1 and 72. */ public synchronized int getMinimumFontSize() { @@ -739,7 +740,7 @@ public class WebSettings { } /** - * Get the minimum logical font size. + * Get the minimum logical font size. The default is 8. * @return A non-negative integer between 1 and 72. */ public synchronized int getMinimumLogicalFontSize() { @@ -760,7 +761,7 @@ public class WebSettings { } /** - * Get the default font size. + * Get the default font size. The default is 16. * @return A non-negative integer between 1 and 72. */ public synchronized int getDefaultFontSize() { @@ -781,7 +782,7 @@ public class WebSettings { } /** - * Get the default fixed font size. + * Get the default fixed font size. The default is 16. * @return A non-negative integer between 1 and 72. */ public synchronized int getDefaultFixedFontSize() { @@ -801,6 +802,7 @@ public class WebSettings { /** * Return true if the WebView will load image resources automatically. + * The default is true. * @return True if the WebView loads images automatically. */ public synchronized boolean getLoadsImagesAutomatically() { @@ -820,16 +822,16 @@ public class WebSettings { } /** - * Return true if the WebView will block network image. + * Return true if the WebView will block network image. The default is false. * @return True if the WebView blocks network image. */ public synchronized boolean getBlockNetworkImage() { return mBlockNetworkImage; } - + /** * @hide - * Tell the WebView to block all network load requests. + * Tell the WebView to block all network load requests. * @param flag True if the WebView should block all network loads */ public synchronized void setBlockNetworkLoads(boolean flag) { @@ -842,13 +844,14 @@ public class WebSettings { /** * @hide * Return true if the WebView will block all network loads. + * The default is false. * @return True if the WebView blocks all network loads. */ public synchronized boolean getBlockNetworkLoads() { return mBlockNetworkLoads; } - - + + private void verifyNetworkAccess() { if (!mBlockNetworkLoads) { if (mContext.checkPermission("android.permission.INTERNET", @@ -896,7 +899,7 @@ public class WebSettings { } /** - * Return true if javascript is enabled. + * Return true if javascript is enabled. Note: The default is false. * @return True if javascript is enabled. */ public synchronized boolean getJavaScriptEnabled() { @@ -933,7 +936,8 @@ public class WebSettings { } /** - * Return true if javascript can open windows automatically. + * Return true if javascript can open windows automatically. The default + * is false. * @return True if javascript can open windows automatically during * window.open(). */ @@ -953,7 +957,7 @@ public class WebSettings { } /** - * Get the default text encoding name. + * Get the default text encoding name. The default is "Latin-1". * @return The default text encoding name as a string. */ public synchronized String getDefaultTextEncodingName() { @@ -1042,8 +1046,8 @@ public class WebSettings { /** * Set the priority of the Render thread. Unlike the other settings, this - * one only needs to be called once per process. - * + * one only needs to be called once per process. The default is NORMAL. + * * @param priority RenderPriority, can be normal, high or low. */ public synchronized void setRenderPriority(RenderPriority priority) { diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 052c2d3835d30..653720500a25d 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -95,7 +95,104 @@ import java.util.List; * in a WebView, you must add the INTERNET permissions to your * Android Manifest file:
*<uses-permission android:name="android.permission.INTERNET" />+ * *
This must be a child of the <manifest> element.
By default, a WebView provides no browser-like widgets, does not + * enable JavaScript and errors will be ignored. If your goal is only + * to display some HTML as a part of your UI, this is probably fine; + * the user won't need to interact with the web page beyond reading + * it, and the web page won't need to interact with the user. If you + * actually want a fully blown web browser, then you probably want to + * invoke the Browser application with your URL rather than show it + * with a WebView. See {@link android.content.Intent} for more information.
+ * + *
+ * WebView webview = new WebView(this);
+ * setContentView(webview);
+ *
+ * // Simplest usage: note that an exception will NOT be thrown
+ * // if there is an error loading this page (see below).
+ * webview.loadUrl("http://slashdot.org/");
+ *
+ * // Of course you can also load from any string:
+ * String summary = "<html><body>You scored <b>192 points.</body></html>";
+ * webview.loadData(summary, "text/html", "utf-8");
+ * // ... although note that there are restrictions on what this HTML can do.
+ * // See the JavaDocs for loadData and loadDataWithBaseUrl for more info.
+ *
+ *
+ * A WebView has several customization points where you can add your + * own behavior. These are:
+ * + *Here's a more complicated example, showing error handling, + * settings, and progress notification:
+ * + *
+ * // Let's display the progress in the activity title bar, like the
+ * // browser app does.
+ * getWindow().requestFeature(Window.FEATURE_PROGRESS);
+ *
+ * webview.getSettings().setJavaScriptEnabled(true);
+ *
+ * final Activity activity = this;
+ * webview.setWebChromeClient(new WebChromeClient() {
+ * public void onProgressChanged(WebView view, int progress) {
+ * // Activities and WebViews measure progress with different scales.
+ * // The progress meter will automatically disappear when we reach 100%
+ * activity.setProgress(progress * 1000);
+ * }
+ * });
+ * webview.setWebViewClient(new WebViewClient() {
+ * public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
+ * Toast.makeText(activity, "Oh no! " + description, Toast.LENGTH_SHORT).show();
+ * }
+ * });
+ *
+ * webview.loadUrl("http://slashdot.org/");
+ *
+ *
+ * For obvious security reasons, your application has its own + * cache, cookie store etc - it does not share the Browser + * applications data. Cookies are managed on a separate thread, so + * operations like index building don't block the UI + * thread. Follow the instructions in {@link android.webkit.CookieSyncManager} + * if you want to use cookies in your application. + *
+ * + *By default, requests by the HTML to open new windows are + * ignored. This is true whether they be opened by JavaScript or by + * the target attribute on a link. You can customize your + * WebChromeClient to provide your own behaviour for opening multiple windows, + * and render them in whatever manner you want.
+ * + *Standard behavior for an Activity is to be destroyed and + * recreated when the devices orientation is changed. This will cause + * the WebView to reload the current page. If you don't want that, you + * can set your Activity to handle the orientation and keyboardHidden + * changes, and then just leave the WebView alone. It'll automatically + * re-orient itself as appropriate.
*/ public class WebView extends AbsoluteLayout implements ViewTreeObserver.OnGlobalFocusChangeListener, @@ -1835,14 +1932,15 @@ public class WebView extends AbsoluteLayout } /** - * Clear the resource cache. This will cause resources to be re-downloaded - * if accessed again. - *
- * Note: this really needs to be a static method as it clears cache for all
- * WebView. But we need mWebViewCore to send message to WebCore thread, so
- * we can't make this static.
+ * Clear the resource cache. Note that the cache is per-application, so
+ * this will clear the cache for all WebViews used.
+ *
+ * @param includeDiskFiles If false, only the RAM cache is cleared.
*/
public void clearCache(boolean includeDiskFiles) {
+ // Note: this really needs to be a static method as it clears cache for all
+ // WebView. But we need mWebViewCore to send message to WebCore thread, so
+ // we can't make this static.
mWebViewCore.sendMessage(EventHub.CLEAR_CACHE,
includeDiskFiles ? 1 : 0, 0);
}
diff --git a/core/java/android/widget/AbsSeekBar.java b/core/java/android/widget/AbsSeekBar.java
index 04cb8a0159442..f92eb997d3a4a 100644
--- a/core/java/android/widget/AbsSeekBar.java
+++ b/core/java/android/widget/AbsSeekBar.java
@@ -320,11 +320,6 @@ public abstract class AbsSeekBar extends ProgressBar {
final int max = getMax();
progress += scale * max;
- if (progress < 0) {
- progress = 0;
- } else if (progress > max) {
- progress = max;
- }
setProgress((int) progress, true);
}
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 6cfdf8f0e8a0e..f45d2e462bfe6 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -760,7 +760,7 @@