Merge "move HttpDateTime from android.webkit to android-common jar"
diff --git a/core/java/android/view/ScaleGestureDetector.java b/core/java/android/view/ScaleGestureDetector.java
index 94ce640..8140d61 100644
--- a/core/java/android/view/ScaleGestureDetector.java
+++ b/core/java/android/view/ScaleGestureDetector.java
@@ -43,9 +43,9 @@
      * 
      * An application will receive events in the following order:
      * <ul>
-     *  <li>One {@link OnScaleGestureListener#onScaleBegin()}
-     *  <li>Zero or more {@link OnScaleGestureListener#onScale()}
-     *  <li>One {@link OnScaleGestureListener#onTransformEnd()}
+     *  <li>One {@link OnScaleGestureListener#onScaleBegin(ScaleGestureDetector)}
+     *  <li>Zero or more {@link OnScaleGestureListener#onScale(ScaleGestureDetector)}
+     *  <li>One {@link OnScaleGestureListener#onScaleEnd(ScaleGestureDetector)}
      * </ul>
      */
     public interface OnScaleGestureListener {
@@ -370,7 +370,7 @@
      * the two pointers forming the gesture.
      * If a gesture is ending, the focal point is the location of the
      * remaining pointer on the screen.
-     * If {@link isInProgress()} would return false, the result of this
+     * If {@link #isInProgress()} would return false, the result of this
      * function is undefined.
      * 
      * @return X coordinate of the focal point in pixels.
@@ -385,7 +385,7 @@
      * the two pointers forming the gesture.
      * If a gesture is ending, the focal point is the location of the
      * remaining pointer on the screen.
-     * If {@link isInProgress()} would return false, the result of this
+     * If {@link #isInProgress()} would return false, the result of this
      * function is undefined.
      * 
      * @return Y coordinate of the focal point in pixels.
@@ -427,7 +427,7 @@
     /**
      * Return the scaling factor from the previous scale event to the current
      * event. This value is defined as
-     * ({@link getCurrentSpan()} / {@link getPreviousSpan()}).
+     * ({@link #getCurrentSpan()} / {@link #getPreviousSpan()}).
      * 
      * @return The current scaling factor.
      */
diff --git a/core/java/android/widget/FastScroller.java b/core/java/android/widget/FastScroller.java
index 67c0def..6b669d8 100644
--- a/core/java/android/widget/FastScroller.java
+++ b/core/java/android/widget/FastScroller.java
@@ -428,12 +428,21 @@
                 if (mListAdapter == null && mList != null) {
                     getSectionsFromIndexer();
                 }
+                if (mList != null) {
+                    mList.requestDisallowInterceptTouchEvent(true);
+                }
 
                 cancelFling();
                 return true;
             }
-        } else if (action == MotionEvent.ACTION_UP) {
+        } else if (action == MotionEvent.ACTION_UP) { // don't add ACTION_CANCEL here
             if (mState == STATE_DRAGGING) {
+                if (mList != null) {
+                    // ViewGroup does the right thing already, but there might
+                    // be other classes that don't properly reset on touch-up,
+                    // so do this explicitly just in case.
+                    mList.requestDisallowInterceptTouchEvent(false);
+                }
                 setState(STATE_VISIBLE);
                 final Handler handler = mHandler;
                 handler.removeCallbacks(mScrollFade);
diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp
index fa1ee0d..1d22de3 100644
--- a/core/jni/AndroidRuntime.cpp
+++ b/core/jni/AndroidRuntime.cpp
@@ -656,6 +656,15 @@
         }
     }
 
+    /* enable poisoning of memory of freed objects */
+    property_get("dalvik.vm.gc.overwritefree", propBuf, "false");
+    if (strcmp(propBuf, "true") == 0) {
+        opt.optionString = "-Xgc:overwritefree";
+        mOptions.add(opt);
+    } else if (strcmp(propBuf, "false") != 0) {
+        LOGW("dalvik.vm.gc.overwritefree should be 'true' or 'false'");
+    }
+
     /* enable debugging; set suspend=y to pause during VM init */
 #ifdef HAVE_ANDROID_OS
     /* use android ADB transport */
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index 265d138..4080a6a 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -17,9 +17,10 @@
 package com.android.providers.settings;
 
 import java.io.FileNotFoundException;
-import java.util.Random;
-import java.security.SecureRandom;
+import java.io.UnsupportedEncodingException;
 import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.util.Random;
 
 import android.backup.BackupManager;
 import android.content.ContentProvider;
@@ -197,6 +198,14 @@
             final String value = c.moveToNext() ? c.getString(0) : null;
             if (value == null) {
                 final SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
+                String serial = SystemProperties.get("ro.serialno");
+                if (serial != null) {
+                    try {
+                        random.setSeed(serial.getBytes("UTF-8"));
+                    } catch (UnsupportedEncodingException ignore) {
+                        // stick with default seed
+                    }
+                }
                 final String newAndroidIdValue = Long.toHexString(random.nextLong());
                 Log.d(TAG, "Generated and saved new ANDROID_ID");
                 final ContentValues values = new ContentValues();