Merge change I0953c1d5 into eclair

* changes:
  fix [2153873] EGL-1.4 software implementation misses surface attributes
diff --git a/api/5.xml b/api/5.xml
index ca2cceb..6148047 100644
--- a/api/5.xml
+++ b/api/5.xml
@@ -112806,6 +112806,58 @@
 >
 </field>
 </class>
+<interface name="ContactsContract.BaseSyncColumns"
+ abstract="true"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<field name="SYNC1"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;sync1&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SYNC2"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;sync2&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SYNC3"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;sync3&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SYNC4"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;sync4&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</interface>
 <class name="ContactsContract.CommonDataKinds"
  extends="java.lang.Object"
  abstract="false"
@@ -112834,6 +112886,49 @@
 >
 </field>
 </interface>
+<interface name="ContactsContract.CommonDataKinds.CommonColumns"
+ abstract="true"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<implements name="android.provider.ContactsContract.CommonDataKinds.BaseTypes">
+</implements>
+<field name="DATA"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data1&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="LABEL"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data3&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="TYPE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data2&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</interface>
 <class name="ContactsContract.CommonDataKinds.Email"
  extends="java.lang.Object"
  abstract="false"
@@ -112842,6 +112937,10 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<implements name="android.provider.ContactsContract.CommonDataKinds.CommonColumns">
+</implements>
+<implements name="android.provider.ContactsContract.DataColumnsWithJoins">
+</implements>
 <method name="getTypeLabel"
  return="java.lang.CharSequence"
  abstract="false"
@@ -112988,6 +113087,10 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<implements name="android.provider.ContactsContract.CommonDataKinds.CommonColumns">
+</implements>
+<implements name="android.provider.ContactsContract.DataColumnsWithJoins">
+</implements>
 <method name="getTypeResource"
  return="int"
  abstract="false"
@@ -113065,6 +113168,8 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<implements name="android.provider.ContactsContract.DataColumnsWithJoins">
+</implements>
 <field name="CONTENT_ITEM_TYPE"
  type="java.lang.String"
  transient="false"
@@ -113107,6 +113212,10 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<implements name="android.provider.ContactsContract.CommonDataKinds.CommonColumns">
+</implements>
+<implements name="android.provider.ContactsContract.DataColumnsWithJoins">
+</implements>
 <method name="getProtocolLabel"
  return="java.lang.CharSequence"
  abstract="false"
@@ -113352,6 +113461,10 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<implements name="android.provider.ContactsContract.CommonDataKinds.CommonColumns">
+</implements>
+<implements name="android.provider.ContactsContract.DataColumnsWithJoins">
+</implements>
 <field name="CONTENT_ITEM_TYPE"
  type="java.lang.String"
  transient="false"
@@ -113438,6 +113551,8 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<implements name="android.provider.ContactsContract.DataColumnsWithJoins">
+</implements>
 <field name="CONTENT_ITEM_TYPE"
  type="java.lang.String"
  transient="false"
@@ -113469,6 +113584,10 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<implements name="android.provider.ContactsContract.CommonDataKinds.CommonColumns">
+</implements>
+<implements name="android.provider.ContactsContract.DataColumnsWithJoins">
+</implements>
 <method name="getTypeLabel"
  return="java.lang.CharSequence"
  abstract="false"
@@ -113618,6 +113737,10 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<implements name="android.provider.ContactsContract.CommonDataKinds.CommonColumns">
+</implements>
+<implements name="android.provider.ContactsContract.DataColumnsWithJoins">
+</implements>
 <method name="getTypeLabel"
  return="java.lang.CharSequence"
  abstract="false"
@@ -113930,6 +114053,8 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<implements name="android.provider.ContactsContract.DataColumnsWithJoins">
+</implements>
 <field name="CONTENT_ITEM_TYPE"
  type="java.lang.String"
  transient="false"
@@ -113961,6 +114086,10 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<implements name="android.provider.ContactsContract.CommonDataKinds.CommonColumns">
+</implements>
+<implements name="android.provider.ContactsContract.DataColumnsWithJoins">
+</implements>
 <field name="CONTENT_ITEM_TYPE"
  type="java.lang.String"
  transient="false"
@@ -114146,6 +114275,8 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<implements name="android.provider.ContactsContract.DataColumnsWithJoins">
+</implements>
 <field name="CONTENT_ITEM_TYPE"
  type="java.lang.String"
  transient="false"
@@ -114265,6 +114396,10 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<implements name="android.provider.ContactsContract.CommonDataKinds.CommonColumns">
+</implements>
+<implements name="android.provider.ContactsContract.DataColumnsWithJoins">
+</implements>
 <method name="getTypeLabel"
  return="java.lang.CharSequence"
  abstract="false"
@@ -114457,6 +114592,10 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<implements name="android.provider.ContactsContract.CommonDataKinds.CommonColumns">
+</implements>
+<implements name="android.provider.ContactsContract.DataColumnsWithJoins">
+</implements>
 <field name="CONTENT_ITEM_TYPE"
  type="java.lang.String"
  transient="false"
@@ -114557,6 +114696,143 @@
 >
 </field>
 </class>
+<interface name="ContactsContract.ContactOptionsColumns"
+ abstract="true"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<field name="CUSTOM_RINGTONE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;custom_ringtone&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="LAST_TIME_CONTACTED"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;last_time_contacted&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SEND_TO_VOICEMAIL"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;send_to_voicemail&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="STARRED"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;starred&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="TIMES_CONTACTED"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;times_contacted&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</interface>
+<interface name="ContactsContract.ContactStatusColumns"
+ abstract="true"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<field name="CONTACT_PRESENCE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;contact_presence&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="CONTACT_STATUS"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;contact_status&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="CONTACT_STATUS_ICON"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;contact_status_icon&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="CONTACT_STATUS_LABEL"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;contact_status_label&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="CONTACT_STATUS_RES_PACKAGE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;contact_status_res_package&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="CONTACT_STATUS_TIMESTAMP"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;contact_status_ts&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</interface>
 <class name="ContactsContract.Contacts"
  extends="java.lang.Object"
  abstract="false"
@@ -114567,6 +114843,12 @@
 >
 <implements name="android.provider.BaseColumns">
 </implements>
+<implements name="android.provider.ContactsContract.ContactOptionsColumns">
+</implements>
+<implements name="android.provider.ContactsContract.ContactStatusColumns">
+</implements>
+<implements name="android.provider.ContactsContract.ContactsColumns">
+</implements>
 <method name="getLookupUri"
  return="android.net.Uri"
  abstract="false"
@@ -114756,6 +115038,8 @@
 >
 <implements name="android.provider.BaseColumns">
 </implements>
+<implements name="android.provider.ContactsContract.ContactsColumns">
+</implements>
 <field name="CONTENT_DIRECTORY"
  type="java.lang.String"
  transient="false"
@@ -114778,6 +115062,8 @@
 >
 <implements name="android.provider.BaseColumns">
 </implements>
+<implements name="android.provider.ContactsContract.DataColumns">
+</implements>
 <field name="CONTENT_DIRECTORY"
  type="java.lang.String"
  transient="false"
@@ -114800,6 +115086,8 @@
 >
 <implements name="android.provider.BaseColumns">
 </implements>
+<implements name="android.provider.ContactsContract.DataColumns">
+</implements>
 <field name="CONTENT_DIRECTORY"
  type="java.lang.String"
  transient="false"
@@ -114812,6 +115100,69 @@
 >
 </field>
 </class>
+<interface name="ContactsContract.ContactsColumns"
+ abstract="true"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<field name="DISPLAY_NAME"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;display_name&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="HAS_PHONE_NUMBER"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;has_phone_number&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="IN_VISIBLE_GROUP"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;in_visible_group&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="LOOKUP_KEY"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;lookup&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="PHOTO_ID"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;photo_id&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</interface>
 <class name="ContactsContract.Data"
  extends="java.lang.Object"
  abstract="false"
@@ -114820,6 +115171,8 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<implements name="android.provider.ContactsContract.DataColumnsWithJoins">
+</implements>
 <method name="getContactLookupUri"
  return="android.net.Uri"
  abstract="false"
@@ -114857,6 +115210,300 @@
 >
 </field>
 </class>
+<interface name="ContactsContract.DataColumns"
+ abstract="true"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<field name="DATA1"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data1&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DATA10"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data10&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DATA11"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data11&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DATA12"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data12&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DATA13"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data13&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DATA14"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data14&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DATA15"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data15&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DATA2"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data2&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DATA3"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data3&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DATA4"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data4&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DATA5"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data5&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DATA6"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data6&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DATA7"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data7&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DATA8"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data8&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DATA9"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data9&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DATA_VERSION"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data_version&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="IS_PRIMARY"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;is_primary&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="IS_SUPER_PRIMARY"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;is_super_primary&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="MIMETYPE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;mimetype&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="RAW_CONTACT_ID"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;raw_contact_id&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SYNC1"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data_sync1&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SYNC2"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data_sync2&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SYNC3"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data_sync3&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SYNC4"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;data_sync4&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</interface>
+<interface name="ContactsContract.DataColumnsWithJoins"
+ abstract="true"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<implements name="android.provider.BaseColumns">
+</implements>
+<implements name="android.provider.ContactsContract.ContactOptionsColumns">
+</implements>
+<implements name="android.provider.ContactsContract.ContactStatusColumns">
+</implements>
+<implements name="android.provider.ContactsContract.ContactsColumns">
+</implements>
+<implements name="android.provider.ContactsContract.DataColumns">
+</implements>
+<implements name="android.provider.ContactsContract.RawContactsColumns">
+</implements>
+<implements name="android.provider.ContactsContract.StatusColumns">
+</implements>
+</interface>
 <class name="ContactsContract.Groups"
  extends="java.lang.Object"
  abstract="false"
@@ -114867,6 +115514,10 @@
 >
 <implements name="android.provider.BaseColumns">
 </implements>
+<implements name="android.provider.ContactsContract.GroupsColumns">
+</implements>
+<implements name="android.provider.ContactsContract.SyncColumns">
+</implements>
 <field name="CONTENT_ITEM_TYPE"
  type="java.lang.String"
  transient="false"
@@ -114910,6 +115561,102 @@
 >
 </field>
 </class>
+<interface name="ContactsContract.GroupsColumns"
+ abstract="true"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<field name="DELETED"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;deleted&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="GROUP_VISIBLE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;group_visible&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="NOTES"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;notes&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SHOULD_SYNC"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;should_sync&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SUMMARY_COUNT"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;summ_count&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SUMMARY_WITH_PHONES"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;summ_phones&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SYSTEM_ID"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;system_id&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="TITLE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;title&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</interface>
 <class name="ContactsContract.Intents"
  extends="java.lang.Object"
  abstract="false"
@@ -115328,6 +116075,12 @@
 >
 <implements name="android.provider.BaseColumns">
 </implements>
+<implements name="android.provider.ContactsContract.ContactOptionsColumns">
+</implements>
+<implements name="android.provider.ContactsContract.ContactsColumns">
+</implements>
+<implements name="android.provider.ContactsContract.PhoneLookupColumns">
+</implements>
 <field name="CONTENT_FILTER_URI"
  type="android.net.Uri"
  transient="false"
@@ -115339,6 +116092,47 @@
 >
 </field>
 </class>
+<interface name="ContactsContract.PhoneLookupColumns"
+ abstract="true"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<field name="LABEL"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;label&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="NUMBER"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;number&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="TYPE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;type&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</interface>
 <class name="ContactsContract.Presence"
  extends="android.provider.ContactsContract.StatusUpdates"
  abstract="false"
@@ -115356,6 +116150,69 @@
 >
 </constructor>
 </class>
+<interface name="ContactsContract.PresenceColumns"
+ abstract="true"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<field name="CUSTOM_PROTOCOL"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;custom_protocol&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DATA_ID"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;presence_data_id&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="IM_ACCOUNT"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;im_account&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="IM_HANDLE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;im_handle&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="PROTOCOL"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;protocol&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</interface>
 <class name="ContactsContract.QuickContact"
  extends="java.lang.Object"
  abstract="false"
@@ -115458,6 +116315,12 @@
 >
 <implements name="android.provider.BaseColumns">
 </implements>
+<implements name="android.provider.ContactsContract.ContactOptionsColumns">
+</implements>
+<implements name="android.provider.ContactsContract.RawContactsColumns">
+</implements>
+<implements name="android.provider.ContactsContract.SyncColumns">
+</implements>
 <method name="getContactLookupUri"
  return="android.net.Uri"
  abstract="false"
@@ -115560,6 +116423,8 @@
 >
 <implements name="android.provider.BaseColumns">
 </implements>
+<implements name="android.provider.ContactsContract.DataColumns">
+</implements>
 <field name="CONTENT_DIRECTORY"
  type="java.lang.String"
  transient="false"
@@ -115582,6 +116447,8 @@
 >
 <implements name="android.provider.BaseColumns">
 </implements>
+<implements name="android.provider.ContactsContract.DataColumns">
+</implements>
 <field name="CONTENT_DIRECTORY"
  type="java.lang.String"
  transient="false"
@@ -115605,6 +116472,47 @@
 >
 </field>
 </class>
+<interface name="ContactsContract.RawContactsColumns"
+ abstract="true"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<field name="AGGREGATION_MODE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;aggregation_mode&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="CONTACT_ID"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;contact_id&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DELETED"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;deleted&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</interface>
 <class name="ContactsContract.RawContactsEntity"
  extends="java.lang.Object"
  abstract="false"
@@ -115615,6 +116523,10 @@
 >
 <implements name="android.provider.BaseColumns">
 </implements>
+<implements name="android.provider.ContactsContract.DataColumns">
+</implements>
+<implements name="android.provider.ContactsContract.RawContactsColumns">
+</implements>
 <field name="CONTENT_TYPE"
  type="java.lang.String"
  transient="false"
@@ -115656,6 +116568,8 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<implements name="android.provider.ContactsContract.SettingsColumns">
+</implements>
 <field name="CONTENT_ITEM_TYPE"
  type="java.lang.String"
  transient="false"
@@ -115689,6 +116603,165 @@
 >
 </field>
 </class>
+<interface name="ContactsContract.SettingsColumns"
+ abstract="true"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<field name="ACCOUNT_NAME"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;account_name&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="ACCOUNT_TYPE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;account_type&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="ANY_UNSYNCED"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;any_unsynced&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SHOULD_SYNC"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;should_sync&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="UNGROUPED_COUNT"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;summ_count&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="UNGROUPED_VISIBLE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;ungrouped_visible&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="UNGROUPED_WITH_PHONES"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;summ_phones&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</interface>
+<interface name="ContactsContract.StatusColumns"
+ abstract="true"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<field name="PRESENCE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;mode&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="STATUS"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;status&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="STATUS_ICON"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;status_icon&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="STATUS_LABEL"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;status_label&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="STATUS_RES_PACKAGE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;status_res_package&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="STATUS_TIMESTAMP"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;status_ts&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</interface>
 <class name="ContactsContract.StatusUpdates"
  extends="java.lang.Object"
  abstract="false"
@@ -115697,6 +116770,10 @@
  deprecated="not deprecated"
  visibility="public"
 >
+<implements name="android.provider.ContactsContract.PresenceColumns">
+</implements>
+<implements name="android.provider.ContactsContract.StatusColumns">
+</implements>
 <method name="getPresenceIconResourceId"
  return="int"
  abstract="false"
@@ -115756,6 +116833,71 @@
 >
 </field>
 </class>
+<interface name="ContactsContract.SyncColumns"
+ abstract="true"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="protected"
+>
+<implements name="android.provider.ContactsContract.BaseSyncColumns">
+</implements>
+<field name="ACCOUNT_NAME"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;account_name&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="ACCOUNT_TYPE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;account_type&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="DIRTY"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;dirty&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SOURCE_ID"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;sourceid&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="VERSION"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;version&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</interface>
 <class name="ContactsContract.SyncState"
  extends="java.lang.Object"
  abstract="false"
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp
index 5397a69..f8bb3c8 100644
--- a/cmds/stagefright/stagefright.cpp
+++ b/cmds/stagefright/stagefright.cpp
@@ -52,6 +52,13 @@
 static void playSource(OMXClient *client, const sp<MediaSource> &source) {
     sp<MetaData> meta = source->getFormat();
 
+    int32_t durationUnits;
+    int32_t timeScale;
+    CHECK(meta->findInt32(kKeyDuration, &durationUnits));
+    CHECK(meta->findInt32(kKeyTimeScale, &timeScale));
+
+    int64_t durationUs = ((int64_t)durationUnits * 1000000) / timeScale;
+
     sp<OMXCodec> decoder = OMXCodec::Create(
             client->interface(), meta, false /* createEncoder */, source);
 
@@ -61,7 +68,7 @@
 
     decoder->start();
 
-    if (gReproduceBug == 3) {
+    if (gReproduceBug >= 3 && gReproduceBug <= 5) {
         status_t err;
         MediaBuffer *buffer;
         MediaSource::ReadOptions options;
@@ -76,23 +83,31 @@
 
                 shouldSeek = true;
             } else {
-                int32_t units, scale;
-                CHECK(buffer->meta_data()->findInt32(kKeyTimeUnits, &units));
-                CHECK(buffer->meta_data()->findInt32(kKeyTimeScale, &scale));
-                int64_t timestamp = ((OMX_TICKS)units * 1000000) / scale;
+                int32_t timestampUnits;
+                CHECK(buffer->meta_data()->findInt32(kKeyTimeUnits, &timestampUnits));
+
+                int64_t timestampUs = ((int64_t)timestampUnits * 1000000) / timeScale;
 
                 bool failed = false;
-                if (seekTimeUs >= 0) {
-                    int64_t diff = timestamp - seekTimeUs;
 
-                    if (diff > 500000) {
+                if (seekTimeUs >= 0) {
+                    int64_t diff = timestampUs - seekTimeUs;
+                    if (diff < 0) {
+                        diff = -diff;
+                    }
+
+                    if ((gReproduceBug == 4 && diff > 500000)
+                        || (gReproduceBug == 5 && timestampUs < 0)) {
+                        printf("wanted: %.2f secs, got: %.2f secs\n",
+                               seekTimeUs / 1E6, timestampUs / 1E6);
+
                         printf("ERROR: ");
                         failed = true;
                     }
                 }
 
                 printf("buffer has timestamp %lld us (%.2f secs)\n",
-                       timestamp, timestamp / 1E6);
+                       timestampUs, timestampUs / 1E6);
 
                 buffer->release();
                 buffer = NULL;
@@ -102,13 +117,16 @@
                 }
 
                 shouldSeek = ((double)rand() / RAND_MAX) < 0.1;
-                shouldSeek = false;
+
+                if (gReproduceBug == 3) {
+                    shouldSeek = false;
+                }
             }
 
             seekTimeUs = -1;
 
             if (shouldSeek) {
-                seekTimeUs = (rand() * 30E6) / RAND_MAX;
+                seekTimeUs = (rand() * (float)durationUs) / RAND_MAX;
                 options.setSeekTo(seekTimeUs);
 
                 printf("seeking to %lld us (%.2f secs)\n",
@@ -138,6 +156,7 @@
 
             if (err != OK) {
                 CHECK_EQ(buffer, NULL);
+
                 break;
             }
 
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java
index a49a27a0..b706c5c 100644
--- a/core/java/android/os/BatteryStats.java
+++ b/core/java/android/os/BatteryStats.java
@@ -130,6 +130,7 @@
     private static final String MISC_DATA = "m";
     private static final String SCREEN_BRIGHTNESS_DATA = "br";
     private static final String SIGNAL_STRENGTH_TIME_DATA = "sgt";
+    private static final String SIGNAL_SCANNING_TIME_DATA = "sst";
     private static final String SIGNAL_STRENGTH_COUNT_DATA = "sgc";
     private static final String DATA_CONNECTION_TIME_DATA = "dct";
     private static final String DATA_CONNECTION_COUNT_DATA = "dcc";
@@ -440,6 +441,15 @@
             long batteryRealtime, int which);
 
     /**
+     * Returns the time in microseconds that the phone has been trying to
+     * acquire a signal.
+     *
+     * {@hide}
+     */
+    public abstract long getPhoneSignalScanningTime(
+            long batteryRealtime, int which);
+
+    /**
      * Returns the number of times the phone has entered the given signal strength.
      * 
      * {@hide}
@@ -823,6 +833,8 @@
             args[i] = getPhoneSignalStrengthTime(i, batteryRealtime, which) / 1000;
         }
         dumpLine(pw, 0 /* uid */, category, SIGNAL_STRENGTH_TIME_DATA, args);
+        dumpLine(pw, 0 /* uid */, category, SIGNAL_SCANNING_TIME_DATA,
+                getPhoneSignalScanningTime(batteryRealtime, which) / 1000);
         for (int i=0; i<NUM_SIGNAL_STRENGTH_BINS; i++) {
             args[i] = getPhoneSignalStrengthCount(i, which);
         }
@@ -1130,7 +1142,13 @@
         }
         if (!didOne) sb.append("No activity");
         pw.println(sb.toString());
-        
+
+        sb.setLength(0);
+        sb.append(prefix);
+        sb.append("  Signal scanning time: ");
+        formatTimeMs(sb, getPhoneSignalScanningTime(batteryRealtime, which) / 1000);
+        pw.println(sb.toString());
+
         sb.setLength(0);
         sb.append(prefix);
         sb.append("  Radio types: ");
diff --git a/core/java/com/android/internal/app/IBatteryStats.aidl b/core/java/com/android/internal/app/IBatteryStats.aidl
index 4bac593..d5ccdeb 100644
--- a/core/java/com/android/internal/app/IBatteryStats.aidl
+++ b/core/java/com/android/internal/app/IBatteryStats.aidl
@@ -37,7 +37,7 @@
     void notePhoneOff();
     void notePhoneSignalStrength(in SignalStrength signalStrength);
     void notePhoneDataConnectionState(int dataType, boolean hasData);
-    void noteAirplaneMode(boolean isAirplaneMode);
+    void notePhoneState(int phoneState);
     void noteWifiOn(int uid);
     void noteWifiOff(int uid);
     void noteWifiRunning();
diff --git a/core/java/com/android/internal/os/BatteryStatsImpl.java b/core/java/com/android/internal/os/BatteryStatsImpl.java
index 4b26b8f..8698cb7 100644
--- a/core/java/com/android/internal/os/BatteryStatsImpl.java
+++ b/core/java/com/android/internal/os/BatteryStatsImpl.java
@@ -24,6 +24,7 @@
 import android.os.Parcelable;
 import android.os.Process;
 import android.os.SystemClock;
+import android.telephony.ServiceState;
 import android.telephony.SignalStrength;
 import android.telephony.TelephonyManager;
 import android.util.Log;
@@ -56,7 +57,7 @@
     private static final int MAGIC = 0xBA757475; // 'BATSTATS' 
 
     // Current on-disk Parcel version
-    private static final int VERSION = 40;
+    private static final int VERSION = 41;
 
     private static int sNumSpeedSteps;
 
@@ -117,7 +118,9 @@
     int mPhoneSignalStrengthBin = -1;
     final StopwatchTimer[] mPhoneSignalStrengthsTimer = 
             new StopwatchTimer[NUM_SIGNAL_STRENGTH_BINS];
-    
+
+    StopwatchTimer mPhoneSignalScanningTimer;
+
     int mPhoneDataConnectionType = -1;
     final StopwatchTimer[] mPhoneDataConnectionsTimer = 
             new StopwatchTimer[NUM_DATA_CONNECTION_TYPES];
@@ -169,6 +172,8 @@
     private int mBluetoothPingCount;
     private int mBluetoothPingStart = -1;
 
+    private int mPhoneServiceState = -1;
+
     /*
      * Holds a SamplingTimer associated with each kernel wakelock name being tracked.
      */
@@ -681,6 +686,8 @@
          */
         long mAcquireTime;
 
+        long mTimeout;
+
         StopwatchTimer(int type, ArrayList<StopwatchTimer> timerPool,
                 ArrayList<Unpluggable> unpluggables, Parcel in) {
             super(type, unpluggables, in);
@@ -694,6 +701,10 @@
             mTimerPool = timerPool;
         }
         
+        void setTimeout(long timeout) {
+            mTimeout = timeout;
+        }
+
         public void writeToParcel(Parcel out, long batteryRealtime) {
             super.writeToParcel(out, batteryRealtime);
             out.writeLong(mUpdateTime);
@@ -797,6 +808,9 @@
 
         @Override
         protected long computeRunTimeLocked(long curBatteryRealtime) {
+            if (mTimeout > 0 && curBatteryRealtime > mUpdateTime + mTimeout) {
+                curBatteryRealtime = mUpdateTime + mTimeout;
+            }
             return mTotalTime + (mNesting > 0
                     ? (curBatteryRealtime - mUpdateTime)
                             / (mTimerPool != null ? mTimerPool.size() : 1)
@@ -1123,34 +1137,59 @@
         }
     }
 
-    public void noteAirplaneModeLocked(boolean isAirplaneMode) {
-        final int bin = mPhoneSignalStrengthBin;
-        if (bin >= 0) {
-            if (!isAirplaneMode) {
-                if (!mPhoneSignalStrengthsTimer[bin].isRunningLocked()) {
-                    mPhoneSignalStrengthsTimer[bin].startRunningLocked(this);
-                }
-            } else {
-                for (int i = 0; i < NUM_SIGNAL_STRENGTH_BINS; i++) {
-                    while (mPhoneSignalStrengthsTimer[i].isRunningLocked()) {
-                        mPhoneSignalStrengthsTimer[i].stopRunningLocked(this);
-                    }
+    /**
+     * Telephony stack updates the phone state.
+     * @param state phone state from ServiceState.getState()
+     */
+    public void notePhoneStateLocked(int state) {
+        int bin = mPhoneSignalStrengthBin;
+        boolean isAirplaneMode = state == ServiceState.STATE_POWER_OFF;
+        // Stop all timers
+        if (isAirplaneMode || state == ServiceState.STATE_OUT_OF_SERVICE) {
+            for (int i = 0; i < NUM_SIGNAL_STRENGTH_BINS; i++) {
+                while (mPhoneSignalStrengthsTimer[i].isRunningLocked()) {
+                    mPhoneSignalStrengthsTimer[i].stopRunningLocked(this);
                 }
             }
         }
+        // Stop Signal Scanning timer, in case we're going into service
+        while (mPhoneSignalScanningTimer.isRunningLocked()) {
+            mPhoneSignalScanningTimer.stopRunningLocked(this);
+        }
+
+        // If we're back in service or continuing in service, restart the old timer.
+        if (state == ServiceState.STATE_IN_SERVICE) {
+            if (bin == -1) bin = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
+            if (!mPhoneSignalStrengthsTimer[bin].isRunningLocked()) {
+                mPhoneSignalStrengthsTimer[bin].startRunningLocked(this);
+            }
+        } else if (state == ServiceState.STATE_OUT_OF_SERVICE) {
+            mPhoneSignalStrengthBin = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
+            if (!mPhoneSignalStrengthsTimer[mPhoneSignalStrengthBin].isRunningLocked()) {
+                mPhoneSignalStrengthsTimer[mPhoneSignalStrengthBin].startRunningLocked(this);
+            }
+            if (!mPhoneSignalScanningTimer.isRunningLocked()) {
+                mPhoneSignalScanningTimer.startRunningLocked(this);
+            }
+        }
+        mPhoneServiceState = state;
     }
 
     public void notePhoneSignalStrengthLocked(SignalStrength signalStrength) {
         // Bin the strength.
         int bin;
-
+        if (mPhoneServiceState == ServiceState.STATE_POWER_OFF
+                || mPhoneServiceState == ServiceState.STATE_OUT_OF_SERVICE) {
+            // Ignore any signal strength changes when radio was turned off or out of service.
+            return;
+        }
         if (!signalStrength.isGsm()) {
             int dBm = signalStrength.getCdmaDbm();
-            if (dBm >= -75) bin = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
-            else if (dBm >= -85) bin = SIGNAL_STRENGTH_GREAT;
-            else if (dBm >= -95)  bin = SIGNAL_STRENGTH_GOOD;
-            else if (dBm >= -100)  bin = SIGNAL_STRENGTH_MODERATE;
-            else bin = SIGNAL_STRENGTH_POOR;
+            if (dBm >= -75) bin = SIGNAL_STRENGTH_GREAT;
+            else if (dBm >= -85) bin = SIGNAL_STRENGTH_GOOD;
+            else if (dBm >= -95)  bin = SIGNAL_STRENGTH_MODERATE;
+            else if (dBm >= -100)  bin = SIGNAL_STRENGTH_POOR;
+            else bin = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
         } else {
             int asu = signalStrength.getGsmSignalStrength();
             if (asu < 0 || asu >= 99) bin = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
@@ -1328,7 +1367,13 @@
         return mPhoneSignalStrengthsTimer[strengthBin].getTotalTimeLocked(
                 batteryRealtime, which);
     }
-    
+
+    @Override public long getPhoneSignalScanningTime(
+            long batteryRealtime, int which) {
+        return mPhoneSignalScanningTimer.getTotalTimeLocked(
+                batteryRealtime, which);
+    }
+
     @Override public int getPhoneSignalStrengthCount(int dataType, int which) {
         return mPhoneDataConnectionsTimer[dataType].getCountLocked(which);
     }
@@ -2653,6 +2698,7 @@
         for (int i=0; i<NUM_SIGNAL_STRENGTH_BINS; i++) {
             mPhoneSignalStrengthsTimer[i] = new StopwatchTimer(-200-i, null, mUnpluggables);
         }
+        mPhoneSignalScanningTimer = new StopwatchTimer(-200+1, null, mUnpluggables);
         for (int i=0; i<NUM_DATA_CONNECTION_TYPES; i++) {
             mPhoneDataConnectionsTimer[i] = new StopwatchTimer(-300-i, null, mUnpluggables);
         }
@@ -2679,6 +2725,12 @@
         if (sNumSpeedSteps == 0) sNumSpeedSteps = steps;
     }
 
+    public void setRadioScanningTimeout(long timeout) {
+        if (mPhoneSignalScanningTimer != null) {
+            mPhoneSignalScanningTimer.setTimeout(timeout);
+        }
+    }
+
     @Override
     public int getStartCount() {
         return mStartCount;
@@ -3114,6 +3166,7 @@
         for (int i=0; i<NUM_SIGNAL_STRENGTH_BINS; i++) {
             mPhoneSignalStrengthsTimer[i].readSummaryFromParcelLocked(in);
         }
+        mPhoneSignalScanningTimer.readSummaryFromParcelLocked(in);
         for (int i=0; i<NUM_DATA_CONNECTION_TYPES; i++) {
             mPhoneDataConnectionsTimer[i].readSummaryFromParcelLocked(in);
         }
@@ -3257,6 +3310,7 @@
         for (int i=0; i<NUM_SIGNAL_STRENGTH_BINS; i++) {
             mPhoneSignalStrengthsTimer[i].writeSummaryFromParcelLocked(out, NOWREAL);
         }
+        mPhoneSignalScanningTimer.writeSummaryFromParcelLocked(out, NOWREAL);
         for (int i=0; i<NUM_DATA_CONNECTION_TYPES; i++) {
             mPhoneDataConnectionsTimer[i].writeSummaryFromParcelLocked(out, NOWREAL);
         }
@@ -3418,6 +3472,7 @@
         for (int i=0; i<NUM_SIGNAL_STRENGTH_BINS; i++) {
             mPhoneSignalStrengthsTimer[i] = new StopwatchTimer(-200-i, null, mUnpluggables, in);
         }
+        mPhoneSignalScanningTimer = new StopwatchTimer(-200+1, null, mUnpluggables, in);
         for (int i=0; i<NUM_DATA_CONNECTION_TYPES; i++) {
             mPhoneDataConnectionsTimer[i] = new StopwatchTimer(-300-i, null, mUnpluggables, in);
         }
@@ -3513,6 +3568,7 @@
         for (int i=0; i<NUM_SIGNAL_STRENGTH_BINS; i++) {
             mPhoneSignalStrengthsTimer[i].writeToParcel(out, batteryRealtime);
         }
+        mPhoneSignalScanningTimer.writeToParcel(out, batteryRealtime);
         for (int i=0; i<NUM_DATA_CONNECTION_TYPES; i++) {
             mPhoneDataConnectionsTimer[i].writeToParcel(out, batteryRealtime);
         }
@@ -3598,6 +3654,8 @@
                 pr.println("*** Signal strength #" + i + ":");
                 mPhoneSignalStrengthsTimer[i].logState(pr, "  ");
             }
+            pr.println("*** Signal scanning :");
+            mPhoneSignalScanningTimer.logState(pr, "  ");
             for (int i=0; i<NUM_DATA_CONNECTION_TYPES; i++) {
                 pr.println("*** Data connection type #" + i + ":");
                 mPhoneDataConnectionsTimer[i].logState(pr, "  ");
diff --git a/core/java/com/android/internal/os/PowerProfile.java b/core/java/com/android/internal/os/PowerProfile.java
index 4b4b717..2369d25 100644
--- a/core/java/com/android/internal/os/PowerProfile.java
+++ b/core/java/com/android/internal/os/PowerProfile.java
@@ -97,6 +97,11 @@
     public static final String POWER_RADIO_ON = "radio.on";
 
     /**
+     * Power consumption when cell radio is hunting for a signal.
+     */
+    public static final String POWER_RADIO_SCANNING = "radio.scanning";
+
+    /**
      * Power consumption when talking on the phone.
      */
     public static final String POWER_RADIO_ACTIVE = "radio.active";
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 45fcaa59..780f611 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -40,6 +40,10 @@
     <!-- The duration (in milliseconds) of a long animation. -->
     <integer name="config_longAnimTime">400</integer>
 
+    <!-- The duration (in milliseconds) that the radio will scan for a signal
+         when there's no network connection. If the scan doesn't timeout, use zero -->
+    <integer name="config_radioScanningTimeout">0</integer>
+
     <!-- XXXXX NOTE THE FOLLOWING RESOURCES USE THE WRONG NAMING CONVENTION.
          Please don't copy them, copy anything else. -->
          
diff --git a/core/res/res/xml/power_profile.xml b/core/res/res/xml/power_profile.xml
index 710b71e..ce623e8 100644
--- a/core/res/res/xml/power_profile.xml
+++ b/core/res/res/xml/power_profile.xml
@@ -29,10 +29,12 @@
   <item name="dsp.audio">0.1</item>
   <item name="dsp.video">0.1</item>
   <item name="radio.active">1</item>
+  <!-- The current consumed by the radio when it is scanning for a signal -->
+  <item name="radio.scanning">0.5</item>
   <item name="gps.on">1</item>
   <!-- Current consumed by the radio at different signal strengths, when paging -->
   <array name="radio.on"> <!-- Strength 0 to BINS-1 -->
-      <value>1</value>
+      <value>0.2</value>
       <value>0.1</value>
   </array>
   <!-- Different CPU speeds as reported in
diff --git a/graphics/java/android/renderscript/SimpleMesh.java b/graphics/java/android/renderscript/SimpleMesh.java
index 0ad093e..3d10e3b 100644
--- a/graphics/java/android/renderscript/SimpleMesh.java
+++ b/graphics/java/android/renderscript/SimpleMesh.java
@@ -228,17 +228,17 @@
                 mVtxData[mVtxCount++] = mB;
                 mVtxData[mVtxCount++] = mA;
             }
+            if ((mFlags & TEXTURE_0) != 0) {
+                makeSpace(2);
+                mVtxData[mVtxCount++] = mS0;
+                mVtxData[mVtxCount++] = mT0;
+            }
             if ((mFlags & NORMAL) != 0) {
                 makeSpace(3);
                 mVtxData[mVtxCount++] = mNX;
                 mVtxData[mVtxCount++] = mNY;
                 mVtxData[mVtxCount++] = mNZ;
             }
-            if ((mFlags & TEXTURE_0) != 0) {
-                makeSpace(2);
-                mVtxData[mVtxCount++] = mS0;
-                mVtxData[mVtxCount++] = mT0;
-            }
         }
 
         public void addVertex(float x, float y) {
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java
index 0ae354a..6e3f5e3 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/performance/MediaPlayerPerformance.java
@@ -309,6 +309,8 @@
     }
 
     public boolean validateMemoryResult (int startPid, int startMemory, Writer output) throws Exception {
+        //Wait for 10 seconds to make sure the memory settle.
+        Thread.sleep(10000);
         mEndPid = getMediaserverPid();
         mEndMemory = getMediaserverVsize();
         Log.v(TAG, "End Memory " + mEndMemory);
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/MediaPlayerStressTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/MediaPlayerStressTest.java
index 90d6ffa..daa0ca7 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/MediaPlayerStressTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/stress/MediaPlayerStressTest.java
@@ -41,7 +41,7 @@
     private static final int NUMBER_OF_RANDOM_REPOSITION_AND_PLAY = 10;
     private static final int NUMBER_OF_RANDOM_REPOSITION_AND_PLAY_SHORT = 5;
     private static final int NUMBER_OF_STRESS_LOOPS = 500;
-    private static final int PLAYBACK_END_TOLERANCE = 5000;
+    private static final int PLAYBACK_END_TOLERANCE = 30000;
     private static final int WAIT_UNTIL_PLAYBACK_FINISH = 515000 ;
 
     public MediaPlayerStressTest() {
@@ -112,10 +112,11 @@
                 if (random_no_of_seek == 0) {
                     random_no_of_seek = 1;
                 }
-                // Random seek and play
+                Log.v(TAG, "random_seek = " + random_no_of_seek);
+                // Play for 10 seconds then random seekTo
                 for (int j = 0; j < random_no_of_seek; j++) {
                     random_play_time =
-                        generator.nextInt(video_duration / 2);
+                        generator.nextInt(video_duration / 100);
                     Log.v(TAG, "Play time = " + random_play_time);
                     Thread.sleep(random_play_time);
                     random_seek_time =
@@ -123,12 +124,13 @@
                     Log.v(TAG, "Seek time = " + random_seek_time);
                     mp.seekTo(random_seek_time);
                 }
-                //wait until the movie finish and check the current position
-                //Make sure the wait time is long enough
-                long wait_until_playback_finish = video_duration - random_seek_time + PLAYBACK_END_TOLERANCE * 2;
-                Thread.sleep(wait_until_playback_finish);
+                //Seek to 10s from the end of the video
+                mp.seekTo(video_duration - 10000);
+                //After reposition, play 30 seconds the video should be finished.
+                Thread.sleep(PLAYBACK_END_TOLERANCE);
                 Log.v(TAG, "CurrentPosition = " + mp.getCurrentPosition());
-                if ( mp.isPlaying() || mp.getCurrentPosition() > (video_duration + PLAYBACK_END_TOLERANCE)){
+                if ( mp.isPlaying() || mp.getCurrentPosition()
+                        > (video_duration)){
                     assertTrue("Current PlayTime greater than duration", false);
                 }
                 mp.release();
diff --git a/opengl/libagl/copybit.cpp b/opengl/libagl/copybit.cpp
index 867459d..73b2355 100644
--- a/opengl/libagl/copybit.cpp
+++ b/opengl/libagl/copybit.cpp
@@ -41,11 +41,12 @@
 namespace android {
 
 static void textureToCopyBitImage(
-        const GGLSurface* surface, buffer_handle_t buffer, copybit_image_t* img) 
+        const GGLSurface* surface, int32_t opFormat, 
+        buffer_handle_t buffer, copybit_image_t* img) 
 {
     img->w      = surface->stride;
     img->h      = surface->height;
-    img->format = surface->format;
+    img->format = opFormat;
     img->base   = surface->data;
     img->handle = (native_handle_t *)buffer;
 }
@@ -207,39 +208,13 @@
     int planeAlpha = 255;
     static const int tmu = 0;
     texture_t& tev(c->rasterizer.state.texture[tmu]);
-    bool srcTextureHasAlpha = hasAlpha(textureObject->surface.format);
+    int32_t opFormat = textureObject->surface.format;
+    const bool srcTextureHasAlpha = hasAlpha(opFormat);
     if (!srcTextureHasAlpha) {
         planeAlpha = fixedToByte(c->currentColorClamped.a);
     }
 
-    switch (tev.env) {
-    case GGL_REPLACE:
-        break;
-    case GGL_MODULATE:
-        if (! (c->currentColorClamped.r == FIXED_ONE &&
-               c->currentColorClamped.g == FIXED_ONE &&
-               c->currentColorClamped.b == FIXED_ONE)) {
-            LOGD_IF(DEBUG_COPYBIT, 
-                    "MODULATE and non white color (%08x, %08x, %08x)",
-                    c->currentColorClamped.r,
-                    c->currentColorClamped.g,
-                    c->currentColorClamped.b);
-            return false;
-        }
-        if (srcTextureHasAlpha && c->currentColorClamped.a < FIXED_ONE) {
-            LOGD_IF(DEBUG_COPYBIT, 
-                    "MODULATE and texture w/alpha and alpha=%08x)",
-                    c->currentColorClamped.a);
-            return false;
-        }
-        break;
-
-    default:
-        // Incompatible texture environment.
-        LOGD_IF(DEBUG_COPYBIT, "incompatible texture environment");
-        return false;
-    }
-
+    const bool cbHasAlpha = hasAlpha(cbSurface.format);
     bool blending = false;
     if ((enables & GGL_ENABLE_BLENDING)
             && !(c->rasterizer.state.blend.src == GL_ONE
@@ -262,32 +237,60 @@
         }
         blending = true;
     } else {
-        // No blending is OK if we are not using alpha.
-        if (srcTextureHasAlpha || planeAlpha != 255) {
-            // Incompatible alpha
-            LOGD_IF(DEBUG_COPYBIT, "incompatible alpha");
-            return false;
+        if (cbHasAlpha) {
+            // NOTE: the result will be slightly wrong in this case because
+            // the destination alpha channel will be set to 1.0 instead of
+            // the iterated alpha value. *shrug*.
+        }
+        // disable plane blending and src blending for supported formats
+        planeAlpha = 255;
+        if (opFormat == COPYBIT_FORMAT_RGBA_8888) {
+            opFormat = COPYBIT_FORMAT_RGBX_8888;
+        } else {
+            if (srcTextureHasAlpha) {
+                LOGD_IF(DEBUG_COPYBIT, "texture format requires blending");
+                return false;
+            }
         }
     }
 
-    if (srcTextureHasAlpha && planeAlpha != 255) {
-        // Can't do two types of alpha at once.
-        LOGD_IF(DEBUG_COPYBIT, "src alpha and plane alpha");
+    switch (tev.env) {
+    case GGL_REPLACE:
+        break;
+    case GGL_MODULATE:
+        // only cases allowed is:
+        // RGB  source, color={1,1,1,a} -> can be done with GL_REPLACE
+        // RGBA source, color={1,1,1,1} -> can be done with GL_REPLACE
+        if (blending) {
+            if (c->currentColorClamped.r == c->currentColorClamped.a &&
+                c->currentColorClamped.g == c->currentColorClamped.a &&
+                c->currentColorClamped.b == c->currentColorClamped.a) {
+                // TODO: Need to emulate: RGBA source, color={a,a,a,a} / premult
+                // and RGBA source, color={1,1,1,a} / regular-blending
+                // (both are equivalent)
+            }
+        }
+        LOGD_IF(DEBUG_COPYBIT, "GGL_MODULATE");
+        return false;
+    default:
+        // Incompatible texture environment.
+        LOGD_IF(DEBUG_COPYBIT, "incompatible texture environment");
         return false;
     }
 
+
     // LOGW("calling copybits");
 
     copybit_device_t* copybit = c->copybits.blitEngine;
 
     copybit_image_t dst;
     buffer_handle_t target_hnd = c->copybits.drawSurfaceBuffer;
-    textureToCopyBitImage(&cbSurface, target_hnd, &dst);
+    textureToCopyBitImage(&cbSurface, cbSurface.format, target_hnd, &dst);
     copybit_rect_t drect = {x, y, x+w, y+h};
 
     copybit_image_t src;
     buffer_handle_t source_hnd = textureObject->buffer->handle;
-    textureToCopyBitImage(&textureObject->surface, source_hnd, &src);
+    textureToCopyBitImage(&textureObject->surface, opFormat, source_hnd, &src);
     copybit_rect_t srect = { Ucr, Vcr + Hcr, Ucr + Wcr, Vcr };
 
     copybit->set_parameter(copybit, COPYBIT_TRANSFORM, transform);
diff --git a/services/java/com/android/server/TelephonyRegistry.java b/services/java/com/android/server/TelephonyRegistry.java
index 101b075..47cb6ad 100644
--- a/services/java/com/android/server/TelephonyRegistry.java
+++ b/services/java/com/android/server/TelephonyRegistry.java
@@ -477,7 +477,7 @@
     private void broadcastServiceStateChanged(ServiceState state) {
         long ident = Binder.clearCallingIdentity();
         try {
-            mBatteryStats.noteAirplaneMode(state.getState() == ServiceState.STATE_POWER_OFF);
+            mBatteryStats.notePhoneState(state.getState());
         } catch (RemoteException re) {
             // Can't do much
         } finally {
diff --git a/services/java/com/android/server/am/BatteryStatsService.java b/services/java/com/android/server/am/BatteryStatsService.java
index 61537f5..5a1619a 100644
--- a/services/java/com/android/server/am/BatteryStatsService.java
+++ b/services/java/com/android/server/am/BatteryStatsService.java
@@ -51,6 +51,9 @@
         mContext = context;
         ServiceManager.addService("batteryinfo", asBinder());
         mStats.setNumSpeedSteps(new PowerProfile(mContext).getNumSpeedSteps());
+        mStats.setRadioScanningTimeout(mContext.getResources().getInteger(
+                com.android.internal.R.integer.config_radioScanningTimeout)
+                * 1000L);
     }
     
     public void shutdown() {
@@ -195,10 +198,10 @@
         }
     }
 
-    public void noteAirplaneMode(boolean airplaneMode) {
+    public void notePhoneState(int state) {
         enforceCallingPermission();
         synchronized (mStats) {
-            mStats.noteAirplaneModeLocked(airplaneMode);
+            mStats.notePhoneStateLocked(state);
         }
     }