Merge change 21178 into donut

* changes:
  Simplified algorithm used to generate the preloaded-classes list. Generated a new preloaded-classes file.
diff --git a/api/current.xml b/api/current.xml
index b17cbe7..e629082 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -1438,237 +1438,6 @@
  visibility="public"
 >
 </field>
-<field name="donut_resource_pad1"
- type="int"
- transient="false"
- volatile="false"
- value="17432608"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad10"
- type="int"
- transient="false"
- volatile="false"
- value="17432599"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad11"
- type="int"
- transient="false"
- volatile="false"
- value="17432598"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad12"
- type="int"
- transient="false"
- volatile="false"
- value="17432597"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad13"
- type="int"
- transient="false"
- volatile="false"
- value="17432596"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad14"
- type="int"
- transient="false"
- volatile="false"
- value="17432595"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad15"
- type="int"
- transient="false"
- volatile="false"
- value="17432594"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad16"
- type="int"
- transient="false"
- volatile="false"
- value="17432593"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad17"
- type="int"
- transient="false"
- volatile="false"
- value="17432592"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad18"
- type="int"
- transient="false"
- volatile="false"
- value="17432591"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad19"
- type="int"
- transient="false"
- volatile="false"
- value="17432590"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad2"
- type="int"
- transient="false"
- volatile="false"
- value="17432607"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad20"
- type="int"
- transient="false"
- volatile="false"
- value="17432589"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad21"
- type="int"
- transient="false"
- volatile="false"
- value="17432588"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad3"
- type="int"
- transient="false"
- volatile="false"
- value="17432606"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad4"
- type="int"
- transient="false"
- volatile="false"
- value="17432605"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad5"
- type="int"
- transient="false"
- volatile="false"
- value="17432604"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad6"
- type="int"
- transient="false"
- volatile="false"
- value="17432603"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad7"
- type="int"
- transient="false"
- volatile="false"
- value="17432602"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad8"
- type="int"
- transient="false"
- volatile="false"
- value="17432601"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad9"
- type="int"
- transient="false"
- volatile="false"
- value="17432600"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
 <field name="fade_in"
  type="int"
  transient="false"
@@ -1752,138 +1521,6 @@
  visibility="public"
 >
 </constructor>
-<field name="donut_resource_pad1"
- type="int"
- transient="false"
- volatile="false"
- value="17235984"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad10"
- type="int"
- transient="false"
- volatile="false"
- value="17235975"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad11"
- type="int"
- transient="false"
- volatile="false"
- value="17235974"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad12"
- type="int"
- transient="false"
- volatile="false"
- value="17235973"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad2"
- type="int"
- transient="false"
- volatile="false"
- value="17235983"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad3"
- type="int"
- transient="false"
- volatile="false"
- value="17235982"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad4"
- type="int"
- transient="false"
- volatile="false"
- value="17235981"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad5"
- type="int"
- transient="false"
- volatile="false"
- value="17235980"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad6"
- type="int"
- transient="false"
- volatile="false"
- value="17235979"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad7"
- type="int"
- transient="false"
- volatile="false"
- value="17235978"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad8"
- type="int"
- transient="false"
- volatile="false"
- value="17235977"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad9"
- type="int"
- transient="false"
- volatile="false"
- value="17235976"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
 <field name="emailAddressTypes"
  type="int"
  transient="false"
@@ -3254,204 +2891,6 @@
  visibility="public"
 >
 </field>
-<field name="donut_resource_pad1"
- type="int"
- transient="false"
- volatile="false"
- value="16843423"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad10"
- type="int"
- transient="false"
- volatile="false"
- value="16843414"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad11"
- type="int"
- transient="false"
- volatile="false"
- value="16843413"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad12"
- type="int"
- transient="false"
- volatile="false"
- value="16843412"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad13"
- type="int"
- transient="false"
- volatile="false"
- value="16843411"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad14"
- type="int"
- transient="false"
- volatile="false"
- value="16843410"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad15"
- type="int"
- transient="false"
- volatile="false"
- value="16843409"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad16"
- type="int"
- transient="false"
- volatile="false"
- value="16843408"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad17"
- type="int"
- transient="false"
- volatile="false"
- value="16843407"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad18"
- type="int"
- transient="false"
- volatile="false"
- value="16843406"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad2"
- type="int"
- transient="false"
- volatile="false"
- value="16843422"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad3"
- type="int"
- transient="false"
- volatile="false"
- value="16843421"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad4"
- type="int"
- transient="false"
- volatile="false"
- value="16843420"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad5"
- type="int"
- transient="false"
- volatile="false"
- value="16843419"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad6"
- type="int"
- transient="false"
- volatile="false"
- value="16843418"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad7"
- type="int"
- transient="false"
- volatile="false"
- value="16843417"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad8"
- type="int"
- transient="false"
- volatile="false"
- value="16843416"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad9"
- type="int"
- transient="false"
- volatile="false"
- value="16843415"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
 <field name="drawSelectorOnTop"
  type="int"
  transient="false"
@@ -9415,347 +8854,6 @@
  visibility="public"
 >
 </field>
-<field name="donut_resource_pad1"
- type="int"
- transient="false"
- volatile="false"
- value="17170480"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad10"
- type="int"
- transient="false"
- volatile="false"
- value="17170471"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad11"
- type="int"
- transient="false"
- volatile="false"
- value="17170470"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad12"
- type="int"
- transient="false"
- volatile="false"
- value="17170469"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad13"
- type="int"
- transient="false"
- volatile="false"
- value="17170468"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad14"
- type="int"
- transient="false"
- volatile="false"
- value="17170467"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad15"
- type="int"
- transient="false"
- volatile="false"
- value="17170466"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad16"
- type="int"
- transient="false"
- volatile="false"
- value="17170465"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad17"
- type="int"
- transient="false"
- volatile="false"
- value="17170464"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad18"
- type="int"
- transient="false"
- volatile="false"
- value="17170463"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad19"
- type="int"
- transient="false"
- volatile="false"
- value="17170462"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad2"
- type="int"
- transient="false"
- volatile="false"
- value="17170479"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad20"
- type="int"
- transient="false"
- volatile="false"
- value="17170461"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad21"
- type="int"
- transient="false"
- volatile="false"
- value="17170460"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad22"
- type="int"
- transient="false"
- volatile="false"
- value="17170459"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad23"
- type="int"
- transient="false"
- volatile="false"
- value="17170458"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad24"
- type="int"
- transient="false"
- volatile="false"
- value="17170457"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad25"
- type="int"
- transient="false"
- volatile="false"
- value="17170456"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad26"
- type="int"
- transient="false"
- volatile="false"
- value="17170455"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad27"
- type="int"
- transient="false"
- volatile="false"
- value="17170454"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad28"
- type="int"
- transient="false"
- volatile="false"
- value="17170453"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad29"
- type="int"
- transient="false"
- volatile="false"
- value="17170452"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad3"
- type="int"
- transient="false"
- volatile="false"
- value="17170478"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad30"
- type="int"
- transient="false"
- volatile="false"
- value="17170451"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad31"
- type="int"
- transient="false"
- volatile="false"
- value="17170450"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad4"
- type="int"
- transient="false"
- volatile="false"
- value="17170477"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad5"
- type="int"
- transient="false"
- volatile="false"
- value="17170476"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad6"
- type="int"
- transient="false"
- volatile="false"
- value="17170475"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad7"
- type="int"
- transient="false"
- volatile="false"
- value="17170474"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad8"
- type="int"
- transient="false"
- volatile="false"
- value="17170473"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad9"
- type="int"
- transient="false"
- volatile="false"
- value="17170472"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
 <field name="primary_text_dark"
  type="int"
  transient="false"
@@ -9938,160 +9036,6 @@
  visibility="public"
 >
 </field>
-<field name="donut_resource_pad1"
- type="int"
- transient="false"
- volatile="false"
- value="17104912"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad10"
- type="int"
- transient="false"
- volatile="false"
- value="17104903"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad11"
- type="int"
- transient="false"
- volatile="false"
- value="17104902"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad12"
- type="int"
- transient="false"
- volatile="false"
- value="17104901"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad13"
- type="int"
- transient="false"
- volatile="false"
- value="17104900"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad14"
- type="int"
- transient="false"
- volatile="false"
- value="17104899"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad2"
- type="int"
- transient="false"
- volatile="false"
- value="17104911"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad3"
- type="int"
- transient="false"
- volatile="false"
- value="17104910"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad4"
- type="int"
- transient="false"
- volatile="false"
- value="17104909"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad5"
- type="int"
- transient="false"
- volatile="false"
- value="17104908"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad6"
- type="int"
- transient="false"
- volatile="false"
- value="17104907"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad7"
- type="int"
- transient="false"
- volatile="false"
- value="17104906"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad8"
- type="int"
- transient="false"
- volatile="false"
- value="17104905"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad9"
- type="int"
- transient="false"
- volatile="false"
- value="17104904"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
 <field name="thumbnail_height"
  type="int"
  transient="false"
@@ -10406,446 +9350,6 @@
  visibility="public"
 >
 </field>
-<field name="donut_resource_pad1"
- type="int"
- transient="false"
- volatile="false"
- value="17301712"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad10"
- type="int"
- transient="false"
- volatile="false"
- value="17301703"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad11"
- type="int"
- transient="false"
- volatile="false"
- value="17301702"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad12"
- type="int"
- transient="false"
- volatile="false"
- value="17301701"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad13"
- type="int"
- transient="false"
- volatile="false"
- value="17301700"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad14"
- type="int"
- transient="false"
- volatile="false"
- value="17301699"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad15"
- type="int"
- transient="false"
- volatile="false"
- value="17301698"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad16"
- type="int"
- transient="false"
- volatile="false"
- value="17301697"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad17"
- type="int"
- transient="false"
- volatile="false"
- value="17301696"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad18"
- type="int"
- transient="false"
- volatile="false"
- value="17301695"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad19"
- type="int"
- transient="false"
- volatile="false"
- value="17301694"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad2"
- type="int"
- transient="false"
- volatile="false"
- value="17301711"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad20"
- type="int"
- transient="false"
- volatile="false"
- value="17301693"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad21"
- type="int"
- transient="false"
- volatile="false"
- value="17301692"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad22"
- type="int"
- transient="false"
- volatile="false"
- value="17301691"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad23"
- type="int"
- transient="false"
- volatile="false"
- value="17301690"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad24"
- type="int"
- transient="false"
- volatile="false"
- value="17301689"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad25"
- type="int"
- transient="false"
- volatile="false"
- value="17301688"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad26"
- type="int"
- transient="false"
- volatile="false"
- value="17301687"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad27"
- type="int"
- transient="false"
- volatile="false"
- value="17301686"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad28"
- type="int"
- transient="false"
- volatile="false"
- value="17301685"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad29"
- type="int"
- transient="false"
- volatile="false"
- value="17301684"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad3"
- type="int"
- transient="false"
- volatile="false"
- value="17301710"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad30"
- type="int"
- transient="false"
- volatile="false"
- value="17301683"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad31"
- type="int"
- transient="false"
- volatile="false"
- value="17301682"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad32"
- type="int"
- transient="false"
- volatile="false"
- value="17301681"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad33"
- type="int"
- transient="false"
- volatile="false"
- value="17301680"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad34"
- type="int"
- transient="false"
- volatile="false"
- value="17301679"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad35"
- type="int"
- transient="false"
- volatile="false"
- value="17301678"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad36"
- type="int"
- transient="false"
- volatile="false"
- value="17301677"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad37"
- type="int"
- transient="false"
- volatile="false"
- value="17301676"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad38"
- type="int"
- transient="false"
- volatile="false"
- value="17301675"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad39"
- type="int"
- transient="false"
- volatile="false"
- value="17301674"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad4"
- type="int"
- transient="false"
- volatile="false"
- value="17301709"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad40"
- type="int"
- transient="false"
- volatile="false"
- value="17301673"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad5"
- type="int"
- transient="false"
- volatile="false"
- value="17301708"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad6"
- type="int"
- transient="false"
- volatile="false"
- value="17301707"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad7"
- type="int"
- transient="false"
- volatile="false"
- value="17301706"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad8"
- type="int"
- transient="false"
- volatile="false"
- value="17301705"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad9"
- type="int"
- transient="false"
- volatile="false"
- value="17301704"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
 <field name="edit_text"
  type="int"
  transient="false"
@@ -12513,248 +11017,6 @@
  visibility="public"
 >
 </field>
-<field name="donut_resource_pad1"
- type="int"
- transient="false"
- volatile="false"
- value="16908352"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad10"
- type="int"
- transient="false"
- volatile="false"
- value="16908343"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad11"
- type="int"
- transient="false"
- volatile="false"
- value="16908342"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad12"
- type="int"
- transient="false"
- volatile="false"
- value="16908341"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad13"
- type="int"
- transient="false"
- volatile="false"
- value="16908340"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad14"
- type="int"
- transient="false"
- volatile="false"
- value="16908339"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad15"
- type="int"
- transient="false"
- volatile="false"
- value="16908338"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad16"
- type="int"
- transient="false"
- volatile="false"
- value="16908337"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad17"
- type="int"
- transient="false"
- volatile="false"
- value="16908336"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad18"
- type="int"
- transient="false"
- volatile="false"
- value="16908335"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad19"
- type="int"
- transient="false"
- volatile="false"
- value="16908334"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad2"
- type="int"
- transient="false"
- volatile="false"
- value="16908351"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad20"
- type="int"
- transient="false"
- volatile="false"
- value="16908333"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad21"
- type="int"
- transient="false"
- volatile="false"
- value="16908332"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad22"
- type="int"
- transient="false"
- volatile="false"
- value="16908331"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad3"
- type="int"
- transient="false"
- volatile="false"
- value="16908350"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad4"
- type="int"
- transient="false"
- volatile="false"
- value="16908349"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad5"
- type="int"
- transient="false"
- volatile="false"
- value="16908348"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad6"
- type="int"
- transient="false"
- volatile="false"
- value="16908347"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad7"
- type="int"
- transient="false"
- volatile="false"
- value="16908346"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad8"
- type="int"
- transient="false"
- volatile="false"
- value="16908345"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad9"
- type="int"
- transient="false"
- volatile="false"
- value="16908344"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
 <field name="edit"
  type="int"
  transient="false"
@@ -13146,160 +11408,6 @@
  visibility="public"
 >
 </field>
-<field name="donut_resource_pad1"
- type="int"
- transient="false"
- volatile="false"
- value="17694736"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad10"
- type="int"
- transient="false"
- volatile="false"
- value="17694727"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad11"
- type="int"
- transient="false"
- volatile="false"
- value="17694726"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad12"
- type="int"
- transient="false"
- volatile="false"
- value="17694725"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad13"
- type="int"
- transient="false"
- volatile="false"
- value="17694724"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad14"
- type="int"
- transient="false"
- volatile="false"
- value="17694723"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad2"
- type="int"
- transient="false"
- volatile="false"
- value="17694735"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad3"
- type="int"
- transient="false"
- volatile="false"
- value="17694734"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad4"
- type="int"
- transient="false"
- volatile="false"
- value="17694733"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad5"
- type="int"
- transient="false"
- volatile="false"
- value="17694732"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad6"
- type="int"
- transient="false"
- volatile="false"
- value="17694731"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad7"
- type="int"
- transient="false"
- volatile="false"
- value="17694730"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad8"
- type="int"
- transient="false"
- volatile="false"
- value="17694729"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad9"
- type="int"
- transient="false"
- volatile="false"
- value="17694728"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
 </class>
 <class name="R.layout"
  extends="java.lang.Object"
@@ -13339,149 +11447,6 @@
  visibility="public"
 >
 </field>
-<field name="donut_resource_pad1"
- type="int"
- transient="false"
- volatile="false"
- value="17367072"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad10"
- type="int"
- transient="false"
- volatile="false"
- value="17367063"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad11"
- type="int"
- transient="false"
- volatile="false"
- value="17367062"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad12"
- type="int"
- transient="false"
- volatile="false"
- value="17367061"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad13"
- type="int"
- transient="false"
- volatile="false"
- value="17367060"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad2"
- type="int"
- transient="false"
- volatile="false"
- value="17367071"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad3"
- type="int"
- transient="false"
- volatile="false"
- value="17367070"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad4"
- type="int"
- transient="false"
- volatile="false"
- value="17367069"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad5"
- type="int"
- transient="false"
- volatile="false"
- value="17367068"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad6"
- type="int"
- transient="false"
- volatile="false"
- value="17367067"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad7"
- type="int"
- transient="false"
- volatile="false"
- value="17367066"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad8"
- type="int"
- transient="false"
- volatile="false"
- value="17367065"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad9"
- type="int"
- transient="false"
- volatile="false"
- value="17367064"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
 <field name="expandable_list_content"
  type="int"
  transient="false"
@@ -13852,303 +11817,6 @@
  visibility="public"
 >
 </field>
-<field name="donut_resource_pad1"
- type="int"
- transient="false"
- volatile="false"
- value="17039408"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad10"
- type="int"
- transient="false"
- volatile="false"
- value="17039399"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad11"
- type="int"
- transient="false"
- volatile="false"
- value="17039398"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad12"
- type="int"
- transient="false"
- volatile="false"
- value="17039397"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad13"
- type="int"
- transient="false"
- volatile="false"
- value="17039396"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad14"
- type="int"
- transient="false"
- volatile="false"
- value="17039395"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad15"
- type="int"
- transient="false"
- volatile="false"
- value="17039394"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad16"
- type="int"
- transient="false"
- volatile="false"
- value="17039393"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad17"
- type="int"
- transient="false"
- volatile="false"
- value="17039392"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad18"
- type="int"
- transient="false"
- volatile="false"
- value="17039391"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad19"
- type="int"
- transient="false"
- volatile="false"
- value="17039390"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad2"
- type="int"
- transient="false"
- volatile="false"
- value="17039407"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad20"
- type="int"
- transient="false"
- volatile="false"
- value="17039389"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad21"
- type="int"
- transient="false"
- volatile="false"
- value="17039388"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad22"
- type="int"
- transient="false"
- volatile="false"
- value="17039387"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad23"
- type="int"
- transient="false"
- volatile="false"
- value="17039386"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad24"
- type="int"
- transient="false"
- volatile="false"
- value="17039385"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad25"
- type="int"
- transient="false"
- volatile="false"
- value="17039384"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad26"
- type="int"
- transient="false"
- volatile="false"
- value="17039383"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad27"
- type="int"
- transient="false"
- volatile="false"
- value="17039382"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad3"
- type="int"
- transient="false"
- volatile="false"
- value="17039406"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad4"
- type="int"
- transient="false"
- volatile="false"
- value="17039405"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad5"
- type="int"
- transient="false"
- volatile="false"
- value="17039404"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad6"
- type="int"
- transient="false"
- volatile="false"
- value="17039403"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad7"
- type="int"
- transient="false"
- volatile="false"
- value="17039402"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad8"
- type="int"
- transient="false"
- volatile="false"
- value="17039401"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad9"
- type="int"
- transient="false"
- volatile="false"
- value="17039400"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
 <field name="emptyPhoneNumber"
  type="int"
  transient="false"
@@ -15299,215 +12967,6 @@
  visibility="public"
 >
 </field>
-<field name="donut_resource_pad1"
- type="int"
- transient="false"
- volatile="false"
- value="16973936"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad10"
- type="int"
- transient="false"
- volatile="false"
- value="16973927"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad11"
- type="int"
- transient="false"
- volatile="false"
- value="16973926"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad12"
- type="int"
- transient="false"
- volatile="false"
- value="16973925"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad13"
- type="int"
- transient="false"
- volatile="false"
- value="16973924"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad14"
- type="int"
- transient="false"
- volatile="false"
- value="16973923"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad15"
- type="int"
- transient="false"
- volatile="false"
- value="16973922"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad16"
- type="int"
- transient="false"
- volatile="false"
- value="16973921"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad17"
- type="int"
- transient="false"
- volatile="false"
- value="16973920"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad18"
- type="int"
- transient="false"
- volatile="false"
- value="16973919"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad19"
- type="int"
- transient="false"
- volatile="false"
- value="16973918"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad2"
- type="int"
- transient="false"
- volatile="false"
- value="16973935"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad3"
- type="int"
- transient="false"
- volatile="false"
- value="16973934"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad4"
- type="int"
- transient="false"
- volatile="false"
- value="16973933"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad5"
- type="int"
- transient="false"
- volatile="false"
- value="16973932"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad6"
- type="int"
- transient="false"
- volatile="false"
- value="16973931"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad7"
- type="int"
- transient="false"
- volatile="false"
- value="16973930"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad8"
- type="int"
- transient="false"
- volatile="false"
- value="16973929"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
-<field name="donut_resource_pad9"
- type="int"
- transient="false"
- volatile="false"
- value="16973928"
- static="true"
- final="true"
- deprecated="not deprecated"
- visibility="public"
->
-</field>
 </class>
 <class name="R.xml"
  extends="java.lang.Object"
@@ -92674,7 +90133,7 @@
  type="int"
  transient="false"
  volatile="false"
- value="10000"
+ value="4"
  static="true"
  final="true"
  deprecated="not deprecated"
@@ -111850,6 +109309,17 @@
  visibility="public"
 >
 </field>
+<field name="ACTION_TTS_DATA_INSTALLED"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;android.speech.tts.engine.TTS_DATA_INSTALLED&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="CHECK_VOICE_DATA_BAD_DATA"
  type="int"
  transient="false"
@@ -111916,6 +109386,17 @@
  visibility="public"
 >
 </field>
+<field name="EXTRA_TTS_DATA_INSTALLED"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value="&quot;dataInstalled&quot;"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
 <field name="EXTRA_VOICE_DATA_FILES"
  type="java.lang.String"
  transient="false"
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 4ac3b9e..f2905a7 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -2521,7 +2521,7 @@
      * no extra data is required.
      * @param globalSearch If false, this will only launch the search that has been specifically
      * defined by the application (which is usually defined as a local search).  If no default 
-     * search is defined in the current application or activity, no search will be launched.
+     * search is defined in the current application or activity, global search will be launched.
      * If true, this will always launch a platform-global (e.g. web-based) search instead.
      * 
      * @see android.app.SearchManager
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index 32a2891..e045105 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -1701,6 +1701,14 @@
             printRow(pw, TWO_COUNT_COLUMNS, "numPagers:", stats.numPagers, "inactivePageKB:",
                     (stats.totalBytes - stats.referencedBytes) / 1024);
             printRow(pw, ONE_COUNT_COLUMN, "activePageKB:", stats.referencedBytes / 1024);
+            
+            // Asset details.
+            String assetAlloc = AssetManager.getAssetAllocations();
+            if (assetAlloc != null) {
+                pw.println(" ");
+                pw.println(" Asset Allocations");
+                pw.print(assetAlloc);
+            }
         }
 
         private void printRow(PrintWriter pw, String format, Object...objs) {
diff --git a/core/java/android/app/SearchManager.java b/core/java/android/app/SearchManager.java
index 7ad6423..d2a3a1d 100644
--- a/core/java/android/app/SearchManager.java
+++ b/core/java/android/app/SearchManager.java
@@ -369,7 +369,26 @@
  * forget to decode it.  (See {@link android.net.Uri#getPathSegments} and
  * {@link android.net.Uri#getLastPathSegment} for helpful utilities you can use here.)</li>
  * </ul>
- * 
+ *
+ * <p><b>Providing access to Content Providers that require permissions.</b>  If your content
+ * provider declares an android:readPermission in your application's manifest, you must provide
+ * access to the search infrastructure to the search suggestion path by including a path-permission
+ * that grants android:readPermission access to "android.permission.GLOBAL_SEARCH".  Granting access
+ * explicitly to the search infrastructure ensures it will be able to access the search suggestions
+ * without needing to know ahead of time any other details of the permissions protecting your
+ * provider.  Content providers that require no permissions are already available to the search
+ * infrastructure.  Here is an example of a provider that protects access to it with permissions,
+ * and provides read access to the search infrastructure to the path that it expects to receive the
+ * suggestion query on:
+ * <pre class="prettyprint">
+ * &lt;provider android:name="MyProvider" android:authorities="myprovider"
+ *        android:readPermission="android.permission.READ_MY_DATA"
+ *        android:writePermission="android.permission.WRITE_MY_DATA"&gt;
+ *    &lt;path-permission android:path="/search_suggest_query"
+ *            android:readPermission="android.permission.GLOBAL_SEARCH" /&gt;
+ * &lt;/provider&gt;
+ * </pre>
+ *
  * <p><b>Handling empty queries.</b>  Your application should handle the "empty query"
  * (no user text entered) case properly, and generate useful suggestions in this case.  There are a
  * number of ways to do this;  Two are outlined here:
@@ -377,7 +396,7 @@
  * unfiltered.  (example: People)</li>
  * <li>For a query search, you could simply present the most recent queries.  This allows the user
  * to quickly repeat a recent search.</li></ul>
- * 
+ *
  * <p><b>The Format of Individual Suggestions.</b>  Your suggestions are communicated back to the
  * Search Manager by way of a {@link android.database.Cursor Cursor}.  The Search Manager will
  * usually pass a null Projection, which means that your provider can simply return all appropriate
@@ -453,13 +472,42 @@
  *         <td align="center">No</td>
  *     </tr>
  *     
+ *     <tr><th>{@link #SUGGEST_COLUMN_INTENT_EXTRA_DATA}</th>
+ *         <td>If this column exists <i>and</i> this element exists at a given row, this is the
+ *             data that will be used when forming the suggestion's intent.  If not provided,
+ *             the Intent's extra data field will be null.  This column allows suggestions to
+ *             provide additional arbitrary data which will be included as an extra under the
+ *             key {@link #EXTRA_DATA_KEY}.</td>
+ *         <td align="center">No.</td>
+ *     </tr>
+ *
  *     <tr><th>{@link #SUGGEST_COLUMN_QUERY}</th>
  *         <td>If this column exists <i>and</i> this element exists at the given row, this is the 
  *             data that will be used when forming the suggestion's query.</td>
  *         <td align="center">Required if suggestion's action is 
  *             {@link android.content.Intent#ACTION_SEARCH ACTION_SEARCH}, optional otherwise.</td>
  *     </tr>
- *     
+ *
+ *     <tr><th>{@link #SUGGEST_COLUMN_SHORTCUT_ID}</th>
+ *         <td>This column is used to indicate whether a search suggestion should be stored as a
+ *             shortcut, and whether it should be validated.  Shortcuts are usually formed when the
+ *             user clicks a suggestion from Quick Search Box.  If missing, the result will be
+ *             stored as a shortcut and never refreshed.  If set to
+ *             {@link #SUGGEST_NEVER_MAKE_SHORTCUT}, the result will not be stored as a shortcut.
+ *             Otherwise, the shortcut id will be used to check back for for an up to date
+ *             suggestion using {@link #SUGGEST_URI_PATH_SHORTCUT}. Read more about shortcut
+ *             refreshing in the section about
+ *             <a href="#ExposingSearchSuggestionsToQuickSearchBox">exposing search suggestions to
+ *             Quick Search Box</a>.</td>
+ *         <td align="center">No.  Only applicable to sources included in Quick Search Box.</td>
+ *     </tr>
+ *
+ *     <tr><th>{@link #SUGGEST_COLUMN_SPINNER_WHILE_REFRESHING}</th>
+ *         <td>This column is used to specify that a spinner should be shown in lieu of an icon2
+ *             while the shortcut of this suggestion is being refreshed.</td>
+ *         <td align="center">No.  Only applicable to sources included in Quick Search Box.</td>
+ *     </tr>
+ * 
  *     <tr><th><i>Other Columns</i></th>
  *         <td>Finally, if you have defined any <a href="#ActionKeys">Action Keys</a> and you wish 
  *             for them to have suggestion-specific definitions, you'll need to define one 
@@ -536,7 +584,55 @@
  * <a name="ExposingSearchSuggestionsToQuickSearchBox"></a>
  * <h3>Exposing Search Suggestions to Quick Search Box</h3>
  * 
- * <p>
+ * <p>Once your application is setup to provide search suggestions, making them available to the
+ * globally accessable Quick Search Box is as easy as setting android:includeInGlobalSearch to
+ * "true" in your searchable metadata file.  Beyond that, here are some more details of how
+ * suggestions interact with Quick Search Box, and optional ways that you may customize suggestions
+ * for your application.
+ *
+ * <p><b>Source Ranking:</b>  Once your application's search results are made available to Quick
+ * Search Box, how they surface to the user for a particular query will depend on how many
+ * other apps have results for that query, and how often the user has clicked on your results
+ * compared to the other apps'.  The apps with the best track record within Quick Search
+ * Box will get queried earlier and have a better chance of showing their results in the top few
+ * slots.  If there are more results than can be displayed to the user within a screen or two, the
+ * results may spill into a "more results" section that groups the remaining results by
+ * source.  The newest apps with little usage information are given middle of the road positioning
+ * until enough usage information is available to rank it as usual.  The exact formula for ranking
+ * the results is not set in stone, but suffice it is to say that providing quality results will
+ * increase the likelihood that your app's suggestions are provided in a prominent position, and
+ * apps that provide lower quality suggestions will be more likely to be pushed into the spillover
+ * area.
+ *
+ * <p><b>Search Settings:</b>  Each app that is available to Quick Search Box has an entry in the
+ * system settings where the user can enable or disable the inclusion of its results.  Below the
+ * name of the application, each application may provide a brief description of what kind of
+ * information will be made available via a search settings description string pointed to by the
+ * android:searchSettingsDescription attribute in the searchable metadata.
+ *
+ * <p><b>Shortcuts:</b>  Suggestions that are clicked on by the user are automatically made into
+ * shortcuts, or, copied so they can quickly be displayed to the user before querying any of
+ * the sources. Thereafter, the shortcutted suggestion will be displayed for the query that yielded
+ * the suggestion and for any prefixes of that query.  When multiple shortcuts are made available
+ * for a given query, they are ranked based on recency and the number of clicks they have received.
+ * You can control how your suggestions are made into shortcuts, and whether they are refreshed,
+ * using the {@link #SUGGEST_COLUMN_SHORTCUT_ID} column:
+ * <ul><li>Suggestions that do not include a shortcut id column will be made into shortcuts and
+ * never refreshed.  This makes sense for suggestions that refer to data that will never be changed
+ * or removed.</li>
+ * <li>Suggestions that include a shortcut id will be re-queried for a fresh version of the
+ * suggestion each time the shortcut is displayed.  The shortcut will be quickly displayed with
+ * whatever data was most recently available until the refresh query returns, after which the
+ * suggestion will be dynamically refreshed with the up to date information.  The shortcut refresh
+ * query will be sent to your suggestion provider with a uri of {@link #SUGGEST_URI_PATH_SHORTCUT}.
+ * The result should contain one suggestion using the same columns as the suggestion query, or be
+ * empty, indicating that the shortcut is no longer valid.  Shortcut ids make sense when referring
+ * to data that may change over time, such as a contact's presence status.  If a suggestion refers
+ * to data that could take longer to refresh, such as a network based refresh of a stock quote, you
+ * may include {@link #SUGGEST_COLUMN_SPINNER_WHILE_REFRESHING} to show a progress spinner for the
+ * right hand icon until the refresh is complete.</li>
+ * <li>Finally, to prevent a suggestion from being copied into a shortcut, you may provide a
+ * shortcut id with a value of {@link #SUGGEST_NEVER_MAKE_SHORTCUT}.</li></ul>
  * 
  * <a name="ActionKeys"></a>
  * <h3>Action Keys</h3>
@@ -673,7 +769,7 @@
  *             entered.</td>
  *         <td align="center">No</td>
  *     </tr>
- *     
+ *
  *     <tr><th>android:searchButtonText</th>
  *         <td>If provided, this text will replace the default text in the "Search" button.</td>
  *         <td align="center">No</td>
@@ -853,7 +949,48 @@
  *     
  *     </tbody>
  * </table>
- * 
+ *
+ * <p>Elements of search metadata that configure search suggestions being available to Quick Search
+ * Box:
+ * <table border="2" width="85%" align="center" frame="hsides" rules="rows">
+ *
+ *     <thead>
+ *     <tr><th>Attribute</th> <th>Description</th> <th>Required?</th></tr>
+ *     </thead>
+ *
+ *     <tr><th>android:includeInGlobalSearch</th>
+ *         <td>If true, indicates the search suggestions provided by your application should be
+ *             included in the globally accessible Quick Search Box.  The attributes below are only
+ *             applicable if this is set to true.</td>
+ *         <td align="center">Yes</td>
+ *     </tr>
+ *
+ *     <tr><th>android:searchSettingsDescription</th>
+ *         <td>If provided, provides a brief description of the search suggestions that are provided
+ *             by your application to Quick Search Box, and will be displayed in the search settings
+ *             entry for your application.</td>
+ *         <td align="center">No</td>
+ *     </tr>
+ *
+ *     <tr><th>android:queryAfterZeroResults</th>
+ *         <td>Indicates whether a source should be invoked for supersets of queries it has
+ *             returned zero results for in the past.  For example, if a source returned zero
+ *             results for "bo", it would be ignored for "bob".  If set to false, this source
+ *             will only be ignored for a single session; the next time the search dialog is
+ *             invoked, all sources will be queried.  The default value is false.</td>
+ *         <td align="center">No</td>
+ *     </tr>
+ *
+ *     <tr><th>android:searchSuggestThreshold</th>
+ *         <td>Indicates the minimum number of characters needed to trigger a source from Quick
+ *             Search Box.  Only guarantees that a source will not be queried for anything shorter
+ *             than the threshold.  The default value is 0.</td>
+ *         <td align="center">No</td>
+ *     </tr>
+ *
+ *     </tbody>
+ * </table>
+ *
  * <p><b>Additional metadata for search action keys.</b>  For each action key that you would like to
  * define, you'll need to add an additional element defining that key, and using the attributes
  * discussed in <a href="#ActionKeys">Action Keys</a>.  A simple example is shown here:
@@ -1376,10 +1513,10 @@
 
     /**
      * Column name for suggestions cursor. <i>Optional.</i>  This column is used to indicate whether
-     * a search suggestion should be stored as a shortcut, and whether it should be validated.  If
+     * a search suggestion should be stored as a shortcut, and whether it should be refreshed.  If
      * missing, the result will be stored as a shortcut and never validated.  If set to
      * {@link #SUGGEST_NEVER_MAKE_SHORTCUT}, the result will not be stored as a shortcut.
-     * Otherwise, the shortcut id will be used to check back for validation via
+     * Otherwise, the shortcut id will be used to check back for an up to date suggestion using
      * {@link #SUGGEST_URI_PATH_SHORTCUT}.
      */
     public final static String SUGGEST_COLUMN_SHORTCUT_ID = "suggest_shortcut_id";
@@ -1546,7 +1683,7 @@
      * no extra data is required.
      * @param globalSearch If false, this will only launch the search that has been specifically
      * defined by the application (which is usually defined as a local search).  If no default 
-     * search is defined in the current application or activity, no search will be launched.
+     * search is defined in the current application or activity, global search will be launched.
      * If true, this will always launch a platform-global (e.g. web-based) search instead.
      * 
      * @see android.app.Activity#onSearchRequested
diff --git a/core/java/android/content/res/AssetManager.java b/core/java/android/content/res/AssetManager.java
index 8ebe093..0bc8a9d 100644
--- a/core/java/android/content/res/AssetManager.java
+++ b/core/java/android/content/res/AssetManager.java
@@ -667,6 +667,11 @@
     /**
      * {@hide}
      */
+    public native static final String getAssetAllocations();
+    
+    /**
+     * {@hide}
+     */
     public native static final int getGlobalAssetManagerCount();
     
     private native final int newTheme();
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java
index 830b0bd..1775a4b 100644
--- a/core/java/android/os/Build.java
+++ b/core/java/android/os/Build.java
@@ -120,9 +120,18 @@
          * {@link android.Manifest.permission#WRITE_EXTERNAL_STORAGE} permission to be
          * able to modify the contents of the SD card.  (Apps targeting
          * earlier versions will always request the permission.)
+         * <li> They must explicitly request the
+         * {@link android.Manifest.permission#READ_PHONE_STATE} permission to be
+         * able to be able to retrieve phone state info.  (Apps targeting
+         * earlier versions will always request the permission.)
+         * <li> They are assumed to support different screen densities and
+         * sizes.  (Apps targeting earlier versions are assumed to only support
+         * medium density normal size screens unless otherwise indicated).
+         * They can still explicitly specify screen support either way with the
+         * supports-screens manifest tag.
          * </ul>
          */
-        public static final int DONUT = CUR_DEVELOPMENT;
+        public static final int DONUT = 4;
     }
     
     /** The type of build, like "user" or "eng". */
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 9a9ddc9..4a4d2de 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -2973,6 +2973,18 @@
                 "vending_pd_resend_frequency_ms";
 
         /**
+         * Size of buffer in bytes for Vending to use when reading cache files.
+         */
+        public static final String VENDING_DISK_INPUT_BUFFER_BYTES =
+                "vending_disk_input_buffer_bytes";
+
+        /**
+         * Size of buffer in bytes for Vending to use when writing cache files.
+         */
+        public static final String VENDING_DISK_OUTPUT_BUFFER_BYTES =
+                "vending_disk_output_buffer_bytes";
+
+        /**
          * Frequency in milliseconds at which we should cycle through the promoted applications
          * on the home screen or the categories page.
          */
diff --git a/core/java/android/speech/RecognitionResult.java b/core/java/android/speech/RecognitionResult.java
index 8d031fc..978106b 100644
--- a/core/java/android/speech/RecognitionResult.java
+++ b/core/java/android/speech/RecognitionResult.java
@@ -60,9 +60,11 @@
      * 
      * @param contact the contact name.
      * @param phoneType the phone type.
+     * @param callAction whether this result included a command to "call", or just the contact name.
      */
-    public static RecognitionResult newContactResult(String contact, int phoneType) {
-        return new RecognitionResult(CONTACT_RESULT, contact, phoneType);
+    public static RecognitionResult newContactResult(String contact, int phoneType,
+            boolean callAction) {
+        return new RecognitionResult(CONTACT_RESULT, contact, phoneType, callAction);
     }
 
     /**
@@ -112,8 +114,16 @@
      */
     public final String mUrl;
 
-    /** Phone number type. This is valid only when mResultType == CONTACT_RESULT */
+    /**
+     * Phone number type. This is valid only when mResultType == CONTACT_RESULT.
+     */
     public final int mPhoneType;
+    
+    /**
+     * Whether a contact recognition result included a command to "call". This is valid only
+     * when mResultType == CONTACT_RESULT.
+     */
+    public final boolean mCallAction;
 
     private RecognitionResult(int type, String query, String html, String url) {
         mResultType = type;
@@ -121,14 +131,16 @@
         mHtml = html;
         mUrl = url;
         mPhoneType = -1;
+        mCallAction = false;
     }
 
-    private RecognitionResult(int type, String query, int at) {
+    private RecognitionResult(int type, String query, int phoneType, boolean callAction) {
         mResultType = type;
         mText = query;
-        mPhoneType = at;
+        mPhoneType = phoneType;
         mHtml = null;
         mUrl = null;
+        mCallAction = callAction;
     }
     
     private RecognitionResult(Parcel in) {
@@ -137,6 +149,7 @@
         mHtml= in.readString();
         mUrl= in.readString();
         mPhoneType = in.readInt();
+        mCallAction = (in.readInt() == 1);
     }
 
     public void writeToParcel(Parcel out, int flags) {
@@ -145,6 +158,7 @@
         out.writeString(mHtml);
         out.writeString(mUrl);
         out.writeInt(mPhoneType);
+        out.writeInt(mCallAction ? 1 : 0);
     }
     
     
diff --git a/core/java/android/speech/tts/TextToSpeech.java b/core/java/android/speech/tts/TextToSpeech.java
index 04a0ec8..a6d76d6 100755
--- a/core/java/android/speech/tts/TextToSpeech.java
+++ b/core/java/android/speech/tts/TextToSpeech.java
@@ -61,7 +61,7 @@
 
 
     /**
-     * Denotes the language is available exactly as specified by the locale
+     * Denotes the language is available exactly as specified by the locale.
      */
     public static final int LANG_COUNTRY_VAR_AVAILABLE = 2;
 
@@ -176,7 +176,7 @@
 
         // intents to ask engine to install data or check its data
         /**
-         * Broadcast Action: Triggers the platform Text-To-Speech engine to
+         * Activity Action: Triggers the platform Text-To-Speech engine to
          * start the activity that installs the resource files on the device
          * that are required for TTS to be operational. Since the installation
          * of the data can be interrupted or declined by the user, the application
@@ -184,18 +184,20 @@
          * and if need be, should check installation status with
          * {@link #ACTION_CHECK_TTS_DATA}.
          */
-        @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+        @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
         public static final String ACTION_INSTALL_TTS_DATA =
                 "android.speech.tts.engine.INSTALL_TTS_DATA";
 
         /**
-         * {@hide}
+         * Broadcast Action: broadcast to signal the completion of the installation of
+         * the data files used by the synthesis engine. Success or failure is indicated in the
+         * {@link #EXTRA_TTS_DATA_INSTALLED} extra.
          */
         @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
         public static final String ACTION_TTS_DATA_INSTALLED =
                 "android.speech.tts.engine.TTS_DATA_INSTALLED";
         /**
-         * Broadcast Action: Starts the activity from the platform Text-To-Speech
+         * Activity Action: Starts the activity from the platform Text-To-Speech
          * engine to verify the proper installation and availability of the
          * resource files on the system. Upon completion, the activity will
          * return one of the following codes:
@@ -217,7 +219,7 @@
          *       and YYY is the 3-letter ISO country code.</li>
          * </ul>
          */
-        @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+        @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
         public static final String ACTION_CHECK_TTS_DATA =
                 "android.speech.tts.engine.CHECK_TTS_DATA";
 
@@ -241,11 +243,11 @@
 
         // extras for a TTS engine's data installation
         /**
-         * Extra information received with the {@link #ACTION_TTS_DATA_INSTALLED} intent
-         * which indicates whether the TTS data installation requested with
-         * {@link #ACTION_INSTALL_TTS_DATA} completed successfully or not. The value is
-         * {@link TextToSpeech#SUCCESS} or {@link TextToSpeech#ERROR}.
-         * {@hide}
+         * Extra information received with the {@link #ACTION_TTS_DATA_INSTALLED} intent.
+         * It indicates whether the data files for the synthesis engine were successfully
+         * installed. The installation was initiated with the  {@link #ACTION_INSTALL_TTS_DATA}
+         * intent. The possible values for this extra are
+         * {@link TextToSpeech#SUCCESS} and {@link TextToSpeech#ERROR}.
          */
         public static final String EXTRA_TTS_DATA_INSTALLED = "dataInstalled";
 
@@ -1032,7 +1034,7 @@
             }
             try {
                 String[] locStrings =  mITts.getLanguage();
-                if (locStrings.length == 3) {
+                if ((locStrings != null) && (locStrings.length == 3)) {
                     return new Locale(locStrings[0], locStrings[1], locStrings[2]);
                 } else {
                     return null;
diff --git a/core/java/android/util/DisplayMetrics.java b/core/java/android/util/DisplayMetrics.java
index dd5a440..74f01cc 100644
--- a/core/java/android/util/DisplayMetrics.java
+++ b/core/java/android/util/DisplayMetrics.java
@@ -24,6 +24,9 @@
 /**
  * A structure describing general information about a display, such as its
  * size, density, and font scaling.
+ * <p>To access the DisplayMetrics members, initialize an object like this:</p>
+ * <pre> DisplayMetrics metrics = new DisplayMetrics();
+ * getWindowManager().getDefaultDisplay().getMetrics(metrics);</pre>
  */
 public class DisplayMetrics {
     /**
diff --git a/core/java/android/widget/ProgressBar.java b/core/java/android/widget/ProgressBar.java
index 2c9e71e..b179a13 100644
--- a/core/java/android/widget/ProgressBar.java
+++ b/core/java/android/widget/ProgressBar.java
@@ -190,10 +190,12 @@
 
         mBehavior = a.getInt(R.styleable.ProgressBar_indeterminateBehavior, mBehavior);
 
-        final int resID = a.getResourceId(com.android.internal.R.styleable.ProgressBar_interpolator, -1);
+        final int resID = a.getResourceId(
+                com.android.internal.R.styleable.ProgressBar_interpolator, 
+                android.R.anim.linear_interpolator); // default to linear interpolator
         if (resID > 0) {
             setInterpolator(context, resID);
-        }
+        } 
 
         setMax(a.getInt(R.styleable.ProgressBar_max, mMax));
 
diff --git a/core/jni/android_util_AssetManager.cpp b/core/jni/android_util_AssetManager.cpp
index 66b2506..562cc8f 100644
--- a/core/jni/android_util_AssetManager.cpp
+++ b/core/jni/android_util_AssetManager.cpp
@@ -1536,6 +1536,22 @@
     return Asset::getGlobalCount();
 }
 
+static jobject android_content_AssetManager_getAssetAllocations(JNIEnv* env, jobject clazz)
+{
+    String8 alloc = Asset::getAssetAllocations();
+    if (alloc.length() <= 0) {
+        return NULL;
+    }
+    
+    jstring str = env->NewStringUTF(alloc.string());
+    if (str == NULL) {
+        doThrow(env, "java/lang/OutOfMemoryError");
+        return NULL;
+    }
+    
+    return str;
+}
+
 static jint android_content_AssetManager_getGlobalAssetManagerCount(JNIEnv* env, jobject clazz)
 {
     return AssetManager::getGlobalCount();
@@ -1646,6 +1662,8 @@
         (void*) android_content_AssetManager_destroy },
     { "getGlobalAssetCount", "()I",
         (void*) android_content_AssetManager_getGlobalAssetCount },
+    { "getAssetAllocations", "()Ljava/lang/String;",
+        (void*) android_content_AssetManager_getAssetAllocations },
     { "getGlobalAssetManagerCount", "()I",
         (void*) android_content_AssetManager_getGlobalAssetCount },
 };
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 4558660..cf2184c 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -49,7 +49,6 @@
     <protected-broadcast android:name="android.intent.action.ACTION_SHUTDOWN" />
     <protected-broadcast android:name="android.intent.action.DEVICE_STORAGE_LOW" />
     <protected-broadcast android:name="android.intent.action.DEVICE_STORAGE_OK" />
-    <protected-broadcast android:name="android.intent.action.AIRPLANE_MODE" />
     <protected-broadcast android:name="android.intent.action.NEW_OUTGOING_CALL" />
     <protected-broadcast android:name="android.intent.action.REBOOT" />
     
diff --git a/core/res/res/drawable/sym_def_app_icon.png b/core/res/res/drawable/sym_def_app_icon.png
index 75024841..8be3b54 100644
--- a/core/res/res/drawable/sym_def_app_icon.png
+++ b/core/res/res/drawable/sym_def_app_icon.png
Binary files differ
diff --git a/core/res/res/values-cs/strings.xml b/core/res/res/values-cs/strings.xml
index ad52251..d858a79 100644
--- a/core/res/res/values-cs/strings.xml
+++ b/core/res/res/values-cs/strings.xml
@@ -168,7 +168,7 @@
     <string name="permdesc_receiveSms" msgid="6298292335965966117">"Umožňuje aplikaci přijímat a zpracovávat zprávy SMS. Škodlivé aplikace mohou sledovat vaše zprávy nebo je smazat, aniž by vám byly zobrazeny."</string>
     <string name="permlab_receiveMms" msgid="8894700916188083287">"příjem zpráv MMS"</string>
     <string name="permdesc_receiveMms" msgid="4563346832000174373">"Umožňuje aplikaci přijímat a zpracovávat zprávy MMS. Škodlivé aplikace mohou sledovat vaše zprávy nebo je smazat, aniž by vám byly zobrazeny."</string>
-    <string name="permlab_sendSms" msgid="5600830612147671529">"odesílat zprávy SMS"</string>
+    <string name="permlab_sendSms" msgid="5600830612147671529">"odesílaní zpráv SMS"</string>
     <string name="permdesc_sendSms" msgid="1946540351763502120">"Umožňuje aplikaci odesílat zprávy SMS. Škodlivé aplikace mohou bez vašeho potvrzení odesílat zpoplatněné zprávy."</string>
     <string name="permlab_readSms" msgid="4085333708122372256">"čtení zpráv SMS a MMS"</string>
     <string name="permdesc_readSms" msgid="3002170087197294591">"Umožňuje aplikaci číst zprávy SMS uložené ve vašem telefonu nebo na kartě SIM. Škodlivé aplikace mohou načíst vaše soukromé zprávy."</string>
@@ -182,7 +182,7 @@
     <string name="permdesc_reorderTasks" msgid="126252774270522835">"Umožňuje aplikaci přesouvat úlohy do popředí či pozadí. Škodlivé aplikace mohou vynutit své přesunutí do popředí bez vašeho přičinění."</string>
     <string name="permlab_setDebugApp" msgid="4339730312925176742">"povolit ladění aplikací"</string>
     <string name="permdesc_setDebugApp" msgid="5584310661711990702">"Umožňuje aplikaci povolit ladění jiné aplikace. Škodlivé aplikace mohou pomocí tohoto nastavení ukončit jiné aplikace."</string>
-    <string name="permlab_changeConfiguration" msgid="8214475779521218295">"změny vašeho nastavení uživatelského rozhraní"</string>
+    <string name="permlab_changeConfiguration" msgid="8214475779521218295">"změna vašeho nastavení uživatelského rozhraní"</string>
     <string name="permdesc_changeConfiguration" msgid="3465121501528064399">"Umožňuje aplikaci změnit aktuální konfiguraci, např. národní prostředí či obecnou velikost písma."</string>
     <string name="permlab_restartPackages" msgid="2386396847203622628">"restartování ostatních aplikací"</string>
     <string name="permdesc_restartPackages" msgid="1076364837492936814">"Umožňuje aplikaci vynutit restartování jiných aplikací."</string>
@@ -190,9 +190,9 @@
     <string name="permdesc_forceBack" msgid="6534109744159919013">"Umožňuje aplikaci vynutit zavření a přesunutí libovolné činnosti v popředí na pozadí. Běžné aplikace by toto nastavení neměly nikdy využívat."</string>
     <string name="permlab_dump" msgid="1681799862438954752">"načtení interního stavu systému"</string>
     <string name="permdesc_dump" msgid="2198776174276275220">"Umožňuje aplikaci načíst interní stav systému. Škodlivé aplikace mohou načíst řádu soukromých a zabezpečených informací, které by nikdy neměly potřebovat."</string>
-    <string name="permlab_shutdown" msgid="7185747824038909016">"Částečné vypnutí"</string>
+    <string name="permlab_shutdown" msgid="7185747824038909016">"částečné vypnutí"</string>
     <string name="permdesc_shutdown" msgid="7046500838746291775">"Uvede správce činností do vypnutého stavu. Nedojde však k úplnému vypnutí."</string>
-    <string name="permlab_stopAppSwitches" msgid="4138608610717425573">"Zabránit přepínání aplikací"</string>
+    <string name="permlab_stopAppSwitches" msgid="4138608610717425573">"zabránění přepínání aplikací"</string>
     <string name="permdesc_stopAppSwitches" msgid="3857886086919033794">"Zabrání uživateli přepnout na jinou aplikaci."</string>
     <string name="permlab_runSetActivityWatcher" msgid="7811586187574696296">"sledování a řízení spouštění všech aplikací"</string>
     <string name="permdesc_runSetActivityWatcher" msgid="3228701938345388092">"Umožňuje aplikaci sledovat a řídit spouštění činností systémem. Škodlivé aplikace mohou zcela ovládnout systém. Toto oprávnění je zapotřebí pouze pro účely vývoje, nikdy pro běžné použití telefonu."</string>
@@ -208,13 +208,13 @@
     <string name="permdesc_setAlwaysFinish" msgid="8773936403987091620">"Umožňuje aplikaci ovládat, zda jsou činnosti vždy dokončeny po přesunutí do pozadí. Běžné aplikace toto nastavení nikdy nevyužívají."</string>
     <string name="permlab_batteryStats" msgid="7863923071360031652">"změna statistických údajů o baterii"</string>
     <string name="permdesc_batteryStats" msgid="5847319823772230560">"Umožňuje změnu shromážděných statistických údajů o baterii. Není určeno pro běžné aplikace."</string>
-    <string name="permlab_backup" msgid="470013022865453920">"Ovládat zálohování a obnovu systému"</string>
+    <string name="permlab_backup" msgid="470013022865453920">"ovládání zálohování a obnovy systému"</string>
     <string name="permdesc_backup" msgid="2305432853944929371">"Umožňuje aplikaci ovládat mechanizmus zálohování a obnovy systému. Není určeno k použití v běžných aplikacích."</string>
     <string name="permlab_internalSystemWindow" msgid="2148563628140193231">"zobrazení nepovolených oken"</string>
     <string name="permdesc_internalSystemWindow" msgid="5895082268284998469">"Umožňuje vytvoření oken, která mají být použita interním systémem uživatelského rozhraní. Běžné aplikace toto nastavení nepoužívají."</string>
     <string name="permlab_systemAlertWindow" msgid="3372321942941168324">"zobrazení upozornění systémové úrovně"</string>
     <string name="permdesc_systemAlertWindow" msgid="5109622689323490558">"Umožňuje aplikaci zobrazit okna s výstrahami systému. Škodlivé aplikace mohou převzít kontrolu nad celou obrazovkou telefonu."</string>
-    <string name="permlab_setAnimationScale" msgid="2805103241153907174">"globální změny rychlosti animace"</string>
+    <string name="permlab_setAnimationScale" msgid="2805103241153907174">"změna globální rychlosti animace"</string>
     <string name="permdesc_setAnimationScale" msgid="7181522138912391988">"Umožňuje aplikaci kdykoli globálně změnit rychlost animace (rychlejší či pomalejší animace)."</string>
     <string name="permlab_manageAppTokens" msgid="17124341698093865">"správa tokenů aplikací"</string>
     <string name="permdesc_manageAppTokens" msgid="977127907524195988">"Umožňuje aplikaci vytvořit a spravovat své vlastní tokeny a obejít jejich obvyklé řazení typu Z. Toto nastavení by nikdy nemělo být potřeba pro běžné aplikace."</string>
@@ -250,11 +250,11 @@
     <string name="permdesc_changeComponentState" msgid="4569107043246700630">"Umožňuje aplikaci změnit, zda je komponenta jiné aplikace povolena nebo ne. Škodlivé aplikace mohou pomocí tohoto nastavení vypnout důležité funkce telefonu. Je třeba postupovat opatrně, protože je možné způsobit nepoužitelnost, nekonzistenci či nestabilitu komponent aplikací."</string>
     <string name="permlab_setPreferredApplications" msgid="3393305202145172005">"nastavení upřednostňovaných aplikací"</string>
     <string name="permdesc_setPreferredApplications" msgid="760008293501937546">"Umožňuje aplikaci změnit vaše upřednostňované aplikace. Toto nastavení může škodlivým aplikacím umožnit nepozorovaně změnit spouštěné aplikace a oklamat vaše existující aplikace tak, aby shromažďovaly vaše soukromá data."</string>
-    <string name="permlab_writeSettings" msgid="1365523497395143704">"změny globálních nastavení systému"</string>
+    <string name="permlab_writeSettings" msgid="1365523497395143704">"změna globálních nastavení systému"</string>
     <string name="permdesc_writeSettings" msgid="838789419871034696">"Umožňuje aplikaci upravit data nastavení systému. Škodlivé aplikace mohou poškodit konfiguraci vašeho systému."</string>
     <string name="permlab_writeSecureSettings" msgid="204676251876718288">"změny zabezpečených nastavení systému"</string>
     <string name="permdesc_writeSecureSettings" msgid="4116616249170428132">"Umožňuje aplikaci změnit data zabezpečených nastavení systému. Běžné aplikace toto nastavení nevyužívají."</string>
-    <string name="permlab_writeGservices" msgid="2149426664226152185">"změny mapy služeb Google"</string>
+    <string name="permlab_writeGservices" msgid="2149426664226152185">"změna mapy služeb Google"</string>
     <string name="permdesc_writeGservices" msgid="6602362746516676175">"Umožňuje aplikaci změnit mapu služeb Google. Běžné aplikace toto nastavení nevyužívají."</string>
     <string name="permlab_receiveBootCompleted" msgid="7776779842866993377">"automatické spuštění při startu"</string>
     <string name="permdesc_receiveBootCompleted" msgid="698336728415008796">"Umožňuje aplikaci spuštění ihned po spuštění systému. Toto nastavení může zpomalit spuštění telefonu a umožnit aplikaci celkově zpomalit telefon, protože bude neustále spuštěna."</string>
@@ -276,7 +276,7 @@
     <string name="permdesc_accessMockLocation" msgid="7648286063459727252">"Vytváří simulované zdroje polohy pro účely testování. Škodlivé aplikace mohou pomocí tohoto nastavení změnit polohu či stav vrácený zdroji skutečné polohy, jako je např. jednotka GPS či poskytovatelé sítě."</string>
     <string name="permlab_accessLocationExtraCommands" msgid="2836308076720553837">"přístup k dalším příkazům poskytovatele polohy"</string>
     <string name="permdesc_accessLocationExtraCommands" msgid="1948144701382451721">"Umožňuje získat přístup k dalším příkazům poskytovatele polohy. Škodlivé aplikace mohou pomocí tohoto nastavení narušit funkci GPS či jiných zdrojů polohy."</string>
-    <string name="permlab_installLocationProvider" msgid="6578101199825193873">"Oprávnění k instalaci poskytovatele polohy"</string>
+    <string name="permlab_installLocationProvider" msgid="6578101199825193873">"oprávnění k instalaci poskytovatele polohy"</string>
     <string name="permdesc_installLocationProvider" msgid="5449175116732002106">"Vytvořit simulace zdrojů polohy pro účely testování. Škodlivé aplikace mohou toto nastavení využít k přepsání polohy nebo stavu vráceného zdroji skutečné polohy, například systémem GPS nebo poskytovateli sítí. Mohou také monitorovat polohu a ohlásit ji externímu zdroji."</string>
     <string name="permlab_accessFineLocation" msgid="8116127007541369477">"upřesnění polohy (GPS)"</string>
     <string name="permdesc_accessFineLocation" msgid="7411213317434337331">"Umožňuje aplikaci přístup ke zdrojům přesné polohy v telefonu, jako je například systém GPS, je-li k dispozici. Škodlivé aplikace mohou pomocí tohoto nastavení zjistit vaši polohu a mohou zvýšit spotřebu baterie."</string>
@@ -316,7 +316,7 @@
     <string name="permdesc_checkinProperties" msgid="7150307006141883832">"Umožňuje čtení i zápis vlastností nahraných službou Checkin. Běžné aplikace toto nastavení obvykle nevyužívají."</string>
     <string name="permlab_bindGadget" msgid="776905339015863471">"zvolit widgety"</string>
     <string name="permdesc_bindGadget" msgid="2098697834497452046">"Umožňuje aplikaci sdělit systému, které aplikace mohou používat které widgety. Aplikace s tímto oprávněním mohou zpřístupnit osobní údaje jiným aplikacím. Není určeno pro běžné aplikace."</string>
-    <string name="permlab_modifyPhoneState" msgid="8423923777659292228">"změny stavu telefonu"</string>
+    <string name="permlab_modifyPhoneState" msgid="8423923777659292228">"změna stavu telefonu"</string>
     <string name="permdesc_modifyPhoneState" msgid="3302284561346956587">"Umožňuje aplikaci ovládat telefonní funkce zařízení. Aplikace s tímto oprávněním může přepínat sítě nebo zapnout či vypnout bezdrátové připojení telefonu bez vašeho svolení."</string>
     <!-- no translation found for permlab_readPhoneState (2326172951448691631) -->
     <skip />
@@ -342,7 +342,7 @@
     <string name="permdesc_accessNetworkState" msgid="558721128707712766">"Umožňuje aplikaci zobrazit stav všech sítí."</string>
     <string name="permlab_createNetworkSockets" msgid="9121633680349549585">"plný přístup k Internetu"</string>
     <string name="permdesc_createNetworkSockets" msgid="4593339106921772192">"Umožňuje aplikaci vytvořit síťové sokety."</string>
-    <string name="permlab_writeApnSettings" msgid="7823599210086622545">"zápis nastavení pro název přístupového bodu (APN)"</string>
+    <string name="permlab_writeApnSettings" msgid="7823599210086622545">"zápis nastavení názvu přístupového bodu (APN)"</string>
     <string name="permdesc_writeApnSettings" msgid="7443433457842966680">"Umožňuje aplikaci změnit nastavení APN, jako je například proxy či port APN."</string>
     <string name="permlab_changeNetworkState" msgid="958884291454327309">"změna připojení k síti"</string>
     <string name="permdesc_changeNetworkState" msgid="6278115726355634395">"Umožňuje aplikaci změnit stav připojení k síti."</string>
@@ -350,9 +350,9 @@
     <string name="permdesc_changeBackgroundDataSetting" msgid="1001482853266638864">"Umožňuje aplikaci změnit nastavení použití dat na pozadí."</string>
     <string name="permlab_accessWifiState" msgid="8100926650211034400">"zobrazení stavu WiFi"</string>
     <string name="permdesc_accessWifiState" msgid="485796529139236346">"Umožňuje aplikaci zobrazit informace o stavu připojení WiFi."</string>
-    <string name="permlab_changeWifiState" msgid="7280632711057112137">"Změnit stav WiFi"</string>
+    <string name="permlab_changeWifiState" msgid="7280632711057112137">"změna stavu WiFi"</string>
     <string name="permdesc_changeWifiState" msgid="2950383153656873267">"Umožňuje aplikaci připojit se k přístupovým bodům WiFi či se od nich odpojit a provádět změny nakonfigurovaných sítí WiFi."</string>
-    <string name="permlab_changeWifiMulticastState" msgid="1368253871483254784">"Povolit příjem Wi-Fi Multicast"</string>
+    <string name="permlab_changeWifiMulticastState" msgid="1368253871483254784">"povolení příjmu Wi-Fi Multicast"</string>
     <string name="permdesc_changeWifiMulticastState" msgid="8199464507656067553">"Povoluje aplikaci přijímat pakety, které nebyly adresovány přímo vašemu zařízení. Pomocí této možnosti můžete objevit služby nabízené ve vaší blízkosti. Spotřeba energie je vyšší než u režimu bez vícesměrového vysílání (multicast)."</string>
     <string name="permlab_bluetoothAdmin" msgid="1092209628459341292">"správa rozhraní Bluetooth"</string>
     <string name="permdesc_bluetoothAdmin" msgid="7256289774667054555">"Umožňuje aplikaci konfigurovat místní telefon s rozhraním Bluetooth a vyhledávat a párovat vzdálená zařízení."</string>
@@ -370,11 +370,11 @@
     <string name="permdesc_subscribedFeedsRead" msgid="3622200625634207660">"Umožňuje aplikaci získat podrobnosti o aktuálně synchronizovaných zdrojích."</string>
     <string name="permlab_subscribedFeedsWrite" msgid="9015246325408209296">"zápis odebíraných zdrojů"</string>
     <string name="permdesc_subscribedFeedsWrite" msgid="8121607099326533878">"Umožňuje aplikaci upravit vaše aktuálně synchronizované zdroje. To může škodlivým aplikacím umožnit změnu vašich synchronizovaných zdrojů."</string>
-    <string name="permlab_readDictionary" msgid="432535716804748781">"číst slovník definovaný uživatelem"</string>
+    <string name="permlab_readDictionary" msgid="432535716804748781">"člení slovníku definovaného uživatelem"</string>
     <string name="permdesc_readDictionary" msgid="1082972603576360690">"Umožní aplikaci číst soukromá slova, jména a fráze, která uživatel mohl uložit do svého slovníku."</string>
-    <string name="permlab_writeDictionary" msgid="6703109511836343341">"zapisovat do slovníku definovaného uživatelem"</string>
+    <string name="permlab_writeDictionary" msgid="6703109511836343341">"zápis do slovníku definovaného uživatelem"</string>
     <string name="permdesc_writeDictionary" msgid="2241256206524082880">"Umožní aplikaci zapisovat nová slova do uživatelského slovníku."</string>
-    <string name="permlab_sdcardWrite" msgid="8079403759001777291">"Změnit/smazat obsah karty SD"</string>
+    <string name="permlab_sdcardWrite" msgid="8079403759001777291">"změna/smazání obsah karty SD"</string>
     <string name="permdesc_sdcardWrite" msgid="6643963204976471878">"Umožní aplikaci zápis na kartu SD."</string>
   <string-array name="phoneTypes">
     <item msgid="8901098336658710359">"Domů"</item>
@@ -473,10 +473,10 @@
     <string name="js_dialog_title_default" msgid="6961903213729667573">"JavaScript"</string>
     <string name="js_dialog_before_unload" msgid="1901675448179653089">"Chcete opustit tuto stránku?"\n\n"<xliff:g id="MESSAGE">%s</xliff:g>"\n\n"Vyberte OK, chcete-li pokračovat, nebo Zrušit, chcete-li na stránce zůstat."</string>
     <string name="save_password_label" msgid="6860261758665825069">"Potvrdit"</string>
-    <string name="permlab_readHistoryBookmarks" msgid="1284843728203412135">"Čtení historie a záložek prohlížeče"</string>
-    <string name="permdesc_readHistoryBookmarks" msgid="4981489815467617191">"Umožňuje aplikaci číst všechny navštívené adresy URL a záložky prohlížeče."</string>
-    <string name="permlab_writeHistoryBookmarks" msgid="9009434109836280374">"Zapisovat historii a záložky prohlížeče"</string>
-    <string name="permdesc_writeHistoryBookmarks" msgid="945571990357114950">"Umožní aplikaci změnit historii či záložky prohlížeče uložené v telefonu. Škodlivé aplikace mohou pomocí tohoto nastavení vymazat či pozměnit data prohlížeče."</string>
+    <string name="permlab_readHistoryBookmarks" msgid="1284843728203412135">"čtení historie a záložek Prohlížeče"</string>
+    <string name="permdesc_readHistoryBookmarks" msgid="4981489815467617191">"Umožňuje aplikaci číst všechny navštívené adresy URL a záložky Prohlížeče."</string>
+    <string name="permlab_writeHistoryBookmarks" msgid="9009434109836280374">"zápis do historie a záložek Prohlížeče"</string>
+    <string name="permdesc_writeHistoryBookmarks" msgid="945571990357114950">"Umožní aplikaci změnit historii či záložky prohlížeče uložené v telefonu. Škodlivé aplikace mohou pomocí tohoto nastavení vymazat či pozměnit data Prohlížeče."</string>
     <string name="save_password_message" msgid="767344687139195790">"Chcete, aby si prohlížeč zapamatoval toto heslo?"</string>
     <string name="save_password_notnow" msgid="6389675316706699758">"Nyní ne"</string>
     <string name="save_password_remember" msgid="6491879678996749466">"Zapamatovat"</string>
@@ -630,7 +630,7 @@
     <string name="volume_music_hint_playing_through_bluetooth" msgid="9165984379394601533">"Přehrávání pomocí rozhraní Bluetooth"</string>
     <string name="volume_call" msgid="3941680041282788711">"Hlasitost hovoru"</string>
     <string name="volume_bluetooth_call" msgid="2002891926351151534">"Hlasitost příchozích hovorů při připojení Bluetooth"</string>
-    <string name="volume_alarm" msgid="1985191616042689100">"Hlasitost upozornění a budíku"</string>
+    <string name="volume_alarm" msgid="1985191616042689100">"Hlasitost budíku"</string>
     <string name="volume_notification" msgid="2422265656744276715">"Hlasitost oznámení"</string>
     <string name="volume_unknown" msgid="1400219669770445902">"Hlasitost"</string>
     <string name="ringtone_default" msgid="3789758980357696936">"Výchozí vyzváněcí tón"</string>
diff --git a/core/res/res/values-zh-rTW/strings.xml b/core/res/res/values-zh-rTW/strings.xml
index d0126ab..fd677ce 100644
--- a/core/res/res/values-zh-rTW/strings.xml
+++ b/core/res/res/values-zh-rTW/strings.xml
@@ -426,7 +426,7 @@
     <string name="emergency_call_dialog_number_for_display" msgid="696192103195090970">"緊急電話號碼"</string>
     <string name="lockscreen_carrier_default" msgid="8812714795156374435">"(沒有服務)"</string>
     <string name="lockscreen_screen_locked" msgid="7288443074806832904">"螢幕已鎖定。"</string>
-    <string name="lockscreen_instructions_when_pattern_enabled" msgid="46154051614126049">"按下 [選單] 解鎖或撥打緊急電話。"</string>
+    <string name="lockscreen_instructions_when_pattern_enabled" msgid="46154051614126049">"按下 [Menu] 解鎖或撥打緊急電話。"</string>
     <string name="lockscreen_instructions_when_pattern_disabled" msgid="686260028797158364">"按下 Menu 鍵解鎖。"</string>
     <string name="lockscreen_pattern_instructions" msgid="7478703254964810302">"畫出解鎖圖形"</string>
     <string name="lockscreen_emergency_call" msgid="5347633784401285225">"緊急電話"</string>
@@ -484,7 +484,7 @@
     <string name="open_permission_deny" msgid="5661861460947222274">"您沒有開啟此頁的權限。"</string>
     <string name="text_copied" msgid="4985729524670131385">"文字已複製到剪貼簿。"</string>
     <string name="more_item_label" msgid="4650918923083320495">"更多"</string>
-    <string name="prepend_shortcut_label" msgid="2572214461676015642">"[選單] +"</string>
+    <string name="prepend_shortcut_label" msgid="2572214461676015642">"[Menu] +"</string>
     <string name="menu_space_shortcut_label" msgid="2410328639272162537">"空白鍵"</string>
     <string name="menu_enter_shortcut_label" msgid="2743362785111309668">"輸入"</string>
     <string name="menu_delete_shortcut_label" msgid="3658178007202748164">"刪除"</string>
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index 48b565f..442357e 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -577,9 +577,7 @@
          backup and restore of the application's settings to external storage. -->
     <attr name="backupAgent" format="string" />
 
-    <!-- Whether the application allows its data to be backed up at all.  This
-         attribute defaults to 'true':  unless the application opts out, the
-         user will be able to back up its data to desktop storage. -->
+    <!-- This is not the attribute you are looking for. -->
     <attr name="allowBackup" format="boolean" />
 
     <!-- The <code>manifest</code> tag is the root of an
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 6a6b7fc..c92cf51 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -1092,74 +1092,52 @@
   <eat-comment />
 
   <public type="attr" name="tension" id="0x0101026a" />
-  <public type="attr" name="extraTension" />
-  <public type="attr" name="anyDensity" />
-  <public type="attr" name="searchSuggestThreshold" />
-  <public type="attr" name="includeInGlobalSearch" />
-  <public type="attr" name="onClick" />
-  <public type="attr" name="targetSdkVersion" />
-  <public type="attr" name="maxSdkVersion" />
-  <public type="attr" name="testOnly" />
-  <public type="attr" name="contentDescription" />
-  <public type="attr" name="gestureStrokeWidth" />
-  <public type="attr" name="gestureColor" />
-  <public type="attr" name="uncertainGestureColor" />
-  <public type="attr" name="fadeOffset" />
-  <public type="attr" name="fadeDuration" />
-  <public type="attr" name="gestureStrokeType" />
-  <public type="attr" name="gestureStrokeLengthThreshold" />
-  <public type="attr" name="gestureStrokeSquarenessThreshold" />
-  <public type="attr" name="gestureStrokeAngleThreshold" />
-  <public type="attr" name="eventsInterceptionEnabled" />
-  <public type="attr" name="fadeEnabled" />
-  <public type="attr" name="backupAgent" />
-  <public type="attr" name="allowBackup" />
-  <public type="attr" name="glEsVersion" />
-  <public type="attr" name="queryAfterZeroResults" />
-  <public type="attr" name="dropDownHeight" />
-  <public type="attr" name="smallScreens" />
-  <public type="attr" name="normalScreens" />
-  <public type="attr" name="largeScreens" />
-  <public type="attr" name="progressBarStyleInverse" />
-  <public type="attr" name="progressBarStyleSmallInverse" />
-  <public type="attr" name="progressBarStyleLargeInverse" /> 
-  <public type="attr" name="searchSettingsDescription" />
-  <public type="attr" name="textColorPrimaryInverseDisableOnly" />
-  <public type="attr" name="autoUrlDetect" />
-  <public type="attr" name="resizeable" />
+  <public type="attr" name="extraTension" id="0x0101026b" />
+  <public type="attr" name="anyDensity" id="0x0101026c" />
+  <public type="attr" name="searchSuggestThreshold" id="0x0101026d" />
+  <public type="attr" name="includeInGlobalSearch" id="0x0101026e" />
+  <public type="attr" name="onClick" id="0x0101026f" />
+  <public type="attr" name="targetSdkVersion" id="0x01010270" />
+  <public type="attr" name="maxSdkVersion" id="0x01010271" />
+  <public type="attr" name="testOnly" id="0x01010272" />
+  <public type="attr" name="contentDescription" id="0x01010273" />
+  <public type="attr" name="gestureStrokeWidth" id="0x01010274" />
+  <public type="attr" name="gestureColor" id="0x01010275" />
+  <public type="attr" name="uncertainGestureColor" id="0x01010276" />
+  <public type="attr" name="fadeOffset" id="0x01010277" />
+  <public type="attr" name="fadeDuration" id="0x01010278" />
+  <public type="attr" name="gestureStrokeType" id="0x01010279" />
+  <public type="attr" name="gestureStrokeLengthThreshold" id="0x0101027a" />
+  <public type="attr" name="gestureStrokeSquarenessThreshold" id="0x0101027b" />
+  <public type="attr" name="gestureStrokeAngleThreshold" id="0x0101027c" />
+  <public type="attr" name="eventsInterceptionEnabled" id="0x0101027d" />
+  <public type="attr" name="fadeEnabled" id="0x0101027e" />
+  <public type="attr" name="backupAgent" id="0x0101027f" />
+  <public type="attr" name="allowBackup" id="0x01010280" />
+  <public type="attr" name="glEsVersion" id="0x01010281" />
+  <public type="attr" name="queryAfterZeroResults" id="0x01010282" />
+  <public type="attr" name="dropDownHeight" id="0x01010283" />
+  <public type="attr" name="smallScreens" id="0x01010284" />
+  <public type="attr" name="normalScreens" id="0x01010285" />
+  <public type="attr" name="largeScreens" id="0x01010286" />
+  <public type="attr" name="progressBarStyleInverse" id="0x01010287" />
+  <public type="attr" name="progressBarStyleSmallInverse" id="0x01010288" />
+  <public type="attr" name="progressBarStyleLargeInverse" id="0x01010289" />
+  <public type="attr" name="searchSettingsDescription" id="0x0101028a" />
+  <public type="attr" name="textColorPrimaryInverseDisableOnly" id="0x0101028b" />
+  <public type="attr" name="autoUrlDetect" id="0x0101028c" />
+  <public type="attr" name="resizeable" id="0x0101028d" />
 
-  <public-padding type="attr" name="donut_resource_pad" end="0x0101029f" />
-
-  <public-padding type="id" name="donut_resource_pad" end="0x01020040" />
-  
   <public type="style" name="Widget.ProgressBar.Inverse" id="0x0103005b" />
   <public type="style" name="Widget.ProgressBar.Large.Inverse" id="0x0103005c" />
   <public type="style" name="Widget.ProgressBar.Small.Inverse" id="0x0103005d" /> 
-  <public-padding type="style" name="donut_resource_pad" end="0x01030070" />
-  
-  <public-padding type="string" name="donut_resource_pad" end="0x01040030" />
 
-  <public-padding type="dimen" name="donut_resource_pad" end="0x01050010" />
-
-  <public-padding type="color" name="donut_resource_pad" end="0x01060030" />
-
-  <public-padding type="array" name="donut_resource_pad" end="0x01070010" />
-
-  <public type="drawable" name="stat_sys_vp_phone_call" />
-  <public type="drawable" name="stat_sys_vp_phone_call_on_hold" />
+  <public type="drawable" name="stat_sys_vp_phone_call" id="0x010800a7" />
+  <public type="drawable" name="stat_sys_vp_phone_call_on_hold" id="0x010800a8" />
   
-  <public-padding type="drawable" name="donut_resource_pad" end="0x010800d0" />
-  
-  <public-padding type="layout" name="donut_resource_pad" end="0x01090020" />
-  
-  <public type="anim" name="anticipate_interpolator" />
-  <public type="anim" name="overshoot_interpolator" />
-  <public type="anim" name="anticipate_overshoot_interpolator" />
-  <public type="anim" name="bounce_interpolator" />
-  <public type="anim" name="linear_interpolator" />
-
-  <public-padding type="anim" name="donut_resource_pad" end="0x010a0020" />
-  
-  <public-padding type="integer" name="donut_resource_pad" end="0x010e0010" />
-  
+  <public type="anim" name="anticipate_interpolator" id="0x010a0007" />
+  <public type="anim" name="overshoot_interpolator" id="0x010a0008" />
+  <public type="anim" name="anticipate_overshoot_interpolator" id="0x010a0009" />
+  <public type="anim" name="bounce_interpolator" id="0x010a000a" />
+  <public type="anim" name="linear_interpolator" id="0x010a000b" />
 </resources>
diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs
index 2127187..11f8c7b 100644
--- a/docs/html/guide/guide_toc.cs
+++ b/docs/html/guide/guide_toc.cs
@@ -145,7 +145,9 @@
           <li><a href="<?cs var:toroot ?>guide/topics/manifest/provider-element.html">&lt;provider&gt;</a></li>
           <li><a href="<?cs var:toroot ?>guide/topics/manifest/receiver-element.html">&lt;receiver&gt;</a></li>
           <li><a href="<?cs var:toroot ?>guide/topics/manifest/service-element.html">&lt;service&gt;</a></li>
+          <li><a href="<?cs var:toroot ?>guide/topics/manifest/supports-screens-element.html">&lt;supports-screens&gt;</a></li>  <!-- ##api level 4## -->
           <li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-configuration-element.html">&lt;uses-configuration&gt;</a></li>
+          <li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-feature-element.html">&lt;uses-feature&gt;</a></li> <!-- ##api level 4## -->
           <li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-library-element.html">&lt;uses-library&gt;</a></li>
           <li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-permission-element.html">&lt;uses-permission&gt;</a></li>
           <li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-sdk-element.html">&lt;uses-sdk&gt;</a></li>
@@ -407,6 +409,9 @@
                <span class="zh-TW">附錄</span>
     </h2>
     <ul>
+      <li><a href="<?cs var:toroot ?>guide/appendix/api-levels.html">
+            <span class="en">Android API Levels</span>
+          </a></li>
       <li><a href="<?cs var:toroot ?>guide/appendix/media-formats.html">
             <span class="en">Supported Media Formats</span>
           </a></li>
diff --git a/docs/html/guide/topics/manifest/manifest-intro.jd b/docs/html/guide/topics/manifest/manifest-intro.jd
index 1907024..9e1b18d 100644
--- a/docs/html/guide/topics/manifest/manifest-intro.jd
+++ b/docs/html/guide/topics/manifest/manifest-intro.jd
@@ -78,10 +78,11 @@
     <a href="{@docRoot}guide/topics/manifest/permission-element.html">&lt;permission /&gt;</a>
     <a href="{@docRoot}guide/topics/manifest/permission-tree-element.html">&lt;permission-tree /&gt;</a>
     <a href="{@docRoot}guide/topics/manifest/permission-group-element.html">&lt;permission-group /&gt;</a>
-
     <a href="{@docRoot}guide/topics/manifest/instrumentation-element.html">&lt;instrumentation /&gt;</a>
-
     <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">&lt;uses-sdk /&gt;</a>
+    <a href="{@docRoot}guide/topics/manifest/uses-configuration-element.html">&lt;uses-configuration /&gt;</a>  <!-- ##api level 3## -->
+    <a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">&lt;uses-feature /&gt;</a>  <!-- ##api level 4## -->
+    <a href="{@docRoot}guide/topics/manifest/supports-screens-element.html">&lt;supports-screens /&gt;</a>  <!-- ##api level 4## -->
 
     <a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a>
 
@@ -115,7 +116,6 @@
         <a href="{@docRoot}guide/topics/manifest/provider-element.html">&lt;/provider&gt;</a>
 
         <a href="{@docRoot}guide/topics/manifest/uses-library-element.html">&lt;uses-library /&gt;</a>
-        <a href="{@docRoot}guide/topics/manifest/uses-configuration-element.html">&lt;uses-configuration /&gt;</a>  <!-- ##api level 3## -->
 
     <a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;/application&gt;</a>
 
@@ -146,13 +146,16 @@
 <br/><code><a href="{@docRoot}guide/topics/manifest/provider-element.html">&lt;provider&gt;</a></code>
 <br/><code><a href="{@docRoot}guide/topics/manifest/receiver-element.html">&lt;receiver&gt;</a></code>
 <br/><code><a href="{@docRoot}guide/topics/manifest/service-element.html">&lt;service&gt;</a></code>
+<br/><code><a href="{@docRoot}guide/topics/manifest/supports-screens-element.html">&lt;supports-screens&gt;</a></code>  <!-- ##api level 4## -->
 <br/><code><a href="{@docRoot}guide/topics/manifest/uses-configuration-element.html">&lt;uses-configuration&gt;</a></code>  <!-- ##api level 3## -->
+<br/><code><a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">&lt;uses-feature&gt;</a></code>  <!-- ##api level 4## -->
 <br/><code><a href="{@docRoot}guide/topics/manifest/uses-library-element.html">&lt;uses-library&gt;</a></code>
 <br/><code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">&lt;uses-permission&gt;</a></code>
 <br/><code><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">&lt;uses-sdk&gt;</a></code>
 </p>
 
 
+    
 
 <h2 id="filec">File Conventions</h2>
 
diff --git a/docs/html/guide/topics/manifest/supports-screens-element.jd b/docs/html/guide/topics/manifest/supports-screens-element.jd
new file mode 100644
index 0000000..00797ed
--- /dev/null
+++ b/docs/html/guide/topics/manifest/supports-screens-element.jd
@@ -0,0 +1,123 @@
+page.title=&lt;supports-screens&gt;
+@jd:body
+
+<dl class="xml">
+
+<dt>syntax:</dt>
+<dd>
+<pre class="stx">
+&lt;supports-screens android:<a href="#small">smallScreens</a>=["true" | "false"] 
+                  android:<a href="#normal">normalScreens</a>=["true" | "false"] 
+                  android:<a href="#large">largeScreens</a>=["true" | "false"] 
+                  android:<a href="#any">anyDensity</a>=["true" | "false"] /&gt;
+</pre>
+</dd>
+
+<dt>contained in:</dt>
+<dd><code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code></dd>
+
+<dt>description:</dt>
+<dd>Lets you specify the screen dimensions the
+application supports.  By default a modern application (using API Level 4 or higher) supports all
+screen sizes and must explicitly disable certain screen sizes here;
+older applications are assumed to support only the "normal"
+screen size.  Note that screen size is a separate axis from
+density. Screen size is determined as the available pixels to an application
+after density scaling has been applied. 
+
+<p>Based on the target device screen density, the Android 
+framework will scale down assets by a factor of 0.75 (low dpi screens) 
+or scale them up by a factor of 1.5 (high dpi screens).
+The screen density is expressed as dots-per-inch (dpi).</p>
+
+<p>Currently supported densities:</p>
+<ul>
+  <li>Low density: 120 dpi</li>
+  <li>Medium density: 160 dpi</li>
+  <li>High density: 240 dpi</li>
+</ul>
+
+<p>Table of display types:</p>
+
+<table>
+<tr>
+  <th></th><th>Low Density</th><th>Medium Density</th><th>High Density</th>
+</tr>
+<tr>
+  <th>Small Screen</th>
+  <td>QVGA</td>
+  <td>n/a</td>
+  <td>VGA</td>
+</tr>
+<tr>
+  <th>Normal Screen</th>
+  <td>WQVGA</td>
+  <td>HVGA</td>
+  <td>WVGA, FWVGA</td>
+</tr>
+<tr>
+  <th>Large Screen</th>
+  <td>n/a</td>
+  <td>VGA, WVGA, FWVGA</td>
+  <td>n/a</td>
+</tr>
+</table>
+
+</dd> 
+
+
+<dt>attributes:</dt>
+
+<dd>
+<dl class="attr"><dt><a name="small"></a>{@code android:smallScreens}</dt>
+  <dd>Indicates whether the application supports smaller screen form-factors.
+     A small screen is defined as one with a smaller aspect ratio than
+     the "normal" (traditional HVGA) screen.  An application that does
+     not support small screens <em>will not be available</em> for
+     small screen devices, because there is little the platform can do
+     to make such an application work on a smaller screen. Applications using
+     API Level 4 or higher default this to "true", others are "false".
+  </dd>
+  
+  <dt><a name="normal"></a>{@code android:normalScreens}</dt>
+  <dd>Indicates whether an application supports the "normal" screen
+     form-factors.  Traditionally this is an HVGA medium density
+     screen, but WQVGA low density and WVGA high density are also
+     considered to be normal.  This attribute is "true" by default,
+     and applications currently should leave it that way.
+  </dd>
+  
+  <dt><a name="large"></a>{@code android:largeScreens}</dt>
+  <dd>Indicates whether the application supports larger screen form-factors.
+     A large screen is defined as a screen that is significantly larger
+     than a "normal" phone screen, and thus may require some special care
+     on the application's part to make good use of it. An application that 
+     does not support large screens will be placed as a "postage stamp" on 
+     such a screen, so that it retains the dimensions it was originally
+     designed for. Applications using API Level 4 or higher default 
+     to "true", others are "false".
+  </dd>
+  
+  <dt><a name="any"></a>{@code android:anyDensity}</dt>
+  <dd>Indicates whether the application can accommodate any screen
+     density.  Older applications (pre API Level 4) are assumed unable to
+     accomodate all densities and this is "false" by default. Applications using 
+     API Level 4 or higher are assumed able to and this is "true" by default. 
+     You can explicitly supply your abilities here.
+  </dd>
+  
+
+</dl></dd>
+
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 4</dd>
+
+<dt>see also:</dt>
+<dd>
+  <ul>
+    <li>{@link android.util.DisplayMetrics}</li>
+  </ul>
+</dd>
+
+</dl>
diff --git a/docs/html/guide/topics/manifest/uses-configuration-element.jd b/docs/html/guide/topics/manifest/uses-configuration-element.jd
index b26881e..4578c63 100755
--- a/docs/html/guide/topics/manifest/uses-configuration-element.jd
+++ b/docs/html/guide/topics/manifest/uses-configuration-element.jd
@@ -168,9 +168,14 @@
 <dd>API Level 3</dd>
 
 <dt>see also:</dt>
-<dd><code><a href="{@docRoot}guide/topics/manifest/activity-element.html#config">configChanges</a></code>
+<dd>
+  <ul>
+    <li><code><a href="{@docRoot}guide/topics/manifest/activity-element.html#config">configChanges</a></code>
 attribute of the
 <code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code> 
-element</dd>
+element</dd></li>
+    <li>{@link android.content.pm.ConfigurationInfo}</li>
+  </ul>
+</dd>
 
 </dl>
diff --git a/docs/html/guide/topics/manifest/uses-feature-element.jd b/docs/html/guide/topics/manifest/uses-feature-element.jd
new file mode 100644
index 0000000..2626735
--- /dev/null
+++ b/docs/html/guide/topics/manifest/uses-feature-element.jd
@@ -0,0 +1,52 @@
+page.title=&lt;uses-feature&gt;
+@jd:body
+
+<dl class="xml">
+
+<dt>syntax:</dt>
+<dd>
+<pre class="stx">
+&lt;uses-feature android:<a href="#glEsVersion">glEsVersion</a>=["true" | "false"] /&gt;
+</pre>
+</dd>
+
+<dt>contained in:</dt>
+<dd><code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code></dd>
+
+<dt>description:</dt>
+<dd>This element specifies specific features used by the application.
+Android provides some features that may not be equally supported by all
+Android devices. In a manner similar to the <code><a href="uses-sdk-element.html">&lt;uses-sdk></a></code> 
+element, this element allows an application to specify which potentially variable
+features it requires. In this way, the application
+will not be installed on devices that do not offer the required feature.</p>
+
+<p>For example, an application might specify that it requires a certain version of Open GL.
+If a device does not support that version of Open GL, then it will not allow installation of the application.</p>
+</dd> 
+
+
+<dt>attributes:</dt>
+
+<dd>
+<dl class="attr"><dt><a name="glEsVersion"></a>{@code android:glEsVersion}</dt>
+  <dd>The GLES version needed by the application.
+     The higher 16 bits represent the major number and the lower 16 bits
+     represent the minor number. For example, for GL 1.2 referring to
+     0x00000102, the actual value should be set as 0x00010002.
+  </dd>
+</dl>
+</dd>
+
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 4</dd>
+
+<dt>see also:</dt>
+<dd>
+  <ul>
+    <li>{@link android.content.pm.ConfigurationInfo}</li>
+  </ul>
+</dd>
+
+</dl>
diff --git a/docs/html/guide/topics/manifest/uses-sdk-element.jd b/docs/html/guide/topics/manifest/uses-sdk-element.jd
index b6e7374..adcdc28 100644
--- a/docs/html/guide/topics/manifest/uses-sdk-element.jd
+++ b/docs/html/guide/topics/manifest/uses-sdk-element.jd
@@ -11,50 +11,68 @@
 <dt>description:</dt>
 <dd>Lets you express an application's compatibility with one or more versions of the Android platform,
 by means of an API Level integer. The API Level expressed by an application will be compared to the
-API Level of a given Android system, which may vary among different Android devices. To declare your
-application's minimum API Level compatibility, use the <a href="#min">minSdkVersion</a> attribute.
+API Level of a given Android system, which may vary among different Android devices.
 </p>
 
 <p>
-The default level is 1. 
-</p>
-
-<p>
-For more information on the API level, see the 
-<a href="{@docRoot}guide/publishing/versioning.html#minsdkversion">Specifying 
-Minimum System API Version</a> section of 
-<a href="{@docRoot}guide/publishing/versioning.html">Versioning Your 
-Applications</a>.
-</p></dd> 
-
-
-<dt>attributes:</dt>
-<dd><dl class="attr">
-<dt><a name="min"></a>{@code android:minSdkVersion}</dt>
-<dd>An integer designating the minimum level of the Android API that's required 
-for the application to run.
-
-<p>
-Despite its name, this attribute specifies the API Level, <em>not</em> the 
+Despite its name, this element is used to specify the API Level, <em>not</em> the 
 version number of the SDK (software development kit).  The API Level is always 
 a single integer; the SDK version may be split into major and minor components 
 (such as 1.5).  You cannot derive the API Level from the SDK version number 
 (for example, it is not the same as the major version or the sum of the major 
-and minor versions).  To learn what the API Level is, check the notes that 
-came with the SDK you're using.</p>
+and minor versions).</p>
 
-<p>Prior to installing an application, the Android system checks the value of this
-attribute and allows the installation only if the
-API Level is less than or equal to the API Level used by the system itself.</p>
+<p>For more information, read about 
+<a href="{@docRoot}guide/appendix/api-levels.html">Android API Levels</a> and
+<a href="{@docRoot}guide/publishing/versioning.html">Versioning Your Applications</a>.
+</p></dd> 
 
-<p>If you do not declare this attribute, then a value of "1" is assumed, which
-indicates that your application is compatible with all versions of Android. If your
-application is <em>not</em> universally compatible (for instance if it uses APIs
-introduced in Android 1.5) and you have not declared the proper <code>minSdkVersion</code>, 
-then when installed on a system with a lower API Level, the application 
-will crash during runtime. For this reason, be certain to declare the appropriate API Level
-in the <code>minSdkVersion</code> attribute.</p>
-</dd>
+
+<dt>attributes:</dt>
+
+<dd>
+<dl class="attr">
+  <dt><a name="min"></a>{@code android:minSdkVersion}</dt>
+  <dd>An integer designating the minimum level of the Android API that's required 
+  for the application to run.
+  
+  <p>Prior to installing an application, the Android system checks the value of this
+  attribute and allows the installation only if it
+  is less than or equal to the API Level used by the system itself.</p>
+  
+  <p>If you do not declare this attribute, then a value of "1" is assumed, which
+  indicates that your application is compatible with all versions of Android. If your
+  application is <em>not</em> universally compatible (for instance if it uses APIs
+  introduced in Android 1.5) and you have not declared the proper <code>minSdkVersion</code>, 
+  then when installed on a system with a lower API Level, the application 
+  will crash during runtime. For this reason, be certain to declare the appropriate API Level
+  in the <code>minSdkVersion</code> attribute.</p>
+  </dd>
+  
+  <dt><a name="max"></a>{@code android:maxSdkVersion}</dt>
+  <dd>An integer designating the maximum level of the Android API that the application is 
+  compatible with. You can use this to ensure your application is filtered out
+  of later versions of the platform when you know you have incompatibility with them.</p>
+  
+  <p>Prior to installing an application, the Android system checks the value of this
+  attribute and allows the installation only it
+  is greater than or equal to the API Level used by the system itself.</p>
+  
+  <p>Introduced in: API Level 4</p>
+  </dd>
+  
+  <dt><a name="target"></a>{@code android:targetSdkVersion}</dt>
+  <dd>An integer designating the API Level that the application is targetting.
+  
+  <p>With this attribute set, the application says that is is be able to run on 
+  older versions (down to {@code minSdkVersion}), but was explicitly tested to work 
+  with the version specified here.
+  Specifying this version allows the platform to disable compatibility
+  code that is not required or enable newer features that are not
+  available to older applications.</p>
+  
+  <p>Introduced in: API Level 4</p>
+  </dd>
 
 </dl></dd>
 
diff --git a/include/utils/Asset.h b/include/utils/Asset.h
index 453a204..5908bcc 100644
--- a/include/utils/Asset.h
+++ b/include/utils/Asset.h
@@ -45,6 +45,7 @@
     virtual ~Asset(void);
 
     static int32_t getGlobalCount();
+    static String8 getAssetAllocations();
     
     /* used when opening an asset */
     typedef enum AccessMode {
@@ -110,6 +111,12 @@
     virtual int openFileDescriptor(off_t* outStart, off_t* outLength) const = 0;
     
     /*
+     * Return whether this asset's buffer is allocated in RAM (not mmapped).
+     * Note: not virtual so it is safe to call even when being destroyed.
+     */
+    virtual bool isAllocated(void) const { return false; }
+    
+    /*
      * Get a string identifying the asset's source.  This might be a full
      * path, it might be a colon-separated list of identifiers.
      *
@@ -197,6 +204,9 @@
 
     AccessMode  mAccessMode;        // how the asset was opened
     String8    mAssetSource;       // debug string
+    
+    Asset*		mNext;				// linked list.
+    Asset*		mPrev;
 };
 
 
@@ -239,6 +249,7 @@
     virtual off_t getLength(void) const { return mLength; }
     virtual off_t getRemainingLength(void) const { return mLength-mOffset; }
     virtual int openFileDescriptor(off_t* outStart, off_t* outLength) const;
+    virtual bool isAllocated(void) const { return mBuf != NULL; }
 
 private:
     off_t       mStart;         // absolute file offset of start of chunk
@@ -295,6 +306,7 @@
     virtual off_t getLength(void) const { return mUncompressedLen; }
     virtual off_t getRemainingLength(void) const { return mUncompressedLen-mOffset; }
     virtual int openFileDescriptor(off_t* outStart, off_t* outLength) const { return -1; }
+    virtual bool isAllocated(void) const { return mBuf != NULL; }
 
 private:
     off_t       mStart;         // offset to start of compressed data
diff --git a/keystore/MODULE_LICENSE_APACHE2 b/keystore/MODULE_LICENSE_APACHE2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/keystore/MODULE_LICENSE_APACHE2
diff --git a/keystore/NOTICE b/keystore/NOTICE
new file mode 100644
index 0000000..64aaa8d
--- /dev/null
+++ b/keystore/NOTICE
@@ -0,0 +1,190 @@
+
+   Copyright (c) 2009, The Android Open Source Project
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
diff --git a/libs/utils/Asset.cpp b/libs/utils/Asset.cpp
index 23cb72d..4295123 100644
--- a/libs/utils/Asset.cpp
+++ b/libs/utils/Asset.cpp
@@ -27,6 +27,7 @@
 #include <utils/ZipUtils.h>
 #include <utils/ZipFileRO.h>
 #include <utils/Log.h>
+#include <utils/threads.h>
 
 #include <string.h>
 #include <memory.h>
@@ -40,24 +41,71 @@
 # define O_BINARY 0
 #endif
 
-static volatile int32_t gCount = 0;
+static Mutex gAssetLock;
+static int32_t gCount = 0;
+static Asset* gHead = NULL;
+static Asset* gTail = NULL;
 
 int32_t Asset::getGlobalCount()
 {
+    AutoMutex _l(gAssetLock);
     return gCount;
 }
 
+String8 Asset::getAssetAllocations()
+{
+    AutoMutex _l(gAssetLock);
+    String8 res;
+    Asset* cur = gHead;
+    while (cur != NULL) {
+        if (cur->isAllocated()) {
+            res.append("    ");
+            res.append(cur->getAssetSource());
+            off_t size = (cur->getLength()+512)/1024;
+            char buf[64];
+            sprintf(buf, ": %dK\n", (int)size);
+            res.append(buf);
+        }
+        cur = cur->mNext;
+    }
+    
+    return res;
+}
+
 Asset::Asset(void)
     : mAccessMode(ACCESS_UNKNOWN)
 {
-    int count = android_atomic_inc(&gCount)+1;
-    //LOGI("Creating Asset %p #%d\n", this, count);
+    AutoMutex _l(gAssetLock);
+    gCount++;
+    mNext = mPrev = NULL;
+    if (gTail == NULL) {
+        gHead = gTail = this;
+  	} else {
+  	    mPrev = gTail;
+  	    gTail->mNext = this;
+  	    gTail = this;
+  	}
+    //LOGI("Creating Asset %p #%d\n", this, gCount);
 }
 
 Asset::~Asset(void)
 {
-    int count = android_atomic_dec(&gCount);
-    //LOGI("Destroying Asset in %p #%d\n", this, count);
+    AutoMutex _l(gAssetLock);
+	gCount--;
+    if (gHead == this) {
+        gHead = mNext;
+    }
+    if (gTail == this) {
+        gTail = mPrev;
+    }
+    if (mNext != NULL) {
+        mNext->mPrev = mPrev;
+    }
+    if (mPrev != NULL) {
+        mPrev->mNext = mNext;
+    }
+    mNext = mPrev = NULL;
+    //LOGI("Destroying Asset in %p #%d\n", this, gCount);
 }
 
 /*
diff --git a/media/libdrm/mobile1/Android.mk b/media/libdrm/mobile1/Android.mk
index 2065cd2..f105799 100644
--- a/media/libdrm/mobile1/Android.mk
+++ b/media/libdrm/mobile1/Android.mk
@@ -36,15 +36,15 @@
     $(LOCAL_PATH)/include/objmng    \
     $(LOCAL_PATH)/include/parser    \
     $(LOCAL_PATH)/include/xml       \
-    external/aes                     \
+    external/openssl/include        \
     $(call include-path-for, system-core)/cutils
 
 LOCAL_CFLAGS := $(LOCAL_DRM_CFLAG)
 
 LOCAL_SHARED_LIBRARIES :=   \
-	libaes                  \
-	libutils                \
-	libcutils
+    libutils                \
+    libcutils               \
+    libcrypto
 
 LOCAL_MODULE := libdrm1
 
@@ -66,15 +66,14 @@
 # Header files path
 LOCAL_C_INCLUDES :=         \
     $(LOCAL_PATH)/include   \
-	$(LOCAL_PATH)/include/parser \
+    $(LOCAL_PATH)/include/parser \
     $(JNI_H_INCLUDE)    \
-	$(call include-path-for, system-core)/cutils \
-	external/aes
+    $(call include-path-for, system-core)/cutils
 	
 
 LOCAL_SHARED_LIBRARIES := libdrm1 \
-	libutils                      \
-	libcutils
+    libutils                      \
+    libcutils
 
 LOCAL_MODULE := libdrm1_jni
 
diff --git a/media/libdrm/mobile1/include/objmng/drm_rights_manager.h b/media/libdrm/mobile1/include/objmng/drm_rights_manager.h
index dd2116c..d81e7a1 100644
--- a/media/libdrm/mobile1/include/objmng/drm_rights_manager.h
+++ b/media/libdrm/mobile1/include/objmng/drm_rights_manager.h
@@ -21,9 +21,9 @@
 extern "C" {
 #endif
 
+#include <openssl/aes.h>
 #include <drm_common_types.h>
 #include <parser_rel.h>
-#include <aes.h>
 
 #ifdef DRM_DEVICE_ARCH_ARM
 #define ANDROID_DRM_CORE_PATH   "/data/drm/rights/"
@@ -141,12 +141,12 @@
  *
  * \param Buffer    The buffer to decrypted and also used to save the output data.
  * \param BufferLen The length of the buffer data and also save the output data length.
- * \param ctx       The structure of the CEK.
+ * \param key       The structure of the CEK.
  *
  * \return
  *      -0
  */
-int32_t drm_aesDecBuffer(uint8_t * Buffer, int32_t * BufferLen, aes_decrypt_ctx ctx[1]);
+int32_t drm_aesDecBuffer(uint8_t * Buffer, int32_t * BufferLen, AES_KEY *key);
 
 /**
  * Update the DCF data length according the CEK.
diff --git a/media/libdrm/mobile1/src/objmng/drm_api.c b/media/libdrm/mobile1/src/objmng/drm_api.c
index 0e453de..249cdbe 100644
--- a/media/libdrm/mobile1/src/objmng/drm_api.c
+++ b/media/libdrm/mobile1/src/objmng/drm_api.c
@@ -22,7 +22,6 @@
 #include <drm_rights_manager.h>
 #include <drm_time.h>
 #include <drm_decoder.h>
-#include <aes.h>
 #include "log.h"
 
 /**
@@ -1578,7 +1577,7 @@
     int32_t readBytes = 0;
     int32_t bufLen, piece, i, copyBytes, leftBytes;
     int32_t aesStart, mediaStart, mediaBufOff;
-    aes_decrypt_ctx ctx[1];
+    AES_KEY key;
 
     if (FALSE == drm_getKey(s->contentID, keyValue))
         return DRM_NO_RIGHTS;
@@ -1600,7 +1599,7 @@
         piece = (offset + readBytes - 1) / DRM_ONE_AES_BLOCK_LEN - offset / DRM_ONE_AES_BLOCK_LEN + 2;
         mediaStart = offset % DRM_ONE_AES_BLOCK_LEN;
 
-        aes_decrypt_key128(keyValue, ctx);
+        AES_set_decrypt_key(keyValue, DRM_KEY_LEN * 8, &key);
         mediaBufOff = 0;
         leftBytes = readBytes;
 
@@ -1608,7 +1607,7 @@
             memcpy(buf, s->rawContent + aesStart + i * DRM_ONE_AES_BLOCK_LEN, DRM_TWO_AES_BLOCK_LEN);
             bufLen = DRM_TWO_AES_BLOCK_LEN;
 
-            if (drm_aesDecBuffer(buf, &bufLen, ctx) < 0)
+            if (drm_aesDecBuffer(buf, &bufLen, &key) < 0)
                 return DRM_MEDIA_DATA_INVALID;
 
             if (0 != i)
@@ -1651,7 +1650,7 @@
         piece = (offset + leftBytes - 1) / DRM_ONE_AES_BLOCK_LEN - offset / DRM_ONE_AES_BLOCK_LEN + 2;
         mediaBufOff = readBytes;
 
-        aes_decrypt_key128(keyValue, ctx);
+        AES_set_decrypt_key(keyValue, DRM_KEY_LEN * 8, &key);
 
         for (i = 0; i < piece - 1; i++) {
             if (-1 == (res = drm_readAesData(buf, s, aesStart, DRM_TWO_AES_BLOCK_LEN)))
@@ -1663,7 +1662,7 @@
             bufLen = DRM_TWO_AES_BLOCK_LEN;
             aesStart += DRM_ONE_AES_BLOCK_LEN;
 
-            if (drm_aesDecBuffer(buf, &bufLen, ctx) < 0)
+            if (drm_aesDecBuffer(buf, &bufLen, &key) < 0)
                 return DRM_MEDIA_DATA_INVALID;
 
             drm_discardPaddingByte(buf, &bufLen);
diff --git a/media/libdrm/mobile1/src/objmng/drm_rights_manager.c b/media/libdrm/mobile1/src/objmng/drm_rights_manager.c
index 80901f5..df22327 100644
--- a/media/libdrm/mobile1/src/objmng/drm_rights_manager.c
+++ b/media/libdrm/mobile1/src/objmng/drm_rights_manager.c
@@ -573,7 +573,7 @@
     return;
 }
 
-int32_t drm_aesDecBuffer(uint8_t * Buffer, int32_t * BufferLen, aes_decrypt_ctx ctx[1])
+int32_t drm_aesDecBuffer(uint8_t * Buffer, int32_t * BufferLen, AES_KEY *key)
 {
     uint8_t dbuf[3 * DRM_ONE_AES_BLOCK_LEN], buf[DRM_ONE_AES_BLOCK_LEN];
     uint64_t i, len, wlen = DRM_ONE_AES_BLOCK_LEN, curLen, restLen;
@@ -596,7 +596,7 @@
     if (len < 2 * DRM_ONE_AES_BLOCK_LEN) { /* The original file is less than one block in length */
         len -= DRM_ONE_AES_BLOCK_LEN;
         /* Decrypt from position len to position len + DRM_ONE_AES_BLOCK_LEN */
-        aes_decrypt((dbuf + len), (dbuf + len), ctx);
+        AES_decrypt((dbuf + len), (dbuf + len), key);
 
         /* Undo the CBC chaining */
         for (i = 0; i < len; ++i)
@@ -620,7 +620,7 @@
             Buffer += len;
 
             /* Decrypt the b2 block */
-            aes_decrypt((uint8_t *)b2, buf, ctx);
+            AES_decrypt((uint8_t *)b2, buf, key);
 
             if (len == 0 || len == DRM_ONE_AES_BLOCK_LEN) { /* No ciphertext stealing */
                 /* Unchain CBC using the previous ciphertext block in b1 */
@@ -639,7 +639,7 @@
                     b3[i] = buf[i];
 
                 /* Decrypt the C[N-1] block in b3 */
-                aes_decrypt((uint8_t *)b3, (uint8_t *)b3, ctx);
+                AES_decrypt((uint8_t *)b3, (uint8_t *)b3, key);
 
                 /* Produce the last but one plaintext block by xoring with */
                 /* The last but two ciphertext block */
@@ -669,15 +669,15 @@
 
 int32_t drm_updateDcfDataLen(uint8_t* pDcfLastData, uint8_t* keyValue, int32_t* moreBytes)
 {
-    aes_decrypt_ctx ctx[1];
+    AES_KEY key;
     int32_t len = DRM_TWO_AES_BLOCK_LEN;
 
     if (NULL == pDcfLastData || NULL == keyValue)
         return FALSE;
 
-    aes_decrypt_key128(keyValue, ctx);
+    AES_set_decrypt_key(keyValue, DRM_KEY_LEN * 8, &key);
 
-    if (drm_aesDecBuffer(pDcfLastData, &len, ctx) < 0)
+    if (drm_aesDecBuffer(pDcfLastData, &len, &key) < 0)
         return FALSE;
 
     drm_discardPaddingByte(pDcfLastData, &len);
diff --git a/packages/TtsService/jni/android_tts_SynthProxy.cpp b/packages/TtsService/jni/android_tts_SynthProxy.cpp
index 99d7723..1bab717 100644
--- a/packages/TtsService/jni/android_tts_SynthProxy.cpp
+++ b/packages/TtsService/jni/android_tts_SynthProxy.cpp
@@ -26,16 +26,25 @@
 #include <android_runtime/AndroidRuntime.h>
 #include <tts/TtsEngine.h>
 #include <media/AudioTrack.h>
+#include <math.h>
 
 #include <dlfcn.h>
 
 #define DEFAULT_TTS_RATE        16000
 #define DEFAULT_TTS_FORMAT      AudioSystem::PCM_16_BIT
 #define DEFAULT_TTS_NB_CHANNELS 1
-#define DEFAULT_TTS_BUFFERSIZE  1024
+#define DEFAULT_TTS_BUFFERSIZE  2048
 // TODO use the TTS stream type when available
 #define DEFAULT_TTS_STREAM_TYPE AudioSystem::MUSIC
 
+// EQ + BOOST parameters
+#define FILTER_LOWSHELF_ATTENUATION -18.0f // in dB
+#define FILTER_TRANSITION_FREQ 1100.0f     // in Hz
+#define FILTER_SHELF_SLOPE 1.0f            // Q
+#define FILTER_GAIN 6.0f // linear gain
+// such a huge gain is justified by how much energy in the low frequencies is "wasted" at the output
+// of the synthesis. The low shelving filter removes it, leaving room for amplification.
+
 #define USAGEMODE_PLAY_IMMEDIATELY 0
 #define USAGEMODE_WRITE_TO_FILE    1
 
@@ -57,6 +66,79 @@
 };
 
 // ----------------------------------------------------------------------------
+// EQ data
+double amp;
+double w;
+double sinw;
+double cosw;
+double beta;
+double a0, a1, a2, b0, b1, b2;
+double m_fa, m_fb, m_fc, m_fd, m_fe;
+double x0;  // x[n]
+double x1;  // x[n-1]
+double x2;  // x[n-2]
+double out0;// y[n]
+double out1;// y[n-1]
+double out2;// y[n-2]
+
+void initializeEQ() {
+
+    amp = float(pow(10.0, FILTER_LOWSHELF_ATTENUATION / 40.0));
+    w = 2.0 * M_PI * (FILTER_TRANSITION_FREQ / DEFAULT_TTS_RATE);
+    sinw = float(sin(w));
+    cosw = float(cos(w));
+    beta = float(sqrt(amp)/FILTER_SHELF_SLOPE);
+
+    // initialize low-shelf parameters
+    b0 = amp * ((amp+1.0F) - ((amp-1.0F)*cosw) + (beta*sinw));
+    b1 = 2.0F * amp * ((amp-1.0F) - ((amp+1.0F)*cosw));
+    b2 = amp * ((amp+1.0F) - ((amp-1.0F)*cosw) - (beta*sinw));
+    a0 = (amp+1.0F) + ((amp-1.0F)*cosw) + (beta*sinw);
+    a1 = 2.0F * ((amp-1.0F) + ((amp+1.0F)*cosw));
+    a2 = -((amp+1.0F) + ((amp-1.0F)*cosw) - (beta*sinw));
+
+    m_fa = FILTER_GAIN * b0/a0;
+    m_fb = FILTER_GAIN * b1/a0;
+    m_fc = FILTER_GAIN * b2/a0;
+    m_fd = a1/a0;
+    m_fe = a2/a0;
+}
+
+void initializeFilter() {
+    x0 = 0.0f;
+    x1 = 0.0f;
+    x2 = 0.0f;
+    out0 = 0.0f;
+    out1 = 0.0f;
+    out2 = 0.0f;
+}
+
+void applyFilter(int16_t* buffer, size_t sampleCount) {
+
+    for (size_t i=0 ; i<sampleCount ; i++) {
+
+        x0 = (double) buffer[i];
+
+        out0 = (m_fa*x0) + (m_fb*x1) + (m_fc*x2) + (m_fd*out1) + (m_fe*out2);
+
+        x2 = x1;
+        x1 = x0;
+
+        out2 = out1;
+        out1 = out0;
+
+        if (out0 > 32767.0f) {
+            buffer[i] = 32767;
+        } else if (out0 < -32768.0f) {
+            buffer[i] = -32768;
+        } else {
+            buffer[i] = (int16_t) out0;
+        }
+    }
+}
+
+
+// ----------------------------------------------------------------------------
 static fields_t javaTTSFields;
 
 // TODO move to synth member once we have multiple simultaneous engines running
@@ -198,12 +280,13 @@
 
         if (wav == NULL) {
             delete pForAfter;
-            LOGI("Null: speech has completed");
+            LOGV("Null: speech has completed");
         }
 
         if (bufferSize > 0) {
             prepAudioTrack(pJniData, pForAfter->streamType, rate, format, channel);
             if (pJniData->mAudioOut) {
+                applyFilter((int16_t*)wav, bufferSize/2);
                 pJniData->mAudioOut->write(wav, bufferSize);
                 memset(wav, 0, bufferSize);
                 //LOGV("AudioTrack wrote: %d bytes", bufferSize);
@@ -212,13 +295,14 @@
             }
         }
     } else  if (pForAfter->usageMode == USAGEMODE_WRITE_TO_FILE) {
-        LOGV("Save to file");
+        //LOGV("Save to file");
         if (wav == NULL) {
             delete pForAfter;
             LOGV("Null: speech has completed");
             return TTS_CALLBACK_HALT;
         }
         if (bufferSize > 0){
+            applyFilter((int16_t*)wav, bufferSize/2);
             fwrite(wav, 1, bufferSize, pForAfter->outputFile);
             memset(wav, 0, bufferSize);
         }
@@ -289,6 +373,8 @@
     env->SetIntField(thiz, javaTTSFields.synthProxyFieldJniData,
             (int)pJniStorage);
 
+    initializeEQ();
+
     env->ReleaseStringUTFChars(nativeSoLib, nativeSoLibNativeString);
 }
 
@@ -479,6 +565,8 @@
         return result;
     }
 
+    initializeFilter();
+
     Mutex::Autolock l(engineMutex);
 
     // Retrieve audio parameters before writing the file header
@@ -583,6 +671,8 @@
         return result;
     }
 
+    initializeFilter();
+
     Mutex::Autolock l(engineMutex);
 
     SynthProxyJniStorage* pSynthData = (SynthProxyJniStorage*)jniData;
diff --git a/packages/TtsService/src/android/tts/TtsService.java b/packages/TtsService/src/android/tts/TtsService.java
index 1b99d32..cd24727 100755
--- a/packages/TtsService/src/android/tts/TtsService.java
+++ b/packages/TtsService/src/android/tts/TtsService.java
@@ -172,10 +172,18 @@
     @Override
     public void onDestroy() {
         super.onDestroy();
+
+        // TODO replace the call to stopAll() with a method to clear absolutely all upcoming
+        // uses of the native synth, including synthesis to a file, and delete files for which
+        // synthesis was not complete.
+        stopAll("");
+
         // Don't hog the media player
         cleanUpPlayer();
 
-        sNativeSynth.shutdown();
+        if (sNativeSynth != null) {
+            sNativeSynth.shutdown();
+        }
         sNativeSynth = null;
 
         // Unregister all callbacks.
@@ -243,38 +251,70 @@
 
 
     private int setSpeechRate(String callingApp, int rate) {
-        if (isDefaultEnforced()) {
-            return sNativeSynth.setSpeechRate(getDefaultRate());
-        } else {
-            return sNativeSynth.setSpeechRate(rate);
+        int res = TextToSpeech.ERROR;
+        try {
+            if (isDefaultEnforced()) {
+                res = sNativeSynth.setSpeechRate(getDefaultRate());
+            } else {
+                res = sNativeSynth.setSpeechRate(rate);
+            }
+        } catch (NullPointerException e) {
+            // synth will become null during onDestroy()
+            res = TextToSpeech.ERROR;
         }
+        return res;
     }
 
 
     private int setPitch(String callingApp, int pitch) {
-        return sNativeSynth.setPitch(pitch);
+        int res = TextToSpeech.ERROR;
+        try {
+            res = sNativeSynth.setPitch(pitch);
+        } catch (NullPointerException e) {
+            // synth will become null during onDestroy()
+            res = TextToSpeech.ERROR;
+        }
+        return res;
     }
 
 
     private int isLanguageAvailable(String lang, String country, String variant) {
         //Log.v("TtsService", "TtsService.isLanguageAvailable(" + lang + ", " + country + ", " +variant+")");
-        return sNativeSynth.isLanguageAvailable(lang, country, variant);
+        int res = TextToSpeech.LANG_NOT_SUPPORTED;
+        try {
+            res = sNativeSynth.isLanguageAvailable(lang, country, variant);
+        } catch (NullPointerException e) {
+            // synth will become null during onDestroy()
+            res = TextToSpeech.LANG_NOT_SUPPORTED;
+        }
+        return res;
     }
 
 
     private String[] getLanguage() {
-        return sNativeSynth.getLanguage();
+        try {
+            return sNativeSynth.getLanguage();
+        } catch (Exception e) {
+            return null;
+        }
     }
 
 
     private int setLanguage(String callingApp, String lang, String country, String variant) {
         Log.v("TtsService", "TtsService.setLanguage(" + lang + ", " + country + ", " + variant + ")");
-        if (isDefaultEnforced()) {
-            return sNativeSynth.setLanguage(getDefaultLanguage(), getDefaultCountry(),
-                    getDefaultLocVariant());
-        } else {
-            return sNativeSynth.setLanguage(lang, country, variant);
+        int res = TextToSpeech.ERROR;
+        try {
+            if (isDefaultEnforced()) {
+                res = sNativeSynth.setLanguage(getDefaultLanguage(), getDefaultCountry(),
+                        getDefaultLocVariant());
+            } else {
+                res = sNativeSynth.setLanguage(lang, country, variant);
+            }
+        } catch (NullPointerException e) {
+            // synth will become null during onDestroy()
+            res = TextToSpeech.ERROR;
         }
+        return res;
     }
 
 
@@ -402,7 +442,12 @@
                 }
                 if ((mCurrentSpeechItem != null) &&
                      mCurrentSpeechItem.mCallingApp.equals(callingApp)) {
-                    result = sNativeSynth.stop();
+                    try {
+                        result = sNativeSynth.stop();
+                    } catch (NullPointerException e1) {
+                        // synth will become null during onDestroy()
+                        result = TextToSpeech.ERROR;
+                    }
                     mKillList.put(mCurrentSpeechItem, true);
                     if (mPlayer != null) {
                         try {
@@ -434,7 +479,8 @@
 
 
     /**
-     * Stops all speech output and removes any utterances still in the queue globally.
+     * Stops all speech output and removes any utterances still in the queue globally, except
+     * those intended to be synthesized to file.
      */
     private int stopAll(String callingApp) {
         int result = TextToSpeech.ERROR;
@@ -451,7 +497,12 @@
                 if ((mCurrentSpeechItem != null) &&
                     ((mCurrentSpeechItem.mType != SpeechItem.TEXT_TO_FILE) ||
                       mCurrentSpeechItem.mCallingApp.equals(callingApp))) {
-                    result = sNativeSynth.stop();
+                    try {
+                        result = sNativeSynth.stop();
+                    } catch (NullPointerException e1) {
+                        // synth will become null during onDestroy()
+                        result = TextToSpeech.ERROR;
+                    }
                     mKillList.put(mCurrentSpeechItem, true);
                     if (mPlayer != null) {
                         try {
@@ -591,7 +642,12 @@
                         if (speechRate.length() > 0){
                             setSpeechRate("", Integer.parseInt(speechRate));
                         }
-                        sNativeSynth.speak(speechItem.mText, streamType);
+                        try {
+                            sNativeSynth.speak(speechItem.mText, streamType);
+                        } catch (NullPointerException e) {
+                            // synth will become null during onDestroy()
+                            Log.v("TtsService", " null synth, can't speak");
+                        }
                     }
                 } catch (InterruptedException e) {
                     Log.e("TtsService", "TTS speakInternalOnly(): tryLock interrupted");
@@ -660,7 +716,12 @@
                         if (speechRate.length() > 0){
                             setSpeechRate("", Integer.parseInt(speechRate));
                         }
-                        sNativeSynth.synthesizeToFile(speechItem.mText, speechItem.mFilename);
+                        try {
+                            sNativeSynth.synthesizeToFile(speechItem.mText, speechItem.mFilename);
+                        } catch (NullPointerException e) {
+                            // synth will become null during onDestroy()
+                            Log.v("TtsService", " null synth, can't synthesize to file");
+                        }
                     }
                 } catch (InterruptedException e) {
                     Log.e("TtsService", "TTS synthToFileInternalOnly(): tryLock interrupted");
diff --git a/services/java/com/android/server/AppWidgetService.java b/services/java/com/android/server/AppWidgetService.java
index 78db6f9..5439f8b 100644
--- a/services/java/com/android/server/AppWidgetService.java
+++ b/services/java/com/android/server/AppWidgetService.java
@@ -1009,8 +1009,7 @@
         if (success) {
             // delete any hosts that didn't manage to get connected (should happen)
             // if it matters, they'll be reconnected.
-            final int N = mHosts.size();
-            for (int i=0; i<N; i++) {
+            for (int i=mHosts.size()-1; i>=0; i--) {
                 pruneHostLocked(mHosts.get(i));
             }
         } else {
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index ae790c9..14c10b9 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -924,6 +924,7 @@
     static final int RESUME_TOP_ACTIVITY_MSG = 19;
     static final int PROC_START_TIMEOUT_MSG = 20;
     static final int DO_PENDING_ACTIVITY_LAUNCHES_MSG = 21;
+    static final int KILL_APPLICATION_MSG = 22;
 
     AlertDialog mUidAlert;
 
@@ -1153,6 +1154,14 @@
                     doPendingActivityLaunchesLocked(true);
                 }
             }
+            case KILL_APPLICATION_MSG: {
+                synchronized (ActivityManagerService.this) {
+                    int uid = msg.arg1;
+                    boolean restart = (msg.arg2 == 1);
+                    String pkg = (String) msg.obj;
+                    uninstallPackageLocked(pkg, uid, restart);
+                }
+            } break;
             }
         }
     };
@@ -4449,7 +4458,7 @@
     }
 
     final void appNotRespondingLocked(ProcessRecord app, HistoryRecord activity, 
-            final String annotation) {
+            HistoryRecord reportedActivity, final String annotation) {
         if (app.notResponding || app.crashing) {
             return;
         }
@@ -4477,8 +4486,13 @@
 
         StringBuilder info = mStringBuilder;
         info.setLength(0);
-        info.append("ANR (application not responding) in process: ");
+        info.append("ANR in process: ");
         info.append(app.processName);
+        if (reportedActivity != null && reportedActivity.app != null) {
+            info.append(" (last in ");
+            info.append(reportedActivity.app.processName);
+            info.append(")");
+        }
         if (annotation != null) {
             info.append("\nAnnotation: ");
             info.append(annotation);
@@ -4498,10 +4512,44 @@
         } else {
             // Dumping traces to a file so dump all active processes we know about
             synchronized (this) {
-                for (int i = mLRUProcesses.size() - 1 ; i >= 0 ; i--) {
+                // First, these are the most important processes.
+                final int[] imppids = new int[3];
+                int i=0;
+                imppids[0] = app.pid;
+                i++;
+                if (reportedActivity != null && reportedActivity.app != null
+                        && reportedActivity.app.thread != null
+                        && reportedActivity.app.pid != app.pid) {
+                    imppids[i] = reportedActivity.app.pid;
+                    i++;
+                }
+                imppids[i] = Process.myPid();
+                for (i=0; i<imppids.length && imppids[i] != 0; i++) {
+                    Process.sendSignal(imppids[i], Process.SIGNAL_QUIT);
+                    synchronized (this) {
+                        try {
+                            wait(200);
+                        } catch (InterruptedException e) {
+                        }
+                    }
+                }
+                for (i = mLRUProcesses.size() - 1 ; i >= 0 ; i--) {
                     ProcessRecord r = mLRUProcesses.get(i);
-                    if (r.thread != null) {
+                    boolean done = false;
+                    for (int j=0; j<imppids.length && imppids[j] != 0; j++) {
+                        if (imppids[j] == r.pid) {
+                            done = true;
+                            break;
+                        }
+                    }
+                    if (!done && r.thread != null) {
                         Process.sendSignal(r.pid, Process.SIGNAL_QUIT);
+                        synchronized (this) {
+                            try {
+                                wait(200);
+                            } catch (InterruptedException e) {
+                            }
+                        }
                     }
                 }
             }
@@ -4565,7 +4613,7 @@
                 if (!dir.exists()) {
                     fileReady = dir.mkdirs();
                     FileUtils.setPermissions(dir.getAbsolutePath(),
-                            FileUtils.S_IRWXU | FileUtils.S_IRWXG | FileUtils.S_IRWXO, -1, -1);
+                            FileUtils.S_IRWXU | FileUtils.S_IRWXG | FileUtils.S_IXOTH, -1, -1);
                 } else if (dir.isDirectory()) {
                     fileReady = true;
                 }
@@ -4575,6 +4623,18 @@
                 Log.i(TAG, "Removing old ANR trace file from " + tracesPath);
                 fileReady = f.delete();
             }
+            
+            if (removeExisting) {
+                try {
+                    f.createNewFile();
+                    FileUtils.setPermissions(f.getAbsolutePath(),
+                            FileUtils.S_IRWXU | FileUtils.S_IRWXG
+                            | FileUtils.S_IWOTH | FileUtils.S_IROTH, -1, -1);
+                    fileReady = true;
+                } catch (IOException e) {
+                    Log.w(TAG, "Unable to make ANR traces file", e);
+                }
+            }
         }
 
         return fileReady;
@@ -4753,7 +4813,12 @@
         int callerUid = Binder.getCallingUid();
         // Only the system server can kill an application
         if (callerUid == Process.SYSTEM_UID) {
-            uninstallPackageLocked(pkg, uid, false);
+            // Post an aysnc message to kill the application
+            Message msg = mHandler.obtainMessage(KILL_APPLICATION_MSG);
+            msg.arg1 = uid;
+            msg.arg2 = 0;
+            msg.obj = pkg;
+            mHandler.dispatchMessage(msg);
         } else {
             throw new SecurityException(callerUid + " cannot kill pkg: " +
                     pkg);
@@ -10597,7 +10662,7 @@
             }
             if (timeout != null && mLRUProcesses.contains(proc)) {
                 Log.w(TAG, "Timeout executing service: " + timeout);
-                appNotRespondingLocked(proc, null, "Executing service "
+                appNotRespondingLocked(proc, null, null, "Executing service "
                         + timeout.name);
             } else {
                 Message msg = mHandler.obtainMessage(SERVICE_TIMEOUT_MSG);
@@ -11392,7 +11457,8 @@
             }
             
             if (app != null) {
-                appNotRespondingLocked(app, null, "Broadcast of " + r.intent.toString());
+                appNotRespondingLocked(app, null, null,
+                        "Broadcast of " + r.intent.toString());
             }
 
             if (mPendingBroadcast == r) {
diff --git a/services/java/com/android/server/am/HistoryRecord.java b/services/java/com/android/server/am/HistoryRecord.java
index b3fc313..84ded22 100644
--- a/services/java/com/android/server/am/HistoryRecord.java
+++ b/services/java/com/android/server/am/HistoryRecord.java
@@ -470,7 +470,8 @@
                 }
                 
                 if (r.app.instrumentationClass == null) { 
-                    service.appNotRespondingLocked(r.app, r, "keyDispatchingTimedOut");
+                    service.appNotRespondingLocked(r.app, r, this,
+                            "keyDispatchingTimedOut");
                 } else {
                     Bundle info = new Bundle();
                     info.putString("shortMsg", "keyDispatchingTimedOut");
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index c33d4b6..d48c941 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -412,7 +412,7 @@
      * @return false while no data connection if all above requirements are met.
      */
     public boolean isDataConnectionAsDesired() {
-        boolean roaming = phone.getServiceState().getRoaming();
+        boolean roaming = getDataRoaming();
 
         if (mGsmPhone.mSIMRecords.getRecordsLoaded() &&
                 mGsmPhone.mSST.getCurrentGprsState() == ServiceState.STATE_IN_SERVICE &&
@@ -424,6 +424,10 @@
         return true;
     }
 
+    private boolean getDataRoaming() {
+        return mGsmPhone.mSST.getDataRoaming();
+    }
+
     private boolean isApnTypeActive(String type) {
         // TODO: to support simultaneous, mActiveApn can be a List instead.
         return mActiveApn != null && mActiveApn.canHandleType(type);
@@ -533,7 +537,7 @@
     }
 
     private boolean isDataAllowed() {
-        boolean roaming = phone.getServiceState().getRoaming();
+        boolean roaming = getDataRoaming();
         return getAnyDataEnabled() && (!roaming || getDataOnRoamingEnabled());
     }
 
@@ -580,7 +584,7 @@
         }
 
         int gprsState = mGsmPhone.mSST.getCurrentGprsState();
-        boolean roaming = phone.getServiceState().getRoaming();
+        boolean roaming = getDataRoaming();
         boolean desiredPowerState = mGsmPhone.mSST.getDesiredPowerState();
 
         if ((state == State.IDLE || state == State.SCANNING)
@@ -1245,16 +1249,38 @@
         }
     }
 
+    /**
+     * Check the data roaming consistency since this can be triggered by
+     * voice roaming flag of ServiceState in setDataOnRoamingEnabled()
+     *
+     * TODO make this triggered by data roaming state only
+     */
+    @Override
     protected void onRoamingOff() {
-        trySetupData(Phone.REASON_ROAMING_OFF);
+        if (!getDataRoaming()) { //data roaming is off
+            trySetupData(Phone.REASON_ROAMING_OFF);
+        } else { // Inconsistent! data roaming is on
+            sendMessage(obtainMessage(EVENT_ROAMING_ON));
+        }
     }
 
+    /**
+     * Check the data roaming consistency since this can be triggered by
+     * voice roaming flag of ServiceState in setDataOnRoamingEnabled()
+     *
+     * TODO make this triggered by data roaming state only
+     */
+    @Override
     protected void onRoamingOn() {
-        if (getDataOnRoamingEnabled()) {
-            trySetupData(Phone.REASON_ROAMING_ON);
-        } else {
-            if (DBG) log("Tear down data connection on roaming.");
-            cleanUpConnection(true, Phone.REASON_ROAMING_ON);
+        if (getDataRoaming()) { // data roaming is on
+            if (getDataOnRoamingEnabled()) {
+                trySetupData(Phone.REASON_ROAMING_ON);
+            } else {
+                if (DBG) log("Tear down data connection on roaming.");
+                cleanUpConnection(true, Phone.REASON_ROAMING_ON);
+            }
+        } else { // Inconsistent! data roaming is off
+            sendMessage(obtainMessage(EVENT_ROAMING_OFF));
         }
     }
 
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
index b3b4345..60d4e8f 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java
@@ -88,6 +88,9 @@
     private int newNetworkType = 0;
     /* gsm roaming status solely based on TS 27.007 7.2 CREG */
     private boolean mGsmRoaming = false;
+    /* data roaming status solely based on TS 27.007 10.1.19 CGREG */
+    private boolean mDataRoaming = false;
+    private boolean newDataRoaming = false;
 
     private RegistrantList gprsAttachedRegistrants = new RegistrantList();
     private RegistrantList gprsDetachedRegistrants = new RegistrantList();
@@ -309,6 +312,10 @@
         psRestrictDisabledRegistrants.remove(h);
     }
 
+    /*protected*/ boolean getDataRoaming() {
+        return mDataRoaming;
+    }
+
     //***** Called from GSMPhone
     public void
     getLacAndCid(Message onComplete) {
@@ -666,6 +673,7 @@
                         }
                     }
                     newGPRSState = regCodeToServiceState(regState);
+                    newDataRoaming = regCodeIsRoaming(regState);
                     newNetworkType = type;
                 break;
 
@@ -693,6 +701,11 @@
 
         if (pollingContext[0] == 0) {
             newSS.setRoaming(isRoamingBetweenOperators(mGsmRoaming, newSS));
+            // when both roaming indicators are true but not roaming between
+            // operators, roaming should set to false.
+            if (newDataRoaming && mGsmRoaming && !newSS.getRoaming()) {
+                newDataRoaming = false;
+            }
             pollStateDone();
         }
 
@@ -722,6 +735,7 @@
                 newCellLoc.setStateInvalid();
                 setSignalStrengthDefaultValues();
                 mGotCountryCode = false;
+                newDataRoaming = false;
 
                 pollStateDone();
             break;
@@ -731,6 +745,7 @@
                 newCellLoc.setStateInvalid();
                 setSignalStrengthDefaultValues();
                 mGotCountryCode = false;
+                newDataRoaming = false;
 
                 pollStateDone();
             break;
@@ -745,6 +760,8 @@
                 newCellLoc.setStateInvalid();
                 setSignalStrengthDefaultValues();
                 mGotCountryCode = false;
+                newDataRoaming = false;
+                mDataRoaming = false;
 
                 //NOTE: pollStateDone() is not needed in this case
                 break;
@@ -829,9 +846,9 @@
 
         boolean hasChanged = !newSS.equals(ss);
 
-        boolean hasRoamingOn = !ss.getRoaming() && newSS.getRoaming();
+        boolean hasRoamingOn = !mDataRoaming && newDataRoaming;
 
-        boolean hasRoamingOff = ss.getRoaming() && !newSS.getRoaming();
+        boolean hasRoamingOff = mDataRoaming && !newDataRoaming;
 
         boolean hasLocationChanged = !newCellLoc.equals(cellLoc);
 
@@ -848,6 +865,7 @@
 
         gprsState = newGPRSState;
         networkType = newNetworkType;
+        mDataRoaming = newDataRoaming;
 
         newSS.setStateOutOfService(); // clean slate for next time
 
diff --git a/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java b/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java
index f1207e4..af59126 100644
--- a/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java
+++ b/telephony/java/com/android/internal/telephony/gsm/SmsMessage.java
@@ -277,10 +277,12 @@
             }
 
             if (header != null) {
-                userData = new byte[header.length + textPart.length];
+                // Need 1 byte for UDHL
+                userData = new byte[header.length + textPart.length + 1];
 
-                System.arraycopy(header, 0, userData, 0, header.length);
-                System.arraycopy(textPart, 0, userData, header.length, textPart.length);
+                userData[0] = (byte)header.length;
+                System.arraycopy(header, 0, userData, 1, header.length);
+                System.arraycopy(textPart, 0, userData, header.length + 1, textPart.length);
             }
             else {
                 userData = textPart;
diff --git a/tests/FrameworkTest/tests/src/android/widget/AutoCompleteTextViewCallbacks.java b/tests/FrameworkTest/tests/src/android/widget/AutoCompleteTextViewCallbacks.java
index 89421e48..29000dd 100644
--- a/tests/FrameworkTest/tests/src/android/widget/AutoCompleteTextViewCallbacks.java
+++ b/tests/FrameworkTest/tests/src/android/widget/AutoCompleteTextViewCallbacks.java
@@ -19,8 +19,8 @@
 import android.app.Instrumentation;
 import android.test.ActivityInstrumentationTestCase2;
 import android.test.FlakyTest;
-import android.test.suitebuilder.annotation.MediumTest;
 
+// TODO: tests fail intermittently. Add back MediumTest annotation when fixed
 public class AutoCompleteTextViewCallbacks
         extends ActivityInstrumentationTestCase2<AutoCompleteTextViewSimple> {
 
@@ -32,7 +32,6 @@
 
     /** Test that the initial popup of the suggestions does not select anything.
      */
-    @MediumTest
     @FlakyTest(tolerance=3)
     public void testPopupNoSelection() throws Exception {
         AutoCompleteTextViewSimple theActivity = getActivity();
@@ -57,7 +56,6 @@
     }
 
     /** Test that arrow-down into the popup calls the onSelected callback. */
-    @MediumTest
     @FlakyTest(tolerance=3)
     public void testPopupEnterSelection() throws Exception {
         AutoCompleteTextViewSimple theActivity = getActivity();
@@ -95,7 +93,6 @@
     }
 
     /** Test that arrow-up out of the popup calls the onNothingSelected callback */
-    @MediumTest
     @FlakyTest(tolerance=3)
     public void testPopupLeaveSelection() {
         AutoCompleteTextViewSimple theActivity = getActivity();
diff --git a/tests/FrameworkTest/tests/src/android/widget/AutoCompleteTextViewPopup.java b/tests/FrameworkTest/tests/src/android/widget/AutoCompleteTextViewPopup.java
index 1e4cd20..c48c056 100644
--- a/tests/FrameworkTest/tests/src/android/widget/AutoCompleteTextViewPopup.java
+++ b/tests/FrameworkTest/tests/src/android/widget/AutoCompleteTextViewPopup.java
@@ -20,10 +20,11 @@
 import android.test.ActivityInstrumentationTestCase2;
 import android.test.FlakyTest;
 import android.test.suitebuilder.annotation.MediumTest;
-import android.util.Log;
 
 /**
  * A collection of tests on aspects of the AutoCompleteTextView's popup
+ *
+ * TODO: tests fail intermittently. Add back MediumTest annotation when fixed
  */
 public class AutoCompleteTextViewPopup
         extends ActivityInstrumentationTestCase2<AutoCompleteTextViewSimple> {
@@ -40,7 +41,6 @@
     }
 
     /** Test that we can move the selection and it responds as expected */
-    @MediumTest
     @FlakyTest(tolerance=3)
     public void testPopupSetListSelection() throws Throwable {
         AutoCompleteTextViewSimple theActivity = getActivity();
@@ -73,7 +73,6 @@
     }
 
     /** Test that we can look at the selection as we move around */
-    @MediumTest
     @FlakyTest(tolerance=3)
     public void testPopupGetListSelection() throws Throwable {
         AutoCompleteTextViewSimple theActivity = getActivity();
@@ -101,7 +100,6 @@
     }
 
     /** Test that we can clear the selection */
-    @MediumTest
     @FlakyTest(tolerance=3)
     public void testPopupClearListSelection() throws Throwable {
         AutoCompleteTextViewSimple theActivity = getActivity();
@@ -135,7 +133,6 @@
     }
 
     /** Make sure we handle an empty adapter properly */
-    @MediumTest
     @FlakyTest(tolerance=3)
     public void testPopupNavigateNoAdapter() throws Throwable {
         AutoCompleteTextViewSimple theActivity = getActivity();
@@ -170,7 +167,6 @@
     }
 
     /** Test the show/hide behavior of the drop-down. */
-    @MediumTest
     @FlakyTest(tolerance=3)
     public void testPopupShow() throws Throwable {
         AutoCompleteTextViewSimple theActivity = getActivity();
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index e04491d..5f80ade 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -321,6 +321,7 @@
     LABEL_ATTR = 0x01010001,
     ICON_ATTR = 0x01010002,
     MIN_SDK_VERSION_ATTR = 0x0101020c,
+    MAX_SDK_VERSION_ATTR = 0x01010271,
     REQ_TOUCH_SCREEN_ATTR = 0x01010227,
     REQ_KEYBOARD_TYPE_ATTR = 0x01010228,
     REQ_HARD_KEYBOARD_ATTR = 0x01010229,
@@ -585,6 +586,10 @@
                             targetSdk = code;
                             printf("sdkVersion:'%d'\n", code);
                         }
+                        code = getIntegerAttribute(tree, MAX_SDK_VERSION_ATTR, NULL, -1);
+                        if (code != -1) {
+                            printf("maxSdkVersion:'%d'\n", code);
+                        }
                         code = getIntegerAttribute(tree, TARGET_SDK_VERSION_ATTR, &error);
                         if (error != "") {
                             error = "";
diff --git a/tools/layoutlib/bridge/src/android/graphics/Bitmap.java b/tools/layoutlib/bridge/src/android/graphics/Bitmap.java
index 6bc01b1..7dde634 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Bitmap.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Bitmap.java
@@ -16,7 +16,6 @@
 
 package android.graphics;
 
-import com.android.layoutlib.bridge.BridgeCanvas;
 
 import java.awt.image.BufferedImage;
 import java.io.File;
@@ -25,15 +24,15 @@
 import javax.imageio.ImageIO;
 
 public final class Bitmap extends _Original_Bitmap {
-    
+
     private BufferedImage mImage;
 
     public Bitmap(File input) throws IOException {
         super(1, true, null);
-        
+
         mImage = ImageIO.read(input);
     }
-    
+
     Bitmap(BufferedImage image) {
         super(1, true, null);
         mImage = image;
@@ -42,9 +41,9 @@
     public BufferedImage getImage() {
         return mImage;
     }
-    
+
     // ----- overriden methods
-    
+
     public enum Config {
         // these native values must match up with the enum in SkBitmap.h
         ALPHA_8     (2),
@@ -56,27 +55,26 @@
             this.nativeInt = ni;
         }
         final int nativeInt;
-        
+
         /* package */ static Config nativeToConfig(int ni) {
             return sConfigs[ni];
         }
-        
+
         private static Config sConfigs[] = {
             null, null, ALPHA_8, null, RGB_565, ARGB_4444, ARGB_8888
         };
     }
 
-    
     @Override
     public int getWidth() {
         return mImage.getWidth();
     }
-    
+
     @Override
     public int getHeight() {
         return mImage.getHeight();
     }
-    
+
     /**
      * Returns an immutable bitmap from the source bitmap. The new bitmap may
      * be the same object as source, or a copy may have been made.
@@ -100,7 +98,7 @@
                                       int width, int height) {
         return new Bitmap(source.mImage.getSubimage(x, y, width, height));
     }
-    
+
     /**
      * Returns an immutable bitmap from subset of the source bitmap,
      * transformed by the optional matrix.
@@ -158,7 +156,7 @@
         neww = Math.round(deviceR.width());
         newh = Math.round(deviceR.height());
 
-        BridgeCanvas canvas = new BridgeCanvas(neww, newh);
+        Canvas canvas = new Canvas(neww, newh);
 
         canvas.translate(-deviceR.left, -deviceR.top);
         canvas.concat(m);
@@ -169,10 +167,10 @@
         }
 
         canvas.drawBitmap(source, srcR, dstR, paint);
-        
+
         return new Bitmap(canvas.getImage());
     }
-    
+
     /**
      * Returns a mutable bitmap with the specified width and height.
      *
@@ -184,7 +182,7 @@
     public static Bitmap createBitmap(int width, int height, Config config) {
         return new Bitmap(new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB));
     }
-    
+
     /**
      * Returns a immutable bitmap with the specified width and height, with each
      * pixel value set to the corresponding value in the colors array.
@@ -215,7 +213,7 @@
             || (lastScanline + width > length)) {
             throw new ArrayIndexOutOfBoundsException();
         }
-        
+
         // TODO: create an immutable bitmap...
         throw new UnsupportedOperationException();
     }
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeCanvas.java b/tools/layoutlib/bridge/src/android/graphics/Canvas.java
similarity index 89%
rename from tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeCanvas.java
rename to tools/layoutlib/bridge/src/android/graphics/Canvas.java
index 4710691..3fa1d1d 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeCanvas.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Canvas.java
@@ -14,24 +14,16 @@
  * limitations under the License.
  */
 
-package com.android.layoutlib.bridge;
+package android.graphics;
 
 import com.android.layoutlib.api.ILayoutLog;
 
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
 import android.graphics.DrawFilter;
-import android.graphics.LinearGradient;
-import android.graphics.Matrix;
-import android.graphics.Paint;
-import android.graphics.Path;
 import android.graphics.Picture;
 import android.graphics.PorterDuff;
-import android.graphics.PorterDuffXfermode;
 import android.graphics.Rect;
 import android.graphics.RectF;
 import android.graphics.Region;
-import android.graphics.Shader;
 import android.graphics.Xfermode;
 import android.graphics.Paint.Align;
 import android.graphics.Paint.Style;
@@ -43,6 +35,7 @@
 import java.awt.Graphics2D;
 import java.awt.Rectangle;
 import java.awt.RenderingHints;
+import java.awt.geom.AffineTransform;
 import java.awt.image.BufferedImage;
 import java.util.Stack;
 
@@ -51,36 +44,59 @@
 /**
  * Re-implementation of the Canvas, 100% in java on top of a BufferedImage.
  */
-public class BridgeCanvas extends Canvas {
-    
+public class Canvas extends _Original_Canvas {
+
     private BufferedImage mBufferedImage;
     private final Stack<Graphics2D> mGraphicsStack = new Stack<Graphics2D>();
     private final ILayoutLog mLogger;
 
-    public BridgeCanvas(int width, int height, ILayoutLog logger) {
+    public Canvas() {
+        mLogger = null;
+        // the mBufferedImage will be taken from a bitmap in #setBitmap()
+    }
+
+    public Canvas(Bitmap bitmap) {
+        mLogger = null;
+        mBufferedImage = bitmap.getImage();
+        mGraphicsStack.push(mBufferedImage.createGraphics());
+    }
+
+    public Canvas(int nativeCanvas) {
+        mLogger = null;
+        throw new UnsupportedOperationException("Can't create Canvas(int)");
+    }
+
+    public Canvas(javax.microedition.khronos.opengles.GL gl) {
+        mLogger = null;
+        throw new UnsupportedOperationException("Can't create Canvas(javax.microedition.khronos.opengles.GL)");
+    }
+
+    // custom constructors for our use.
+    public Canvas(int width, int height, ILayoutLog logger) {
         mLogger = logger;
         mBufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
         mGraphicsStack.push(mBufferedImage.createGraphics());
     }
-    
-    public BridgeCanvas(int width, int height) {
+
+    public Canvas(int width, int height) {
         this(width, height, null /* logger*/);
     }
-    
+
+    // custom mehtods
     public BufferedImage getImage() {
         return mBufferedImage;
     }
-    
-    Graphics2D getGraphics2d() {
+
+    public Graphics2D getGraphics2d() {
         return mGraphicsStack.peek();
     }
-    
-    void dispose() {
+
+    public void dispose() {
         while (mGraphicsStack.size() > 0) {
             mGraphicsStack.pop().dispose();
         }
     }
-    
+
     /**
      * Creates a new {@link Graphics2D} based on the {@link Paint} parameters.
      * <p/>The object must be disposed ({@link Graphics2D#dispose()}) after being used.
@@ -91,11 +107,11 @@
         g.setColor(new Color(paint.getColor()));
         int alpha = paint.getAlpha();
         float falpha = alpha / 255.f;
-        
+
         Xfermode xfermode = paint.getXfermode();
         if (xfermode instanceof PorterDuffXfermode) {
             PorterDuff.Mode mode = ((PorterDuffXfermode)xfermode).getMode();
-            
+
             setModeInGraphics(mode, g, falpha);
         } else {
             if (mLogger != null && xfermode != null) {
@@ -105,7 +121,7 @@
             }
             g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, falpha));
         }
-        
+
         Shader shader = paint.getShader();
         if (shader instanceof LinearGradient) {
             g.setPaint(((LinearGradient)shader).getPaint());
@@ -116,10 +132,10 @@
                         shader.getClass().getCanonicalName()));
             }
         }
-        
+
         return g;
     }
-    
+
     private void setModeInGraphics(PorterDuff.Mode mode, Graphics2D g, float falpha) {
         switch (mode) {
             case CLEAR:
@@ -168,14 +184,43 @@
                 break;
         }
     }
-    
+
+
     // --------------------
-    
+    // OVERRIDEN ENUMS
+    // This is needed since we rename Canvas into _Original_Canvas
+    // --------------------
+
+    public enum EdgeType {
+        BW(0),  //!< treat edges by just rounding to nearest pixel boundary
+        AA(1);  //!< treat edges by rounding-out, since they may be antialiased
+
+        EdgeType(int nativeInt) {
+            this.nativeInt = nativeInt;
+        }
+        final int nativeInt;
+    }
+
+
+    // --------------------
+    // OVERRIDEN METHODS
+    // --------------------
+
     @Override
     public void finalize() throws Throwable {
         // pass
     }
-    
+
+    /* (non-Javadoc)
+     * @see android.graphics.Canvas#setBitmap(android.graphics.Bitmap)
+     */
+    @Override
+    public void setBitmap(Bitmap bitmap) {
+        mBufferedImage = bitmap.getImage();
+        mGraphicsStack.push(mBufferedImage.createGraphics());
+    }
+
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#translate(float, float)
      */
@@ -183,7 +228,7 @@
     public void translate(float dx, float dy) {
         getGraphics2d().translate(dx, dy);
     }
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#save()
      */
@@ -191,7 +236,7 @@
     public int save() {
         Graphics2D g = (Graphics2D)getGraphics2d().create();
         mGraphicsStack.push(g);
-        
+
         return mGraphicsStack.size() - 1;
     }
 
@@ -203,7 +248,7 @@
         // For now we ignore saveFlags
         return save();
     }
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#restore()
      */
@@ -221,7 +266,7 @@
             mGraphicsStack.pop();
         }
     }
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#getSaveCount()
      */
@@ -229,8 +274,8 @@
     public int getSaveCount() {
         return mGraphicsStack.size() - 1;
     }
-    
-    
+
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#clipRect(float, float, float, float, android.graphics.Region.Op)
      */
@@ -288,23 +333,36 @@
     public boolean clipRect(RectF rect) {
         return clipRect(rect.left, rect.top, rect.right, rect.bottom);
     }
-    
-    @Override
+
     public boolean quickReject(RectF rect, EdgeType type) {
         return false;
     }
 
     @Override
+    public boolean quickReject(RectF rect, _Original_Canvas.EdgeType type) {
+        throw new UnsupportedOperationException("CALL TO PARENT FORBIDDEN");
+    }
+
     public boolean quickReject(Path path, EdgeType type) {
         return false;
     }
 
     @Override
+    public boolean quickReject(Path path, _Original_Canvas.EdgeType type) {
+        throw new UnsupportedOperationException("CALL TO PARENT FORBIDDEN");
+    }
+
     public boolean quickReject(float left, float top, float right, float bottom,
                                EdgeType type) {
         return false;
     }
 
+    @Override
+    public boolean quickReject(float left, float top, float right, float bottom,
+                               _Original_Canvas.EdgeType type) {
+        throw new UnsupportedOperationException("CALL TO PARENT FORBIDDEN");
+    }
+
     /**
      * Retrieve the clip bounds, returning true if they are non-empty.
      *
@@ -324,31 +382,31 @@
         }
         return false;
     }
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#drawColor(int, android.graphics.PorterDuff.Mode)
      */
     @Override
     public void drawColor(int color, PorterDuff.Mode mode) {
         Graphics2D g = getGraphics2d();
-        
+
         // save old color
         Color c = g.getColor();
-        
+
         Composite composite = g.getComposite();
-        
+
         // get the alpha from the color
         int alpha = color >>> 24;
         float falpha = alpha / 255.f;
-        
+
         setModeInGraphics(mode, g, falpha);
-        
+
         g.setColor(new Color(color));
-        
+
         getGraphics2d().fillRect(0, 0, getWidth(), getHeight());
-        
+
         g.setComposite(composite);
-        
+
         // restore color
         g.setColor(c);
     }
@@ -360,7 +418,7 @@
     public void drawColor(int color) {
         drawColor(color, PorterDuff.Mode.SRC_OVER);
     }
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#drawARGB(int, int, int, int)
      */
@@ -368,7 +426,7 @@
     public void drawARGB(int a, int r, int g, int b) {
         drawColor(a << 24 | r << 16 | g << 8 | b, PorterDuff.Mode.SRC_OVER);
     }
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#drawRGB(int, int, int)
      */
@@ -377,7 +435,7 @@
         drawColor(0xFF << 24 | r << 16 | g << 8 | b, PorterDuff.Mode.SRC_OVER);
     }
 
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#getWidth()
      */
@@ -385,7 +443,7 @@
     public int getWidth() {
         return mBufferedImage.getWidth();
     }
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#getHeight()
      */
@@ -401,7 +459,7 @@
     public void drawPaint(Paint paint) {
         drawColor(paint.getColor());
     }
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#drawBitmap(android.graphics.Bitmap, float, float, android.graphics.Paint)
      */
@@ -417,7 +475,32 @@
      */
     @Override
     public void drawBitmap(Bitmap bitmap, Matrix matrix, Paint paint) {
-        throw new UnsupportedOperationException();
+        boolean needsRestore = false;
+        if (matrix.isIdentity() == false) {
+            // create a new graphics and apply the matrix to it
+            save(); // this creates a new Graphics2D, and stores it for children call to use
+            needsRestore = true;
+            Graphics2D g = getGraphics2d(); // get the newly create Graphics2D
+
+            // get the Graphics2D current matrix
+            AffineTransform currentTx = g.getTransform();
+            // get the AffineTransform from the matrix
+            AffineTransform matrixTx = matrix.getTransform();
+
+            // combine them so that the matrix is applied after.
+            currentTx.preConcatenate(matrixTx);
+
+            // give it to the graphics as a new matrix replacing all previous transform
+            g.setTransform(currentTx);
+        }
+
+        // draw the bitmap
+        drawBitmap(bitmap, 0, 0, paint);
+
+        if (needsRestore) {
+            // remove the new graphics
+            restore();
+        }
     }
 
     /* (non-Javadoc)
@@ -456,39 +539,42 @@
             int height, boolean hasAlpha, Paint paint) {
         throw new UnsupportedOperationException();
     }
-    
+
     private void drawBitmap(Bitmap bitmap, int sleft, int stop, int sright, int sbottom, int dleft,
             int dtop, int dright, int dbottom, Paint paint) {
         BufferedImage image = bitmap.getImage();
-        
+
         Graphics2D g = getGraphics2d();
-        
+
         Composite c = null;
-        
-        if (paint.isFilterBitmap()) {
-            g = (Graphics2D)g.create();
-            g.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
-                    RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+
+        if (paint != null) {
+            if (paint.isFilterBitmap()) {
+                g = (Graphics2D)g.create();
+                g.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
+                        RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+            }
+
+            if (paint.getAlpha() != 0xFF) {
+                c = g.getComposite();
+                g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
+                        paint.getAlpha()/255.f));
+            }
         }
-        
-        if (paint.getAlpha() != 0xFF) {
-            c = g.getComposite();
-            g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
-                    paint.getAlpha()/255.f));
-        }
-        
+
         g.drawImage(image, dleft, dtop, dright, dbottom,
                 sleft, stop, sright, sbottom, null);
 
-        if (paint.isFilterBitmap()) {
-            g.dispose();
-        }
-        
-        if (c != null) {
-            g.setComposite(c);
+        if (paint != null) {
+            if (paint.isFilterBitmap()) {
+                g.dispose();
+            }
+            if (c != null) {
+                g.setComposite(c);
+            }
         }
     }
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#rotate(float, float, float)
      */
@@ -509,7 +595,7 @@
     public void rotate(float degrees) {
         getGraphics2d().rotate(Math.toRadians(degrees));
     }
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#scale(float, float, float, float)
      */
@@ -528,19 +614,19 @@
     public void scale(float sx, float sy) {
         getGraphics2d().scale(sx, sy);
     }
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#drawText(char[], int, int, float, float, android.graphics.Paint)
      */
     @Override
     public void drawText(char[] text, int index, int count, float x, float y, Paint paint) {
         Graphics2D g = getGraphics2d();
-        
+
         g = (Graphics2D)g.create();
         g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
-        
+
         g.setFont(paint.getFont());
-        
+
         // set the color. because this only handles RGB we have to handle the alpha separately
         g.setColor(new Color(paint.getColor()));
         int alpha = paint.getAlpha();
@@ -557,9 +643,9 @@
                 x -= m;
             }
         }
-        
+
         g.drawChars(text, index, count, (int)x, (int)y);
-        
+
         g.dispose();
     }
 
@@ -586,7 +672,7 @@
     public void drawText(String text, int start, int end, float x, float y, Paint paint) {
         drawText(text.toCharArray(), start, end - start, x, y, paint);
     }
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#drawRect(android.graphics.RectF, android.graphics.Paint)
      */
@@ -594,7 +680,7 @@
     public void drawRect(RectF rect, Paint paint) {
         doDrawRect((int)rect.left, (int)rect.top, (int)rect.width(), (int)rect.height(), paint);
     }
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#drawRect(float, float, float, float, android.graphics.Paint)
      */
@@ -614,11 +700,11 @@
     private final void doDrawRect(int left, int top, int width, int height, Paint paint) {
         // get current graphisc
         Graphics2D g = getGraphics2d();
-        
+
         g = getNewGraphics(paint, g);
 
         Style style = paint.getStyle();
-        
+
         // draw
         if (style == Style.FILL || style == Style.FILL_AND_STROKE) {
             g.fillRect(left, top, width, height);
@@ -639,16 +725,16 @@
     public void drawRoundRect(RectF rect, float rx, float ry, Paint paint) {
         // get current graphisc
         Graphics2D g = getGraphics2d();
-        
+
         g = getNewGraphics(paint, g);
 
         Style style = paint.getStyle();
-        
+
         // draw
-        
+
         int arcWidth = (int)(rx * 2);
         int arcHeight = (int)(ry * 2);
-        
+
         if (style == Style.FILL || style == Style.FILL_AND_STROKE) {
             g.fillRoundRect((int)rect.left, (int)rect.top, (int)rect.width(), (int)rect.height(),
                     arcWidth, arcHeight);
@@ -671,7 +757,7 @@
     public void drawLine(float startX, float startY, float stopX, float stopY, Paint paint) {
         // get current graphisc
         Graphics2D g = getGraphics2d();
-        
+
         g = getNewGraphics(paint, g);
 
         g.drawLine((int)startX, (int)startY, (int)stopX, (int)stopY);
@@ -679,7 +765,7 @@
         // dispose Graphics2D object
         g.dispose();
     }
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#drawLines(float[], int, int, android.graphics.Paint)
      */
@@ -687,7 +773,7 @@
     public void drawLines(float[] pts, int offset, int count, Paint paint) {
         // get current graphisc
         Graphics2D g = getGraphics2d();
-        
+
         g = getNewGraphics(paint, g);
 
         for (int i = 0 ; i < count ; i += 4) {
@@ -706,7 +792,7 @@
     public void drawLines(float[] pts, Paint paint) {
         drawLines(pts, 0, pts.length, paint);
     }
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#drawCircle(float, float, float, android.graphics.Paint)
      */
@@ -714,11 +800,11 @@
     public void drawCircle(float cx, float cy, float radius, Paint paint) {
         // get current graphisc
         Graphics2D g = getGraphics2d();
-        
+
         g = getNewGraphics(paint, g);
 
         Style style = paint.getStyle();
-        
+
         int size = (int)(radius * 2);
 
         // draw
@@ -741,11 +827,11 @@
     public void drawOval(RectF oval, Paint paint) {
         // get current graphics
         Graphics2D g = getGraphics2d();
-        
+
         g = getNewGraphics(paint, g);
 
         Style style = paint.getStyle();
-        
+
         // draw
         if (style == Style.FILL || style == Style.FILL_AND_STROKE) {
             g.fillOval((int)oval.left, (int)oval.top, (int)oval.width(), (int)oval.height());
@@ -758,7 +844,7 @@
         // dispose Graphics2D object
         g.dispose();
     }
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#drawPath(android.graphics.Path, android.graphics.Paint)
      */
@@ -766,11 +852,11 @@
     public void drawPath(Path path, Paint paint) {
         // get current graphics
         Graphics2D g = getGraphics2d();
-        
+
         g = getNewGraphics(paint, g);
 
         Style style = paint.getStyle();
-        
+
         // draw
         if (style == Style.FILL || style == Style.FILL_AND_STROKE) {
             g.fill(path.getAwtShape());
@@ -783,7 +869,7 @@
         // dispose Graphics2D object
         g.dispose();
     }
-    
+
     /* (non-Javadoc)
      * @see android.graphics.Canvas#setMatrix(android.graphics.Matrix)
      */
@@ -795,10 +881,10 @@
 
         // get the new current graphics
         Graphics2D g = getGraphics2d();
-        
+
         // and apply the matrix
         g.setTransform(matrix.getTransform());
-        
+
         if (mLogger != null && matrix.hasPerspective()) {
             mLogger.warning("android.graphics.Canvas#setMatrix(android.graphics.Matrix) only supports affine transformations in the Layout Editor.");
         }
@@ -1059,15 +1145,6 @@
     }
 
     /* (non-Javadoc)
-     * @see android.graphics.Canvas#setBitmap(android.graphics.Bitmap)
-     */
-    @Override
-    public void setBitmap(Bitmap bitmap) {
-        // TODO Auto-generated method stub
-        super.setBitmap(bitmap);
-    }
-
-    /* (non-Javadoc)
      * @see android.graphics.Canvas#setDrawFilter(android.graphics.DrawFilter)
      */
     @Override
diff --git a/tools/layoutlib/bridge/src/android/graphics/Matrix.java b/tools/layoutlib/bridge/src/android/graphics/Matrix.java
index 18c0e17..3974e08 100644
--- a/tools/layoutlib/bridge/src/android/graphics/Matrix.java
+++ b/tools/layoutlib/bridge/src/android/graphics/Matrix.java
@@ -17,6 +17,7 @@
 package android.graphics;
 
 import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
 
 
 /**
@@ -747,7 +748,24 @@
      * inverted, ignore inverse and return false.
      */
     public boolean invert(Matrix inverse) {
-        throw new UnsupportedOperationException("STUB NEEDED");
+        if (inverse == null) {
+            return false;
+        }
+
+        try {
+            AffineTransform affineTransform = getTransform();
+            AffineTransform inverseTransform = affineTransform.createInverse();
+            inverse.mValues[0] = (float)inverseTransform.getScaleX();
+            inverse.mValues[1] = (float)inverseTransform.getShearX();
+            inverse.mValues[2] = (float)inverseTransform.getTranslateX();
+            inverse.mValues[3] = (float)inverseTransform.getScaleX();
+            inverse.mValues[4] = (float)inverseTransform.getShearY();
+            inverse.mValues[5] = (float)inverseTransform.getTranslateY();
+
+            return true;
+        } catch (NoninvertibleTransformException e) {
+            return false;
+        }
     }
 
     @Override
@@ -770,7 +788,19 @@
     public void mapPoints(float[] dst, int dstIndex, float[] src, int srcIndex,
                           int pointCount) {
         checkPointArrays(src, srcIndex, dst, dstIndex, pointCount);
-        throw new UnsupportedOperationException("STUB NEEDED");
+
+        for (int i = 0 ; i < pointCount ; i++) {
+            // just in case we are doing in place, we better put this in temp vars
+            float x = mValues[0] * src[i + srcIndex] +
+                      mValues[1] * src[i + srcIndex + 1] +
+                      mValues[2];
+            float y = mValues[3] * src[i + srcIndex] +
+                      mValues[4] * src[i + srcIndex + 1] +
+                      mValues[5];
+
+            dst[i + dstIndex]     = x;
+            dst[i + dstIndex + 1] = y;
+        }
     }
 
     /**
@@ -858,7 +888,26 @@
         if (dst == null || src == null) {
             throw new NullPointerException();
         }
-        throw new UnsupportedOperationException("STUB NEEDED");
+
+        // array with 4 corners
+        float[] corners = new float[] {
+                src.left, src.top,
+                src.right, src.top,
+                src.right, src.bottom,
+                src.left, src.bottom,
+        };
+
+        // apply the transform to them.
+        mapPoints(corners);
+
+        // now put the result in the rect. We take the min/max of Xs and min/max of Ys
+        dst.left = Math.min(Math.min(corners[0], corners[2]), Math.min(corners[4], corners[6]));
+        dst.right = Math.max(Math.max(corners[0], corners[2]), Math.max(corners[4], corners[6]));
+
+        dst.top = Math.min(Math.min(corners[1], corners[3]), Math.min(corners[5], corners[7]));
+        dst.bottom = Math.max(Math.max(corners[1], corners[3]), Math.max(corners[5], corners[7]));
+
+        return rectStaysRect();
     }
 
     /**
diff --git a/tools/layoutlib/bridge/src/android/os/ServiceManager.java b/tools/layoutlib/bridge/src/android/os/ServiceManager.java
new file mode 100644
index 0000000..6a68ee2
--- /dev/null
+++ b/tools/layoutlib/bridge/src/android/os/ServiceManager.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.os;
+
+import java.util.Map;
+
+public final class ServiceManager {
+
+    /**
+     * Returns a reference to a service with the given name.
+     *
+     * @param name the name of the service to get
+     * @return a reference to the service, or <code>null</code> if the service doesn't exist
+     */
+    public static IBinder getService(String name) {
+        return null;
+    }
+
+    /**
+     * Place a new @a service called @a name into the service
+     * manager.
+     *
+     * @param name the name of the new service
+     * @param service the service object
+     */
+    public static void addService(String name, IBinder service) {
+        // pass
+    }
+
+    /**
+     * Retrieve an existing service called @a name from the
+     * service manager.  Non-blocking.
+     */
+    public static IBinder checkService(String name) {
+        return null;
+    }
+
+    /**
+     * Return a list of all currently running services.
+     */
+    public static String[] listServices() throws RemoteException {
+        // actual implementation returns null sometimes, so it's ok
+        // to return null instead of an empty list.
+        return null;
+    }
+
+    /**
+     * This is only intended to be called when the process is first being brought
+     * up and bound by the activity manager. There is only one thread in the process
+     * at that time, so no locking is done.
+     *
+     * @param cache the cache of service references
+     * @hide
+     */
+    public static void initServiceCache(Map<String, IBinder> cache) {
+        // pass
+    }
+}
diff --git a/tools/layoutlib/bridge/src/android/view/accessibility/AccessibilityManager.java b/tools/layoutlib/bridge/src/android/view/accessibility/AccessibilityManager.java
new file mode 100644
index 0000000..251c053
--- /dev/null
+++ b/tools/layoutlib/bridge/src/android/view/accessibility/AccessibilityManager.java
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.view.accessibility;
+
+import android.content.Context;
+import android.content.pm.ServiceInfo;
+
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * System level service that serves as an event dispatch for {@link AccessibilityEvent}s.
+ * Such events are generated when something notable happens in the user interface,
+ * for example an {@link android.app.Activity} starts, the focus or selection of a
+ * {@link android.view.View} changes etc. Parties interested in handling accessibility
+ * events implement and register an accessibility service which extends
+ * {@link android.accessibilityservice.AccessibilityService}.
+ *
+ * @see AccessibilityEvent
+ * @see android.accessibilityservice.AccessibilityService
+ * @see android.content.Context#getSystemService
+ */
+public final class AccessibilityManager {
+    private static AccessibilityManager sInstance = new AccessibilityManager();
+
+    /**
+     * Get an AccessibilityManager instance (create one if necessary).
+     *
+     * @hide
+     */
+    public static AccessibilityManager getInstance(Context context) {
+        return sInstance;
+    }
+
+    /**
+     * Create an instance.
+     *
+     * @param context A {@link Context}.
+     */
+    private AccessibilityManager() {
+    }
+
+    /**
+     * Returns if the {@link AccessibilityManager} is enabled.
+     *
+     * @return True if this {@link AccessibilityManager} is enabled, false otherwise.
+     */
+    public boolean isEnabled() {
+        return false;
+    }
+
+    /**
+     * Sends an {@link AccessibilityEvent}. If this {@link AccessibilityManager} is not
+     * enabled the call is a NOOP.
+     *
+     * @param event The {@link AccessibilityEvent}.
+     *
+     * @throws IllegalStateException if a client tries to send an {@link AccessibilityEvent}
+     *         while accessibility is not enabled.
+     */
+    public void sendAccessibilityEvent(AccessibilityEvent event) {
+    }
+
+    /**
+     * Requests interruption of the accessibility feedback from all accessibility services.
+     */
+    public void interrupt() {
+    }
+
+    /**
+     * Returns the {@link ServiceInfo}s of the installed accessibility services.
+     *
+     * @return An unmodifiable list with {@link ServiceInfo}s.
+     */
+    public List<ServiceInfo> getAccessibilityServiceList() {
+        // normal implementation does this in some case, so let's do the same
+        // (unmodifiableList wrapped around null).
+        List<ServiceInfo> services = null;
+        return Collections.unmodifiableList(services);
+    }
+}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
index fd77d51..145a045 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java
@@ -31,6 +31,7 @@
 import com.android.tools.layoutlib.create.OverrideMethod;
 
 import android.graphics.Bitmap;
+import android.graphics.Canvas;
 import android.graphics.Rect;
 import android.graphics.Region;
 import android.graphics.Typeface;
@@ -358,7 +359,7 @@
                 windowBackground = context.findItemInStyle(currentTheme, "windowBackground");
                 windowBackground = context.resolveResValue(windowBackground);
 
-                screenOffset = getScreenOffset(currentTheme, context);
+                screenOffset = getScreenOffset(frameworkResources, currentTheme, context);
             }
 
             // we need to make sure the Looper has been initialized for this thread.
@@ -401,8 +402,7 @@
             view.layout(0, screenOffset, screenWidth, screenHeight);
 
             // draw them
-            BridgeCanvas canvas = new BridgeCanvas(screenWidth, screenHeight - screenOffset,
-                    logger);
+            Canvas canvas = new Canvas(screenWidth, screenHeight - screenOffset, logger);
 
             root.draw(canvas);
             canvas.dispose();
@@ -673,9 +673,13 @@
     /**
      * Returns the top screen offset. This depends on whether the current theme defines the user
      * of the title and status bars.
+     * @param frameworkResources The framework resources
+     * @param currentTheme The current theme
+     * @param context The context
      * @return the pixel height offset
      */
-    private int getScreenOffset(IStyleResourceValue currentTheme, BridgeContext context) {
+    private int getScreenOffset(Map<String, Map<String, IResourceValue>> frameworkResources,
+            IStyleResourceValue currentTheme, BridgeContext context) {
         int offset = 0;
 
         // get the title bar flag from the current theme.
@@ -687,22 +691,25 @@
         // if there's a value and it's true (default is false)
         if (value == null || value.getValue() == null ||
                 XmlUtils.convertValueToBoolean(value.getValue(), false /* defValue */) == false) {
+            // default size of the window title bar
+            int defaultOffset = DEFAULT_TITLE_BAR_HEIGHT;
+
             // get value from the theme.
             value = context.findItemInStyle(currentTheme, "windowTitleSize");
 
             // resolve it
             value = context.resolveResValue(value);
 
-            // default value
-            offset = DEFAULT_TITLE_BAR_HEIGHT;
-
-            // get the real value;
             if (value != null) {
+                // get the numerical value, if available
                 TypedValue typedValue = ResourceHelper.getValue(value.getValue());
                 if (typedValue != null) {
-                    offset = (int)typedValue.getDimension(context.getResources().mMetrics);
+                    // compute the pixel value based on the display metrics
+                    defaultOffset = (int)typedValue.getDimension(context.getResources().mMetrics);
                 }
             }
+
+            offset += defaultOffset;
         }
 
         // get the fullscreen flag from the current theme.
@@ -713,8 +720,25 @@
 
         if (value == null || value.getValue() == null ||
                 XmlUtils.convertValueToBoolean(value.getValue(), false /* defValue */) == false) {
-            // FIXME: Right now this is hard-coded in the platform, but once there's a constant, we'll need to use it.
-            offset += DEFAULT_STATUS_BAR_HEIGHT;
+
+            // default value
+            int defaultOffset = DEFAULT_STATUS_BAR_HEIGHT;
+
+            // get the real value, first the list of Dimensions from the framework map
+            Map<String, IResourceValue> dimens = frameworkResources.get(BridgeConstants.RES_DIMEN);
+
+            // now get the value
+            value = dimens.get("status_bar_height");
+            if (value != null) {
+                TypedValue typedValue = ResourceHelper.getValue(value.getValue());
+                if (typedValue != null) {
+                    // compute the pixel value based on the display metrics
+                    defaultOffset = (int)typedValue.getDimension(context.getResources().mMetrics);
+                }
+            }
+
+            // add the computed offset.
+            offset += defaultOffset;
         }
 
         return offset;
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeConstants.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeConstants.java
index b426247..b5b7ceb 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeConstants.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeConstants.java
@@ -45,11 +45,12 @@
     public final static String PREFIX_RESOURCE_REF = "@";
     public final static String PREFIX_ANDROID_THEME_REF = "?android:";
     public final static String PREFIX_THEME_REF = "?";
-    
+
     public final static String PREFIX_ANDROID = "android:";
-    
+
     public final static String RES_STYLE = "style";
     public final static String RES_ATTR = "attr";
+    public final static String RES_DIMEN = "dimen";
     public final static String RES_DRAWABLE = "drawable";
     public final static String RES_COLOR = "color";
     public final static String RES_LAYOUT = "layout";
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeContext.java
index 69f3d9c..f48c8db 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeContext.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeContext.java
@@ -64,7 +64,7 @@
  * Custom implementation of Context to handle non compiled resources.
  */
 public final class BridgeContext extends Context {
-    
+
     private Resources mResources;
     private Theme mTheme;
     private HashMap<View, Object> mViewKeyMap = new HashMap<View, Object>();
@@ -73,12 +73,12 @@
     private Map<String, Map<String, IResourceValue>> mProjectResources;
     private Map<String, Map<String, IResourceValue>> mFrameworkResources;
     private Map<IStyleResourceValue, IStyleResourceValue> mStyleInheritanceMap;
-    
+
     // maps for dynamically generated id representing style objects (IStyleResourceValue)
     private Map<Integer, IStyleResourceValue> mDynamicIdToStyleMap;
     private Map<IStyleResourceValue, Integer> mStyleToDynamicIdMap;
     private int mDynamicIdGenerator = 0x01030000; // Base id for framework R.style
-    
+
     // cache for TypedArray generated from IStyleResourceValue object
     private Map<int[], Map<Integer, TypedArray>> mTypedArrayCache;
     private BridgeInflater mInflater;
@@ -112,7 +112,7 @@
         mProjectCallback = customViewLoader;
         mLogger = logger;
         Configuration config = new Configuration();
-        
+
         AssetManager assetManager = BridgeAssetManager.initSystem();
         mResources = BridgeResources.initSystem(
                 this,
@@ -120,19 +120,19 @@
                 metrics,
                 config,
                 customViewLoader);
-        
+
         mTheme = mResources.newTheme();
-        
+
         mThemeValues = currentTheme;
         mProjectResources = projectResources;
         mFrameworkResources = frameworkResources;
         mStyleInheritanceMap = styleInheritanceMap;
     }
-    
+
     public void setBridgeInflater(BridgeInflater inflater) {
         mInflater = inflater;
     }
-    
+
     public void addViewKey(View view, Object viewKey) {
         mViewKeyMap.put(view, viewKey);
     }
@@ -140,19 +140,19 @@
     public Object getViewKey(View view) {
         return mViewKeyMap.get(view);
     }
-    
+
     public Object getProjectKey() {
         return mProjectKey;
     }
-    
+
     public IProjectCallback getProjectCallback() {
         return mProjectCallback;
     }
-    
+
     public ILayoutLog getLogger() {
         return mLogger;
     }
-    
+
     // ------------ Context methods
 
     @Override
@@ -169,14 +169,14 @@
     public ClassLoader getClassLoader() {
         return this.getClass().getClassLoader();
     }
-    
+
     @Override
     public Object getSystemService(String service) {
         if (LAYOUT_INFLATER_SERVICE.equals(service)) {
             return mInflater;
         }
-        
-        // AutoCompleteTextView and MultiAutoCompleteTextView want a window 
+
+        // AutoCompleteTextView and MultiAutoCompleteTextView want a window
         // service. We don't have any but it's not worth an exception.
         if (WINDOW_SERVICE.equals(service)) {
             return null;
@@ -196,38 +196,38 @@
             throws Resources.NotFoundException {
         // get the IStyleResourceValue based on the resId;
         IStyleResourceValue style = getStyleByDynamicId(resid);
-        
+
         if (style == null) {
             throw new Resources.NotFoundException();
         }
 
         if (mTypedArrayCache == null) {
             mTypedArrayCache = new HashMap<int[], Map<Integer,TypedArray>>();
-            
+
             Map<Integer, TypedArray> map = new HashMap<Integer, TypedArray>();
             mTypedArrayCache.put(attrs, map);
 
             BridgeTypedArray ta = createStyleBasedTypedArray(style, attrs);
             map.put(resid, ta);
-            
+
             return ta;
         }
-        
+
         // get the 2nd map
         Map<Integer, TypedArray> map = mTypedArrayCache.get(attrs);
         if (map == null) {
             map = new HashMap<Integer, TypedArray>();
             mTypedArrayCache.put(attrs, map);
         }
-        
+
         // get the array from the 2nd map
         TypedArray ta = map.get(resid);
-        
+
         if (ta == null) {
             ta = createStyleBasedTypedArray(style, attrs);
             map.put(resid, ta);
         }
-        
+
         return ta;
     }
 
@@ -235,11 +235,11 @@
     public final TypedArray obtainStyledAttributes(AttributeSet set, int[] attrs) {
         return obtainStyledAttributes(set, attrs, 0, 0);
     }
-    
+
     @Override
     public TypedArray obtainStyledAttributes(AttributeSet set, int[] attrs,
             int defStyleAttr, int defStyleRes) {
-        
+
         // Hint: for XmlPullParser, attach source //DEVICE_SRC/dalvik/libcore/xml/src/java
         BridgeXmlBlockParser parser = null;
         if (set instanceof BridgeXmlBlockParser) {
@@ -252,10 +252,10 @@
 
         boolean[] frameworkAttributes = new boolean[1];
         TreeMap<Integer, String> styleNameMap = searchAttrs(attrs, frameworkAttributes);
-        
+
         BridgeTypedArray ta = ((BridgeResources) mResources).newTypeArray(attrs.length,
                 parser.isPlatformFile());
-        
+
         // resolve the defStyleAttr value into a IStyleResourceValue
         IStyleResourceValue defStyleValues = null;
         if (defStyleAttr != 0) {
@@ -265,7 +265,7 @@
             // look for the style in the current theme, and its parent:
             if (mThemeValues != null) {
                 IResourceValue item = findItemInStyle(mThemeValues, defStyleName);
-                
+
                 if (item != null) {
                     // item is a reference to a style entry. Search for it.
                     item = findResValue(item.getValue());
@@ -279,12 +279,12 @@
                 }
             }
         }
-        
+
         if (defStyleRes != 0) {
             // FIXME: See what we need to do with this.
             throw new UnsupportedOperationException();
         }
-        
+
         String namespace = BridgeConstants.NS_RESOURCES;
         if (frameworkAttributes[0] == false) {
             // need to use the application namespace
@@ -294,32 +294,32 @@
         if (styleNameMap != null) {
             for (Entry<Integer, String> styleAttribute : styleNameMap.entrySet()) {
                 int index = styleAttribute.getKey().intValue();
-    
+
                 String name = styleAttribute.getValue();
                 String value = parser.getAttributeValue(namespace, name);
-                
+
                 // if there's no direct value for this attribute in the XML, we look for default
                 // values in the widget defStyle, and then in the theme.
                 if (value == null) {
                     IResourceValue resValue = null;
-    
+
                     // look for the value in the defStyle first (and its parent if needed)
                     if (defStyleValues != null) {
                         resValue = findItemInStyle(defStyleValues, name);
                     }
-                    
+
                     // if the item is not present in the defStyle, we look in the main theme (and
                     // its parent themes)
                     if (resValue == null && mThemeValues != null) {
                         resValue = findItemInStyle(mThemeValues, name);
                     }
-    
+
                     // if we found a value, we make sure this doesn't reference another value.
                     // So we resolve it.
                     if (resValue != null) {
                         resValue = resolveResValue(resValue);
                     }
-                    
+
                     ta.bridgeSetValue(index, name, resValue);
                 } else {
                     // there is a value in the XML, but we need to resolve it in case it's
@@ -328,15 +328,20 @@
                 }
             }
         }
-        
+
         ta.sealArray();
-        
+
         return ta;
     }
-    
-    
+
+    @Override
+    public Looper getMainLooper() {
+        return Looper.myLooper();
+    }
+
+
     // ------------- private new methods
-    
+
     /**
      * Creates a {@link BridgeTypedArray} by filling the values defined by the int[] with the
      * values found in the given style.
@@ -345,30 +350,30 @@
     private BridgeTypedArray createStyleBasedTypedArray(IStyleResourceValue style, int[] attrs)
             throws Resources.NotFoundException {
         TreeMap<Integer, String> styleNameMap = searchAttrs(attrs, null);
-        
+
         BridgeTypedArray ta = ((BridgeResources) mResources).newTypeArray(attrs.length,
                 false /* platformResourceFlag */);
-        
+
         // loop through all the values in the style map, and init the TypedArray with
         // the style we got from the dynamic id
         for (Entry<Integer, String> styleAttribute : styleNameMap.entrySet()) {
             int index = styleAttribute.getKey().intValue();
 
             String name = styleAttribute.getValue();
-            
+
             // get the value from the style, or its parent styles.
             IResourceValue resValue = findItemInStyle(style, name);
-            
+
             // resolve it to make sure there are no references left.
             ta.bridgeSetValue(index, name, resolveResValue(resValue));
         }
-        
+
         ta.sealArray();
 
         return ta;
     }
 
-    
+
     /**
      * Resolves the value of a resource, if the value references a theme or resource value.
      * <p/>
@@ -391,13 +396,13 @@
 
         // get the IResourceValue referenced by this value
         IResourceValue resValue = findResValue(value);
-        
+
         // if resValue is null, but value is not null, this means it was not a reference.
         // we return the name/value wrapper in a IResourceValue
         if (resValue == null) {
             return new ResourceValue(type, name, value);
         }
-        
+
         // we resolved a first reference, but we need to make sure this isn't a reference also.
         return resolveResValue(resValue);
     }
@@ -411,7 +416,7 @@
      * <p/>
      * If a value that does not need to be resolved is given, the method will return the input
      * value.
-     * 
+     *
      * @param value the value containing the reference to resolve.
      * @return a {@link IResourceValue} object or <code>null</code>
      */
@@ -419,7 +424,7 @@
         if (value == null) {
             return null;
         }
-        
+
         // if the resource value is a style, we simply return it.
         if (value instanceof IStyleResourceValue) {
             return value;
@@ -436,7 +441,7 @@
         // otherwise, we attempt to resolve this new value as well
         return resolveResValue(resolvedValue);
     }
-    
+
     /**
      * Searches for, and returns a {@link IResourceValue} by its reference.
      * <p/>
@@ -451,7 +456,7 @@
      * <p/>
      * The actual format of a reference is <pre>@[namespace:]resType/resName</pre> but this method
      * only support the android namespace.
-     * 
+     *
      * @param reference the resource reference to search for.
      * @return a {@link IResourceValue} or <code>null</code>.
      */
@@ -481,7 +486,7 @@
 
             // we look for the referenced item name.
             String referenceName = null;
-            
+
             if (segments.length == 2) {
                 // there was a resType in the reference. If it's attr, we ignore it
                 // else, we assert for now.
@@ -495,7 +500,7 @@
                 // it's just an item name.
                 referenceName = segments[0];
             }
-            
+
             // now we look for android: in the referenceName in order to support format
             // such as: ?attr/android:name
             if (referenceName.startsWith(BridgeConstants.PREFIX_ANDROID)) {
@@ -512,9 +517,9 @@
             return findItemInStyle(mThemeValues, referenceName);
         } else if (reference.startsWith(BridgeConstants.PREFIX_RESOURCE_REF)) {
             boolean frameworkOnly = false;
-            
+
             // check for the specific null reference value.
-            if (BridgeConstants.REFERENCE_NULL.equals(reference)) { 
+            if (BridgeConstants.REFERENCE_NULL.equals(reference)) {
                 return null;
             }
 
@@ -526,20 +531,20 @@
             } else {
                 reference = reference.substring(BridgeConstants.PREFIX_RESOURCE_REF.length());
             }
-            
+
             // at this point, value contains type/[android:]name (drawable/foo for instance)
             String[] segments = reference.split("\\/");
-            
+
             // now we look for android: in the resource name in order to support format
             // such as: @drawable/android:name
             if (segments[1].startsWith(BridgeConstants.PREFIX_ANDROID)) {
                 frameworkOnly = true;
                 segments[1] = segments[1].substring(BridgeConstants.PREFIX_ANDROID.length());
             }
-            
+
             return findResValue(segments[0], segments[1], frameworkOnly);
         }
-        
+
         // Looks like the value didn't reference anything. Return null.
         return null;
     }
@@ -565,7 +570,7 @@
                 }
             }
         }
-        
+
         // now search in the framework resources.
         typeMap = mFrameworkResources.get(resType);
         if (typeMap != null) {
@@ -574,11 +579,11 @@
                 return item;
             }
         }
-        
+
         // didn't find the resource anywhere.
         return null;
     }
-    
+
     /**
      * Returns a framework resource by type and name. The returned resource is resolved.
      * @param resourceType the type of the resource
@@ -587,7 +592,7 @@
     public IResourceValue getFrameworkResource(String resourceType, String resourceName) {
         return getResource(resourceType, resourceName, mFrameworkResources);
     }
-    
+
     /**
      * Returns a project resource by type and name. The returned resource is resolved.
      * @param resourceType the type of the resource
@@ -596,7 +601,7 @@
     public IResourceValue getProjectResource(String resourceType, String resourceName) {
         return getResource(resourceType, resourceName, mProjectResources);
     }
-    
+
     IResourceValue getResource(String resourceType, String resourceName,
             Map<String, Map<String, IResourceValue>> resourceRepository) {
         Map<String, IResourceValue> typeMap = resourceRepository.get(resourceType);
@@ -607,12 +612,12 @@
                 return item;
             }
         }
-        
+
         // didn't find the resource anywhere.
         return null;
-        
+
     }
-    
+
     /**
      * Returns the {@link IResourceValue} matching a given name in a given style. If the
      * item is not directly available in the style, the method looks in its parent style.
@@ -622,7 +627,7 @@
      */
     IResourceValue findItemInStyle(IStyleResourceValue style, String itemName) {
         IResourceValue item = style.findItem(itemName);
-        
+
         // if we didn't find it, we look in the parent style (if applicable)
         if (item == null && mStyleInheritanceMap != null) {
             IStyleResourceValue parentStyle = mStyleInheritanceMap.get(style);
@@ -630,7 +635,7 @@
                 return findItemInStyle(parentStyle, itemName);
             }
         }
-        
+
         return item;
     }
 
@@ -642,7 +647,7 @@
      * attrs == com.android.internal.R.styleable.View, this returns the list of the "xyz" where
      * there's a field com.android.internal.R.styleable.View_xyz and the field value is the index
      * that is used to reference the attribute later in the TypedArray.
-     * 
+     *
      * @param attrs An attribute array reference given to obtainStyledAttributes.
      * @return A sorted map Attribute-Value to Attribute-Name for all attributes declared by the
      *         attribute array. Returns null if nothing is found.
@@ -662,14 +667,14 @@
                     attributes.put(i, null);
                 }
             }
-            
+
             if (outFrameworkFlag != null) {
                 outFrameworkFlag[0] = true;
             }
-            
+
             return attributes;
         }
-        
+
         // if the name was not found in the framework resources, look in the project
         // resources
         arrayName = mProjectCallback.resolveResourceValue(attrs);
@@ -697,7 +702,7 @@
 
     /**
      * Searches for the attribute referenced by its internal id.
-     * 
+     *
      * @param attr An attribute reference given to obtainStyledAttributes such as defStyle.
      * @return The unique name of the attribute, if found, e.g. "buttonStyle". Returns null
      *         if nothing is found.
@@ -707,12 +712,12 @@
         if (info != null) {
             return info[0];
         }
-        
+
         info = mProjectCallback.resolveResourceValue(attr);
         if (info != null) {
             return info[0];
         }
-        
+
         return null;
     }
 
@@ -722,27 +727,27 @@
             mDynamicIdToStyleMap = new HashMap<Integer, IStyleResourceValue>();
             mStyleToDynamicIdMap = new HashMap<IStyleResourceValue, Integer>();
         }
-        
+
         // look for an existing id
         Integer id = mStyleToDynamicIdMap.get(resValue);
-        
+
         if (id == null) {
             // generate a new id
             id = Integer.valueOf(++mDynamicIdGenerator);
-            
+
             // and add it to the maps.
             mDynamicIdToStyleMap.put(id, resValue);
             mStyleToDynamicIdMap.put(resValue, id);
         }
-        
+
         return id;
     }
-    
+
     private IStyleResourceValue getStyleByDynamicId(int i) {
         if (mDynamicIdToStyleMap != null) {
             return mDynamicIdToStyleMap.get(i);
         }
-   
+
         return null;
     }
 
@@ -751,10 +756,10 @@
         if (value != null) {
             return value.intValue();
         }
-        
+
         return defValue;
     }
-    
+
     int getProjectIdValue(String idName, int defValue) {
         if (mProjectCallback != null) {
             Integer value = mProjectCallback.getResourceValue(BridgeConstants.RES_ID, idName);
@@ -762,7 +767,7 @@
                 return value.intValue();
             }
         }
-        
+
         return defValue;
     }
 
@@ -820,7 +825,7 @@
     @Override
     public void clearWallpaper() {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
@@ -850,46 +855,46 @@
     @Override
     public void enforceCallingOrSelfPermission(String arg0, String arg1) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
     public void enforceCallingOrSelfUriPermission(Uri arg0, int arg1,
             String arg2) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
     public void enforceCallingPermission(String arg0, String arg1) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
     public void enforceCallingUriPermission(Uri arg0, int arg1, String arg2) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
     public void enforcePermission(String arg0, int arg1, int arg2, String arg3) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
     public void enforceUriPermission(Uri arg0, int arg1, int arg2, int arg3,
             String arg4) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
     public void enforceUriPermission(Uri arg0, String arg1, String arg2,
             int arg3, int arg4, int arg5, String arg6) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
@@ -965,7 +970,7 @@
         // TODO Auto-generated method stub
         return null;
     }
-    
+
     @Override
     public String getPackageResourcePath() {
         // TODO Auto-generated method stub
@@ -1003,7 +1008,7 @@
     @Override
     public void grantUriPermission(String arg0, Uri arg1, int arg2) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @SuppressWarnings("unused")
@@ -1051,31 +1056,31 @@
     @Override
     public void removeStickyBroadcast(Intent arg0) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
     public void revokeUriPermission(Uri arg0, int arg1) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
     public void sendBroadcast(Intent arg0) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
     public void sendBroadcast(Intent arg0, String arg1) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
     public void sendOrderedBroadcast(Intent arg0, String arg1) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
@@ -1083,39 +1088,39 @@
             BroadcastReceiver arg2, Handler arg3, int arg4, String arg5,
             Bundle arg6) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
     public void sendStickyBroadcast(Intent arg0) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
     public void setTheme(int arg0) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @SuppressWarnings("unused")
     @Override
     public void setWallpaper(Bitmap arg0) throws IOException {
         // TODO Auto-generated method stub
-        
+
     }
 
     @SuppressWarnings("unused")
     @Override
     public void setWallpaper(InputStream arg0) throws IOException {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
     public void startActivity(Intent arg0) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
@@ -1140,21 +1145,16 @@
     @Override
     public void unbindService(ServiceConnection arg0) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
     public void unregisterReceiver(BroadcastReceiver arg0) {
         // TODO Auto-generated method stub
-        
+
     }
 
     @Override
-    public Looper getMainLooper() {
-        throw new UnsupportedOperationException();
-    }
-    
-    @Override
     public Context getApplicationContext() {
         throw new UnsupportedOperationException();
     }
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeResources.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeResources.java
index 0bcc7fd..8a040e41 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeResources.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeResources.java
@@ -43,14 +43,14 @@
 import java.io.InputStream;
 
 /**
- * 
+ *
  */
 public final class BridgeResources extends Resources {
 
     private BridgeContext mContext;
     private IProjectCallback mProjectCallback;
     private boolean[] mPlatformResourceFlag = new boolean[1];
-    
+
     /**
      * This initializes the static field {@link Resources#mSystem} which is used
      * by methods who get global resources using {@link Resources#getSystem()}.
@@ -59,7 +59,7 @@
      * <p/>
      * {@link Bridge} calls this method after setting up a new bridge.
      */
-    /*package*/ static Resources initSystem(BridgeContext context, 
+    /*package*/ static Resources initSystem(BridgeContext context,
             AssetManager assets,
             DisplayMetrics metrics,
             Configuration config,
@@ -73,7 +73,7 @@
         }
         return Resources.mSystem;
     }
-    
+
     /**
      * Clears the static {@link Resources#mSystem} to make sure we don't leave objects
      * around that would prevent us from unloading the library.
@@ -92,15 +92,15 @@
         mContext = context;
         mProjectCallback = projectCallback;
     }
-    
+
     public BridgeTypedArray newTypeArray(int numEntries, boolean platformFile) {
         return new BridgeTypedArray(this, mContext, numEntries, platformFile);
     }
-    
+
     private IResourceValue getResourceValue(int id, boolean[] platformResFlag_out) {
         // first get the String related to this id in the framework
         String[] resourceInfo = Bridge.resolveResourceValue(id);
-        
+
         if (resourceInfo != null) {
             platformResFlag_out[0] = true;
             return mContext.getFrameworkResource(resourceInfo[1], resourceInfo[0]);
@@ -109,7 +109,7 @@
         // didn't find a match in the framework? look in the project.
         if (mProjectCallback != null) {
             resourceInfo = mProjectCallback.resolveResourceValue(id);
-            
+
             if (resourceInfo != null) {
                 platformResFlag_out[0] = false;
                 return mContext.getProjectResource(resourceInfo[1], resourceInfo[0]);
@@ -118,26 +118,26 @@
 
         return null;
     }
-    
+
     @Override
     public Drawable getDrawable(int id) throws NotFoundException {
         IResourceValue value = getResourceValue(id, mPlatformResourceFlag);
-        
+
         if (value != null) {
             return ResourceHelper.getDrawable(value.getValue(), mContext, value.isFramework());
         }
-        
+
         // id was not found or not resolved. Throw a NotFoundException.
         throwException(id);
-        
+
         // this is not used since the method above always throws
         return null;
     }
-    
+
     @Override
     public int getColor(int id) throws NotFoundException {
         IResourceValue value = getResourceValue(id, mPlatformResourceFlag);
-        
+
         if (value != null) {
             try {
                 return ResourceHelper.getColor(value.getValue());
@@ -145,18 +145,18 @@
                 return 0;
             }
         }
-        
+
         // id was not found or not resolved. Throw a NotFoundException.
         throwException(id);
-        
+
         // this is not used since the method above always throws
         return 0;
     }
-    
+
     @Override
     public ColorStateList getColorStateList(int id) throws NotFoundException {
         IResourceValue value = getResourceValue(id, mPlatformResourceFlag);
-        
+
         if (value != null) {
             try {
                 int color = ResourceHelper.getColor(value.getValue());
@@ -165,33 +165,33 @@
                 return null;
             }
         }
-        
+
         // id was not found or not resolved. Throw a NotFoundException.
         throwException(id);
-        
+
         // this is not used since the method above always throws
         return null;
     }
-    
+
     @Override
     public CharSequence getText(int id) throws NotFoundException {
         IResourceValue value = getResourceValue(id, mPlatformResourceFlag);
-        
+
         if (value != null) {
             return value.getValue();
         }
-        
+
         // id was not found or not resolved. Throw a NotFoundException.
         throwException(id);
-        
+
         // this is not used since the method above always throws
         return null;
     }
-    
+
     @Override
     public XmlResourceParser getLayout(int id) throws NotFoundException {
         IResourceValue value = getResourceValue(id, mPlatformResourceFlag);
-        
+
         if (value != null) {
             File xml = new File(value.getValue());
             if (xml.isFile()) {
@@ -201,7 +201,7 @@
                     KXmlParser parser = new KXmlParser();
                     parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
                     parser.setInput(new FileReader(xml));
-                    
+
                     return new BridgeXmlBlockParser(parser, mContext, mPlatformResourceFlag[0]);
                 } catch (XmlPullParserException e) {
                     mContext.getLogger().error(e);
@@ -215,22 +215,22 @@
 
         // id was not found or not resolved. Throw a NotFoundException.
         throwException(id);
-        
+
         // this is not used since the method above always throws
         return null;
     }
-    
+
     @Override
     public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
         return mContext.obtainStyledAttributes(set, attrs);
     }
-    
+
     @Override
     public TypedArray obtainTypedArray(int id) throws NotFoundException {
         throw new UnsupportedOperationException();
     }
-    
-    
+
+
     @Override
     public float getDimension(int id) throws NotFoundException {
         IResourceValue value = getResourceValue(id, mPlatformResourceFlag);
@@ -244,7 +244,7 @@
                 } else if (v.equals(BridgeConstants.WRAP_CONTENT)) {
                     return LayoutParams.WRAP_CONTENT;
                 }
-            
+
                 if (ResourceHelper.stringToFloat(v, mTmpValue) &&
                         mTmpValue.type == TypedValue.TYPE_DIMENSION) {
                     return mTmpValue.getDimension(mMetrics);
@@ -254,7 +254,7 @@
 
         // id was not found or not resolved. Throw a NotFoundException.
         throwException(id);
-        
+
         // this is not used since the method above always throws
         return 0;
     }
@@ -276,7 +276,7 @@
 
         // id was not found or not resolved. Throw a NotFoundException.
         throwException(id);
-        
+
         // this is not used since the method above always throws
         return 0;
     }
@@ -298,7 +298,7 @@
 
         // id was not found or not resolved. Throw a NotFoundException.
         throwException(id);
-        
+
         // this is not used since the method above always throws
         return 0;
     }
@@ -306,7 +306,7 @@
     @Override
     public int getInteger(int id) throws NotFoundException {
         IResourceValue value = getResourceValue(id, mPlatformResourceFlag);
-        
+
         if (value != null && value.getValue() != null) {
             String v = value.getValue();
             int radix = 10;
@@ -320,10 +320,10 @@
                 // return exception below
             }
         }
-        
+
         // id was not found or not resolved. Throw a NotFoundException.
         throwException(id);
-        
+
         // this is not used since the method above always throws
         return 0;
     }
@@ -348,12 +348,12 @@
         String s = getString(id);
         if (s != null) {
             return String.format(s, formatArgs);
-            
+
         }
 
         // id was not found or not resolved. Throw a NotFoundException.
         throwException(id);
-        
+
         // this is not used since the method above always throws
         return null;
     }
@@ -361,14 +361,14 @@
     @Override
     public String getString(int id) throws NotFoundException {
         IResourceValue value = getResourceValue(id, mPlatformResourceFlag);
-        
+
         if (value != null && value.getValue() != null) {
             return value.getValue();
         }
 
         // id was not found or not resolved. Throw a NotFoundException.
         throwException(id);
-        
+
         // this is not used since the method above always throws
         return null;
     }
@@ -385,6 +385,11 @@
                 if (ResourceHelper.stringToFloat(v, outValue)) {
                     return;
                 }
+
+                // else it's a string
+                outValue.type = TypedValue.TYPE_STRING;
+                outValue.string = v;
+                return;
             }
         }
 
@@ -413,7 +418,7 @@
                         KXmlParser parser = new KXmlParser();
                         parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
                         parser.setInput(new FileReader(f));
-                        
+
                         return new BridgeXmlBlockParser(parser, mContext, mPlatformResourceFlag[0]);
                     } catch (XmlPullParserException e) {
                         NotFoundException newE = new NotFoundException();
@@ -436,6 +441,33 @@
     }
 
     @Override
+    public XmlResourceParser loadXmlResourceParser(String file, int id,
+            int assetCookie, String type) throws NotFoundException {
+        // even though we know the XML file to load directly, we still need to resolve the
+        // id so that we can know if it's a platform or project resource.
+        // (mPlatformResouceFlag will get the result and will be used later).
+        getResourceValue(id, mPlatformResourceFlag);
+
+        File f = new File(file);
+        try {
+            KXmlParser parser = new KXmlParser();
+            parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true);
+            parser.setInput(new FileReader(f));
+
+            return new BridgeXmlBlockParser(parser, mContext, mPlatformResourceFlag[0]);
+        } catch (XmlPullParserException e) {
+            NotFoundException newE = new NotFoundException();
+            newE.initCause(e);
+            throw newE;
+        } catch (FileNotFoundException e) {
+            NotFoundException newE = new NotFoundException();
+            newE.initCause(e);
+            throw newE;
+        }
+    }
+
+
+    @Override
     public InputStream openRawResource(int id) throws NotFoundException {
         IResourceValue value = getResourceValue(id, mPlatformResourceFlag);
 
@@ -482,7 +514,7 @@
         if (resourceInfo == null && mProjectCallback != null) {
             resourceInfo = mProjectCallback.resolveResourceValue(id);
         }
-        
+
         String message = null;
         if (resourceInfo != null) {
             message = String.format(
@@ -492,7 +524,7 @@
             message = String.format(
                     "Could not resolve resource value: 0x%1$X.", id);
         }
-        
+
         throw new NotFoundException(message);
     }
 }
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/NinePatchDrawable.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/NinePatchDrawable.java
index 5f0852e..abbf2f0 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/NinePatchDrawable.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/NinePatchDrawable.java
@@ -30,17 +30,17 @@
     NinePatchDrawable(NinePatch ninePatch) {
         m9Patch = ninePatch;
     }
-    
+
     @Override
     public int getMinimumWidth() {
         return m9Patch.getWidth();
     }
-    
+
     @Override
     public int getMinimumHeight() {
         return m9Patch.getHeight();
     }
-    
+
     /**
      * Return the intrinsic width of the underlying drawable object.  Returns
      * -1 if it has no intrinsic width, such as with a solid color.
@@ -58,7 +58,7 @@
     public int getIntrinsicHeight() {
         return m9Patch.getHeight();
     }
-    
+
     /**
      * Return in padding the insets suggested by this Drawable for placing
      * content inside the drawable's bounds. Positive values move toward the
@@ -76,24 +76,18 @@
         padding.bottom = padd[3];
         return true;
     }
-    
+
     @Override
     public void draw(Canvas canvas) {
-        if (canvas instanceof BridgeCanvas) {
-            BridgeCanvas bridgeCanvas = (BridgeCanvas)canvas;
-            
-            Rect r = getBounds();
-            m9Patch.draw(bridgeCanvas.getGraphics2d(), r.left, r.top, r.width(), r.height());
-            
-            return;
-        }
+        Rect r = getBounds();
+        m9Patch.draw(canvas.getGraphics2d(), r.left, r.top, r.width(), r.height());
 
-        throw new UnsupportedOperationException();
+        return;
     }
 
-    
+
     // ----------- Not implemented methods ---------------
-    
+
 
     @Override
     public int getOpacity() {
diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java
index 76bd8d4..47184f1 100644
--- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java
+++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/Main.java
@@ -40,7 +40,7 @@
         for (String path : osJarPath) {
             log.info("Input :      %1$s", path);
         }
-        
+
         try {
             AsmGenerator agen = new AsmGenerator(log, osDestJar[0],
                     new Class<?>[] {  // classes to inject in the final JAR
@@ -54,20 +54,23 @@
                     },
                     new String[] {  // classes to rename (so that we can replace them in layoutlib)
                         // original-platform-class-name ======> renamed-class-name
+                        "android.graphics.Bitmap",              "android.graphics._Original_Bitmap",
+                        "android.graphics.BitmapShader",        "android.graphics._Original_BitmapShader",
+                        "android.graphics.Canvas",              "android.graphics._Original_Canvas",
+                        "android.graphics.ComposeShader",       "android.graphics._Original_ComposeShader",
+                        "android.graphics.LinearGradient",      "android.graphics._Original_LinearGradient",
                         "android.graphics.Matrix",              "android.graphics._Original_Matrix",
                         "android.graphics.Paint",               "android.graphics._Original_Paint",
-                        "android.graphics.Typeface",            "android.graphics._Original_Typeface",
-                        "android.graphics.Bitmap",              "android.graphics._Original_Bitmap",
                         "android.graphics.Path",                "android.graphics._Original_Path",
                         "android.graphics.PorterDuffXfermode",  "android.graphics._Original_PorterDuffXfermode",
-                        "android.graphics.Shader",              "android.graphics._Original_Shader",
-                        "android.graphics.LinearGradient",      "android.graphics._Original_LinearGradient",
-                        "android.graphics.BitmapShader",        "android.graphics._Original_BitmapShader",
-                        "android.graphics.ComposeShader",       "android.graphics._Original_ComposeShader",
                         "android.graphics.RadialGradient",      "android.graphics._Original_RadialGradient",
+                        "android.graphics.Shader",              "android.graphics._Original_Shader",
                         "android.graphics.SweepGradient",       "android.graphics._Original_SweepGradient",
+                        "android.graphics.Typeface",            "android.graphics._Original_Typeface",
+                        "android.os.ServiceManager",            "android.os._Original_ServiceManager",
                         "android.util.FloatMath",               "android.util._Original_FloatMath",
                         "android.view.SurfaceView",             "android.view._Original_SurfaceView",
+                        "android.view.accessibility.AccessibilityManager", "android.view.accessibility._Original_AccessibilityManager",
                     },
                     new String[] { // methods deleted from their return type.
                         "android.graphics.Paint", // class to delete method from
@@ -101,7 +104,7 @@
                         });
             aa.analyze();
             agen.generate();
-            
+
             // Throw an error if any class failed to get renamed by the generator
             //
             // IMPORTANT: if you're building the platform and you get this error message,
@@ -123,7 +126,7 @@
                 }
                 System.exit(1);
             }
-            
+
             System.exit(0);
         } catch (IOException e) {
             log.exception(e, "Failed to load jar");
@@ -158,7 +161,7 @@
                 return false;
             }
         }
-        
+
         if (osJarPath.isEmpty()) {
             log.error("Missing parameter: path to input jar");
             return false;