Merge change 22921 into eclair

* changes:
  An attempt to fix a deadlock between OMXCodec::start and upstream ::read
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 9e3008b..77d1740 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -2968,15 +2968,33 @@
                 "gtalk_youtube_video_url";
 
         /**
+         * 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";
+        /**
+         * 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.
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 1dd0096..425ccab 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -8742,7 +8742,8 @@
                 mLastColor = color;
                 color |= 0xFF000000;
 
-                shader = new LinearGradient(0, 0, 0, 1, color, 0, Shader.TileMode.CLAMP);
+                shader = new LinearGradient(0, 0, 0, 1, color | 0xFF000000,
+                        color & 0x00FFFFFF, Shader.TileMode.CLAMP);
 
                 paint.setShader(shader);
                 // Restore the default transfer mode (src_over)
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index d1b9351..754d5a2 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -1381,7 +1381,8 @@
                             address);
                     mConnectedDevices.remove(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP);
                 } else if (!isConnected &&
-                           (state == BluetoothA2dp.STATE_CONNECTED || state != BluetoothA2dp.STATE_PLAYING)){
+                             (state == BluetoothA2dp.STATE_CONNECTED ||
+                              state == BluetoothA2dp.STATE_PLAYING)) {
                     AudioSystem.setDeviceConnectionState(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP,
                                                          AudioSystem.DEVICE_STATE_AVAILABLE,
                                                          address);