Merge change 8688

* changes:
  Fix the issue of new call failing in 3-way call scenario.
diff --git a/core/java/android/view/MotionEvent.java b/core/java/android/view/MotionEvent.java
index 89b721d..d46660c 100644
--- a/core/java/android/view/MotionEvent.java
+++ b/core/java/android/view/MotionEvent.java
@@ -509,7 +509,7 @@
         ev.mYPrecision = o.mYPrecision;
         
         final int NT = ev.mNumSamples = o.mNumSamples;
-        if (ev.mTimeSamples.length < NT) {
+        if (ev.mTimeSamples.length >= NT) {
             System.arraycopy(o.mTimeSamples, 0, ev.mTimeSamples, 0, NT);
         } else {
             ev.mTimeSamples = (long[])o.mTimeSamples.clone();
diff --git a/core/res/res/drawable/rate_star_small_half.png b/core/res/res/drawable/rate_star_small_half.png
index a81449b..437a11c 100644
--- a/core/res/res/drawable/rate_star_small_half.png
+++ b/core/res/res/drawable/rate_star_small_half.png
Binary files differ
diff --git a/core/res/res/drawable/rate_star_small_off.png b/core/res/res/drawable/rate_star_small_off.png
index 618766f..6fb0a36 100644
--- a/core/res/res/drawable/rate_star_small_off.png
+++ b/core/res/res/drawable/rate_star_small_off.png
Binary files differ
diff --git a/core/res/res/drawable/rate_star_small_on.png b/core/res/res/drawable/rate_star_small_on.png
index 74e3280..5392361 100644
--- a/core/res/res/drawable/rate_star_small_on.png
+++ b/core/res/res/drawable/rate_star_small_on.png
Binary files differ
diff --git a/packages/TtsService/src/android/tts/TtsService.java b/packages/TtsService/src/android/tts/TtsService.java
index e52ba80..6832862 100755
--- a/packages/TtsService/src/android/tts/TtsService.java
+++ b/packages/TtsService/src/android/tts/TtsService.java
@@ -109,7 +109,9 @@
             mFilename = file;
         }
     }
-
+    // If the speech queue is locked for more than 5 seconds, something has gone
+    // very wrong with processSpeechQueue.
+    private static final int SPEECHQUEUELOCK_TIMEOUT = 5000;
     private static final int MAX_SPEECH_ITEM_CHAR_LENGTH = 4000;
     private static final int MAX_FILENAME_LENGTH = 250;
     // TODO use the TTS stream type when available
@@ -389,9 +391,8 @@
         int result = TextToSpeech.TTS_ERROR;
         boolean speechQueueAvailable = false;
         try{
-            // If the queue is locked for more than 1 second,
-            // something has gone very wrong with processSpeechQueue.
-            speechQueueAvailable = speechQueueLock.tryLock(1000, TimeUnit.MILLISECONDS);
+            speechQueueAvailable =
+                    speechQueueLock.tryLock(SPEECHQUEUELOCK_TIMEOUT, TimeUnit.MILLISECONDS);
             if (speechQueueAvailable) {
                 Log.i("TtsService", "Stopping");
                 for (int i = mSpeechQueue.size() - 1; i > -1; i--){
@@ -439,9 +440,8 @@
         int result = TextToSpeech.TTS_ERROR;
         boolean speechQueueAvailable = false;
         try{
-            // If the queue is locked for more than 1 second,
-            // something has gone very wrong with processSpeechQueue.
-            speechQueueAvailable = speechQueueLock.tryLock(1000, TimeUnit.MILLISECONDS);
+            speechQueueAvailable =
+                    speechQueueLock.tryLock(SPEECHQUEUELOCK_TIMEOUT, TimeUnit.MILLISECONDS);
             if (speechQueueAvailable) {
                 for (int i = mSpeechQueue.size() - 1; i > -1; i--){
                     if (mSpeechQueue.get(i).mType != SpeechItem.TEXT_TO_FILE){
@@ -752,8 +752,10 @@
     private void processSpeechQueue() {
         boolean speechQueueAvailable = false;
         try {
-            speechQueueAvailable = speechQueueLock.tryLock();
+            speechQueueAvailable =
+                    speechQueueLock.tryLock(SPEECHQUEUELOCK_TIMEOUT, TimeUnit.MILLISECONDS);
             if (!speechQueueAvailable) {
+                Log.e("TtsService", "processSpeechQueue - Speech queue is unavailable.");
                 return;
             }
             if (mSpeechQueue.size() < 1) {
@@ -822,6 +824,9 @@
             if (mSpeechQueue.size() > 0) {
                 mSpeechQueue.remove(0);
             }
+        } catch (InterruptedException e) {
+          Log.e("TtsService", "TTS processSpeechQueue: tryLock interrupted");
+          e.printStackTrace();
         } finally {
             // This check is needed because finally will always run; even if the
             // method returns somewhere in the try block.