diff options
81 files changed, 1996 insertions, 762 deletions
@@ -7616,6 +7616,17 @@ visibility="public" > </field> +<field name="queryHint" + type="int" + transient="false" + volatile="false" + value="16843610" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="quickContactBadgeStyleSmallWindowLarge" type="int" transient="false" @@ -14860,7 +14871,7 @@ type="int" transient="false" volatile="false" - value="16974053" + value="16974054" static="true" final="true" deprecated="not deprecated" @@ -14871,7 +14882,7 @@ type="int" transient="false" volatile="false" - value="16974055" + value="16974056" static="true" final="true" deprecated="not deprecated" @@ -14882,7 +14893,7 @@ type="int" transient="false" volatile="false" - value="16974054" + value="16974055" static="true" final="true" deprecated="not deprecated" @@ -14893,7 +14904,7 @@ type="int" transient="false" volatile="false" - value="16974056" + value="16974057" static="true" final="true" deprecated="not deprecated" @@ -14904,7 +14915,7 @@ type="int" transient="false" volatile="false" - value="16974058" + value="16974059" static="true" final="true" deprecated="not deprecated" @@ -14915,7 +14926,7 @@ type="int" transient="false" volatile="false" - value="16974057" + value="16974058" static="true" final="true" deprecated="not deprecated" @@ -15234,7 +15245,7 @@ type="int" transient="false" volatile="false" - value="16973952" + value="16973953" static="true" final="true" deprecated="not deprecated" @@ -15245,7 +15256,7 @@ type="int" transient="false" volatile="false" - value="16973953" + value="16973954" static="true" final="true" deprecated="not deprecated" @@ -15439,6 +15450,17 @@ visibility="public" > </field> +<field name="Theme_Holo_InputMethod" + type="int" + transient="false" + volatile="false" + value="16973952" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="Theme_Holo_Light" type="int" transient="false" @@ -15828,7 +15850,7 @@ type="int" transient="false" volatile="false" - value="16973954" + value="16973955" static="true" final="true" deprecated="not deprecated" @@ -15839,7 +15861,7 @@ type="int" transient="false" volatile="false" - value="16973956" + value="16973957" static="true" final="true" deprecated="not deprecated" @@ -15850,7 +15872,7 @@ type="int" transient="false" volatile="false" - value="16973960" + value="16973961" static="true" final="true" deprecated="not deprecated" @@ -15861,7 +15883,7 @@ type="int" transient="false" volatile="false" - value="16973959" + value="16973960" static="true" final="true" deprecated="not deprecated" @@ -15927,7 +15949,7 @@ type="int" transient="false" volatile="false" - value="16974068" + value="16974069" static="true" final="true" deprecated="not deprecated" @@ -16015,7 +16037,7 @@ type="int" transient="false" volatile="false" - value="16974060" + value="16974061" static="true" final="true" deprecated="not deprecated" @@ -16037,7 +16059,7 @@ type="int" transient="false" volatile="false" - value="16973961" + value="16973962" static="true" final="true" deprecated="not deprecated" @@ -16070,7 +16092,7 @@ type="int" transient="false" volatile="false" - value="16973962" + value="16973963" static="true" final="true" deprecated="not deprecated" @@ -16081,7 +16103,7 @@ type="int" transient="false" volatile="false" - value="16974004" + value="16974005" static="true" final="true" deprecated="not deprecated" @@ -16092,7 +16114,7 @@ type="int" transient="false" volatile="false" - value="16973999" + value="16974000" static="true" final="true" deprecated="not deprecated" @@ -16103,7 +16125,7 @@ type="int" transient="false" volatile="false" - value="16974003" + value="16974004" static="true" final="true" deprecated="not deprecated" @@ -16114,7 +16136,7 @@ type="int" transient="false" volatile="false" - value="16974000" + value="16974001" static="true" final="true" deprecated="not deprecated" @@ -16125,7 +16147,7 @@ type="int" transient="false" volatile="false" - value="16974001" + value="16974002" static="true" final="true" deprecated="not deprecated" @@ -16136,7 +16158,7 @@ type="int" transient="false" volatile="false" - value="16974002" + value="16974003" static="true" final="true" deprecated="not deprecated" @@ -16147,7 +16169,7 @@ type="int" transient="false" volatile="false" - value="16973968" + value="16973969" static="true" final="true" deprecated="not deprecated" @@ -16158,7 +16180,7 @@ type="int" transient="false" volatile="false" - value="16973963" + value="16973964" static="true" final="true" deprecated="not deprecated" @@ -16169,7 +16191,7 @@ type="int" transient="false" volatile="false" - value="16974050" + value="16974051" static="true" final="true" deprecated="not deprecated" @@ -16180,7 +16202,7 @@ type="int" transient="false" volatile="false" - value="16973965" + value="16973966" static="true" final="true" deprecated="not deprecated" @@ -16191,7 +16213,7 @@ type="int" transient="false" volatile="false" - value="16973964" + value="16973965" static="true" final="true" deprecated="not deprecated" @@ -16202,7 +16224,7 @@ type="int" transient="false" volatile="false" - value="16973966" + value="16973967" static="true" final="true" deprecated="not deprecated" @@ -16213,7 +16235,7 @@ type="int" transient="false" volatile="false" - value="16974069" + value="16974070" static="true" final="true" deprecated="not deprecated" @@ -16224,7 +16246,7 @@ type="int" transient="false" volatile="false" - value="16973969" + value="16973970" static="true" final="true" deprecated="not deprecated" @@ -16235,7 +16257,7 @@ type="int" transient="false" volatile="false" - value="16973986" + value="16973987" static="true" final="true" deprecated="not deprecated" @@ -16246,7 +16268,7 @@ type="int" transient="false" volatile="false" - value="16973990" + value="16973991" static="true" final="true" deprecated="not deprecated" @@ -16257,7 +16279,7 @@ type="int" transient="false" volatile="false" - value="16973994" + value="16973995" static="true" final="true" deprecated="not deprecated" @@ -16268,7 +16290,7 @@ type="int" transient="false" volatile="false" - value="16973995" + value="16973996" static="true" final="true" deprecated="not deprecated" @@ -16279,7 +16301,7 @@ type="int" transient="false" volatile="false" - value="16973971" + value="16973972" static="true" final="true" deprecated="not deprecated" @@ -16290,7 +16312,7 @@ type="int" transient="false" volatile="false" - value="16974063" + value="16974064" static="true" final="true" deprecated="not deprecated" @@ -16301,7 +16323,7 @@ type="int" transient="false" volatile="false" - value="16973972" + value="16973973" static="true" final="true" deprecated="not deprecated" @@ -16312,7 +16334,7 @@ type="int" transient="false" volatile="false" - value="16973973" + value="16973974" static="true" final="true" deprecated="not deprecated" @@ -16323,7 +16345,7 @@ type="int" transient="false" volatile="false" - value="16973988" + value="16973989" static="true" final="true" deprecated="not deprecated" @@ -16334,7 +16356,7 @@ type="int" transient="false" volatile="false" - value="16973974" + value="16973975" static="true" final="true" deprecated="not deprecated" @@ -16345,7 +16367,7 @@ type="int" transient="false" volatile="false" - value="16974064" + value="16974065" static="true" final="true" deprecated="not deprecated" @@ -16356,7 +16378,7 @@ type="int" transient="false" volatile="false" - value="16974062" + value="16974063" static="true" final="true" deprecated="not deprecated" @@ -16367,7 +16389,7 @@ type="int" transient="false" volatile="false" - value="16974005" + value="16974006" static="true" final="true" deprecated="not deprecated" @@ -16378,7 +16400,7 @@ type="int" transient="false" volatile="false" - value="16974049" + value="16974050" static="true" final="true" deprecated="not deprecated" @@ -16389,7 +16411,7 @@ type="int" transient="false" volatile="false" - value="16974045" + value="16974046" static="true" final="true" deprecated="not deprecated" @@ -16400,7 +16422,7 @@ type="int" transient="false" volatile="false" - value="16974048" + value="16974049" static="true" final="true" deprecated="not deprecated" @@ -16411,7 +16433,7 @@ type="int" transient="false" volatile="false" - value="16974046" + value="16974047" static="true" final="true" deprecated="not deprecated" @@ -16422,7 +16444,7 @@ type="int" transient="false" volatile="false" - value="16974047" + value="16974048" static="true" final="true" deprecated="not deprecated" @@ -16433,7 +16455,7 @@ type="int" transient="false" volatile="false" - value="16974011" + value="16974012" static="true" final="true" deprecated="not deprecated" @@ -16444,7 +16466,7 @@ type="int" transient="false" volatile="false" - value="16974006" + value="16974007" static="true" final="true" deprecated="not deprecated" @@ -16455,7 +16477,7 @@ type="int" transient="false" volatile="false" - value="16974008" + value="16974009" static="true" final="true" deprecated="not deprecated" @@ -16466,7 +16488,7 @@ type="int" transient="false" volatile="false" - value="16974007" + value="16974008" static="true" final="true" deprecated="not deprecated" @@ -16477,7 +16499,7 @@ type="int" transient="false" volatile="false" - value="16974009" + value="16974010" static="true" final="true" deprecated="not deprecated" @@ -16488,7 +16510,7 @@ type="int" transient="false" volatile="false" - value="16974070" + value="16974071" static="true" final="true" deprecated="not deprecated" @@ -16499,7 +16521,7 @@ type="int" transient="false" volatile="false" - value="16974012" + value="16974013" static="true" final="true" deprecated="not deprecated" @@ -16510,7 +16532,7 @@ type="int" transient="false" volatile="false" - value="16974032" + value="16974033" static="true" final="true" deprecated="not deprecated" @@ -16521,7 +16543,7 @@ type="int" transient="false" volatile="false" - value="16974036" + value="16974037" static="true" final="true" deprecated="not deprecated" @@ -16532,7 +16554,7 @@ type="int" transient="false" volatile="false" - value="16974040" + value="16974041" static="true" final="true" deprecated="not deprecated" @@ -16543,7 +16565,7 @@ type="int" transient="false" volatile="false" - value="16974041" + value="16974042" static="true" final="true" deprecated="not deprecated" @@ -16554,7 +16576,7 @@ type="int" transient="false" volatile="false" - value="16974014" + value="16974015" static="true" final="true" deprecated="not deprecated" @@ -16565,7 +16587,7 @@ type="int" transient="false" volatile="false" - value="16974066" + value="16974067" static="true" final="true" deprecated="not deprecated" @@ -16576,7 +16598,7 @@ type="int" transient="false" volatile="false" - value="16974015" + value="16974016" static="true" final="true" deprecated="not deprecated" @@ -16587,7 +16609,7 @@ type="int" transient="false" volatile="false" - value="16974016" + value="16974017" static="true" final="true" deprecated="not deprecated" @@ -16598,7 +16620,7 @@ type="int" transient="false" volatile="false" - value="16974034" + value="16974035" static="true" final="true" deprecated="not deprecated" @@ -16609,7 +16631,7 @@ type="int" transient="false" volatile="false" - value="16974017" + value="16974018" static="true" final="true" deprecated="not deprecated" @@ -16620,7 +16642,7 @@ type="int" transient="false" volatile="false" - value="16974067" + value="16974068" static="true" final="true" deprecated="not deprecated" @@ -16631,7 +16653,7 @@ type="int" transient="false" volatile="false" - value="16974065" + value="16974066" static="true" final="true" deprecated="not deprecated" @@ -16642,7 +16664,7 @@ type="int" transient="false" volatile="false" - value="16974043" + value="16974044" static="true" final="true" deprecated="not deprecated" @@ -16653,7 +16675,7 @@ type="int" transient="false" volatile="false" - value="16974018" + value="16974019" static="true" final="true" deprecated="not deprecated" @@ -16664,7 +16686,7 @@ type="int" transient="false" volatile="false" - value="16974013" + value="16974014" static="true" final="true" deprecated="not deprecated" @@ -16675,7 +16697,7 @@ type="int" transient="false" volatile="false" - value="16974044" + value="16974045" static="true" final="true" deprecated="not deprecated" @@ -16686,7 +16708,7 @@ type="int" transient="false" volatile="false" - value="16974019" + value="16974020" static="true" final="true" deprecated="not deprecated" @@ -16697,7 +16719,7 @@ type="int" transient="false" volatile="false" - value="16974020" + value="16974021" static="true" final="true" deprecated="not deprecated" @@ -16708,7 +16730,7 @@ type="int" transient="false" volatile="false" - value="16974021" + value="16974022" static="true" final="true" deprecated="not deprecated" @@ -16719,7 +16741,7 @@ type="int" transient="false" volatile="false" - value="16974025" + value="16974026" static="true" final="true" deprecated="not deprecated" @@ -16730,7 +16752,7 @@ type="int" transient="false" volatile="false" - value="16974024" + value="16974025" static="true" final="true" deprecated="not deprecated" @@ -16741,7 +16763,7 @@ type="int" transient="false" volatile="false" - value="16974027" + value="16974028" static="true" final="true" deprecated="not deprecated" @@ -16752,7 +16774,7 @@ type="int" transient="false" volatile="false" - value="16974022" + value="16974023" static="true" final="true" deprecated="not deprecated" @@ -16763,7 +16785,7 @@ type="int" transient="false" volatile="false" - value="16974026" + value="16974027" static="true" final="true" deprecated="not deprecated" @@ -16774,7 +16796,7 @@ type="int" transient="false" volatile="false" - value="16974023" + value="16974024" static="true" final="true" deprecated="not deprecated" @@ -16785,7 +16807,7 @@ type="int" transient="false" volatile="false" - value="16974029" + value="16974030" static="true" final="true" deprecated="not deprecated" @@ -16796,7 +16818,7 @@ type="int" transient="false" volatile="false" - value="16974030" + value="16974031" static="true" final="true" deprecated="not deprecated" @@ -16807,7 +16829,7 @@ type="int" transient="false" volatile="false" - value="16974031" + value="16974032" static="true" final="true" deprecated="not deprecated" @@ -16818,7 +16840,7 @@ type="int" transient="false" volatile="false" - value="16974033" + value="16974034" static="true" final="true" deprecated="not deprecated" @@ -16829,7 +16851,7 @@ type="int" transient="false" volatile="false" - value="16974028" + value="16974029" static="true" final="true" deprecated="not deprecated" @@ -16840,7 +16862,7 @@ type="int" transient="false" volatile="false" - value="16974035" + value="16974036" static="true" final="true" deprecated="not deprecated" @@ -16851,7 +16873,7 @@ type="int" transient="false" volatile="false" - value="16974052" + value="16974053" static="true" final="true" deprecated="not deprecated" @@ -16862,7 +16884,7 @@ type="int" transient="false" volatile="false" - value="16974037" + value="16974038" static="true" final="true" deprecated="not deprecated" @@ -16873,7 +16895,7 @@ type="int" transient="false" volatile="false" - value="16974010" + value="16974011" static="true" final="true" deprecated="not deprecated" @@ -16884,7 +16906,7 @@ type="int" transient="false" volatile="false" - value="16974042" + value="16974043" static="true" final="true" deprecated="not deprecated" @@ -16895,7 +16917,7 @@ type="int" transient="false" volatile="false" - value="16974038" + value="16974039" static="true" final="true" deprecated="not deprecated" @@ -16906,7 +16928,7 @@ type="int" transient="false" volatile="false" - value="16974039" + value="16974040" static="true" final="true" deprecated="not deprecated" @@ -16917,7 +16939,7 @@ type="int" transient="false" volatile="false" - value="16973997" + value="16973998" static="true" final="true" deprecated="not deprecated" @@ -16928,7 +16950,7 @@ type="int" transient="false" volatile="false" - value="16973975" + value="16973976" static="true" final="true" deprecated="not deprecated" @@ -16939,7 +16961,7 @@ type="int" transient="false" volatile="false" - value="16973970" + value="16973971" static="true" final="true" deprecated="not deprecated" @@ -16950,7 +16972,7 @@ type="int" transient="false" volatile="false" - value="16973998" + value="16973999" static="true" final="true" deprecated="not deprecated" @@ -16961,7 +16983,7 @@ type="int" transient="false" volatile="false" - value="16973976" + value="16973977" static="true" final="true" deprecated="not deprecated" @@ -16972,7 +16994,7 @@ type="int" transient="false" volatile="false" - value="16973977" + value="16973978" static="true" final="true" deprecated="not deprecated" @@ -16983,7 +17005,7 @@ type="int" transient="false" volatile="false" - value="16973978" + value="16973979" static="true" final="true" deprecated="not deprecated" @@ -16994,7 +17016,7 @@ type="int" transient="false" volatile="false" - value="16973981" + value="16973982" static="true" final="true" deprecated="not deprecated" @@ -17005,7 +17027,7 @@ type="int" transient="false" volatile="false" - value="16973979" + value="16973980" static="true" final="true" deprecated="not deprecated" @@ -17016,7 +17038,7 @@ type="int" transient="false" volatile="false" - value="16973980" + value="16973981" static="true" final="true" deprecated="not deprecated" @@ -17027,7 +17049,7 @@ type="int" transient="false" volatile="false" - value="16973983" + value="16973984" static="true" final="true" deprecated="not deprecated" @@ -17038,7 +17060,7 @@ type="int" transient="false" volatile="false" - value="16973984" + value="16973985" static="true" final="true" deprecated="not deprecated" @@ -17049,7 +17071,7 @@ type="int" transient="false" volatile="false" - value="16973985" + value="16973986" static="true" final="true" deprecated="not deprecated" @@ -17060,7 +17082,7 @@ type="int" transient="false" volatile="false" - value="16973987" + value="16973988" static="true" final="true" deprecated="not deprecated" @@ -17071,7 +17093,7 @@ type="int" transient="false" volatile="false" - value="16973982" + value="16973983" static="true" final="true" deprecated="not deprecated" @@ -17082,7 +17104,7 @@ type="int" transient="false" volatile="false" - value="16973989" + value="16973990" static="true" final="true" deprecated="not deprecated" @@ -17093,7 +17115,7 @@ type="int" transient="false" volatile="false" - value="16974051" + value="16974052" static="true" final="true" deprecated="not deprecated" @@ -17104,7 +17126,7 @@ type="int" transient="false" volatile="false" - value="16973991" + value="16973992" static="true" final="true" deprecated="not deprecated" @@ -17115,7 +17137,7 @@ type="int" transient="false" volatile="false" - value="16973967" + value="16973968" static="true" final="true" deprecated="not deprecated" @@ -17126,7 +17148,7 @@ type="int" transient="false" volatile="false" - value="16973996" + value="16973997" static="true" final="true" deprecated="not deprecated" @@ -17137,7 +17159,7 @@ type="int" transient="false" volatile="false" - value="16973992" + value="16973993" static="true" final="true" deprecated="not deprecated" @@ -17148,7 +17170,7 @@ type="int" transient="false" volatile="false" - value="16973993" + value="16973994" static="true" final="true" deprecated="not deprecated" @@ -17170,7 +17192,7 @@ type="int" transient="false" volatile="false" - value="16974061" + value="16974062" static="true" final="true" deprecated="not deprecated" @@ -17181,7 +17203,7 @@ type="int" transient="false" volatile="false" - value="16974059" + value="16974060" static="true" final="true" deprecated="not deprecated" @@ -17214,7 +17236,7 @@ type="int" transient="false" volatile="false" - value="16973957" + value="16973958" static="true" final="true" deprecated="not deprecated" @@ -17269,7 +17291,7 @@ type="int" transient="false" volatile="false" - value="16973958" + value="16973959" static="true" final="true" deprecated="not deprecated" @@ -17412,7 +17434,7 @@ type="int" transient="false" volatile="false" - value="16973955" + value="16973956" static="true" final="true" deprecated="not deprecated" @@ -37232,6 +37254,17 @@ visibility="public" > </field> +<field name="USES_ENCRYPTED_STORAGE" + type="int" + transient="false" + volatile="false" + value="7" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="USES_POLICY_EXPIRE_PASSWORD" type="int" transient="false" @@ -37795,6 +37828,19 @@ <parameter name="admin" type="android.content.ComponentName"> </parameter> </method> +<method name="getStorageEncryption" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="admin" type="android.content.ComponentName"> +</parameter> +</method> <method name="hasGrantedPolicy" return="boolean" abstract="false" @@ -38070,6 +38116,21 @@ <parameter name="quality" type="int"> </parameter> </method> +<method name="setStorageEncryption" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="admin" type="android.content.ComponentName"> +</parameter> +<parameter name="encrypt" type="boolean"> +</parameter> +</method> <method name="wipeData" return="void" abstract="false" @@ -38105,6 +38166,72 @@ visibility="public" > </field> +<field name="ACTION_START_ENCRYPTION" + type="java.lang.String" + transient="false" + volatile="false" + value=""android.app.action.START_ENCRYPTION"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="ENCRYPTION_STATUS_ACTIVATING" + type="int" + transient="false" + volatile="false" + value="3" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="ENCRYPTION_STATUS_ACTIVE" + type="int" + transient="false" + volatile="false" + value="4" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="ENCRYPTION_STATUS_INACTIVE" + type="int" + transient="false" + volatile="false" + value="1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="ENCRYPTION_STATUS_REQUESTED" + type="int" + transient="false" + volatile="false" + value="2" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="ENCRYPTION_STATUS_UNSUPPORTED" + type="int" + transient="false" + volatile="false" + value="0" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="EXTRA_ADD_EXPLANATION" type="java.lang.String" transient="false" @@ -86104,6 +86231,19 @@ <parameter name="texName" type="int"> </parameter> </constructor> +<method name="getTransformMatrix" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="mtx" type="float[]"> +</parameter> +</method> <method name="setOnFrameAvailableListener" return="void" abstract="false" @@ -167047,7 +167187,7 @@ </parameter> <parameter name="type" type="android.renderscript.Type"> </parameter> -<parameter name="mc" type="android.renderscript.Allocation.MipmapControl"> +<parameter name="mips" type="android.renderscript.Allocation.MipmapControl"> </parameter> <parameter name="usage" type="int"> </parameter> @@ -168910,52 +169050,6 @@ > </method> </class> -<class name="FileA3D.ClassID" - extends="java.lang.Enum" - abstract="false" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -<method name="toClassID" - return="android.renderscript.FileA3D.ClassID" - abstract="false" - native="false" - synchronized="false" - static="true" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="intID" type="int"> -</parameter> -</method> -<method name="valueOf" - return="android.renderscript.FileA3D.ClassID" - abstract="false" - native="false" - synchronized="false" - static="true" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="name" type="java.lang.String"> -</parameter> -</method> -<method name="values" - return="android.renderscript.FileA3D.ClassID[]" - abstract="false" - native="false" - synchronized="false" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</method> -</class> <class name="FileA3D.EntryType" extends="java.lang.Enum" abstract="false" @@ -168997,17 +169091,6 @@ deprecated="not deprecated" visibility="public" > -<method name="getClassID" - return="android.renderscript.FileA3D.ClassID" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getEntryType" return="android.renderscript.FileA3D.EntryType" abstract="false" @@ -260097,7 +260180,7 @@ deprecated="not deprecated" visibility="public" > -<parameter name="t" type="T"> +<parameter name="arg0" type="T"> </parameter> </method> </interface> diff --git a/api/current.xml b/api/current.xml index 0c33b8c..2a7436f 100644 --- a/api/current.xml +++ b/api/current.xml @@ -7616,6 +7616,17 @@ visibility="public" > </field> +<field name="queryHint" + type="int" + transient="false" + volatile="false" + value="16843610" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="quickContactBadgeStyleSmallWindowLarge" type="int" transient="false" @@ -14860,7 +14871,7 @@ type="int" transient="false" volatile="false" - value="16974053" + value="16974054" static="true" final="true" deprecated="not deprecated" @@ -14871,7 +14882,7 @@ type="int" transient="false" volatile="false" - value="16974055" + value="16974056" static="true" final="true" deprecated="not deprecated" @@ -14882,7 +14893,7 @@ type="int" transient="false" volatile="false" - value="16974054" + value="16974055" static="true" final="true" deprecated="not deprecated" @@ -14893,7 +14904,7 @@ type="int" transient="false" volatile="false" - value="16974056" + value="16974057" static="true" final="true" deprecated="not deprecated" @@ -14904,7 +14915,7 @@ type="int" transient="false" volatile="false" - value="16974058" + value="16974059" static="true" final="true" deprecated="not deprecated" @@ -14915,7 +14926,7 @@ type="int" transient="false" volatile="false" - value="16974057" + value="16974058" static="true" final="true" deprecated="not deprecated" @@ -15234,7 +15245,7 @@ type="int" transient="false" volatile="false" - value="16973952" + value="16973953" static="true" final="true" deprecated="not deprecated" @@ -15245,7 +15256,7 @@ type="int" transient="false" volatile="false" - value="16973953" + value="16973954" static="true" final="true" deprecated="not deprecated" @@ -15439,6 +15450,17 @@ visibility="public" > </field> +<field name="Theme_Holo_InputMethod" + type="int" + transient="false" + volatile="false" + value="16973952" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="Theme_Holo_Light" type="int" transient="false" @@ -15828,7 +15850,7 @@ type="int" transient="false" volatile="false" - value="16973954" + value="16973955" static="true" final="true" deprecated="not deprecated" @@ -15839,7 +15861,7 @@ type="int" transient="false" volatile="false" - value="16973956" + value="16973957" static="true" final="true" deprecated="not deprecated" @@ -15850,7 +15872,7 @@ type="int" transient="false" volatile="false" - value="16973960" + value="16973961" static="true" final="true" deprecated="not deprecated" @@ -15861,7 +15883,7 @@ type="int" transient="false" volatile="false" - value="16973959" + value="16973960" static="true" final="true" deprecated="not deprecated" @@ -15927,7 +15949,7 @@ type="int" transient="false" volatile="false" - value="16974068" + value="16974069" static="true" final="true" deprecated="not deprecated" @@ -16015,7 +16037,7 @@ type="int" transient="false" volatile="false" - value="16974060" + value="16974061" static="true" final="true" deprecated="not deprecated" @@ -16037,7 +16059,7 @@ type="int" transient="false" volatile="false" - value="16973961" + value="16973962" static="true" final="true" deprecated="not deprecated" @@ -16070,7 +16092,7 @@ type="int" transient="false" volatile="false" - value="16973962" + value="16973963" static="true" final="true" deprecated="not deprecated" @@ -16081,7 +16103,7 @@ type="int" transient="false" volatile="false" - value="16974004" + value="16974005" static="true" final="true" deprecated="not deprecated" @@ -16092,7 +16114,7 @@ type="int" transient="false" volatile="false" - value="16973999" + value="16974000" static="true" final="true" deprecated="not deprecated" @@ -16103,7 +16125,7 @@ type="int" transient="false" volatile="false" - value="16974003" + value="16974004" static="true" final="true" deprecated="not deprecated" @@ -16114,7 +16136,7 @@ type="int" transient="false" volatile="false" - value="16974000" + value="16974001" static="true" final="true" deprecated="not deprecated" @@ -16125,7 +16147,7 @@ type="int" transient="false" volatile="false" - value="16974001" + value="16974002" static="true" final="true" deprecated="not deprecated" @@ -16136,7 +16158,7 @@ type="int" transient="false" volatile="false" - value="16974002" + value="16974003" static="true" final="true" deprecated="not deprecated" @@ -16147,7 +16169,7 @@ type="int" transient="false" volatile="false" - value="16973968" + value="16973969" static="true" final="true" deprecated="not deprecated" @@ -16158,7 +16180,7 @@ type="int" transient="false" volatile="false" - value="16973963" + value="16973964" static="true" final="true" deprecated="not deprecated" @@ -16169,7 +16191,7 @@ type="int" transient="false" volatile="false" - value="16974050" + value="16974051" static="true" final="true" deprecated="not deprecated" @@ -16180,7 +16202,7 @@ type="int" transient="false" volatile="false" - value="16973965" + value="16973966" static="true" final="true" deprecated="not deprecated" @@ -16191,7 +16213,7 @@ type="int" transient="false" volatile="false" - value="16973964" + value="16973965" static="true" final="true" deprecated="not deprecated" @@ -16202,7 +16224,7 @@ type="int" transient="false" volatile="false" - value="16973966" + value="16973967" static="true" final="true" deprecated="not deprecated" @@ -16213,7 +16235,7 @@ type="int" transient="false" volatile="false" - value="16974069" + value="16974070" static="true" final="true" deprecated="not deprecated" @@ -16224,7 +16246,7 @@ type="int" transient="false" volatile="false" - value="16973969" + value="16973970" static="true" final="true" deprecated="not deprecated" @@ -16235,7 +16257,7 @@ type="int" transient="false" volatile="false" - value="16973986" + value="16973987" static="true" final="true" deprecated="not deprecated" @@ -16246,7 +16268,7 @@ type="int" transient="false" volatile="false" - value="16973990" + value="16973991" static="true" final="true" deprecated="not deprecated" @@ -16257,7 +16279,7 @@ type="int" transient="false" volatile="false" - value="16973994" + value="16973995" static="true" final="true" deprecated="not deprecated" @@ -16268,7 +16290,7 @@ type="int" transient="false" volatile="false" - value="16973995" + value="16973996" static="true" final="true" deprecated="not deprecated" @@ -16279,7 +16301,7 @@ type="int" transient="false" volatile="false" - value="16973971" + value="16973972" static="true" final="true" deprecated="not deprecated" @@ -16290,7 +16312,7 @@ type="int" transient="false" volatile="false" - value="16974063" + value="16974064" static="true" final="true" deprecated="not deprecated" @@ -16301,7 +16323,7 @@ type="int" transient="false" volatile="false" - value="16973972" + value="16973973" static="true" final="true" deprecated="not deprecated" @@ -16312,7 +16334,7 @@ type="int" transient="false" volatile="false" - value="16973973" + value="16973974" static="true" final="true" deprecated="not deprecated" @@ -16323,7 +16345,7 @@ type="int" transient="false" volatile="false" - value="16973988" + value="16973989" static="true" final="true" deprecated="not deprecated" @@ -16334,7 +16356,7 @@ type="int" transient="false" volatile="false" - value="16973974" + value="16973975" static="true" final="true" deprecated="not deprecated" @@ -16345,7 +16367,7 @@ type="int" transient="false" volatile="false" - value="16974064" + value="16974065" static="true" final="true" deprecated="not deprecated" @@ -16356,7 +16378,7 @@ type="int" transient="false" volatile="false" - value="16974062" + value="16974063" static="true" final="true" deprecated="not deprecated" @@ -16367,7 +16389,7 @@ type="int" transient="false" volatile="false" - value="16974005" + value="16974006" static="true" final="true" deprecated="not deprecated" @@ -16378,7 +16400,7 @@ type="int" transient="false" volatile="false" - value="16974049" + value="16974050" static="true" final="true" deprecated="not deprecated" @@ -16389,7 +16411,7 @@ type="int" transient="false" volatile="false" - value="16974045" + value="16974046" static="true" final="true" deprecated="not deprecated" @@ -16400,7 +16422,7 @@ type="int" transient="false" volatile="false" - value="16974048" + value="16974049" static="true" final="true" deprecated="not deprecated" @@ -16411,7 +16433,7 @@ type="int" transient="false" volatile="false" - value="16974046" + value="16974047" static="true" final="true" deprecated="not deprecated" @@ -16422,7 +16444,7 @@ type="int" transient="false" volatile="false" - value="16974047" + value="16974048" static="true" final="true" deprecated="not deprecated" @@ -16433,7 +16455,7 @@ type="int" transient="false" volatile="false" - value="16974011" + value="16974012" static="true" final="true" deprecated="not deprecated" @@ -16444,7 +16466,7 @@ type="int" transient="false" volatile="false" - value="16974006" + value="16974007" static="true" final="true" deprecated="not deprecated" @@ -16455,7 +16477,7 @@ type="int" transient="false" volatile="false" - value="16974008" + value="16974009" static="true" final="true" deprecated="not deprecated" @@ -16466,7 +16488,7 @@ type="int" transient="false" volatile="false" - value="16974007" + value="16974008" static="true" final="true" deprecated="not deprecated" @@ -16477,7 +16499,7 @@ type="int" transient="false" volatile="false" - value="16974009" + value="16974010" static="true" final="true" deprecated="not deprecated" @@ -16488,7 +16510,7 @@ type="int" transient="false" volatile="false" - value="16974070" + value="16974071" static="true" final="true" deprecated="not deprecated" @@ -16499,7 +16521,7 @@ type="int" transient="false" volatile="false" - value="16974012" + value="16974013" static="true" final="true" deprecated="not deprecated" @@ -16510,7 +16532,7 @@ type="int" transient="false" volatile="false" - value="16974032" + value="16974033" static="true" final="true" deprecated="not deprecated" @@ -16521,7 +16543,7 @@ type="int" transient="false" volatile="false" - value="16974036" + value="16974037" static="true" final="true" deprecated="not deprecated" @@ -16532,7 +16554,7 @@ type="int" transient="false" volatile="false" - value="16974040" + value="16974041" static="true" final="true" deprecated="not deprecated" @@ -16543,7 +16565,7 @@ type="int" transient="false" volatile="false" - value="16974041" + value="16974042" static="true" final="true" deprecated="not deprecated" @@ -16554,7 +16576,7 @@ type="int" transient="false" volatile="false" - value="16974014" + value="16974015" static="true" final="true" deprecated="not deprecated" @@ -16565,7 +16587,7 @@ type="int" transient="false" volatile="false" - value="16974066" + value="16974067" static="true" final="true" deprecated="not deprecated" @@ -16576,7 +16598,7 @@ type="int" transient="false" volatile="false" - value="16974015" + value="16974016" static="true" final="true" deprecated="not deprecated" @@ -16587,7 +16609,7 @@ type="int" transient="false" volatile="false" - value="16974016" + value="16974017" static="true" final="true" deprecated="not deprecated" @@ -16598,7 +16620,7 @@ type="int" transient="false" volatile="false" - value="16974034" + value="16974035" static="true" final="true" deprecated="not deprecated" @@ -16609,7 +16631,7 @@ type="int" transient="false" volatile="false" - value="16974017" + value="16974018" static="true" final="true" deprecated="not deprecated" @@ -16620,7 +16642,7 @@ type="int" transient="false" volatile="false" - value="16974067" + value="16974068" static="true" final="true" deprecated="not deprecated" @@ -16631,7 +16653,7 @@ type="int" transient="false" volatile="false" - value="16974065" + value="16974066" static="true" final="true" deprecated="not deprecated" @@ -16642,7 +16664,7 @@ type="int" transient="false" volatile="false" - value="16974043" + value="16974044" static="true" final="true" deprecated="not deprecated" @@ -16653,7 +16675,7 @@ type="int" transient="false" volatile="false" - value="16974018" + value="16974019" static="true" final="true" deprecated="not deprecated" @@ -16664,7 +16686,7 @@ type="int" transient="false" volatile="false" - value="16974013" + value="16974014" static="true" final="true" deprecated="not deprecated" @@ -16675,7 +16697,7 @@ type="int" transient="false" volatile="false" - value="16974044" + value="16974045" static="true" final="true" deprecated="not deprecated" @@ -16686,7 +16708,7 @@ type="int" transient="false" volatile="false" - value="16974019" + value="16974020" static="true" final="true" deprecated="not deprecated" @@ -16697,7 +16719,7 @@ type="int" transient="false" volatile="false" - value="16974020" + value="16974021" static="true" final="true" deprecated="not deprecated" @@ -16708,7 +16730,7 @@ type="int" transient="false" volatile="false" - value="16974021" + value="16974022" static="true" final="true" deprecated="not deprecated" @@ -16719,7 +16741,7 @@ type="int" transient="false" volatile="false" - value="16974025" + value="16974026" static="true" final="true" deprecated="not deprecated" @@ -16730,7 +16752,7 @@ type="int" transient="false" volatile="false" - value="16974024" + value="16974025" static="true" final="true" deprecated="not deprecated" @@ -16741,7 +16763,7 @@ type="int" transient="false" volatile="false" - value="16974027" + value="16974028" static="true" final="true" deprecated="not deprecated" @@ -16752,7 +16774,7 @@ type="int" transient="false" volatile="false" - value="16974022" + value="16974023" static="true" final="true" deprecated="not deprecated" @@ -16763,7 +16785,7 @@ type="int" transient="false" volatile="false" - value="16974026" + value="16974027" static="true" final="true" deprecated="not deprecated" @@ -16774,7 +16796,7 @@ type="int" transient="false" volatile="false" - value="16974023" + value="16974024" static="true" final="true" deprecated="not deprecated" @@ -16785,7 +16807,7 @@ type="int" transient="false" volatile="false" - value="16974029" + value="16974030" static="true" final="true" deprecated="not deprecated" @@ -16796,7 +16818,7 @@ type="int" transient="false" volatile="false" - value="16974030" + value="16974031" static="true" final="true" deprecated="not deprecated" @@ -16807,7 +16829,7 @@ type="int" transient="false" volatile="false" - value="16974031" + value="16974032" static="true" final="true" deprecated="not deprecated" @@ -16818,7 +16840,7 @@ type="int" transient="false" volatile="false" - value="16974033" + value="16974034" static="true" final="true" deprecated="not deprecated" @@ -16829,7 +16851,7 @@ type="int" transient="false" volatile="false" - value="16974028" + value="16974029" static="true" final="true" deprecated="not deprecated" @@ -16840,7 +16862,7 @@ type="int" transient="false" volatile="false" - value="16974035" + value="16974036" static="true" final="true" deprecated="not deprecated" @@ -16851,7 +16873,7 @@ type="int" transient="false" volatile="false" - value="16974052" + value="16974053" static="true" final="true" deprecated="not deprecated" @@ -16862,7 +16884,7 @@ type="int" transient="false" volatile="false" - value="16974037" + value="16974038" static="true" final="true" deprecated="not deprecated" @@ -16873,7 +16895,7 @@ type="int" transient="false" volatile="false" - value="16974010" + value="16974011" static="true" final="true" deprecated="not deprecated" @@ -16884,7 +16906,7 @@ type="int" transient="false" volatile="false" - value="16974042" + value="16974043" static="true" final="true" deprecated="not deprecated" @@ -16895,7 +16917,7 @@ type="int" transient="false" volatile="false" - value="16974038" + value="16974039" static="true" final="true" deprecated="not deprecated" @@ -16906,7 +16928,7 @@ type="int" transient="false" volatile="false" - value="16974039" + value="16974040" static="true" final="true" deprecated="not deprecated" @@ -16917,7 +16939,7 @@ type="int" transient="false" volatile="false" - value="16973997" + value="16973998" static="true" final="true" deprecated="not deprecated" @@ -16928,7 +16950,7 @@ type="int" transient="false" volatile="false" - value="16973975" + value="16973976" static="true" final="true" deprecated="not deprecated" @@ -16939,7 +16961,7 @@ type="int" transient="false" volatile="false" - value="16973970" + value="16973971" static="true" final="true" deprecated="not deprecated" @@ -16950,7 +16972,7 @@ type="int" transient="false" volatile="false" - value="16973998" + value="16973999" static="true" final="true" deprecated="not deprecated" @@ -16961,7 +16983,7 @@ type="int" transient="false" volatile="false" - value="16973976" + value="16973977" static="true" final="true" deprecated="not deprecated" @@ -16972,7 +16994,7 @@ type="int" transient="false" volatile="false" - value="16973977" + value="16973978" static="true" final="true" deprecated="not deprecated" @@ -16983,7 +17005,7 @@ type="int" transient="false" volatile="false" - value="16973978" + value="16973979" static="true" final="true" deprecated="not deprecated" @@ -16994,7 +17016,7 @@ type="int" transient="false" volatile="false" - value="16973981" + value="16973982" static="true" final="true" deprecated="not deprecated" @@ -17005,7 +17027,7 @@ type="int" transient="false" volatile="false" - value="16973979" + value="16973980" static="true" final="true" deprecated="not deprecated" @@ -17016,7 +17038,7 @@ type="int" transient="false" volatile="false" - value="16973980" + value="16973981" static="true" final="true" deprecated="not deprecated" @@ -17027,7 +17049,7 @@ type="int" transient="false" volatile="false" - value="16973983" + value="16973984" static="true" final="true" deprecated="not deprecated" @@ -17038,7 +17060,7 @@ type="int" transient="false" volatile="false" - value="16973984" + value="16973985" static="true" final="true" deprecated="not deprecated" @@ -17049,7 +17071,7 @@ type="int" transient="false" volatile="false" - value="16973985" + value="16973986" static="true" final="true" deprecated="not deprecated" @@ -17060,7 +17082,7 @@ type="int" transient="false" volatile="false" - value="16973987" + value="16973988" static="true" final="true" deprecated="not deprecated" @@ -17071,7 +17093,7 @@ type="int" transient="false" volatile="false" - value="16973982" + value="16973983" static="true" final="true" deprecated="not deprecated" @@ -17082,7 +17104,7 @@ type="int" transient="false" volatile="false" - value="16973989" + value="16973990" static="true" final="true" deprecated="not deprecated" @@ -17093,7 +17115,7 @@ type="int" transient="false" volatile="false" - value="16974051" + value="16974052" static="true" final="true" deprecated="not deprecated" @@ -17104,7 +17126,7 @@ type="int" transient="false" volatile="false" - value="16973991" + value="16973992" static="true" final="true" deprecated="not deprecated" @@ -17115,7 +17137,7 @@ type="int" transient="false" volatile="false" - value="16973967" + value="16973968" static="true" final="true" deprecated="not deprecated" @@ -17126,7 +17148,7 @@ type="int" transient="false" volatile="false" - value="16973996" + value="16973997" static="true" final="true" deprecated="not deprecated" @@ -17137,7 +17159,7 @@ type="int" transient="false" volatile="false" - value="16973992" + value="16973993" static="true" final="true" deprecated="not deprecated" @@ -17148,7 +17170,7 @@ type="int" transient="false" volatile="false" - value="16973993" + value="16973994" static="true" final="true" deprecated="not deprecated" @@ -17170,7 +17192,7 @@ type="int" transient="false" volatile="false" - value="16974061" + value="16974062" static="true" final="true" deprecated="not deprecated" @@ -17181,7 +17203,7 @@ type="int" transient="false" volatile="false" - value="16974059" + value="16974060" static="true" final="true" deprecated="not deprecated" @@ -17214,7 +17236,7 @@ type="int" transient="false" volatile="false" - value="16973957" + value="16973958" static="true" final="true" deprecated="not deprecated" @@ -17269,7 +17291,7 @@ type="int" transient="false" volatile="false" - value="16973958" + value="16973959" static="true" final="true" deprecated="not deprecated" @@ -17412,7 +17434,7 @@ type="int" transient="false" volatile="false" - value="16973955" + value="16973956" static="true" final="true" deprecated="not deprecated" @@ -167165,7 +167187,7 @@ </parameter> <parameter name="type" type="android.renderscript.Type"> </parameter> -<parameter name="mc" type="android.renderscript.Allocation.MipmapControl"> +<parameter name="mips" type="android.renderscript.Allocation.MipmapControl"> </parameter> <parameter name="usage" type="int"> </parameter> @@ -169028,52 +169050,6 @@ > </method> </class> -<class name="FileA3D.ClassID" - extends="java.lang.Enum" - abstract="false" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -<method name="toClassID" - return="android.renderscript.FileA3D.ClassID" - abstract="false" - native="false" - synchronized="false" - static="true" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="intID" type="int"> -</parameter> -</method> -<method name="valueOf" - return="android.renderscript.FileA3D.ClassID" - abstract="false" - native="false" - synchronized="false" - static="true" - final="false" - deprecated="not deprecated" - visibility="public" -> -<parameter name="name" type="java.lang.String"> -</parameter> -</method> -<method name="values" - return="android.renderscript.FileA3D.ClassID[]" - abstract="false" - native="false" - synchronized="false" - static="true" - final="true" - deprecated="not deprecated" - visibility="public" -> -</method> -</class> <class name="FileA3D.EntryType" extends="java.lang.Enum" abstract="false" @@ -169115,17 +169091,6 @@ deprecated="not deprecated" visibility="public" > -<method name="getClassID" - return="android.renderscript.FileA3D.ClassID" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="not deprecated" - visibility="public" -> -</method> <method name="getEntryType" return="android.renderscript.FileA3D.EntryType" abstract="false" @@ -238199,6 +238164,34 @@ > </field> </class> +<class name="WebViewFragment" + extends="android.app.Fragment" + abstract="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<constructor name="WebViewFragment" + type="android.webkit.WebViewFragment" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</constructor> +<method name="getWebView" + return="android.webkit.WebView" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +</class> </package> <package name="android.widget" > @@ -260215,7 +260208,7 @@ deprecated="not deprecated" visibility="public" > -<parameter name="t" type="T"> +<parameter name="arg0" type="T"> </parameter> </method> </interface> diff --git a/core/java/android/accounts/AccountManagerService.java b/core/java/android/accounts/AccountManagerService.java index 6e04587..9cbc7be 100644 --- a/core/java/android/accounts/AccountManagerService.java +++ b/core/java/android/accounts/AccountManagerService.java @@ -861,7 +861,7 @@ public class AccountManagerService public void getAuthToken(IAccountManagerResponse response, final Account account, final String authTokenType, final boolean notifyOnAuthFailure, - final boolean expectActivityLaunch, final Bundle loginOptions) { + final boolean expectActivityLaunch, Bundle loginOptionsIn) { if (Log.isLoggable(TAG, Log.VERBOSE)) { Log.v(TAG, "getAuthToken: " + account + ", response " + response @@ -888,6 +888,8 @@ public class AccountManagerService final boolean permissionGranted = customTokens || permissionIsGranted(account, authTokenType, callerUid); + final Bundle loginOptions = (loginOptionsIn == null) ? new Bundle() : + loginOptionsIn; if (customTokens) { // let authenticator know the identity of the caller loginOptions.putInt(AccountManager.KEY_CALLER_UID, callerUid); diff --git a/core/java/android/app/ContextImpl.java b/core/java/android/app/ContextImpl.java index 16d3a7f..e133ea0 100644 --- a/core/java/android/app/ContextImpl.java +++ b/core/java/android/app/ContextImpl.java @@ -17,9 +17,6 @@ package android.app; import com.android.internal.policy.PolicyManager; -import com.android.internal.util.XmlUtils; - -import org.xmlpull.v1.XmlPullParserException; import android.content.BroadcastReceiver; import android.content.ComponentName; @@ -35,14 +32,7 @@ import android.content.ReceiverCallNotAllowedException; import android.content.ServiceConnection; import android.content.SharedPreferences; import android.content.pm.ApplicationInfo; -import android.content.pm.ComponentInfo; -import android.content.pm.FeatureInfo; -import android.content.pm.IPackageDataObserver; -import android.content.pm.IPackageDeleteObserver; -import android.content.pm.IPackageInstallObserver; -import android.content.pm.IPackageMoveObserver; import android.content.pm.IPackageManager; -import android.content.pm.IPackageStatsObserver; import android.content.pm.PackageManager; import android.content.res.AssetManager; import android.content.res.Resources; @@ -80,14 +70,12 @@ import android.os.Process; import android.os.RemoteException; import android.os.ServiceManager; import android.os.Vibrator; -import android.os.FileUtils.FileStatus; import android.os.storage.StorageManager; import android.telephony.TelephonyManager; import android.content.ClipboardManager; import android.util.AndroidRuntimeException; import android.util.Log; import android.view.ContextThemeWrapper; -import android.view.LayoutInflater; import android.view.WindowManagerImpl; import android.view.accessibility.AccessibilityManager; import android.view.inputmethod.InputMethodManager; @@ -104,9 +92,6 @@ import java.io.IOException; import java.io.InputStream; import java.util.ArrayList; import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; class ReceiverRestrictedContext extends ContextWrapper { ReceiverRestrictedContext(Context base) { @@ -354,10 +339,10 @@ class ContextImpl extends Context { final Context outerContext = ctx.getOuterContext(); return new NotificationManager( new ContextThemeWrapper(outerContext, - outerContext.getApplicationInfo().targetSdkVersion >= - Build.VERSION_CODES.HONEYCOMB - ? com.android.internal.R.style.Theme_Holo_Dialog - : com.android.internal.R.style.Theme_Dialog), + Resources.selectSystemTheme(0, + outerContext.getApplicationInfo().targetSdkVersion, + com.android.internal.R.style.Theme_Dialog, + com.android.internal.R.style.Theme_Holo_Dialog)), ctx.mMainThread.getHandler()); }}); @@ -492,13 +477,8 @@ class ContextImpl extends Context { @Override public Resources.Theme getTheme() { if (mTheme == null) { - if (mThemeResource == 0) { - final Context outerContext = getOuterContext(); - mThemeResource = (outerContext.getApplicationInfo().targetSdkVersion - >= Build.VERSION_CODES.HONEYCOMB) - ? com.android.internal.R.style.Theme_Holo - : com.android.internal.R.style.Theme; - } + mThemeResource = Resources.selectDefaultTheme(mThemeResource, + getOuterContext().getApplicationInfo().targetSdkVersion); mTheme = mResources.newTheme(); mTheme.applyStyle(mThemeResource, true); } diff --git a/core/java/android/bluetooth/BluetoothDeviceProfileState.java b/core/java/android/bluetooth/BluetoothDeviceProfileState.java index 21144f2..3280d39 100644 --- a/core/java/android/bluetooth/BluetoothDeviceProfileState.java +++ b/core/java/android/bluetooth/BluetoothDeviceProfileState.java @@ -102,7 +102,6 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine private BluetoothDevice mDevice; private int mHeadsetState = BluetoothProfile.STATE_DISCONNECTED; private int mA2dpState = BluetoothProfile.STATE_DISCONNECTED; - private int mHidState = BluetoothProfile.STATE_DISCONNECTED; private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override @@ -140,7 +139,7 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine int newState = intent.getIntExtra(BluetoothInputDevice.EXTRA_INPUT_DEVICE_STATE, 0); int oldState = intent.getIntExtra(BluetoothInputDevice.EXTRA_PREVIOUS_INPUT_DEVICE_STATE, 0); - mHidState = newState; + if (oldState == BluetoothInputDevice.STATE_CONNECTED && newState == BluetoothInputDevice.STATE_DISCONNECTED) { sendMessage(DISCONNECT_HID_INCOMING); @@ -286,7 +285,8 @@ public final class BluetoothDeviceProfileState extends HierarchicalStateMachine sendMessage(DISCONNECT_A2DP_OUTGOING); deferMessage(message); break; - } else if (mHidState != BluetoothInputDevice.STATE_DISCONNECTED) { + } else if (mService.getInputDeviceState(mDevice) != + BluetoothInputDevice.STATE_DISCONNECTED) { sendMessage(DISCONNECT_HID_OUTGOING); deferMessage(message); break; diff --git a/core/java/android/content/res/Resources.java b/core/java/android/content/res/Resources.java index e6fd039..e8bf29d 100755 --- a/core/java/android/content/res/Resources.java +++ b/core/java/android/content/res/Resources.java @@ -115,6 +115,23 @@ public class Resources { return (LongSparseArray<T>) EMPTY_ARRAY; } + /** @hide */ + public static int selectDefaultTheme(int curTheme, int targetSdkVersion) { + return selectSystemTheme(curTheme, targetSdkVersion, + com.android.internal.R.style.Theme, com.android.internal.R.style.Theme_Holo); + } + + /** @hide */ + public static int selectSystemTheme(int curTheme, int targetSdkVersion, int orig, int holo) { + if (curTheme != 0) { + return curTheme; + } + if (targetSdkVersion < Build.VERSION_CODES.HONEYCOMB) { + return orig; + } + return holo; + } + /** * This exception is thrown by the resource APIs when a requested resource * can not be found. diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 8150493..23b9ad5 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -22,6 +22,7 @@ import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; import android.app.Dialog; import android.content.Context; import android.content.res.Configuration; +import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Rect; import android.os.Bundle; @@ -220,7 +221,7 @@ public class InputMethodService extends AbstractInputMethodService { InputMethodManager mImm; - int mTheme = android.R.style.Theme_InputMethod; + int mTheme = 0; LayoutInflater mInflater; TypedArray mThemeAttrs; @@ -556,6 +557,9 @@ public class InputMethodService extends AbstractInputMethodService { } @Override public void onCreate() { + mTheme = Resources.selectSystemTheme(mTheme, + getApplicationInfo().targetSdkVersion, + android.R.style.Theme_InputMethod, android.R.style.Theme_Holo_InputMethod); super.setTheme(mTheme); super.onCreate(); mImm = (InputMethodManager)getSystemService(INPUT_METHOD_SERVICE); diff --git a/core/java/android/net/MobileDataStateTracker.java b/core/java/android/net/MobileDataStateTracker.java index b3a354f..9ecd68c 100644 --- a/core/java/android/net/MobileDataStateTracker.java +++ b/core/java/android/net/MobileDataStateTracker.java @@ -221,6 +221,8 @@ public class MobileDataStateTracker implements NetworkStateTracker { if (!TextUtils.equals(apnType, mApnType)) { return; } + mNetworkInfo.setSubtype(TelephonyManager.getDefault().getNetworkType(), + TelephonyManager.getDefault().getNetworkTypeName()); Phone.DataState state = Enum.valueOf(Phone.DataState.class, intent.getStringExtra(Phone.STATE_KEY)); String reason = intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY); diff --git a/core/java/android/os/StrictMode.java b/core/java/android/os/StrictMode.java index e314fce..0f062cc 100644 --- a/core/java/android/os/StrictMode.java +++ b/core/java/android/os/StrictMode.java @@ -1632,7 +1632,6 @@ public final class StrictMode { */ public static void noteDiskRead() { BlockGuard.Policy policy = BlockGuard.getThreadPolicy(); - Log.d(TAG, "noteDiskRead; policy=" + policy); if (!(policy instanceof AndroidBlockGuardPolicy)) { // StrictMode not enabled. return; diff --git a/core/java/android/server/BluetoothService.java b/core/java/android/server/BluetoothService.java index 32e609c..dd88838 100644 --- a/core/java/android/server/BluetoothService.java +++ b/core/java/android/server/BluetoothService.java @@ -1755,7 +1755,8 @@ public class BluetoothService extends IBluetooth.Stub { "Need BLUETOOTH_ADMIN permission"); String objectPath = getObjectPathFromAddress(device.getAddress()); - if (objectPath == null || getConnectedInputDevices().size() == 0) { + if (objectPath == null || + getInputDeviceState(device) == BluetoothInputDevice.STATE_DISCONNECTED) { return false; } BluetoothDeviceProfileState state = mDeviceProfileState.get(device.getAddress()); diff --git a/core/java/android/view/ContextThemeWrapper.java b/core/java/android/view/ContextThemeWrapper.java index be4152b..626f385 100644 --- a/core/java/android/view/ContextThemeWrapper.java +++ b/core/java/android/view/ContextThemeWrapper.java @@ -62,12 +62,8 @@ public class ContextThemeWrapper extends ContextWrapper { return mTheme; } - if (mThemeResource == 0) { - mThemeResource = (getApplicationInfo().targetSdkVersion - >= Build.VERSION_CODES.HONEYCOMB) - ? com.android.internal.R.style.Theme_Holo - : com.android.internal.R.style.Theme; - } + mThemeResource = Resources.selectDefaultTheme(mThemeResource, + getApplicationInfo().targetSdkVersion); initializeTheme(); return mTheme; diff --git a/core/java/android/view/MotionEvent.java b/core/java/android/view/MotionEvent.java index e81aa98..db2cd50 100644 --- a/core/java/android/view/MotionEvent.java +++ b/core/java/android/view/MotionEvent.java @@ -1550,6 +1550,7 @@ public final class MotionEvent extends InputEvent implements Parcelable { @Override public String toString() { return "MotionEvent{" + Integer.toHexString(System.identityHashCode(this)) + + " pointerId=" + getPointerId(0) + " action=" + actionToString(mAction) + " x=" + getX() + " y=" + getY() @@ -1567,6 +1568,8 @@ public final class MotionEvent extends InputEvent implements Parcelable { + " edgeFlags=0x" + Integer.toHexString(mEdgeFlags) + " device=" + mDeviceId + " source=0x" + Integer.toHexString(mSource) + + (getPointerCount() > 1 ? + " pointerId2=" + getPointerId(1) + " x2=" + getX(2) + " y2=" + getY(2) : "") + "}"; } diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index a7e13cc..c4bd1de 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -58,6 +58,7 @@ import android.util.PoolableManager; import android.util.Pools; import android.util.SparseArray; import android.view.ContextMenu.ContextMenuInfo; +import android.view.View.MeasureSpec; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityEventSource; import android.view.accessibility.AccessibilityManager; @@ -7825,6 +7826,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * * <p>Note: if this view's parent addStateFromChildren property is enabled and this * property is enabled, an exception will be thrown.</p> + * + * <p>Note: if the child view uses and updates additionnal states which are unknown to the + * parent, these states should not be affected by this method.</p> * * @param enabled True to enable duplication of the parent's drawable state, false * to disable it. diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java index d480bbc..ad9e6863 100644 --- a/core/java/android/view/ViewRoot.java +++ b/core/java/android/view/ViewRoot.java @@ -486,16 +486,16 @@ public final class ViewRoot extends Handler implements ViewParent, mAttachInfo.mHardwareAccelerated = false; mAttachInfo.mHardwareAccelerationRequested = false; - // Don't enable hardware acceleration when we're not on the main thread - if (Looper.getMainLooper() != Looper.myLooper()) { - Log.w(HardwareRenderer.LOG_TAG, "Attempting to initialize hardware acceleration " - + "outside of the main thread, aborting"); - return; - } - // Try to enable hardware acceleration if requested if (attrs != null && (attrs.flags & WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED) != 0) { + // Don't enable hardware acceleration when we're not on the main thread + if (Looper.getMainLooper() != Looper.myLooper()) { + Log.w(HardwareRenderer.LOG_TAG, "Attempting to initialize hardware acceleration " + + "outside of the main thread, aborting"); + return; + } + // Only enable hardware acceleration if we are not in the system process // The window manager creates ViewRoots to display animated preview windows // of launching apps and we don't want those to be hardware accelerated diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java index cb0a2a9..e8d67da 100644 --- a/core/java/android/view/WindowManagerPolicy.java +++ b/core/java/android/view/WindowManagerPolicy.java @@ -23,6 +23,9 @@ import android.os.IBinder; import android.os.LocalPowerManager; import android.view.animation.Animation; +import java.io.FileDescriptor; +import java.io.PrintWriter; + /** * This interface supplies all UI-specific behavior of the window manager. An * instance of it is created by the window manager when it starts up, and allows @@ -817,4 +820,15 @@ public interface WindowManagerPolicy { * {@link Surface#ROTATION_180}, {@link Surface#ROTATION_270}. */ public void setUserRotationMode(int mode, int rotation); + + /** + * Print the WindowManagerPolicy's state into the given stream. + * + * @param prefix Text to print at the front of each line. + * @param fd The raw file descriptor that the dump is being sent to. + * @param writer The PrintWriter to which you should dump your state. This will be + * closed for you after you return. + * @param args additional arguments to the dump request. + */ + public void dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args); } diff --git a/core/java/android/webkit/CacheManager.java b/core/java/android/webkit/CacheManager.java index e46daad..6073f7a 100644 --- a/core/java/android/webkit/CacheManager.java +++ b/core/java/android/webkit/CacheManager.java @@ -191,7 +191,14 @@ public final class CacheManager { */ static void init(Context context) { if (JniUtil.useChromiumHttpStack()) { - // TODO: Need to init mBaseDir. + // This isn't actually where the real cache lives, but where we put files for the + // purpose of getCacheFile(). + mBaseDir = new File(context.getCacheDir(), "webviewCacheChromiumStaging"); + if (!mBaseDir.exists()) { + mBaseDir.mkdirs(); + } else { + // TODO: Should we clear out old files? + } return; } @@ -343,8 +350,8 @@ public final class CacheManager { /** * Given a URL, returns the corresponding CacheResult if it exists, or null otherwise. * - * The output stream of the CacheEntry object is initialized and opened and should be closed by - * the caller when access to the undelying file is no longer required. + * The input stream of the CacheEntry object is initialized and opened and should be closed by + * the caller when access to the underlying file is no longer required. * If a non-zero value is provided for the headers map, and the cache entry needs validation, * HEADER_KEY_IFNONEMATCH or HEADER_KEY_IFMODIFIEDSINCE will be set in headers. * @@ -365,8 +372,24 @@ public final class CacheManager { } if (JniUtil.useChromiumHttpStack()) { - // TODO: Implement this. - return null; + CacheResult result = nativeGetCacheResult(url); + if (result == null) { + return null; + } + // A temporary local file will have been created native side and localPath set + // appropriately. + File src = new File(mBaseDir, result.localPath); + try { + // Open the file here so that even if it is deleted, the content + // is still readable by the caller until close() is called. + result.inStream = new FileInputStream(src); + } catch (FileNotFoundException e) { + Log.v(LOGTAG, "getCacheFile(): Failed to open file: " + e); + // TODO: The files in the cache directory can be removed by the + // system. If it is gone, what should we do? + return null; + } + return result; } String databaseKey = getDatabaseKey(url, postIdentifier); @@ -437,7 +460,7 @@ public final class CacheManager { public static CacheResult createCacheFile(String url, int statusCode, Headers headers, String mimeType, boolean forceCache) { if (JniUtil.useChromiumHttpStack()) { - // TODO: Implement this. + // This method is public but hidden. We break functionality. return null; } @@ -522,8 +545,16 @@ public final class CacheManager { } if (JniUtil.useChromiumHttpStack()) { - // TODO: Implement this. - return; + // This method is exposed in the public API but the API provides no way to obtain a + // new CacheResult object with a non-null output stream ... + // - CacheResult objects returned by getCacheFile() have a null output stream. + // - new CacheResult objects have a null output stream and no setter is provided. + // Since for the Android HTTP stack this method throws a null pointer exception in this + // case, this method is effectively useless from the point of view of the public API. + + // We should already have thrown an exception above, to maintain 'backward + // compatibility' with the Android HTTP stack. + assert false; } if (!cacheRet.outFile.exists()) { @@ -917,4 +948,6 @@ public final class CacheManager { return ret; } + + private static native CacheResult nativeGetCacheResult(String url); } diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index b893af8..43e7ef6 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -5471,6 +5471,8 @@ public class WebView extends AbsoluteLayout if (shouldForwardTouchEvent()) { TouchEventData ted = new TouchEventData(); ted.mAction = action; + ted.mIds = new int[1]; + ted.mIds[0] = ev.getPointerId(0); ted.mPoints = new Point[1]; ted.mPoints[0] = new Point(contentX, contentY); ted.mMetaState = ev.getMetaState(); @@ -5513,6 +5515,8 @@ public class WebView extends AbsoluteLayout || eventTime - mLastSentTouchTime > mCurrentTouchInterval)) { TouchEventData ted = new TouchEventData(); ted.mAction = action; + ted.mIds = new int[1]; + ted.mIds[0] = ev.getPointerId(0); ted.mPoints = new Point[1]; ted.mPoints[0] = new Point(contentX, contentY); ted.mMetaState = ev.getMetaState(); @@ -5682,6 +5686,8 @@ public class WebView extends AbsoluteLayout // pass the touch events from UI thread to WebCore thread if (shouldForwardTouchEvent()) { TouchEventData ted = new TouchEventData(); + ted.mIds = new int[1]; + ted.mIds[0] = ev.getPointerId(0); ted.mAction = action; ted.mPoints = new Point[1]; ted.mPoints[0] = new Point(contentX, contentY); @@ -5699,6 +5705,8 @@ public class WebView extends AbsoluteLayout mPrivateHandler.removeMessages(SWITCH_TO_LONGPRESS); if (inFullScreenMode() || mDeferTouchProcess) { TouchEventData ted = new TouchEventData(); + ted.mIds = new int[1]; + ted.mIds[0] = ev.getPointerId(0); ted.mAction = WebViewCore.ACTION_DOUBLETAP; ted.mPoints = new Point[1]; ted.mPoints[0] = new Point(contentX, contentY); @@ -5832,8 +5840,10 @@ public class WebView extends AbsoluteLayout TouchEventData ted = new TouchEventData(); ted.mAction = ev.getAction() & MotionEvent.ACTION_MASK; final int count = ev.getPointerCount(); + ted.mIds = new int[count]; ted.mPoints = new Point[count]; for (int c = 0; c < count; c++) { + ted.mIds[c] = ev.getPointerId(c); int x = viewToContentX((int) ev.getX(c) + mScrollX); int y = viewToContentY((int) ev.getY(c) + mScrollY); ted.mPoints[c] = new Point(x, y); @@ -5927,6 +5937,8 @@ public class WebView extends AbsoluteLayout mWebViewCore.removeMessages(EventHub.TOUCH_EVENT); } TouchEventData ted = new TouchEventData(); + ted.mIds = new int[1]; + ted.mIds[0] = 0; ted.mPoints = new Point[1]; ted.mPoints[0] = new Point(x, y); ted.mAction = MotionEvent.ACTION_CANCEL; @@ -7054,6 +7066,8 @@ public class WebView extends AbsoluteLayout if (inFullScreenMode() || mDeferTouchProcess) { TouchEventData ted = new TouchEventData(); ted.mAction = WebViewCore.ACTION_LONGPRESS; + ted.mIds = new int[1]; + ted.mIds[0] = 0; ted.mPoints = new Point[1]; ted.mPoints[0] = new Point(viewToContentX((int) mLastTouchX + mScrollX), viewToContentY((int) mLastTouchY + mScrollY)); diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java index 2ea20ee..c56f252 100644 --- a/core/java/android/webkit/WebViewCore.java +++ b/core/java/android/webkit/WebViewCore.java @@ -562,8 +562,8 @@ final class WebViewCore { private native void nativeTouchUp(int touchGeneration, int framePtr, int nodePtr, int x, int y); - private native boolean nativeHandleTouchEvent(int action, int[] x, int[] y, - int count, int metaState); + private native boolean nativeHandleTouchEvent(int action, int[] idArray, + int[] xArray, int[] yArray, int count, int metaState); private native void nativeUpdateFrameCache(); @@ -828,6 +828,7 @@ final class WebViewCore { static class TouchEventData { int mAction; + int[] mIds; // Ids of the touch points Point[] mPoints; int mMetaState; boolean mReprocess; @@ -1336,8 +1337,8 @@ final class WebViewCore { mWebView.mPrivateHandler, WebView.PREVENT_TOUCH_ID, ted.mAction, - nativeHandleTouchEvent(ted.mAction, xArray, - yArray, count, ted.mMetaState) ? 1 : 0, + nativeHandleTouchEvent(ted.mAction, ted.mIds, + xArray, yArray, count, ted.mMetaState) ? 1 : 0, ted.mReprocess ? ted : null).sendToTarget(); break; } diff --git a/core/java/android/webkit/WebViewFragment.java b/core/java/android/webkit/WebViewFragment.java new file mode 100644 index 0000000..466f174 --- /dev/null +++ b/core/java/android/webkit/WebViewFragment.java @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2010 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.webkit; + +import android.app.Fragment; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.webkit.WebView; + +/** + * A fragment that displays a WebView. + * <p> + * The WebView is automically paused or resumed when the Fragment is paused or resumed. + */ +public class WebViewFragment extends Fragment { + private WebView mWebView; + + public WebViewFragment() { + } + + /** + * Called to instantiate the view. Creates and returns the WebView. + */ + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + mWebView = new WebView(getActivity()); + return mWebView; + } + + /** + * Called when the fragment is visible to the user and actively running. Resumes the WebView. + */ + @Override + public void onPause() { + super.onPause(); + mWebView.onPause(); + } + + /** + * Called when the fragment is no longer resumed. Pauses the WebView. + */ + @Override + public void onResume() { + mWebView.onResume(); + super.onResume(); + } + + /** + * Called when the view has been detached from the fragment. Destroys the WebView. + */ + @Override + public void onDestroyView() { + mWebView.destroy(); + mWebView = null; + super.onDestroyView(); + } + + /** + * Gets the WebView. + */ + public WebView getWebView() { + return mWebView; + } +} diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 2e38743..7631df4 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -4106,8 +4106,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te final int topLimit = getPaddingTop(); final int bottomLimit = getHeight() - getPaddingBottom(); - if (distance == 0 || - firstPos == INVALID_POSITION || + if (distance == 0 || mItemCount == 0 || childCount == 0 || (firstPos == 0 && getChildAt(0).getTop() == topLimit && distance < 0) || (lastPos == mItemCount - 1 && getChildAt(childCount - 1).getBottom() == bottomLimit && distance > 0)) { diff --git a/core/java/android/widget/SearchView.java b/core/java/android/widget/SearchView.java index 3bf5af3..2c96056 100644 --- a/core/java/android/widget/SearchView.java +++ b/core/java/android/widget/SearchView.java @@ -217,6 +217,10 @@ public class SearchView extends LinearLayout { if (maxWidth != -1) { setMaxWidth(maxWidth); } + CharSequence queryHint = a.getText(R.styleable.SearchView_queryHint); + if (!TextUtils.isEmpty(queryHint)) { + setQueryHint(queryHint); + } a.recycle(); // Save voice intent for later queries/launching diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index b892fe2..623cd41 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -4135,9 +4135,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener @Override protected int[] onCreateDrawableState(int extraSpace) { - final int[] drawableState = super.onCreateDrawableState(extraSpace + 1); + final int[] drawableState; - if (!mSingleLine) { + if (mSingleLine) { + drawableState = super.onCreateDrawableState(extraSpace); + } else { + drawableState = super.onCreateDrawableState(extraSpace + 1); mergeDrawableStates(drawableState, MULTILINE_STATE_SET); } diff --git a/core/java/com/android/internal/app/ActionBarImpl.java b/core/java/com/android/internal/app/ActionBarImpl.java index f5c0124..4ee3083 100644 --- a/core/java/com/android/internal/app/ActionBarImpl.java +++ b/core/java/com/android/internal/app/ActionBarImpl.java @@ -681,12 +681,12 @@ public class ActionBarImpl extends ActionBar { @Override public void setTitle(int resId) { - setTitle(mActivity.getString(resId)); + setTitle(mContext.getResources().getString(resId)); } @Override public void setSubtitle(int resId) { - setSubtitle(mActivity.getString(resId)); + setSubtitle(mContext.getResources().getString(resId)); } @Override diff --git a/core/res/res/drawable-hdpi/ic_btn_round_more_disabled.png b/core/res/res/drawable-hdpi/ic_btn_round_more_disabled.png Binary files differindex 0125944..3f1176f 100644..100755 --- a/core/res/res/drawable-hdpi/ic_btn_round_more_disabled.png +++ b/core/res/res/drawable-hdpi/ic_btn_round_more_disabled.png diff --git a/core/res/res/drawable-hdpi/ic_btn_round_more_normal.png b/core/res/res/drawable-hdpi/ic_btn_round_more_normal.png Binary files differindex 33d7f89..8abda4d 100644..100755 --- a/core/res/res/drawable-hdpi/ic_btn_round_more_normal.png +++ b/core/res/res/drawable-hdpi/ic_btn_round_more_normal.png diff --git a/core/res/res/drawable-hdpi/stat_notify_chat.png b/core/res/res/drawable-hdpi/stat_notify_chat.png Binary files differindex 71ea8de..95b2700 100644 --- a/core/res/res/drawable-hdpi/stat_notify_chat.png +++ b/core/res/res/drawable-hdpi/stat_notify_chat.png diff --git a/core/res/res/drawable-hdpi/stat_notify_email_generic.png b/core/res/res/drawable-hdpi/stat_notify_email_generic.png Binary files differindex bc5fcab..f222872 100644 --- a/core/res/res/drawable-hdpi/stat_notify_email_generic.png +++ b/core/res/res/drawable-hdpi/stat_notify_email_generic.png diff --git a/core/res/res/drawable-hdpi/stat_notify_gmail.png b/core/res/res/drawable-hdpi/stat_notify_gmail.png Binary files differindex ea8beae..2d5686d 100644 --- a/core/res/res/drawable-hdpi/stat_notify_gmail.png +++ b/core/res/res/drawable-hdpi/stat_notify_gmail.png diff --git a/core/res/res/drawable-mdpi/ic_btn_round_more_disabled.png b/core/res/res/drawable-mdpi/ic_btn_round_more_disabled.png Binary files differindex 1ab98c9..428edf2 100644 --- a/core/res/res/drawable-mdpi/ic_btn_round_more_disabled.png +++ b/core/res/res/drawable-mdpi/ic_btn_round_more_disabled.png diff --git a/core/res/res/drawable-mdpi/ic_btn_round_more_normal.png b/core/res/res/drawable-mdpi/ic_btn_round_more_normal.png Binary files differindex ebdc55c..c2ecb01 100644 --- a/core/res/res/drawable-mdpi/ic_btn_round_more_normal.png +++ b/core/res/res/drawable-mdpi/ic_btn_round_more_normal.png diff --git a/core/res/res/drawable-mdpi/stat_notify_chat.png b/core/res/res/drawable-mdpi/stat_notify_chat.png Binary files differindex 8cf02cc..f199fce 100644 --- a/core/res/res/drawable-mdpi/stat_notify_chat.png +++ b/core/res/res/drawable-mdpi/stat_notify_chat.png diff --git a/core/res/res/drawable-mdpi/stat_notify_email_generic.png b/core/res/res/drawable-mdpi/stat_notify_email_generic.png Binary files differindex 5b866bf..536e8ec 100644 --- a/core/res/res/drawable-mdpi/stat_notify_email_generic.png +++ b/core/res/res/drawable-mdpi/stat_notify_email_generic.png diff --git a/core/res/res/drawable-mdpi/stat_notify_gmail.png b/core/res/res/drawable-mdpi/stat_notify_gmail.png Binary files differindex 907306d..89fe3cd 100644 --- a/core/res/res/drawable-mdpi/stat_notify_gmail.png +++ b/core/res/res/drawable-mdpi/stat_notify_gmail.png diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index 3a3ca36..a29f417 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -4664,6 +4664,8 @@ <attr name="iconifiedByDefault" format="boolean"/> <!-- An optional maximum width of the SearchView. --> <attr name="maxWidth" /> + <!-- An optional query hint string to be displayed in the empty query field. --> + <attr name="queryHint" format="string" /> </declare-styleable> <declare-styleable name="ActionBar_LayoutParams"> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 6d79569..9b88b01 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1424,6 +1424,7 @@ <public type="attr" name="alertDialogIcon" /> <public type="attr" name="windowMinWidthMajor" /> <public type="attr" name="windowMinWidthMinor" /> + <public type="attr" name="queryHint" /> <!-- A simple fade-in animation. --> <public type="animator" name="fade_in" id="0x010b0000" /> @@ -1513,6 +1514,7 @@ <public type="style" name="Theme.Holo.Light.Panel" /> <public type="style" name="Theme.Holo.Wallpaper" /> <public type="style" name="Theme.Holo.Wallpaper.NoTitleBar" /> + <public type="style" name="Theme.Holo.InputMethod" /> <public type="style" name="TextAppearance.Widget.PopupMenu.Large" /> <public type="style" name="TextAppearance.Widget.PopupMenu.Small" /> diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index f346bac..2658b53 100755 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -2403,6 +2403,8 @@ <!-- Title of the pop-up dialog in which the user switches input method components. --> <string name="select_input_method">Select input method</string> + <!-- Title of a button to open the settings for input methods [CHAR LIMIT=30] --> + <string name="configure_input_methods">Configure input methods</string> <string name="fast_scroll_alphabet">\u0020ABCDEFGHIJKLMNOPQRSTUVWXYZ</string> <string name="fast_scroll_numeric_alphabet">\u00200123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ</string> diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index d070c30..971719e 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -624,10 +624,8 @@ <!-- Default theme for input methods, which is used by the {@link android.inputmethodservice.InputMethodService} class. - this inherits from Theme.NoTitleBar, but makes the background - transparent, the window floating and translucent, and ensures that - it does not dim the UI behind it. This also configures the window - with the standard IME animations and visuals. --> + this inherits from Theme.Panel, but sets up IME appropriate animations + and a few custom attributes. --> <style name="Theme.InputMethod" parent="Theme.Panel"> <item name="android:windowAnimationStyle">@android:style/Animation.InputMethod</item> <item name="android:imeFullscreenBackground">@android:drawable/input_method_fullscreen_background</item> @@ -635,6 +633,17 @@ <item name="android:imeExtractExitAnimation">@android:anim/input_method_extract_exit</item> </style> + <!-- Default theme for modern holo style input methods, which is used by the + {@link android.inputmethodservice.InputMethodService} class. + this inherits from Theme.Panel, but sets up IME appropriate animations + and a few custom attributes. --> + <style name="Theme.Holo.InputMethod" parent="Theme.Holo.Panel"> + <item name="android:windowAnimationStyle">@android:style/Animation.InputMethod</item> + <item name="android:imeFullscreenBackground">@android:drawable/input_method_fullscreen_background</item> + <item name="android:imeExtractEnterAnimation">@android:anim/input_method_extract_enter</item> + <item name="android:imeExtractExitAnimation">@android:anim/input_method_extract_exit</item> + </style> + <!-- Theme for the search input bar. --> <style name="Theme.SearchBar" parent="Theme.Holo.Light.Panel"> <item name="windowContentOverlay">@null</item> diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java index b15121a..579f314 100644 --- a/graphics/java/android/renderscript/Allocation.java +++ b/graphics/java/android/renderscript/Allocation.java @@ -503,7 +503,7 @@ public class Allocation extends BaseObj { * Creates a renderscript allocation with the size specified by * the type and no mipmaps generated by default * - * @param rs + * @param rs Context to which the allocation will belong. * @param type renderscript type describing data layout * @param usage bit field specifying how the allocation is * utilized @@ -519,7 +519,7 @@ public class Allocation extends BaseObj { * the size specified by the type and no mipmaps generated by * default * - * @param rs + * @param rs Context to which the allocation will belong. * @param type renderscript type describing data layout * * @return allocation @@ -532,7 +532,7 @@ public class Allocation extends BaseObj { * Creates a renderscript allocation with a specified number of * given elements * - * @param rs + * @param rs Context to which the allocation will belong. * @param e describes what each element of an allocation is * @param count specifies the number of element in the allocation * @param usage bit field specifying how the allocation is @@ -558,7 +558,7 @@ public class Allocation extends BaseObj { * Creates a renderscript allocation with a specified number of * given elements * - * @param rs + * @param rs Context to which the allocation will belong. * @param e describes what each element of an allocation is * @param count specifies the number of element in the allocation * @@ -598,7 +598,7 @@ public class Allocation extends BaseObj { /** * Creates a renderscript allocation from a bitmap * - * @param rs + * @param rs Context to which the allocation will belong. * @param b bitmap source for the allocation data * @param mips specifies desired mipmap behaviour for the * allocation @@ -625,7 +625,7 @@ public class Allocation extends BaseObj { * Creates a non-mipmapped renderscript allocation to use as a * graphics texture * - * @param rs + * @param rs Context to which the allocation will belong. * @param b bitmap source for the allocation data * * @return renderscript allocation containing bitmap data @@ -641,7 +641,7 @@ public class Allocation extends BaseObj { * horizontal list of cube faces. Each individual face must be * the same size and power of 2 * - * @param rs + * @param rs Context to which the allocation will belong. * @param b bitmap with cubemap faces layed out in the following * format: right, left, top, bottom, front, back * @param mips specifies desired mipmap behaviour for the cubemap @@ -690,7 +690,7 @@ public class Allocation extends BaseObj { * of cube faces. Each individual face must be the same size and * power of 2 * - * @param rs + * @param rs Context to which the allocation will belong. * @param b bitmap with cubemap faces layed out in the following * format: right, left, top, bottom, front, back * @@ -708,7 +708,7 @@ public class Allocation extends BaseObj { * the cube faces. All the faces must be the same size and * power of 2 * - * @param rs + * @param rs Context to which the allocation will belong. * @param xpos cubemap face in the positive x direction * @param xneg cubemap face in the negative x direction * @param ypos cubemap face in the positive y direction @@ -776,7 +776,7 @@ public class Allocation extends BaseObj { * the cube faces. All the faces must be the same size and * power of 2 * - * @param rs + * @param rs Context to which the allocation will belong. * @param xpos cubemap face in the positive x direction * @param xneg cubemap face in the negative x direction * @param ypos cubemap face in the positive y direction @@ -803,7 +803,7 @@ public class Allocation extends BaseObj { * Creates a renderscript allocation from the bitmap referenced * by resource id * - * @param rs + * @param rs Context to which the allocation will belong. * @param res application resources * @param id resource id to load the data from * @param mips specifies desired mipmap behaviour for the @@ -831,7 +831,7 @@ public class Allocation extends BaseObj { * Creates a non-mipmapped renderscript allocation to use as a * graphics texture from the bitmap referenced by resource id * - * @param rs + * @param rs Context to which the allocation will belong. * @param res application resources * @param id resource id to load the data from * @@ -850,7 +850,7 @@ public class Allocation extends BaseObj { * Creates a renderscript allocation containing string data * encoded in UTF-8 format * - * @param rs + * @param rs Context to which the allocation will belong. * @param str string to create the allocation from * @param usage bit field specifying how the allocaiton is * utilized diff --git a/graphics/java/android/renderscript/FileA3D.java b/graphics/java/android/renderscript/FileA3D.java index 90d102c..fe3971a 100644 --- a/graphics/java/android/renderscript/FileA3D.java +++ b/graphics/java/android/renderscript/FileA3D.java @@ -28,22 +28,22 @@ import android.util.Log; import android.util.TypedValue; /** + * FileA3D allows users to load renderscript objects from files + * or resources stored on disk. It could be used to load items + * such as 3d geometry data converted a renderscript format from + * content creation tools. Currently only meshes are supported + * in FileA3D. + * + * When successfully loaded, FileA3D will contain a list of + * index entries for all the objects stored inside it. * **/ public class FileA3D extends BaseObj { - // This will go away in the clean up pass, - // trying to avoid multiproject submits - public enum ClassID { - - UNKNOWN, - MESH; - - public static ClassID toClassID(int intID) { - return ClassID.values()[intID]; - } - } - + /** + * Specifies what renderscript object type is contained within + * the FileA3D IndexEntry + **/ public enum EntryType { UNKNOWN (0), @@ -59,34 +59,48 @@ public class FileA3D extends BaseObj { } } - // Read only class with index entries + /** + * IndexEntry contains information about one of the renderscript + * objects inside the file's index. It could be used to query the + * object's type and name and load the object itself if + * necessary. + */ public static class IndexEntry { RenderScript mRS; int mIndex; int mID; String mName; - ClassID mClassID; EntryType mEntryType; BaseObj mLoadedObj; + /** + * @return name of a renderscript object the index entry + * describes + */ public String getName() { return mName; } - public ClassID getClassID() { - return mClassID; - } - + /** + * @return type of a renderscript object the index entry + * describes + */ public EntryType getEntryType() { return mEntryType; } + /** + * @return renderscript object described by the entry + */ public BaseObj getObject() { mRS.validate(); BaseObj obj = internalCreate(mRS, this); return obj; } + /** + * @return renderscript mesh object described by the entry + */ public Mesh getMesh() { return (Mesh)getObject(); } @@ -122,7 +136,6 @@ public class FileA3D extends BaseObj { mID = id; mName = name; mEntryType = type; - mClassID = mEntryType == EntryType.MESH ? ClassID.MESH : ClassID.UNKNOWN; mLoadedObj = null; } } @@ -152,6 +165,9 @@ public class FileA3D extends BaseObj { } } + /** + * @return the numberof objects stored inside a FileA3D + */ public int getIndexEntryCount() { if(mFileEntries == null) { return 0; @@ -159,6 +175,12 @@ public class FileA3D extends BaseObj { return mFileEntries.length; } + /** + * Returns an index entry from the list of all objects inside + * FileA3D + * + * @param index number of the entry from the list to return + */ public IndexEntry getIndexEntry(int index) { if(getIndexEntryCount() == 0 || index < 0 || index >= mFileEntries.length) { return null; @@ -166,6 +188,14 @@ public class FileA3D extends BaseObj { return mFileEntries[index]; } + /** + * Creates a FileA3D object from an asset stored on disk + * + * @param rs Context to which the object will belong. + * @param mgr asset manager used to load asset + * @param path location of the file to load + * + */ static public FileA3D createFromAsset(RenderScript rs, AssetManager mgr, String path) { rs.validate(); int fileId = rs.nFileA3DCreateFromAsset(mgr, path); @@ -178,6 +208,13 @@ public class FileA3D extends BaseObj { return fa3d; } + /** + * Creates a FileA3D object from a file stored on disk + * + * @param rs Context to which the object will belong. + * @param path location of the file to load + * + */ static public FileA3D createFromFile(RenderScript rs, String path) { int fileId = rs.nFileA3DCreateFromFile(path); @@ -189,10 +226,25 @@ public class FileA3D extends BaseObj { return fa3d; } + /** + * Creates a FileA3D object from a file stored on disk + * + * @param rs Context to which the object will belong. + * @param path location of the file to load + * + */ static public FileA3D createFromFile(RenderScript rs, File path) { return createFromFile(rs, path.getAbsolutePath()); } + /** + * Creates a FileA3D object from an application resource + * + * @param rs Context to which the object will belong. + * @param res resource manager used for loading + * @param id resource to create FileA3D from + * + */ static public FileA3D createFromResource(RenderScript rs, Resources res, int id) { rs.validate(); diff --git a/graphics/java/android/renderscript/Mesh.java b/graphics/java/android/renderscript/Mesh.java index f1f1237..fcf8178 100644 --- a/graphics/java/android/renderscript/Mesh.java +++ b/graphics/java/android/renderscript/Mesh.java @@ -172,7 +172,7 @@ public class Mesh extends BaseObj { /** * Creates builder object - * @param rs + * @param rs Context to which the mesh will belong. * @param usage specifies how the mesh allocations are to be * handled, whether they need to be uploaded to a * buffer on the gpu, maintain a cpu copy, etc @@ -512,7 +512,7 @@ public class Mesh extends BaseObj { public static final int TEXTURE_0 = 0x0100; /** - * @param rs + * @param rs Context to which the mesh will belong. * @param vtxSize specifies whether the vertex is a float2 or * float3 * @param flags bitfield that is a combination of COLOR, NORMAL, diff --git a/graphics/java/android/renderscript/ProgramFragment.java b/graphics/java/android/renderscript/ProgramFragment.java index 14c0c01..333880d 100644 --- a/graphics/java/android/renderscript/ProgramFragment.java +++ b/graphics/java/android/renderscript/ProgramFragment.java @@ -36,7 +36,7 @@ public class ProgramFragment extends Program { /** * Create a builder object. * - * @param rs + * @param rs Context to which the program will belong. */ public Builder(RenderScript rs) { super(rs); diff --git a/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java b/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java index 663bc9f..1af31f8 100644 --- a/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java +++ b/graphics/java/android/renderscript/ProgramFragmentFixedFunction.java @@ -194,7 +194,7 @@ public class ProgramFragmentFixedFunction extends ProgramFragment { /** * Creates a builder for fixed function fragment program * - * @param rs + * @param rs Context to which the program will belong. */ public Builder(RenderScript rs) { mRS = rs; diff --git a/graphics/java/android/renderscript/ProgramStore.java b/graphics/java/android/renderscript/ProgramStore.java index d79900e..9128f9b 100644 --- a/graphics/java/android/renderscript/ProgramStore.java +++ b/graphics/java/android/renderscript/ProgramStore.java @@ -149,7 +149,7 @@ public class ProgramStore extends BaseObj { * - incoming pixels override the value stored in the color * buffer if it passes the depth test * - * @param rs + * @param rs Context to which the program will belong. **/ public static ProgramStore BLEND_NONE_DEPTH_TEST(RenderScript rs) { if(rs.mProgramStore_BLEND_NONE_DEPTH_TEST == null) { @@ -170,7 +170,7 @@ public class ProgramStore extends BaseObj { * - incoming pixels override the value stored in the color * buffer * - * @param rs + * @param rs Context to which the program will belong. **/ public static ProgramStore BLEND_NONE_DEPTH_NONE(RenderScript rs) { if(rs.mProgramStore_BLEND_NONE_DEPTH_NO_DEPTH == null) { @@ -194,7 +194,7 @@ public class ProgramStore extends BaseObj { * following formula * Final.RGB = Source.RGB * Source.A + Dest.RGB * (1 - Source.A) * - * @param rs + * @param rs Context to which the program will belong. **/ public static ProgramStore BLEND_ALPHA_DEPTH_TEST(RenderScript rs) { if(rs.mProgramStore_BLEND_ALPHA_DEPTH_TEST == null) { @@ -216,7 +216,7 @@ public class ProgramStore extends BaseObj { * (Dest) using the following formula * Final.RGB = Source.RGB * Source.A + Dest.RGB * (1 - Source.A) * - * @param rs + * @param rs Context to which the program will belong. **/ public static ProgramStore BLEND_ALPHA_DEPTH_NONE(RenderScript rs) { if(rs.mProgramStore_BLEND_ALPHA_DEPTH_NO_DEPTH == null) { diff --git a/graphics/java/android/renderscript/ProgramVertex.java b/graphics/java/android/renderscript/ProgramVertex.java index 7ba8b82..a965b81 100644 --- a/graphics/java/android/renderscript/ProgramVertex.java +++ b/graphics/java/android/renderscript/ProgramVertex.java @@ -46,7 +46,7 @@ public class ProgramVertex extends Program { /** * Create a builder object. * - * @param rs + * @param rs Context to which the program will belong. */ public Builder(RenderScript rs) { super(rs); diff --git a/graphics/java/android/renderscript/ProgramVertexFixedFunction.java b/graphics/java/android/renderscript/ProgramVertexFixedFunction.java index b9537c7..666c7ec 100644 --- a/graphics/java/android/renderscript/ProgramVertexFixedFunction.java +++ b/graphics/java/android/renderscript/ProgramVertexFixedFunction.java @@ -105,7 +105,7 @@ public class ProgramVertexFixedFunction extends ProgramVertex { /** * Creates a builder for fixed function vertex program * - * @param rs + * @param rs Context to which the program will belong. */ public Builder(RenderScript rs) { mRS = rs; @@ -196,9 +196,9 @@ public class ProgramVertexFixedFunction extends ProgramVertex { private FieldPacker mIOBuffer; /** - * Creates buffer to store fixed function emulation matrices + * Creates a buffer to store fixed function emulation matrices * - * @param rs + * @param rs Context to which the allocation will belong. **/ public Constants(RenderScript rs) { Type constInputType = ProgramVertexFixedFunction.Builder.getConstantInputType(rs); diff --git a/graphics/java/android/renderscript/Sampler.java b/graphics/java/android/renderscript/Sampler.java index 57a9889..c656d75 100644 --- a/graphics/java/android/renderscript/Sampler.java +++ b/graphics/java/android/renderscript/Sampler.java @@ -56,7 +56,7 @@ public class Sampler extends BaseObj { * Retrieve a sampler with min and mag set to nearest and wrap modes set to * clamp. * - * @param rs + * @param rs Context to which the sampler will belong. * * @return Sampler */ @@ -76,7 +76,7 @@ public class Sampler extends BaseObj { * Retrieve a sampler with min and mag set to linear and wrap modes set to * clamp. * - * @param rs + * @param rs Context to which the sampler will belong. * * @return Sampler */ @@ -96,7 +96,7 @@ public class Sampler extends BaseObj { * Retrieve a sampler with ag set to linear, min linear mipmap linear, and * to and wrap modes set to clamp. * - * @param rs + * @param rs Context to which the sampler will belong. * * @return Sampler */ @@ -116,7 +116,7 @@ public class Sampler extends BaseObj { * Retrieve a sampler with min and mag set to nearest and wrap modes set to * wrap. * - * @param rs + * @param rs Context to which the sampler will belong. * * @return Sampler */ @@ -136,7 +136,7 @@ public class Sampler extends BaseObj { * Retrieve a sampler with min and mag set to nearest and wrap modes set to * wrap. * - * @param rs + * @param rs Context to which the sampler will belong. * * @return Sampler */ @@ -156,7 +156,7 @@ public class Sampler extends BaseObj { * Retrieve a sampler with ag set to linear, min linear mipmap linear, and * to and wrap modes set to wrap. * - * @param rs + * @param rs Context to which the sampler will belong. * * @return Sampler */ diff --git a/libs/hwui/Debug.h b/libs/hwui/Debug.h index a194cbe..bdd8e73 100644 --- a/libs/hwui/Debug.h +++ b/libs/hwui/Debug.h @@ -47,4 +47,7 @@ // Turn on to display debug info about the layer renderer #define DEBUG_LAYER_RENDERER 0 +// Turn on to dump display list state +#define DEBUG_DISPLAY_LIST 0 + #endif // ANDROID_HWUI_DEBUG_H diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp index 57df976..75b1671 100644 --- a/libs/hwui/DisplayListRenderer.cpp +++ b/libs/hwui/DisplayListRenderer.cpp @@ -81,6 +81,39 @@ void PathHeap::flatten(SkFlattenableWriteBuffer& buffer) const { // Display list /////////////////////////////////////////////////////////////////////////////// +const char* DisplayList::OP_NAMES[] = { + "AcquireContext", + "ReleaseContext", + "Save", + "Restore", + "RestoreToCount", + "SaveLayer", + "SaveLayerAlpha", + "Translate", + "Rotate", + "Scale", + "SetMatrix", + "ConcatMatrix", + "ClipRect", + "DrawDisplayList", + "DrawLayer", + "DrawBitmap", + "DrawBitmapMatrix", + "DrawBitmapRect", + "DrawPatch", + "DrawColor", + "DrawRect", + "DrawPath", + "DrawLines", + "DrawText", + "ResetShader", + "SetupShader", + "ResetColorFilter", + "SetupColorFilter", + "ResetShadow", + "SetupShadow" +}; + DisplayList::DisplayList(const DisplayListRenderer& recorder) { initFromDisplayListRenderer(recorder); } @@ -173,14 +206,25 @@ void DisplayList::init() { mPathHeap = NULL; } -void DisplayList::replay(OpenGLRenderer& renderer) { +void DisplayList::replay(OpenGLRenderer& renderer, uint32_t level) { TextContainer text; mReader.rewind(); - int saveCount = renderer.getSaveCount() - 1; +#if DEBUG_DISPLAY_LIST + uint32_t count = (level + 1) * 2; + char indent[count + 1]; + for (uint32_t i = 0; i < count; i++) { + indent[i] = ' '; + } + indent[count] = '\0'; + DISPLAY_LIST_LOGD("%sStart display list (%p)", (char*) indent + 2, this); +#endif + int saveCount = renderer.getSaveCount() - 1; while (!mReader.eof()) { int op = mReader.readInt(); + DISPLAY_LIST_LOGD("%s%s", (char*) indent, OP_NAMES[op]); + switch (op) { case AcquireContext: { renderer.acquireContext(); @@ -238,7 +282,7 @@ void DisplayList::replay(OpenGLRenderer& renderer) { } break; case DrawDisplayList: { - renderer.drawDisplayList(getDisplayList()); + renderer.drawDisplayList(getDisplayList(), level + 1); } break; case DrawLayer: { @@ -326,6 +370,8 @@ void DisplayList::replay(OpenGLRenderer& renderer) { break; } } + + DISPLAY_LIST_LOGD("%sDone", (char*) indent + 2); } /////////////////////////////////////////////////////////////////////////////// @@ -482,7 +528,7 @@ bool DisplayListRenderer::clipRect(float left, float top, float right, float bot return OpenGLRenderer::clipRect(left, top, right, bottom, op); } -void DisplayListRenderer::drawDisplayList(DisplayList* displayList) { +void DisplayListRenderer::drawDisplayList(DisplayList* displayList, uint32_t level) { addOp(DisplayList::DrawDisplayList); addDisplayList(displayList); } diff --git a/libs/hwui/DisplayListRenderer.h b/libs/hwui/DisplayListRenderer.h index 0822725..cc52309 100644 --- a/libs/hwui/DisplayListRenderer.h +++ b/libs/hwui/DisplayListRenderer.h @@ -39,6 +39,13 @@ namespace uirenderer { #define MIN_WRITER_SIZE 16384 #define HEAP_BLOCK_SIZE 4096 +// Debug +#if DEBUG_DISPLAY_LIST + #define DISPLAY_LIST_LOGD(...) LOGD(__VA_ARGS__) +#else + #define DISPLAY_LIST_LOGD(...) +#endif + /////////////////////////////////////////////////////////////////////////////// // Helpers /////////////////////////////////////////////////////////////////////////////// @@ -78,8 +85,10 @@ public: DisplayList(const DisplayListRenderer& recorder); ~DisplayList(); + // IMPORTANT: Update the intialization of OP_NAMES in the .cpp file + // when modifying this file enum Op { - AcquireContext, + AcquireContext = 0, ReleaseContext, Save, Restore, @@ -108,12 +117,14 @@ public: ResetColorFilter, SetupColorFilter, ResetShadow, - SetupShadow + SetupShadow, }; + static const char* OP_NAMES[]; + void initFromDisplayListRenderer(const DisplayListRenderer& recorder); - void replay(OpenGLRenderer& renderer); + void replay(OpenGLRenderer& renderer, uint32_t level = 0); private: void init(); @@ -245,7 +256,7 @@ public: bool clipRect(float left, float top, float right, float bottom, SkRegion::Op op); - void drawDisplayList(DisplayList* displayList); + void drawDisplayList(DisplayList* displayList, uint32_t level = 0); void drawLayer(Layer* layer, float x, float y, SkPaint* paint); void drawBitmap(SkBitmap* bitmap, float left, float top, SkPaint* paint); void drawBitmap(SkBitmap* bitmap, SkMatrix* matrix, SkPaint* paint); diff --git a/libs/hwui/OpenGLDebugRenderer.cpp b/libs/hwui/OpenGLDebugRenderer.cpp index f71e5d6..29bcde8 100644 --- a/libs/hwui/OpenGLDebugRenderer.cpp +++ b/libs/hwui/OpenGLDebugRenderer.cpp @@ -48,7 +48,7 @@ int OpenGLDebugRenderer::saveLayer(float left, float top, float right, float bot return OpenGLRenderer::saveLayer(left, top, right, bottom, p, flags); } -void OpenGLDebugRenderer::drawDisplayList(DisplayList* displayList) { +void OpenGLDebugRenderer::drawDisplayList(DisplayList* displayList, uint32_t level) { mPrimitivesCount++; StopWatch w("drawDisplayList"); OpenGLRenderer::drawDisplayList(displayList); diff --git a/libs/hwui/OpenGLDebugRenderer.h b/libs/hwui/OpenGLDebugRenderer.h index 1cef267..aefa7bf 100644 --- a/libs/hwui/OpenGLDebugRenderer.h +++ b/libs/hwui/OpenGLDebugRenderer.h @@ -40,7 +40,7 @@ public: int saveLayer(float left, float top, float right, float bottom, SkPaint* p, int flags); - void drawDisplayList(DisplayList* displayList); + void drawDisplayList(DisplayList* displayList, uint32_t level = 0); void drawLayer(Layer* layer, float x, float y, SkPaint* paint); void drawBitmap(SkBitmap* bitmap, float left, float top, SkPaint* paint); void drawBitmap(SkBitmap* bitmap, SkMatrix* matrix, SkPaint* paint); diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 7f7deec..f005573 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -697,12 +697,12 @@ void OpenGLRenderer::dirtyLayer(const float left, const float top, if ((mSnapshot->flags & Snapshot::kFlagFboTarget) && mSnapshot->region) { Rect bounds(left, top, right, bottom); transform.mapRect(bounds); - bounds.intersect(*mSnapshot->clipRect); - bounds.snapToPixelBoundaries(); - - android::Rect dirty(bounds.left, bounds.top, bounds.right, bounds.bottom); - if (!dirty.isEmpty()) { - mSnapshot->region->orSelf(dirty); + if (bounds.intersect(*mSnapshot->clipRect)) { + bounds.snapToPixelBoundaries(); + android::Rect dirty(bounds.left, bounds.top, bounds.right, bounds.bottom); + if (!dirty.isEmpty()) { + mSnapshot->region->orSelf(dirty); + } } } #endif @@ -713,12 +713,12 @@ void OpenGLRenderer::dirtyLayer(const float left, const float top, #if RENDER_LAYERS_AS_REGIONS if ((mSnapshot->flags & Snapshot::kFlagFboTarget) && mSnapshot->region) { Rect bounds(left, top, right, bottom); - bounds.intersect(*mSnapshot->clipRect); - bounds.snapToPixelBoundaries(); - - android::Rect dirty(bounds.left, bounds.top, bounds.right, bounds.bottom); - if (!dirty.isEmpty()) { - mSnapshot->region->orSelf(dirty); + if (bounds.intersect(*mSnapshot->clipRect)) { + bounds.snapToPixelBoundaries(); + android::Rect dirty(bounds.left, bounds.top, bounds.right, bounds.bottom); + if (!dirty.isEmpty()) { + mSnapshot->region->orSelf(dirty); + } } } #endif @@ -1024,11 +1024,11 @@ void OpenGLRenderer::finishDrawTexture() { // Drawing /////////////////////////////////////////////////////////////////////////////// -void OpenGLRenderer::drawDisplayList(DisplayList* displayList) { +void OpenGLRenderer::drawDisplayList(DisplayList* displayList, uint32_t level) { // All the usual checks and setup operations (quickReject, setupDraw, etc.) // will be performed by the display list itself if (displayList) { - displayList->replay(*this); + displayList->replay(*this, level); } } diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h index da27dac..8cec8f1 100644 --- a/libs/hwui/OpenGLRenderer.h +++ b/libs/hwui/OpenGLRenderer.h @@ -94,7 +94,7 @@ public: bool quickReject(float left, float top, float right, float bottom); virtual bool clipRect(float left, float top, float right, float bottom, SkRegion::Op op); - virtual void drawDisplayList(DisplayList* displayList); + virtual void drawDisplayList(DisplayList* displayList, uint32_t level = 0); virtual void drawLayer(Layer* layer, float x, float y, SkPaint* paint); virtual void drawBitmap(SkBitmap* bitmap, float left, float top, SkPaint* paint); virtual void drawBitmap(SkBitmap* bitmap, SkMatrix* matrix, SkPaint* paint); diff --git a/libs/rs/Android.mk b/libs/rs/Android.mk index d8d70c6..3835852 100644 --- a/libs/rs/Android.mk +++ b/libs/rs/Android.mk @@ -23,17 +23,17 @@ include $(BUILD_HOST_EXECUTABLE) # TODO: This should go into build/core/config.mk RSG_GENERATOR:=$(LOCAL_BUILT_MODULE) -include $(CLEAR_VARS) -input_data_file := $(LOCAL_PATH)/rslib.bc -slangdata_output_var_name := rs_runtime_lib_bc -LOCAL_MODULE := librslib_rt +# include $(CLEAR_VARS) +# input_data_file := $(LOCAL_PATH)/rslib.bc +# slangdata_output_var_name := rs_runtime_lib_bc +# LOCAL_MODULE := librslib_rt -LOCAL_PRELINK_MODULE := false -LOCAL_MODULE_CLASS := STATIC_LIBRARIES +# LOCAL_PRELINK_MODULE := false +# LOCAL_MODULE_CLASS := STATIC_LIBRARIES -LOCAL_MODULE_TAGS := optional -include frameworks/compile/slang/SlangData.mk -include $(BUILD_STATIC_LIBRARY) +# LOCAL_MODULE_TAGS := optional +# include frameworks/compile/slang/SlangData.mk +# include $(BUILD_STATIC_LIBRARY) # Build render script lib ==================== @@ -119,9 +119,10 @@ LOCAL_SRC_FILES:= \ LOCAL_SHARED_LIBRARIES += libz libcutils libutils libEGL libGLESv1_CM libGLESv2 libui libbcc -LOCAL_STATIC_LIBRARIES := libdex libft2 librslib_rt +LOCAL_STATIC_LIBRARIES := libdex libft2 LOCAL_C_INCLUDES += external/freetype/include external/zlib dalvik +LOCAL_C_INCLUDES += frameworks/compile/libbcc/include LOCAL_LDLIBS := -lpthread -ldl LOCAL_MODULE:= libRS diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index bb38825..2e0c491 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -236,6 +236,7 @@ bool Context::initGLThread() { glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, &mGL.mMaxFragmentUniformVectors); mGL.OES_texture_npot = NULL != strstr((const char *)mGL.mExtensions, "GL_OES_texture_npot"); + mGL.GL_IMG_texture_npot = NULL != strstr((const char *)mGL.mExtensions, "GL_IMG_texture_npot"); mGL.GL_NV_texture_npot_2D_mipmap = NULL != strstr((const char *)mGL.mExtensions, "GL_NV_texture_npot_2D_mipmap"); mGL.EXT_texture_max_aniso = 1.0f; bool hasAniso = NULL != strstr((const char *)mGL.mExtensions, "GL_EXT_texture_filter_anisotropic"); diff --git a/libs/rs/rsContext.h b/libs/rs/rsContext.h index df275bc..9f94f26 100644 --- a/libs/rs/rsContext.h +++ b/libs/rs/rsContext.h @@ -205,6 +205,7 @@ public: mutable const ObjectBase * mObjHead; bool ext_OES_texture_npot() const {return mGL.OES_texture_npot;} + bool ext_GL_IMG_texture_npot() const {return mGL.GL_IMG_texture_npot;} bool ext_GL_NV_texture_npot_2D_mipmap() const {return mGL.GL_NV_texture_npot_2D_mipmap;} float ext_texture_max_aniso() const {return mGL.EXT_texture_max_aniso; } uint32_t getMaxFragmentTextures() const {return mGL.mMaxFragmentTextureImageUnits;} @@ -249,6 +250,7 @@ protected: int32_t mMaxVertexTextureUnits; bool OES_texture_npot; + bool GL_IMG_texture_npot; bool GL_NV_texture_npot_2D_mipmap; float EXT_texture_max_aniso; } mGL; diff --git a/libs/rs/rsContextHostStub.h b/libs/rs/rsContextHostStub.h index c22647f..8cfb38b 100644 --- a/libs/rs/rsContextHostStub.h +++ b/libs/rs/rsContextHostStub.h @@ -119,11 +119,12 @@ public: mutable const ObjectBase * mObjHead; bool ext_OES_texture_npot() const {return mGL.OES_texture_npot;} - bool ext_GL_NV_texture_npot_2D_mipmap() const {return false;} - float ext_texture_max_aniso() const {return 1.0f;} + bool ext_GL_NV_texture_npot_2D_mipmap() const {return mGL.GL_NV_texture_npot_2D_mipmap;} + float ext_texture_max_aniso() const {return mGL.EXT_texture_max_aniso; } uint32_t getMaxFragmentTextures() const {return mGL.mMaxFragmentTextureImageUnits;} uint32_t getMaxFragmentUniformVectors() const {return mGL.mMaxFragmentUniformVectors;} uint32_t getMaxVertexUniformVectors() const {return mGL.mMaxVertexUniformVectors;} + uint32_t getMaxVertexAttributes() const {return mGL.mMaxVertexAttribs;} protected: @@ -147,6 +148,8 @@ protected: int32_t mMaxVertexTextureUnits; bool OES_texture_npot; + bool GL_NV_texture_npot_2D_mipmap; + float EXT_texture_max_aniso; } mGL; }; diff --git a/libs/rs/rsSampler.cpp b/libs/rs/rsSampler.cpp index e2757df..c80aecc 100644 --- a/libs/rs/rsSampler.cpp +++ b/libs/rs/rsSampler.cpp @@ -77,8 +77,20 @@ void Sampler::setupGL(const Context *rsc, const Allocation *tex) { GLenum target = (GLenum)tex->getGLTarget(); if (!rsc->ext_OES_texture_npot() && tex->getType()->getIsNp2()) { - if (tex->getHasGraphicsMipmaps() && rsc->ext_GL_NV_texture_npot_2D_mipmap()) { - glTexParameteri(target, GL_TEXTURE_MIN_FILTER, trans[mMinFilter]); + if (tex->getHasGraphicsMipmaps() && + (rsc->ext_GL_NV_texture_npot_2D_mipmap() || rsc->ext_GL_IMG_texture_npot())) { + if (rsc->ext_GL_NV_texture_npot_2D_mipmap()) { + glTexParameteri(target, GL_TEXTURE_MIN_FILTER, trans[mMinFilter]); + } else { + switch (trans[mMinFilter]) { + case GL_LINEAR_MIPMAP_LINEAR: + glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); + break; + default: + glTexParameteri(target, GL_TEXTURE_MIN_FILTER, trans[mMinFilter]); + break; + } + } } else { glTexParameteri(target, GL_TEXTURE_MIN_FILTER, transNP[mMinFilter]); } diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp index 5dd976a..872e7a6 100644 --- a/libs/rs/rsScriptC.cpp +++ b/libs/rs/rsScriptC.cpp @@ -17,7 +17,6 @@ #include "rsContext.h" #include "rsScriptC.h" #include "rsMatrix.h" -#include "../../compile/libbcc/include/bcc/bcc.h" #include "utils/Timers.h" #include "utils/StopWatch.h" extern "C" { @@ -35,6 +34,64 @@ using namespace android::renderscript; Context * rsc = tls->mContext; \ ScriptC * sc = (ScriptC *) tls->mScript +// Input: cacheDir +// Input: resName +// Input: extName +// +// Note: cacheFile = resName + extName +// +// Output: Returns cachePath == cacheDir + cacheFile +char *genCacheFileName(const char *cacheDir, + const char *resName, + const char *extName) { + char cachePath[512]; + char cacheFile[sizeof(cachePath)]; + const size_t kBufLen = sizeof(cachePath) - 1; + + cacheFile[0] = '\0'; + // Note: resName today is usually something like + // "/com.android.fountain:raw/fountain" + if (resName[0] != '/') { + // Get the absolute path of the raw/***.bc file. + + // Generate the absolute path. This doesn't do everything it + // should, e.g. if resName is "./out/whatever" it doesn't crunch + // the leading "./" out because this if-block is not triggered, + // but it'll make do. + // + if (getcwd(cacheFile, kBufLen) == NULL) { + LOGE("Can't get CWD while opening raw/***.bc file\n"); + return NULL; + } + // Append "/" at the end of cacheFile so far. + strncat(cacheFile, "/", kBufLen); + } + + // cacheFile = resName + extName + // + strncat(cacheFile, resName, kBufLen); + if (extName != NULL) { + // TODO(srhines): strncat() is a bit dangerous + strncat(cacheFile, extName, kBufLen); + } + + // Turn the path into a flat filename by replacing + // any slashes after the first one with '@' characters. + char *cp = cacheFile + 1; + while (*cp != '\0') { + if (*cp == '/') { + *cp = '@'; + } + cp++; + } + + // Tack on the file name for the actual cache file path. + strncpy(cachePath, cacheDir, kBufLen); + strncat(cachePath, cacheFile, kBufLen); + + LOGV("Cache file for '%s' '%s' is '%s'\n", resName, extName, cachePath); + return strdup(cachePath); +} ScriptC::ScriptC(Context *rsc) : Script(rsc) { LOGD(">>>> ScriptC ctor called, obj=%p", this); @@ -45,7 +102,7 @@ ScriptC::ScriptC(Context *rsc) : Script(rsc) { ScriptC::~ScriptC() { LOGD(">>>> ~ScriptC() mBccScript = %p", mBccScript); if (mBccScript) { - bccDeleteScript(mBccScript); + bccDisposeScript(mBccScript); LOGD(">>>> ~ScriptC(mBCCScript)"); } free(mEnviroment.mScriptText); @@ -381,11 +438,11 @@ void ScriptCState::clear(Context *rsc) { mScript.set(new ScriptC(rsc)); } -static BCCvoid* symbolLookup(BCCvoid* pContext, const BCCchar* name) { +static void* symbolLookup(void* pContext, char const* name) { const ScriptCState::SymbolTable_t *sym; ScriptC *s = (ScriptC *)pContext; if (!strcmp(name, "__isThreadable")) { - return (BCCvoid*) s->mEnviroment.mIsThreadable; + return (void*) s->mEnviroment.mIsThreadable; } else if (!strcmp(name, "__clearThreadable")) { s->mEnviroment.mIsThreadable = false; return NULL; @@ -420,30 +477,33 @@ void ScriptCState::runCompiler(Context *rsc, bccRegisterSymbolCallback(s->mBccScript, symbolLookup, s); if (bccReadBC(s->mBccScript, + resName, s->mEnviroment.mScriptText, - s->mEnviroment.mScriptTextLength, - /*deprecated*/ 0, /*deprecated*/ 0, - resName, cacheDir) != 0) { + s->mEnviroment.mScriptTextLength, 0) != 0) { LOGE("bcc: FAILS to read bitcode"); // Handle Fatal Error } #if 0 if (bccLinkBC(s->mBccScript, + resName, rs_runtime_lib_bc, - rs_runtime_lib_bc_size) != 0) { + rs_runtime_lib_bc_size, 0) != 0) { LOGE("bcc: FAILS to link bitcode"); // Handle Fatal Error } #endif + char *cachePath = genCacheFileName(cacheDir, resName, ".oBCC"); - if (bccPrepareExecutable(s->mBccScript) != 0) { + if (bccPrepareExecutable(s->mBccScript, cachePath, 0) != 0) { LOGE("bcc: FAILS to prepare executable"); // Handle Fatal Error } - bccGetScriptLabel(s->mBccScript, "root", (BCCvoid**) &s->mProgram.mRoot); - bccGetScriptLabel(s->mBccScript, "init", (BCCvoid**) &s->mProgram.mInit); + free(cachePath); + + s->mProgram.mRoot = reinterpret_cast<int (*)()>(bccGetFuncAddr(s->mBccScript, "root")); + s->mProgram.mInit = reinterpret_cast<void (*)()>(bccGetFuncAddr(s->mBccScript, "init")); } LOGV("%p ScriptCState::runCompiler root %p, init %p", rsc, s->mProgram.mRoot, s->mProgram.mInit); @@ -451,20 +511,20 @@ void ScriptCState::runCompiler(Context *rsc, s->mProgram.mInit(); } - bccGetExportFuncs(s->mBccScript, (BCCsizei*) &s->mEnviroment.mInvokeFunctionCount, 0, NULL); + s->mEnviroment.mInvokeFunctionCount = bccGetExportFuncCount(s->mBccScript); if (s->mEnviroment.mInvokeFunctionCount <= 0) s->mEnviroment.mInvokeFunctions = NULL; else { s->mEnviroment.mInvokeFunctions = (Script::InvokeFunc_t*) calloc(s->mEnviroment.mInvokeFunctionCount, sizeof(Script::InvokeFunc_t)); - bccGetExportFuncs(s->mBccScript, NULL, s->mEnviroment.mInvokeFunctionCount, (BCCvoid **) s->mEnviroment.mInvokeFunctions); + bccGetExportFuncList(s->mBccScript, s->mEnviroment.mInvokeFunctionCount, (void **) s->mEnviroment.mInvokeFunctions); } - bccGetExportVars(s->mBccScript, (BCCsizei*) &s->mEnviroment.mFieldCount, 0, NULL); + s->mEnviroment.mFieldCount = bccGetExportVarCount(s->mBccScript); if (s->mEnviroment.mFieldCount <= 0) s->mEnviroment.mFieldAddress = NULL; else { s->mEnviroment.mFieldAddress = (void **) calloc(s->mEnviroment.mFieldCount, sizeof(void *)); - bccGetExportVars(s->mBccScript, NULL, s->mEnviroment.mFieldCount, (BCCvoid **) s->mEnviroment.mFieldAddress); + bccGetExportVarList(s->mBccScript, s->mEnviroment.mFieldCount, (void **) s->mEnviroment.mFieldAddress); s->initSlots(); } @@ -475,63 +535,61 @@ void ScriptCState::runCompiler(Context *rsc, if (s->mProgram.mRoot) { const static int pragmaMax = 16; - BCCsizei pragmaCount; - BCCchar * str[pragmaMax]; - bccGetPragmas(s->mBccScript, &pragmaCount, pragmaMax, &str[0]); - - for (int ct=0; ct < pragmaCount; ct+=2) { - //LOGE("pragme %s %s", str[ct], str[ct+1]); - if (!strcmp(str[ct], "version")) { + size_t pragmaCount = bccGetPragmaCount(s->mBccScript); + char const *keys[pragmaMax]; + char const *values[pragmaMax]; + bccGetPragmaList(s->mBccScript, pragmaMax, keys, values); + + for (size_t i=0; i < pragmaCount; ++i) { + //LOGE("pragma %s %s", keys[i], values[i]); + if (!strcmp(keys[i], "version")) { continue; } - if (!strcmp(str[ct], "stateVertex")) { - if (!strcmp(str[ct+1], "default")) { + if (!strcmp(keys[i], "stateVertex")) { + if (!strcmp(values[i], "default")) { continue; } - if (!strcmp(str[ct+1], "parent")) { + if (!strcmp(values[i], "parent")) { s->mEnviroment.mVertex.clear(); continue; } - LOGE("Unreconized value %s passed to stateVertex", str[ct+1]); + LOGE("Unreconized value %s passed to stateVertex", values[i]); } - if (!strcmp(str[ct], "stateRaster")) { - if (!strcmp(str[ct+1], "default")) { + if (!strcmp(keys[i], "stateRaster")) { + if (!strcmp(values[i], "default")) { continue; } - if (!strcmp(str[ct+1], "parent")) { + if (!strcmp(values[i], "parent")) { s->mEnviroment.mRaster.clear(); continue; } - LOGE("Unreconized value %s passed to stateRaster", str[ct+1]); + LOGE("Unreconized value %s passed to stateRaster", values[i]); } - if (!strcmp(str[ct], "stateFragment")) { - if (!strcmp(str[ct+1], "default")) { + if (!strcmp(keys[i], "stateFragment")) { + if (!strcmp(values[i], "default")) { continue; } - if (!strcmp(str[ct+1], "parent")) { + if (!strcmp(values[i], "parent")) { s->mEnviroment.mFragment.clear(); continue; } - LOGE("Unreconized value %s passed to stateFragment", str[ct+1]); + LOGE("Unreconized value %s passed to stateFragment", values[i]); } - if (!strcmp(str[ct], "stateStore")) { - if (!strcmp(str[ct+1], "default")) { + if (!strcmp(keys[i], "stateStore")) { + if (!strcmp(values[i], "default")) { continue; } - if (!strcmp(str[ct+1], "parent")) { + if (!strcmp(values[i], "parent")) { s->mEnviroment.mFragmentStore.clear(); continue; } - LOGE("Unreconized value %s passed to stateStore", str[ct+1]); + LOGE("Unreconized value %s passed to stateStore", values[i]); } - } - - } else { LOGE("bcc: FAILS to prepare executable"); // Handle Fatal Error diff --git a/libs/rs/rsScriptC.h b/libs/rs/rsScriptC.h index cd68546..483481e 100644 --- a/libs/rs/rsScriptC.h +++ b/libs/rs/rsScriptC.h @@ -21,9 +21,7 @@ #include "RenderScriptEnv.h" -namespace bcc { -class Script; -} +#include <bcc/bcc.h> // --------------------------------------------------------------------------- namespace android { @@ -48,7 +46,7 @@ public: Program_t mProgram; - bcc::Script* mBccScript; + BCCScriptRef mBccScript; const Allocation *ptrToAllocation(const void *) const; diff --git a/libs/rs/rslib.bc b/libs/rs/rslib.bc Binary files differdeleted file mode 100644 index 761e765..0000000 --- a/libs/rs/rslib.bc +++ /dev/null diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_input_methods_item.xml b/packages/SystemUI/res/layout-xlarge/status_bar_input_methods_item.xml new file mode 100644 index 0000000..3028a42 --- /dev/null +++ b/packages/SystemUI/res/layout-xlarge/status_bar_input_methods_item.xml @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** Copyright 2011, 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. +*/ +--> + +<LinearLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:minHeight="?android:attr/listPreferredItemHeight" + android:background="@drawable/status_bar_item_background" + android:orientation="vertical" + android:paddingRight="6dip" + android:paddingLeft="6dip" + android:paddingTop="5dip" + android:paddingBottom="5dip" + android:gravity="center_vertical"> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_weight="1" + android:gravity="center_vertical" + android:orientation="horizontal"> + <LinearLayout + android:id="@+id/item_subtype" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:layout_weight="1" + android:gravity="center_vertical" + android:orientation="horizontal" + android:background="?android:attr/selectableItemBackground"> + <RadioButton + android:id="@+id/item_radio" + android:layout_width="30dip" + android:layout_height="wrap_content" + android:layout_marginRight="11dip" + android:focusable="false" + android:clickable="false" /> + <ImageView + android:id="@+id/item_icon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:scaleType="fitCenter" /> + <LinearLayout + android:orientation="vertical" + android:layout_width="0px" + android:layout_weight="1" + android:layout_height="wrap_content"> + <TextView + android:id="@+id/item_title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textAppearance="?android:attr/textAppearanceMedium" + android:singleLine="true" + android:ellipsize="marquee" + android:layout_marginBottom="2dip" /> + <TextView + android:id="@+id/item_subtitle" + android:layout_marginTop="-4dip" + android:layout_gravity="center_vertical|left" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:textAppearance="?android:attr/textAppearanceSmall" /> + </LinearLayout> + </LinearLayout> + <View + android:id="@+id/item_vertical_separator" + android:layout_width="2dip" + android:layout_height="match_parent" + android:layout_marginBottom="5dip" + android:background="@android:drawable/divider_horizontal_dark" /> + <ImageView + android:id="@+id/item_settings_icon" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:layout_marginLeft="5dip" + android:layout_gravity="center_vertical" + android:paddingRight="10dip" + android:paddingLeft="10dip" + android:src="@drawable/ic_sysbar_quicksettings" + android:visibility="visible" + android:clickable="true" + android:focusable="true" + android:background="?android:attr/selectableItemBackground" /> + </LinearLayout> + <View + android:layout_width="match_parent" + android:layout_height="1dip" + android:background="@android:drawable/divider_horizontal_dark" /> +</LinearLayout>
\ No newline at end of file diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_input_methods_panel.xml b/packages/SystemUI/res/layout-xlarge/status_bar_input_methods_panel.xml new file mode 100644 index 0000000..c4bca61 --- /dev/null +++ b/packages/SystemUI/res/layout-xlarge/status_bar_input_methods_panel.xml @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +** +** Copyright 2011, 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. +*/ +--> + +<com.android.systemui.statusbar.tablet.InputMethodsPanel + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_height="match_parent" + android:layout_width="match_parent" + android:paddingBottom="28dip" + android:orientation="vertical"> + <View + android:layout_width="match_parent" + android:layout_height="0dip" + android:layout_weight="1" /> + <FrameLayout + android:id="@+id/glow" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@drawable/recents_blue_glow"> + <LinearLayout + android:layout_width="450dip" + android:layout_height="wrap_content" + android:layout_marginLeft="20dip" + android:orientation="vertical" + android:background="@*android:drawable/dialog_full_holo_dark"> + <ScrollView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:overScrollMode="ifContentScrolls" + android:layout_marginTop="3dip" + android:layout_weight="1"> + <LinearLayout + android:id="@+id/input_method_menu_list" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="vertical" /> + </ScrollView> + <TextView + android:id="@+id/ime_settings_shortcut" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:minHeight="?android:attr/listPreferredItemHeight" + android:background="?android:attr/selectableItemBackground" + android:orientation="vertical" + android:paddingRight="6dip" + android:paddingLeft="30dip" + android:paddingTop="5dip" + android:paddingBottom="5dip" + android:gravity="center_vertical" + android:singleLine="true" + android:text="@string/status_bar_input_method_settings_configure_input_methods" + android:textAppearance="?android:attr/textAppearanceMedium" + android:ellipsize="marquee" /> + </LinearLayout> + </FrameLayout> +</com.android.systemui.statusbar.tablet.InputMethodsPanel>
\ No newline at end of file diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index caafbdb..53d06c0 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -109,5 +109,7 @@ <string name="recent_tasks_app_label">Apps</string> <!-- Network connection string for Bluetooth Reverse Tethering --> - <string name="bluetooth_tethered">Bluetooth tethered"</string> + <string name="bluetooth_tethered">Bluetooth tethered</string> + <!-- Title of a button to open the settings for input methods [CHAR LIMIT=30] --> + <string name="status_bar_input_method_settings_configure_input_methods">Configure input methods</string> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java index df4bfa1..69bc161 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java @@ -19,11 +19,9 @@ package com.android.systemui.statusbar.tablet; import android.content.Context; import android.content.pm.PackageManager; import android.graphics.drawable.Drawable; -import android.os.Handler; import android.os.IBinder; import android.provider.Settings; import android.util.Log; -import android.util.Slog; import android.util.AttributeSet; import android.view.inputmethod.InputMethodInfo; import android.view.inputmethod.InputMethodManager; @@ -31,11 +29,8 @@ import android.view.inputmethod.InputMethodSubtype; import android.view.View; import android.widget.ImageView; -import com.android.server.InputMethodManagerService; import com.android.systemui.R; -import java.util.ArrayList; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -56,9 +51,6 @@ public class InputMethodButton extends ImageView { // other services we wish to talk to private final InputMethodManager mImm; private final int mId; - // Cache of InputMethodsInfo - private final HashMap<String, InputMethodInfo> mInputMethodsInfo = - new HashMap<String, InputMethodInfo>(); private ImageView mIcon; private IBinder mToken; private boolean mKeyboardVisible = false; @@ -102,20 +94,6 @@ public class InputMethodButton extends ImageView { refreshStatusIcon(); } - private InputMethodInfo getCurrentInputMethodInfo() { - String curInputMethodId = Settings.Secure.getString(getContext() - .getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD); - if (!mInputMethodsInfo.containsKey(curInputMethodId)) { - mInputMethodsInfo.clear(); - List<InputMethodInfo> imis = mImm.getInputMethodList(); - for (int i = 0; i < imis.size(); ++i) { - InputMethodInfo imi = imis.get(i); - mInputMethodsInfo.put(imi.getId(), imi); - } - } - return mInputMethodsInfo.get(curInputMethodId); - } - // TODO: Need to show an appropriate drawable for this shortcut button, // if there are two or more shortcut input methods contained in this button. // And need to add other methods to handle multiple shortcuts as appropriate. @@ -141,8 +119,7 @@ public class InputMethodButton extends ImageView { final PackageManager pm = getContext().getPackageManager(); if (imi != null) { if (DEBUG) { - Log.d(TAG, "Update icons of IME: " + imi.getPackageName() + "," - + subtype.getLocale() + "," + subtype.getMode()); + Log.d(TAG, "Update icons of IME: " + imi.getPackageName()); } if (subtype != null) { return pm.getDrawable(imi.getPackageName(), subtype.getIconResId(), @@ -188,25 +165,19 @@ public class InputMethodButton extends ImageView { return; } if (!needsToShowIMEButton()) { - setVisibility(View.INVISIBLE); + setVisibility(View.GONE); return; } else { setVisibility(View.VISIBLE); } Drawable icon = null; switch (mId) { - case ID_IME_SWITCH_BUTTON: - // TODO: Just showing the first shortcut IME subtype for now. Should handle all - // shortcuts as appropriate. - icon = getSubtypeIcon(getCurrentInputMethodInfo(), - mImm.getCurrentInputMethodSubtype()); - break; case ID_IME_SHORTCUT_BUTTON: icon = getShortcutInputMethodAndSubtypeDrawable(); break; } if (icon == null) { - mIcon.setImageResource(R.drawable.ic_sysbar_ime_default); + mIcon.setImageResource(R.drawable.ic_sysbar_ime); } else { mIcon.setImageDrawable(icon); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java new file mode 100644 index 0000000..d4ba693 --- /dev/null +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java @@ -0,0 +1,341 @@ +/* + * Copyright (C) 2011 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 com.android.systemui.statusbar.tablet; + +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.content.res.Resources; +import android.graphics.drawable.Drawable; +import android.os.IBinder; +import android.provider.Settings; +import android.text.TextUtils; +import android.util.AttributeSet; +import android.util.Log; +import android.util.Pair; +import android.view.View; +import android.view.View.OnClickListener; +import android.view.inputmethod.InputMethodInfo; +import android.view.inputmethod.InputMethodManager; +import android.view.inputmethod.InputMethodSubtype; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.RadioButton; +import android.widget.TextView; + +import java.util.HashMap; +import java.util.List; +import java.util.Set; + +import com.android.systemui.R; + +public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, OnClickListener { + private static final boolean DEBUG = TabletStatusBar.DEBUG; + private static final String TAG = "InputMethodsPanel"; + + private final InputMethodManager mImm; + private final HashMap<InputMethodInfo, List<InputMethodSubtype>> + mEnabledInputMethodAndSubtypesCache = + new HashMap<InputMethodInfo, List<InputMethodSubtype>>(); + private final HashMap<View, Pair<InputMethodInfo, InputMethodSubtype>> mRadioViewAndImiMap = + new HashMap<View, Pair<InputMethodInfo, InputMethodSubtype>>(); + private final PackageManager mPackageManager; + + private Context mContext; + private IBinder mToken; + private LinearLayout mInputMethodMenuList; + private String mEnabledInputMethodAndSubtypesCacheStr; + private View mConfigureImeShortcut; + + public InputMethodsPanel(Context context, AttributeSet attrs) { + this(context, attrs, 0); + } + + public InputMethodsPanel(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + mContext = context; + mImm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); + mPackageManager = context.getPackageManager(); + } + + @Override + public void onFinishInflate() { + mInputMethodMenuList = (LinearLayout) findViewById(R.id.input_method_menu_list); + mConfigureImeShortcut = ((View) findViewById(R.id.ime_settings_shortcut)); + mConfigureImeShortcut.setOnClickListener(this); + // TODO: If configurations for IME are not changed, do not update + // by checking onConfigurationChanged. + updateUiElements(); + } + + @Override + public boolean isInContentArea(int x, int y) { + return false; + } + + @Override + protected void onVisibilityChanged(View changedView, int visibility) { + super.onVisibilityChanged(changedView, visibility); + if (visibility == View.VISIBLE && changedView == this) { + updateUiElements(); + } + } + + @Override + public void onClick(View view) { + if (view == mConfigureImeShortcut) { + showConfigureInputMethods(); + onFinishPanel(true); + return; + } + } + + private void onFinishPanel(boolean closeKeyboard) { + setVisibility(View.GONE); + if (closeKeyboard) { + mImm.hideSoftInputFromWindow(getWindowToken(), 0); + } + } + + private void startActivity(Intent intent) { + mContext.startActivity(intent); + } + + private void showConfigureInputMethods() { + Intent intent = new Intent(Settings.ACTION_INPUT_METHOD_SETTINGS); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK + | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED + | Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(intent); + } + + private View createInputMethodItem( + final InputMethodInfo imi, final InputMethodSubtype subtype) { + CharSequence subtypeName = getSubtypeName(imi, subtype); + CharSequence imiName = getIMIName(imi); + Drawable icon = getSubtypeIcon(imi, subtype); + View view = View.inflate(mContext, R.layout.status_bar_input_methods_item, null); + ImageView subtypeIcon = (ImageView)view.findViewById(R.id.item_icon); + TextView itemTitle = (TextView)view.findViewById(R.id.item_title); + TextView itemSubtitle = (TextView)view.findViewById(R.id.item_subtitle); + ImageView settingsIcon = (ImageView)view.findViewById(R.id.item_settings_icon); + View subtypeView = view.findViewById(R.id.item_subtype); + if (subtypeName == null) { + itemTitle.setText(imiName); + itemSubtitle.setVisibility(View.GONE); + } else { + itemTitle.setText(subtypeName); + itemSubtitle.setVisibility(View.VISIBLE); + itemSubtitle.setText(imiName); + } + subtypeIcon.setImageDrawable(icon); + final String settingsActivity = imi.getSettingsActivity(); + if (!TextUtils.isEmpty(settingsActivity)) { + settingsIcon.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View arg0) { + Intent intent = new Intent(Intent.ACTION_MAIN); + intent.setClassName(imi.getPackageName(), settingsActivity); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK + | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED + | Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(intent); + onFinishPanel(true); + } + }); + } else { + // Do not show the settings icon if the IME does not have a settings preference + view.findViewById(R.id.item_vertical_separator).setVisibility(View.GONE); + settingsIcon.setVisibility(View.GONE); + } + mRadioViewAndImiMap.put( + subtypeView, new Pair<InputMethodInfo, InputMethodSubtype> (imi, subtype)); + subtypeView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Pair<InputMethodInfo, InputMethodSubtype> imiAndSubtype = + updateRadioButtonsByView(view); + onFinishPanel(false); + setInputMethodAndSubtype(imiAndSubtype.first, imiAndSubtype.second); + } + }); + return view; + } + + private void updateUiElements() { + // TODO: Reuse subtype views. + mInputMethodMenuList.removeAllViews(); + mRadioViewAndImiMap.clear(); + HashMap<InputMethodInfo, List<InputMethodSubtype>> enabledIMIs + = getEnabledInputMethodAndSubtypeList(); + // TODO: Sort by alphabet and mode. + Set<InputMethodInfo> cachedImiSet = enabledIMIs.keySet(); + for (InputMethodInfo imi: cachedImiSet) { + List<InputMethodSubtype> subtypes = enabledIMIs.get(imi); + if (subtypes == null || subtypes.size() == 0) { + mInputMethodMenuList.addView( + createInputMethodItem(imi, null)); + continue; + } + for (InputMethodSubtype subtype: subtypes) { + mInputMethodMenuList.addView(createInputMethodItem(imi, subtype)); + } + } + updateRadioButtons(); + } + + public void setIMEToken(IBinder token) { + mToken = token; + } + + private void setInputMethodAndSubtype(InputMethodInfo imi, InputMethodSubtype subtype) { + if (mToken != null) { + mImm.setInputMethodAndSubtype(mToken, imi.getId(), subtype); + } else { + Log.w(TAG, "IME Token is not set yet."); + } + } + + // Turn on the selected radio button when the user chooses the item + private Pair<InputMethodInfo, InputMethodSubtype> updateRadioButtonsByView(View selectedView) { + Pair<InputMethodInfo, InputMethodSubtype> selectedImiAndSubtype = null; + if (mRadioViewAndImiMap.containsKey(selectedView)) { + for (View radioView: mRadioViewAndImiMap.keySet()) { + RadioButton subtypeRadioButton = + (RadioButton) radioView.findViewById(R.id.item_radio); + if (subtypeRadioButton == null) { + Log.w(TAG, "RadioButton was not found in the selected subtype view"); + return null; + } + if (radioView == selectedView) { + Pair<InputMethodInfo, InputMethodSubtype> imiAndSubtype = + mRadioViewAndImiMap.get(radioView); + selectedImiAndSubtype = imiAndSubtype; + subtypeRadioButton.setChecked(true); + } else { + subtypeRadioButton.setChecked(false); + } + } + } + return selectedImiAndSubtype; + } + + private void updateRadioButtons() { + updateRadioButtonsByImiAndSubtype( + getCurrentInputMethodInfo(), mImm.getCurrentInputMethodSubtype()); + } + + // Turn on the selected radio button at startup + private void updateRadioButtonsByImiAndSubtype( + InputMethodInfo imi, InputMethodSubtype subtype) { + if (DEBUG) { + Log.d(TAG, "Update radio buttons by " + imi.getId() + ", " + subtype); + } + for (View radioView: mRadioViewAndImiMap.keySet()) { + RadioButton subtypeRadioButton = + (RadioButton) radioView.findViewById(R.id.item_radio); + if (subtypeRadioButton == null) { + Log.w(TAG, "RadioButton was not found in the selected subtype view"); + return; + } + Pair<InputMethodInfo, InputMethodSubtype> imiAndSubtype = + mRadioViewAndImiMap.get(radioView); + if (imiAndSubtype.first.getId().equals(imi.getId()) + && (imiAndSubtype.second == null || imiAndSubtype.second.equals(subtype))) { + subtypeRadioButton.setChecked(true); + } else { + subtypeRadioButton.setChecked(false); + } + } + } + + private HashMap<InputMethodInfo, List<InputMethodSubtype>> + getEnabledInputMethodAndSubtypeList() { + String newEnabledIMIs = Settings.Secure.getString( + mContext.getContentResolver(), Settings.Secure.ENABLED_INPUT_METHODS); + if (mEnabledInputMethodAndSubtypesCacheStr == null + || !mEnabledInputMethodAndSubtypesCacheStr.equals(newEnabledIMIs)) { + mEnabledInputMethodAndSubtypesCache.clear(); + final List<InputMethodInfo> imis = mImm.getEnabledInputMethodList(); + for (InputMethodInfo imi: imis) { + mEnabledInputMethodAndSubtypesCache.put(imi, + mImm.getEnabledInputMethodSubtypeList(imi, true)); + } + mEnabledInputMethodAndSubtypesCacheStr = newEnabledIMIs; + } + return mEnabledInputMethodAndSubtypesCache; + } + + private InputMethodInfo getCurrentInputMethodInfo() { + String curInputMethodId = Settings.Secure.getString(getContext() + .getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD); + Set<InputMethodInfo> cachedImiSet = mEnabledInputMethodAndSubtypesCache.keySet(); + // 1. Search IMI in cache + for (InputMethodInfo imi: cachedImiSet) { + if (imi.getId().equals(curInputMethodId)) { + return imi; + } + } + // 2. Get current enabled IMEs and search IMI + cachedImiSet = getEnabledInputMethodAndSubtypeList().keySet(); + for (InputMethodInfo imi: cachedImiSet) { + if (imi.getId().equals(curInputMethodId)) { + return imi; + } + } + return null; + } + + private CharSequence getIMIName(InputMethodInfo imi) { + if (imi == null) return null; + return mPackageManager.getApplicationLabel(imi.getServiceInfo().applicationInfo); + } + + private CharSequence getSubtypeName(InputMethodInfo imi, InputMethodSubtype subtype) { + if (imi == null || subtype == null) return null; + // TODO: Change the language of subtype name according to subtype's locale. + return mPackageManager.getText( + imi.getPackageName(), subtype.getNameResId(), imi.getServiceInfo().applicationInfo); + } + + private Drawable getSubtypeIcon(InputMethodInfo imi, InputMethodSubtype subtype) { + if (imi != null) { + if (DEBUG) { + Log.d(TAG, "Update icons of IME: " + imi.getPackageName()); + if (subtype != null) { + Log.d(TAG, "subtype =" + subtype.getLocale() + "," + subtype.getMode()); + } + } + if (subtype != null) { + return mPackageManager.getDrawable(imi.getPackageName(), subtype.getIconResId(), + imi.getServiceInfo().applicationInfo); + } else if (imi.getSubtypes().size() > 0) { + return mPackageManager.getDrawable(imi.getPackageName(), + imi.getSubtypes().get(0).getIconResId(), + imi.getServiceInfo().applicationInfo); + } else { + try { + return mPackageManager.getApplicationInfo( + imi.getPackageName(), 0).loadIcon(mPackageManager); + } catch (PackageManager.NameNotFoundException e) { + Log.w(TAG, "IME can't be found: " + imi.getPackageName()); + } + } + } + return null; + } +} diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java index 020b955..af730fe 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -80,6 +80,8 @@ public class TabletStatusBar extends StatusBar implements public static final String TAG = "TabletStatusBar"; public static final int MAX_NOTIFICATION_ICONS = 5; + // IME switcher icon is big and occupy width of two icons + public static final int MAX_NOTIFICATION_ICONS_IME_BUTTON_VISIBLE = MAX_NOTIFICATION_ICONS - 2; public static final int MSG_OPEN_NOTIFICATION_PANEL = 1000; public static final int MSG_CLOSE_NOTIFICATION_PANEL = 1001; @@ -89,6 +91,8 @@ public class TabletStatusBar extends StatusBar implements public static final int MSG_CLOSE_RECENTS_PANEL = 1021; public static final int MSG_SHOW_CHROME = 1030; public static final int MSG_HIDE_CHROME = 1031; + public static final int MSG_OPEN_INPUT_METHODS_PANEL = 1040; + public static final int MSG_CLOSE_INPUT_METHODS_PANEL = 1041; // Fitts' Law assistance for LatinIME; TODO: replace with a more general approach private static final boolean FAKE_SPACE_BAR = true; @@ -155,6 +159,7 @@ public class TabletStatusBar extends StatusBar implements boolean mNotificationsOn = true; private RecentAppsPanel mRecentsPanel; + private InputMethodsPanel mInputMethodsPanel; public Context getContext() { return mContext; } @@ -260,6 +265,28 @@ public class TabletStatusBar extends StatusBar implements WindowManagerImpl.getDefault().addView(mRecentsPanel, lp); mRecentsPanel.setBar(this); + + // Input methods Panel + mInputMethodsPanel = (InputMethodsPanel) View.inflate(context, + R.layout.status_bar_input_methods_panel, null); + mInputMethodsPanel.setVisibility(View.GONE); + mInputMethodsPanel.setOnTouchListener(new TouchOutsideListener( + MSG_CLOSE_INPUT_METHODS_PANEL, mInputMethodsPanel)); + mStatusBarView.setIgnoreChildren(3, mInputMethodSwitchButton, mInputMethodsPanel); + lp = new WindowManager.LayoutParams( + ViewGroup.LayoutParams.WRAP_CONTENT, + ViewGroup.LayoutParams.WRAP_CONTENT, + WindowManager.LayoutParams.TYPE_STATUS_BAR_PANEL, + WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN + | WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM + | WindowManager.LayoutParams.FLAG_SPLIT_TOUCH + | WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, + PixelFormat.TRANSLUCENT); + lp.gravity = Gravity.BOTTOM | Gravity.RIGHT; + lp.setTitle("InputMethodsPanel"); + lp.windowAnimations = R.style.Animation_RecentPanel; + + WindowManagerImpl.getDefault().addView(mInputMethodsPanel, lp); } @Override @@ -351,6 +378,8 @@ public class TabletStatusBar extends StatusBar implements // The bar contents buttons mNotificationAndImeArea = (ViewGroup)sb.findViewById(R.id.notificationAndImeArea); mInputMethodSwitchButton = (InputMethodButton) sb.findViewById(R.id.imeSwitchButton); + // Overwrite the lister + mInputMethodSwitchButton.setOnClickListener(mOnClickListener); // for redirecting errant bar taps to the IME mFakeSpaceBar = sb.findViewById(R.id.fake_space_bar); @@ -522,6 +551,14 @@ public class TabletStatusBar extends StatusBar implements mRecentsPanel.show(false, true); } break; + case MSG_OPEN_INPUT_METHODS_PANEL: + if (DEBUG) Slog.d(TAG, "opening input methods panel"); + if (mInputMethodsPanel != null) mInputMethodsPanel.setVisibility(View.VISIBLE); + break; + case MSG_CLOSE_INPUT_METHODS_PANEL: + if (DEBUG) Slog.d(TAG, "closing input methods panel"); + if (mInputMethodsPanel != null) mInputMethodsPanel.setVisibility(View.GONE); + break; case MSG_SHOW_CHROME: if (DEBUG) Slog.d(TAG, "hiding shadows (lights on)"); mBarContents.setVisibility(View.VISIBLE); @@ -774,6 +811,8 @@ public class TabletStatusBar extends StatusBar implements mHandler.sendEmptyMessage(MSG_CLOSE_NOTIFICATION_PANEL); mHandler.removeMessages(MSG_CLOSE_RECENTS_PANEL); mHandler.sendEmptyMessage(MSG_CLOSE_RECENTS_PANEL); + mHandler.removeMessages(MSG_CLOSE_INPUT_METHODS_PANEL); + mHandler.sendEmptyMessage(MSG_CLOSE_INPUT_METHODS_PANEL); } // called by StatusBar @@ -803,7 +842,12 @@ public class TabletStatusBar extends StatusBar implements if (DEBUG) { Slog.d(TAG, (visible?"showing":"hiding") + " the IME button"); } + int oldVisibility = mInputMethodSwitchButton.getVisibility(); mInputMethodSwitchButton.setIMEButtonVisible(token, visible); + if (oldVisibility != mInputMethodSwitchButton.getVisibility()) { + updateNotificationIcons(); + } + mInputMethodsPanel.setIMEToken(token); mBackButton.setImageResource( visible ? R.drawable.ic_sysbar_back_ime : R.drawable.ic_sysbar_back); if (FAKE_SPACE_BAR) { @@ -851,6 +895,8 @@ public class TabletStatusBar extends StatusBar implements onClickNotificationTrigger(); } else if (v == mRecentButton) { onClickRecentButton(); + } else if (v == mInputMethodSwitchButton) { + onClickInputMethodSwitchButton(); } } }; @@ -890,6 +936,14 @@ public class TabletStatusBar extends StatusBar implements } } + public void onClickInputMethodSwitchButton() { + if (DEBUG) Slog.d(TAG, "clicked input methods panel; disabled=" + mDisabled); + int msg = (mInputMethodsPanel.getVisibility() == View.GONE) ? + MSG_OPEN_INPUT_METHODS_PANEL : MSG_CLOSE_INPUT_METHODS_PANEL; + mHandler.removeMessages(msg); + mHandler.sendEmptyMessage(msg); + } + public NotificationClicker makeClicker(PendingIntent intent, String pkg, String tag, int id) { return new NotificationClicker(intent, pkg, tag, id); } @@ -1086,7 +1140,12 @@ public class TabletStatusBar extends StatusBar implements ArrayList<View> toShow = new ArrayList<View>(); - for (int i=0; i<MAX_NOTIFICATION_ICONS; i++) { + // When IME button is visible, the number of notification icons should be decremented + // to fit the upper limit. + final int maxNotificationIconsCount = + (mInputMethodSwitchButton.getVisibility() != View.GONE) ? + MAX_NOTIFICATION_ICONS_IME_BUTTON_VISIBLE : MAX_NOTIFICATION_ICONS; + for (int i=0; i< maxNotificationIconsCount; i++) { if (i>=N) break; toShow.add(mNotns.get(N-i-1).icon); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java index 6550765..4ee985d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java @@ -27,9 +27,9 @@ import android.widget.FrameLayout; public class TabletStatusBarView extends FrameLayout { private Handler mHandler; - private View[] mIgnoreChildren = new View[3]; - private View[] mPanels = new View[3]; - private int[] mPos = new int[2]; + private final View[] mIgnoreChildren = new View[4]; + private final View[] mPanels = new View[4]; + private final int[] mPos = new int[2]; public TabletStatusBarView(Context context) { super(context); @@ -39,6 +39,7 @@ public class TabletStatusBarView extends FrameLayout { super(context, attrs); } + @Override public boolean onInterceptTouchEvent(MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_DOWN) { if (TabletStatusBar.DEBUG) { @@ -48,12 +49,16 @@ public class TabletStatusBarView extends FrameLayout { mHandler.sendEmptyMessage(TabletStatusBar.MSG_CLOSE_NOTIFICATION_PANEL); mHandler.removeMessages(TabletStatusBar.MSG_CLOSE_RECENTS_PANEL); mHandler.sendEmptyMessage(TabletStatusBar.MSG_CLOSE_RECENTS_PANEL); + mHandler.removeMessages(TabletStatusBar.MSG_CLOSE_INPUT_METHODS_PANEL); + mHandler.sendEmptyMessage(TabletStatusBar.MSG_CLOSE_INPUT_METHODS_PANEL); for (int i=0; i < mPanels.length; i++) { if (mPanels[i] != null && mPanels[i].getVisibility() == View.VISIBLE) { if (eventInside(mIgnoreChildren[i], ev)) { if (TabletStatusBar.DEBUG) { - Slog.d(TabletStatusBar.TAG, "TabletStatusBarView eating event for view: " + mIgnoreChildren[i]); + Slog.d(TabletStatusBar.TAG, + "TabletStatusBarView eating event for view: " + + mIgnoreChildren[i]); } return true; } diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index 243fa07..a6037aa 100755 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -122,8 +122,10 @@ import android.media.IAudioService; import android.media.AudioManager; import java.io.File; +import java.io.FileDescriptor; import java.io.FileReader; import java.io.IOException; +import java.io.PrintWriter; import java.util.ArrayList; /** @@ -2808,4 +2810,70 @@ public class PhoneWindowManager implements WindowManagerPolicy { // disable key repeat when screen is off return mScreenOn; } + + public void dump(String prefix, FileDescriptor fd, PrintWriter pw, String[] args) { + pw.print(prefix); pw.print("mSafeMode="); pw.print(mSafeMode); + pw.print(" mSystemRead="); pw.println(mSystemReady); + pw.print(prefix); pw.print("mLidOpen="); pw.print(mLidOpen); + pw.print(" mLidOpenRotation="); pw.print(mLidOpenRotation); + pw.print(" mHdmiPlugged="); pw.println(mHdmiPlugged); + pw.print(prefix); pw.print("mUiMode="); pw.print(mUiMode); + pw.print(" mDockMode="); pw.print(mDockMode); + pw.print(" mCarDockRotation="); pw.print(mCarDockRotation); + pw.print(" mDeskDockRotation="); pw.println(mDeskDockRotation); + pw.print(prefix); pw.print("mUserRotationMode="); pw.print(mUserRotationMode); + pw.print(" mUserRotation="); pw.print(mUserRotation); + pw.print("mAllowAllRotations="); pw.println(mAllowAllRotations); + pw.print(prefix); pw.print("mAccelerometerDefault="); pw.print(mAccelerometerDefault); + pw.print(" mCurrentAppOrientation="); pw.println(mCurrentAppOrientation); + pw.print(prefix); pw.print("mCarDockEnablesAccelerometer="); + pw.print(mCarDockEnablesAccelerometer); + pw.print(" mDeskDockEnablesAccelerometer="); + pw.println(mDeskDockEnablesAccelerometer); + pw.print(prefix); pw.print("mLidKeyboardAccessibility="); + pw.print(mLidKeyboardAccessibility); + pw.print(" mLidNavigationAccessibility="); pw.print(mLidNavigationAccessibility); + pw.print(" mLongPressOnPowerBehavior="); pw.println(mLongPressOnPowerBehavior); + pw.print(prefix); pw.print("mScreenOn="); pw.print(mScreenOn); + pw.print(" mOrientationSensorEnabled="); pw.print(mOrientationSensorEnabled); + pw.print(" mHasSoftInput="); pw.println(mHasSoftInput); + pw.print(prefix); pw.print("mUnrestrictedScreen=("); pw.print(mUnrestrictedScreenLeft); + pw.print(","); pw.print(mUnrestrictedScreenTop); + pw.print(") "); pw.print(mUnrestrictedScreenWidth); + pw.print("x"); pw.println(mUnrestrictedScreenHeight); + pw.print(prefix); pw.print("mRestrictedScreen=("); pw.print(mRestrictedScreenLeft); + pw.print(","); pw.print(mRestrictedScreenTop); + pw.print(") "); pw.print(mRestrictedScreenWidth); + pw.print("x"); pw.println(mRestrictedScreenHeight); + pw.print(prefix); pw.print("mCur=("); pw.print(mCurLeft); + pw.print(","); pw.print(mCurTop); + pw.print(")-("); pw.print(mCurRight); + pw.print(","); pw.print(mCurBottom); pw.println(")"); + pw.print(prefix); pw.print("mContent=("); pw.print(mContentLeft); + pw.print(","); pw.print(mContentTop); + pw.print(")-("); pw.print(mContentRight); + pw.print(","); pw.print(mContentBottom); pw.println(")"); + pw.print(prefix); pw.print("mDock=("); pw.print(mDockLeft); + pw.print(","); pw.print(mDockTop); + pw.print(")-("); pw.print(mDockRight); + pw.print(","); pw.print(mDockBottom); pw.println(")"); + pw.print(prefix); pw.print("mDockLayer="); pw.println(mDockLayer); + pw.print(prefix); pw.print("mTopFullscreenOpaqueWindowState="); + pw.println(mTopFullscreenOpaqueWindowState); + pw.print(prefix); pw.print("mTopIsFullscreen="); pw.print(mTopIsFullscreen); + pw.print(" mForceStatusBar="); pw.print(mForceStatusBar); + pw.print(" mHideLockScreen="); pw.println(mHideLockScreen); + pw.print(prefix); pw.print("mDismissKeyguard="); pw.print(mDismissKeyguard); + pw.print(" mHomePressed="); pw.println(mHomePressed); + pw.print(prefix); pw.print("mAllowLockscreenWhenOn="); pw.print(mAllowLockscreenWhenOn); + pw.print(" mLockScreenTimeout="); pw.print(mLockScreenTimeout); + pw.print(" mLockScreenTimerActive="); pw.println(mLockScreenTimerActive); + pw.print(prefix); pw.print("mEndcallBehavior="); pw.print(mEndcallBehavior); + pw.print(" mIncallPowerBehavior="); pw.print(mIncallPowerBehavior); + pw.print(" mLongPressOnHomeBehavior="); pw.println(mLongPressOnHomeBehavior); + pw.print(prefix); pw.print("mLandscapeRotation="); pw.print(mLandscapeRotation); + pw.print(" mSeascapeRotation="); pw.println(mSeascapeRotation); + pw.print(prefix); pw.print("mPortraitRotation="); pw.print(mPortraitRotation); + pw.print(" mUpsideDownRotation="); pw.println(mUpsideDownRotation); + } } diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java index a2684fb..9c80b51 100644 --- a/services/java/com/android/server/InputMethodManagerService.java +++ b/services/java/com/android/server/InputMethodManagerService.java @@ -427,6 +427,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub // Uh oh, current input method is no longer around! // Pick another one... Slog.i(TAG, "Current input method removed: " + curInputMethodId); + mStatusBar.setIMEButtonVisible(mCurToken, false); if (!chooseNewDefaultIMELocked()) { changed = true; curIm = null; @@ -1020,9 +1021,11 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } if (subtype != mCurrentSubtype) { synchronized (mMethodMap) { + if (subtype != null) { + setSelectedInputMethodAndSubtypeLocked(info, subtypeId, true); + } if (mCurMethod != null) { try { - setSelectedInputMethodAndSubtypeLocked(info, subtypeId, true); if (mInputShown) { // If mInputShown is false, there is no IME button on the // system bar. @@ -1797,19 +1800,14 @@ public class InputMethodManagerService extends IInputMethodManager.Stub }); if (showSubtypes) { - mDialogBuilder.setPositiveButton(com.android.internal.R.string.more_item_label, + mDialogBuilder.setPositiveButton( + com.android.internal.R.string.configure_input_methods, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { showConfigureInputMethods(); } }); } - mDialogBuilder.setNegativeButton(com.android.internal.R.string.cancel, - new DialogInterface.OnClickListener() { - public void onClick(DialogInterface dialog, int whichButton) { - hideInputMethodMenu(); - } - }); mSwitchingDialog = mDialogBuilder.create(); mSwitchingDialog.getWindow().setType( WindowManager.LayoutParams.TYPE_INPUT_METHOD_DIALOG); diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java index b196f74..26060e6 100644 --- a/services/java/com/android/server/PackageManagerService.java +++ b/services/java/com/android/server/PackageManagerService.java @@ -7453,6 +7453,10 @@ class PackageManagerService extends IPackageManager.Stub { static class PackageSignatures { private Signature[] mSignatures; + PackageSignatures(PackageSignatures orig) { + mSignatures = orig.mSignatures.clone(); + } + PackageSignatures(Signature[] sigs) { assignSignatures(sigs); } @@ -7788,6 +7792,12 @@ class PackageManagerService extends IPackageManager.Stub { setFlags(pkgFlags); } + GrantedPermissions(GrantedPermissions base) { + pkgFlags = base.pkgFlags; + grantedPermissions = (HashSet<String>) base.grantedPermissions.clone(); + gids = base.gids.clone(); + } + void setFlags(int pkgFlags) { this.pkgFlags = pkgFlags & ( ApplicationInfo.FLAG_SYSTEM | @@ -7815,7 +7825,7 @@ class PackageManagerService extends IPackageManager.Stub { int versionCode; boolean uidError; - + PackageSignatures signatures = new PackageSignatures(); boolean permissionsFixed; @@ -7841,6 +7851,44 @@ class PackageManagerService extends IPackageManager.Stub { init(codePath, resourcePath, nativeLibraryPathString, pVersionCode); } + /** + * New instance of PackageSetting with one-level-deep cloning. + */ + PackageSettingBase(PackageSettingBase base) { + super(base); + + name = base.name; + realName = base.realName; + codePath = base.codePath; + codePathString = base.codePathString; + resourcePath = base.resourcePath; + resourcePathString = base.resourcePathString; + nativeLibraryPathString = base.nativeLibraryPathString; + obbPathString = base.obbPathString; + timeStamp = base.timeStamp; + firstInstallTime = base.firstInstallTime; + lastUpdateTime = base.lastUpdateTime; + versionCode = base.versionCode; + + uidError = base.uidError; + + signatures = new PackageSignatures(base.signatures); + + permissionsFixed = base.permissionsFixed; + haveGids = base.haveGids; + + disabledComponents = (HashSet<String>) base.disabledComponents.clone(); + + enabledComponents = (HashSet<String>) base.enabledComponents.clone(); + + enabled = base.enabled; + installStatus = base.installStatus; + + origPackage = base.origPackage; + + installerPackageName = base.installerPackageName; + } + void init(File codePath, File resourcePath, String nativeLibraryPathString, int pVersionCode) { this.codePath = codePath; @@ -7871,6 +7919,9 @@ class PackageManagerService extends IPackageManager.Stub { timeStamp = newStamp; } + /** + * Make a shallow copy of this package settings. + */ public void copyFrom(PackageSettingBase base) { grantedPermissions = base.grantedPermissions; gids = base.gids; @@ -7930,18 +7981,16 @@ class PackageManagerService extends IPackageManager.Stub { pkgFlags); } + /** + * New instance of PackageSetting replicating the original settings. + * Note that it keeps the same PackageParser.Package instance. + */ PackageSetting(PackageSetting orig) { - super(orig.name, orig.realName, orig.codePath, orig.resourcePath, - orig.nativeLibraryPathString, orig.versionCode, orig.pkgFlags); - copyFrom(orig); - } - - public void copyFrom(PackageSetting base) { - super.copyFrom((PackageSettingBase) base); + super(orig); - userId = base.userId; - sharedUser = base.sharedUser; - pkg = base.pkg; + userId = orig.userId; + pkg = orig.pkg; + sharedUser = orig.sharedUser; } @Override @@ -8173,7 +8222,7 @@ class PackageManagerService extends IPackageManager.Stub { // a little trick... when we install the new package, we don't // want to modify the existing PackageSetting for the built-in // version. so at this point we need a new PackageSetting that - // is okay to much with. + // is okay to muck with. PackageSetting newp = new PackageSetting(p); replacePackageLP(name, newp); return true; diff --git a/services/java/com/android/server/ScreenRotationAnimation.java b/services/java/com/android/server/ScreenRotationAnimation.java index 19cc203..2ad9cbe 100644 --- a/services/java/com/android/server/ScreenRotationAnimation.java +++ b/services/java/com/android/server/ScreenRotationAnimation.java @@ -60,7 +60,8 @@ class ScreenRotationAnimation { final Matrix mSnapshotFinalMatrix = new Matrix(); final float[] mTmpFloats = new float[9]; - public ScreenRotationAnimation(Context context, Display display, SurfaceSession session) { + public ScreenRotationAnimation(Context context, Display display, SurfaceSession session, + boolean inTransaction) { mContext = context; mDisplay = display; @@ -84,60 +85,70 @@ class ScreenRotationAnimation { mOriginalWidth = mDisplayMetrics.widthPixels; mOriginalHeight = mDisplayMetrics.heightPixels; - Surface.openTransaction(); - - try { - mSurface = new Surface(session, 0, "FreezeSurface", - -1, mWidth, mHeight, PixelFormat.OPAQUE, 0); - mSurface.setLayer(WindowManagerService.TYPE_LAYER_MULTIPLIER * 200); - } catch (Surface.OutOfResourcesException e) { - Slog.w(TAG, "Unable to allocate freeze surface", e); + if (!inTransaction) { + if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, + ">>> OPEN TRANSACTION ScreenRotationAnimation"); + Surface.openTransaction(); } - if (false) { + try { try { - int size = mOriginalWidth > mOriginalHeight ? mOriginalWidth : mOriginalHeight; - mBlackSurface = new Surface(session, 0, "BlackSurface", - -1, size, size, PixelFormat.OPAQUE, Surface.FX_SURFACE_DIM); - mBlackSurface.setAlpha(1.0f); - mBlackSurface.setLayer(0); + mSurface = new Surface(session, 0, "FreezeSurface", + -1, mWidth, mHeight, PixelFormat.OPAQUE, 0); + mSurface.setLayer(WindowManagerService.TYPE_LAYER_MULTIPLIER * 200); } catch (Surface.OutOfResourcesException e) { - Slog.w(TAG, "Unable to allocate black surface", e); + Slog.w(TAG, "Unable to allocate freeze surface", e); } - } + + if (false) { + try { + int size = mOriginalWidth > mOriginalHeight ? mOriginalWidth : mOriginalHeight; + mBlackSurface = new Surface(session, 0, "BlackSurface", + -1, size, size, PixelFormat.OPAQUE, Surface.FX_SURFACE_DIM); + mBlackSurface.setAlpha(1.0f); + mBlackSurface.setLayer(0); + } catch (Surface.OutOfResourcesException e) { + Slog.w(TAG, "Unable to allocate black surface", e); + } + } + + setRotation(display.getRotation()); + + if (mSurface != null) { + Rect dirty = new Rect(0, 0, mWidth, mHeight); + Canvas c = null; + try { + c = mSurface.lockCanvas(dirty); + } catch (IllegalArgumentException e) { + Slog.w(TAG, "Unable to lock surface", e); + return; + } catch (Surface.OutOfResourcesException e) { + Slog.w(TAG, "Unable to lock surface", e); + return; + } + if (c == null) { + Slog.w(TAG, "Null surface"); + return; + } - setRotation(display.getRotation()); + if (screenshot != null) { + c.drawBitmap(screenshot, 0, 0, new Paint(0)); + } else { + c.drawColor(Color.GREEN); + } - if (mSurface != null) { - Rect dirty = new Rect(0, 0, mWidth, mHeight); - Canvas c = null; - try { - c = mSurface.lockCanvas(dirty); - } catch (IllegalArgumentException e) { - Slog.w(TAG, "Unable to lock surface", e); - return; - } catch (Surface.OutOfResourcesException e) { - Slog.w(TAG, "Unable to lock surface", e); - return; + mSurface.unlockCanvasAndPost(c); } - if (c == null) { - Slog.w(TAG, "Null surface"); - return; + } finally { + if (!inTransaction) { + Surface.closeTransaction(); + if (WindowManagerService.SHOW_TRANSACTIONS) Slog.i(WindowManagerService.TAG, + "<<< CLOSE TRANSACTION ScreenRotationAnimation"); } if (screenshot != null) { - c.drawBitmap(screenshot, 0, 0, new Paint(0)); - } else { - c.drawColor(Color.GREEN); + screenshot.recycle(); } - - mSurface.unlockCanvasAndPost(c); - } - - Surface.closeTransaction(); - - if (screenshot != null) { - screenshot.recycle(); } } diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java index e9bf624..8d9cb31 100644 --- a/services/java/com/android/server/WindowManagerService.java +++ b/services/java/com/android/server/WindowManagerService.java @@ -149,6 +149,7 @@ public class WindowManagerService extends IWindowManager.Stub implements Watchdog.Monitor { static final String TAG = "WindowManager"; static final boolean DEBUG = false; + static final boolean DEBUG_ADD_REMOVE = false; static final boolean DEBUG_FOCUS = false; static final boolean DEBUG_ANIM = false; static final boolean DEBUG_LAYOUT = false; @@ -158,6 +159,7 @@ public class WindowManagerService extends IWindowManager.Stub static final boolean DEBUG_INPUT_METHOD = false; static final boolean DEBUG_VISIBILITY = false; static final boolean DEBUG_WINDOW_MOVEMENT = false; + static final boolean DEBUG_TOKEN_MOVEMENT = false; static final boolean DEBUG_ORIENTATION = false; static final boolean DEBUG_CONFIGURATION = false; static final boolean DEBUG_APP_TRANSITIONS = false; @@ -296,12 +298,6 @@ public class WindowManagerService extends IWindowManager.Stub new HashMap<IBinder, WindowToken>(); /** - * The same tokens as mTokenMap, stored in a list for efficient iteration - * over them. - */ - final ArrayList<WindowToken> mTokenList = new ArrayList<WindowToken>(); - - /** * Window tokens that are in the process of exiting, but still * on screen for animations. */ @@ -310,7 +306,7 @@ public class WindowManagerService extends IWindowManager.Stub /** * Z-ordered (bottom-most first) list of all application tokens, for * controlling the ordering of windows in different applications. This - * contains WindowToken objects. + * contains AppWindowToken objects. */ final ArrayList<AppWindowToken> mAppTokens = new ArrayList<AppWindowToken>(); @@ -344,6 +340,11 @@ public class WindowManagerService extends IWindowManager.Stub final ArrayList<WindowState> mPendingRemove = new ArrayList<WindowState>(); /** + * Used when processing mPendingRemove to avoid working on the original array. + */ + WindowState[] mPendingRemoveTmp = new WindowState[20]; + + /** * Windows whose surface should be destroyed. */ final ArrayList<WindowState> mDestroySurface = new ArrayList<WindowState>(); @@ -360,6 +361,12 @@ public class WindowManagerService extends IWindowManager.Stub */ ArrayList<WindowState> mForceRemoves; + /** + * Used when rebuilding window list to keep track of windows that have + * been removed. + */ + WindowState[] mRebuildTmp = new WindowState[20]; + IInputMethodManager mInputMethodManager; SurfaceSession mFxSession; @@ -685,7 +692,7 @@ public class WindowManagerService extends IWindowManager.Stub // deferred rotation if (performRotation) { if (DEBUG_ORIENTATION) Slog.d(TAG, "Performing post-drag rotation"); - boolean changed = setRotationUncheckedLocked(rotation, animFlags); + boolean changed = setRotationUncheckedLocked(rotation, animFlags, false); if (changed) { sendNewConfiguration(); } @@ -696,9 +703,14 @@ public class WindowManagerService extends IWindowManager.Stub final int myPid = Process.myPid(); // Move the surface to the given touch + if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION notifyMoveLw"); mSurface.openTransaction(); - mSurface.setPosition((int)(x - mThumbOffsetX), (int)(y - mThumbOffsetY)); - mSurface.closeTransaction(); + try { + mSurface.setPosition((int)(x - mThumbOffsetX), (int)(y - mThumbOffsetY)); + } finally { + mSurface.closeTransaction(); + if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION notifyMoveLw"); + } // Tell the affected window WindowState touchedWin = getTouchedWinAtPointLw(x, y); @@ -1089,7 +1101,7 @@ public class WindowManagerService extends IWindowManager.Stub private void placeWindowAfter(WindowState pos, WindowState window) { final int i = mWindows.indexOf(pos); - if (DEBUG_FOCUS || DEBUG_WINDOW_MOVEMENT) Slog.v( + if (DEBUG_FOCUS || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v( TAG, "Adding window " + window + " at " + (i+1) + " of " + mWindows.size() + " (after " + pos + ")"); mWindows.add(i+1, window); @@ -1098,7 +1110,7 @@ public class WindowManagerService extends IWindowManager.Stub private void placeWindowBefore(WindowState pos, WindowState window) { final int i = mWindows.indexOf(pos); - if (DEBUG_FOCUS || DEBUG_WINDOW_MOVEMENT) Slog.v( + if (DEBUG_FOCUS || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v( TAG, "Adding window " + window + " at " + i + " of " + mWindows.size() + " (before " + pos + ")"); mWindows.add(i, window); @@ -1156,9 +1168,10 @@ public class WindowManagerService extends IWindowManager.Stub //apptoken note that the window could be a floating window //that was created later or a window at the top of the list of //windows associated with this token. - if (DEBUG_FOCUS || DEBUG_WINDOW_MOVEMENT) Slog.v( - TAG, "Adding window " + win + " at " - + (newIdx+1) + " of " + N); + if (DEBUG_FOCUS || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) { + Slog.v(TAG, "Adding window " + win + " at " + + (newIdx+1) + " of " + N); + } localmWindows.add(newIdx+1, win); mWindowsChanged = true; } @@ -1237,9 +1250,10 @@ public class WindowManagerService extends IWindowManager.Stub break; } } - if (DEBUG_FOCUS || DEBUG_WINDOW_MOVEMENT) Slog.v( - TAG, "Adding window " + win + " at " - + i + " of " + N); + if (DEBUG_FOCUS || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) { + Slog.v(TAG, "Adding window " + win + " at " + + i + " of " + N); + } localmWindows.add(i, win); mWindowsChanged = true; } @@ -1255,13 +1269,14 @@ public class WindowManagerService extends IWindowManager.Stub } } if (i < 0) i = 0; - if (DEBUG_FOCUS || DEBUG_WINDOW_MOVEMENT) Slog.v( + if (DEBUG_FOCUS || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v( TAG, "Adding window " + win + " at " + i + " of " + N); localmWindows.add(i, win); mWindowsChanged = true; } if (addToToken) { + if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Adding " + win + " to " + token); token.windows.add(tokenWindowsPos, win); } @@ -1284,6 +1299,7 @@ public class WindowManagerService extends IWindowManager.Stub // in the same sublayer. if (wSublayer >= sublayer) { if (addToToken) { + if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Adding " + win + " to " + token); token.windows.add(i, win); } placeWindowBefore( @@ -1295,6 +1311,7 @@ public class WindowManagerService extends IWindowManager.Stub // in the same sublayer. if (wSublayer > sublayer) { if (addToToken) { + if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Adding " + win + " to " + token); token.windows.add(i, win); } placeWindowBefore(w, win); @@ -1304,6 +1321,7 @@ public class WindowManagerService extends IWindowManager.Stub } if (i >= NA) { if (addToToken) { + if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Adding " + win + " to " + token); token.windows.add(win); } if (sublayer < 0) { @@ -1478,7 +1496,7 @@ public class WindowManagerService extends IWindowManager.Stub int pos = findDesiredInputMethodWindowIndexLocked(true); if (pos >= 0) { win.mTargetAppToken = mInputMethodTarget.mAppToken; - if (DEBUG_WINDOW_MOVEMENT) Slog.v( + if (DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v( TAG, "Adding input method window " + win + " at " + pos); mWindows.add(pos, win); mWindowsChanged = true; @@ -2028,9 +2046,10 @@ public class WindowManagerService extends IWindowManager.Stub } // Now stick it in. - if (DEBUG_WALLPAPER || DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, - "Moving wallpaper " + wallpaper - + " from " + oldIndex + " to " + foundI); + if (DEBUG_WALLPAPER || DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) { + Slog.v(TAG, "Moving wallpaper " + wallpaper + + " from " + oldIndex + " to " + foundI); + } localmWindows.add(foundI, wallpaper); mWindowsChanged = true; @@ -2349,7 +2368,6 @@ public class WindowManagerService extends IWindowManager.Stub if (addToken) { mTokenMap.put(attrs.token, token); - mTokenList.add(token); } win.attach(); mWindowMap.put(client.asBinder(), win); @@ -2417,7 +2435,7 @@ public class WindowManagerService extends IWindowManager.Stub TAG, "New client " + client.asBinder() + ": window=" + win); - if (win.isVisibleOrAdding() && updateOrientationFromAppTokensLocked()) { + if (win.isVisibleOrAdding() && updateOrientationFromAppTokensLocked(false)) { reportNewConfig = true; } } @@ -2504,7 +2522,7 @@ public class WindowManagerService extends IWindowManager.Stub // So just update orientation if needed. if (wasVisible && computeForcedAppOrientationLocked() != mForcedAppOrientation - && updateOrientationFromAppTokensLocked()) { + && updateOrientationFromAppTokensLocked(false)) { mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION); } updateFocusedWindowLocked(UPDATE_FOCUS_NORMAL); @@ -2512,6 +2530,18 @@ public class WindowManagerService extends IWindowManager.Stub } private void removeWindowInnerLocked(Session session, WindowState win) { + if (win.mRemoved) { + // Nothing to do. + return; + } + + for (int i=win.mChildWindows.size()-1; i>=0; i--) { + WindowState cwin = win.mChildWindows.get(i); + Slog.w(TAG, "Force-removing child win " + cwin + " from container " + + win); + removeWindowInnerLocked(cwin.mSession, cwin); + } + win.mRemoved = true; if (mInputMethodTarget == win) { @@ -2527,8 +2557,10 @@ public class WindowManagerService extends IWindowManager.Stub mPolicy.removeWindowLw(win); win.removeLocked(); + if (DEBUG_ADD_REMOVE) Slog.v(TAG, "removeWindowInnerLocked: " + win); mWindowMap.remove(win.mClient.asBinder()); mWindows.remove(win); + mPendingRemove.remove(win); mWindowsChanged = true; if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, "Final remove of window: " + win); @@ -2540,6 +2572,7 @@ public class WindowManagerService extends IWindowManager.Stub final WindowToken token = win.mToken; final AppWindowToken atoken = win.mAppToken; + if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Removing " + win + " from " + token); token.windows.remove(win); if (atoken != null) { atoken.allAppWindows.remove(win); @@ -2550,7 +2583,6 @@ public class WindowManagerService extends IWindowManager.Stub if (token.windows.size() == 0) { if (!token.explicit) { mTokenMap.remove(token.token); - mTokenList.remove(token); } else if (atoken != null) { atoken.firstWindowDrawn = false; } @@ -2610,15 +2642,17 @@ public class WindowManagerService extends IWindowManager.Stub synchronized (mWindowMap) { WindowState w = windowForClientLocked(session, client, false); if ((w != null) && (w.mSurface != null)) { - if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION"); + if (SHOW_TRANSACTIONS) Slog.i(TAG, + ">>> OPEN TRANSACTION setTransparentRegion"); Surface.openTransaction(); try { if (SHOW_TRANSACTIONS) logSurface(w, "transparentRegionHint=" + region, null); w.mSurface.setTransparentRegionHint(region); } finally { - if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION"); Surface.closeTransaction(); + if (SHOW_TRANSACTIONS) Slog.i(TAG, + "<<< CLOSE TRANSACTION setTransparentRegion"); } } } @@ -2956,7 +2990,7 @@ public class WindowManagerService extends IWindowManager.Stub if (assignLayers) { assignLayersLocked(); } - configChanged = updateOrientationFromAppTokensLocked(); + configChanged = updateOrientationFromAppTokensLocked(false); performLayoutAndPlaceSurfacesLocked(); if (displayed && win.mIsWallpaper) { updateWallpaperOffsetLocked(win, mDisplay.getWidth(), @@ -3313,7 +3347,6 @@ public class WindowManagerService extends IWindowManager.Stub } wtoken = new WindowToken(token, type, true); mTokenMap.put(token, wtoken); - mTokenList.add(wtoken); if (type == TYPE_WALLPAPER) { mWallpaperTokens.add(wtoken); } @@ -3329,7 +3362,6 @@ public class WindowManagerService extends IWindowManager.Stub final long origId = Binder.clearCallingIdentity(); synchronized(mWindowMap) { WindowToken wtoken = mTokenMap.remove(token); - mTokenList.remove(wtoken); if (wtoken != null) { boolean delayed = false; if (!wtoken.hidden) { @@ -3405,10 +3437,9 @@ public class WindowManagerService extends IWindowManager.Stub wtoken.groupId = groupId; wtoken.appFullscreen = fullscreen; wtoken.requestedOrientation = requestedOrientation; + if (DEBUG_TOKEN_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, "addAppToken: " + wtoken); mAppTokens.add(addPos, wtoken); - if (localLOGV) Slog.v(TAG, "Adding new app token: " + wtoken); mTokenMap.put(token.asBinder(), wtoken); - mTokenList.add(wtoken); // Application tokens start out hidden. wtoken.hidden = true; @@ -3525,7 +3556,7 @@ public class WindowManagerService extends IWindowManager.Stub long ident = Binder.clearCallingIdentity(); synchronized(mWindowMap) { - if (updateOrientationFromAppTokensLocked()) { + if (updateOrientationFromAppTokensLocked(false)) { if (freezeThisOneIfNeeded != null) { AppWindowToken wtoken = findAppWindowToken( freezeThisOneIfNeeded); @@ -3547,7 +3578,7 @@ public class WindowManagerService extends IWindowManager.Stub if (currentConfig.diff(mTempConfiguration) != 0) { mWaitingForConfig = true; mLayoutNeeded = true; - startFreezingDisplayLocked(); + startFreezingDisplayLocked(false); config = new Configuration(mTempConfiguration); } } @@ -3572,8 +3603,8 @@ public class WindowManagerService extends IWindowManager.Stub * @see android.view.IWindowManager#updateOrientationFromAppTokens( * android.os.IBinder) */ - boolean updateOrientationFromAppTokensLocked() { - if (mDisplayFrozen) { + boolean updateOrientationFromAppTokensLocked(boolean inTransaction) { + if (mDisplayFrozen || mOpeningApps.size() > 0 || mClosingApps.size() > 0) { // If the display is frozen, some activities may be in the middle // of restarting, and thus have removed their old window. If the // window has the flag to hide the lock screen, then the lock screen @@ -3593,7 +3624,8 @@ public class WindowManagerService extends IWindowManager.Stub //action like disabling/enabling sensors etc., mPolicy.setCurrentOrientationLw(req); if (setRotationUncheckedLocked(WindowManagerPolicy.USE_LAST_ROTATION, - mLastRotationFlags | Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE)) { + mLastRotationFlags | Surface.FLAGS_ORIENTATION_ANIMATION_DISABLE, + inTransaction)) { changed = true; } } @@ -3819,10 +3851,12 @@ public class WindowManagerService extends IWindowManager.Stub startingWindow.mToken = wtoken; startingWindow.mRootToken = wtoken; startingWindow.mAppToken = wtoken; - if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, + if (DEBUG_WINDOW_MOVEMENT || DEBUG_ADD_REMOVE) Slog.v(TAG, "Removing starting window: " + startingWindow); mWindows.remove(startingWindow); mWindowsChanged = true; + if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Removing starting " + startingWindow + + " from " + ttoken); ttoken.windows.remove(startingWindow); ttoken.allAppWindows.remove(startingWindow); addWindowToListInOrderLocked(startingWindow, true); @@ -4168,7 +4202,7 @@ public class WindowManagerService extends IWindowManager.Stub wtoken.freezingScreen = true; mAppsFreezingScreen++; if (mAppsFreezingScreen == 1) { - startFreezingDisplayLocked(); + startFreezingDisplayLocked(false); mH.removeMessages(H.APP_FREEZE_TIMEOUT); mH.sendMessageDelayed(mH.obtainMessage(H.APP_FREEZE_TIMEOUT), 5000); @@ -4237,7 +4271,6 @@ public class WindowManagerService extends IWindowManager.Stub final long origId = Binder.clearCallingIdentity(); synchronized(mWindowMap) { WindowToken basewtoken = mTokenMap.remove(token); - mTokenList.remove(basewtoken); if (basewtoken != null && (wtoken=basewtoken.appWindowToken) != null) { if (DEBUG_APP_TRANSITIONS) Slog.v(TAG, "Removing app token: " + wtoken); delayed = setTokenVisibilityLocked(wtoken, null, false, WindowManagerPolicy.TRANSIT_UNSET, true); @@ -4257,6 +4290,8 @@ public class WindowManagerService extends IWindowManager.Stub + " animating=" + wtoken.animating); if (delayed) { // set the token aside because it has an active animation to be finished + if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, + "removeAppToken make exiting: " + wtoken); mExitingAppTokens.add(wtoken); } else { // Make sure there is no animation running on this token, @@ -4265,6 +4300,8 @@ public class WindowManagerService extends IWindowManager.Stub wtoken.animation = null; wtoken.animating = false; } + if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, + "removeAppToken: " + wtoken); mAppTokens.remove(wtoken); wtoken.removed = true; if (wtoken.startingData != null) { @@ -4391,18 +4428,21 @@ public class WindowManagerService extends IWindowManager.Stub if (!added && cwin.mSubLayer >= 0) { if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, "Re-adding child window at " + index + ": " + cwin); + win.mRebuilding = false; mWindows.add(index, win); index++; added = true; } if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, "Re-adding window at " + index + ": " + cwin); + cwin.mRebuilding = false; mWindows.add(index, cwin); index++; } if (!added) { if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, "Re-adding window at " + index + ": " + win); + win.mRebuilding = false; mWindows.add(index, win); index++; } @@ -4428,6 +4468,9 @@ public class WindowManagerService extends IWindowManager.Stub if (DEBUG_REORDER) Slog.v(TAG, "Initial app tokens:"); if (DEBUG_REORDER) dumpAppTokensLocked(); final AppWindowToken wtoken = findAppWindowToken(token); + if (DEBUG_TOKEN_MOVEMENT || DEBUG_REORDER) Slog.v(TAG, + "Start moving token " + wtoken + " initially at " + + mAppTokens.indexOf(wtoken)); if (wtoken == null || !mAppTokens.remove(wtoken)) { Slog.w(TAG, "Attempting to reorder token that doesn't exist: " + token + " (" + wtoken + ")"); @@ -4435,6 +4478,7 @@ public class WindowManagerService extends IWindowManager.Stub } mAppTokens.add(index, wtoken); if (DEBUG_REORDER) Slog.v(TAG, "Moved " + token + " to " + index + ":"); + else if (DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, "Moved " + token + " to " + index); if (DEBUG_REORDER) dumpAppTokensLocked(); final long origId = Binder.clearCallingIdentity(); @@ -4462,6 +4506,8 @@ public class WindowManagerService extends IWindowManager.Stub for (int i=0; i<N; i++) { IBinder token = tokens.get(i); final AppWindowToken wtoken = findAppWindowToken(token); + if (DEBUG_REORDER || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, + "Temporarily removing " + wtoken + " from " + mAppTokens.indexOf(wtoken)); if (!mAppTokens.remove(wtoken)) { Slog.w(TAG, "Attempting to reorder token that doesn't exist: " + token + " (" + wtoken + ")"); @@ -4535,6 +4581,8 @@ public class WindowManagerService extends IWindowManager.Stub for (int i=0; i<N; i++) { AppWindowToken wt = findAppWindowToken(tokens.get(i)); if (wt != null) { + if (DEBUG_TOKEN_MOVEMENT || DEBUG_REORDER) Slog.v(TAG, + "Adding next to top: " + wt); mAppTokens.add(wt); if (mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) { mToTopApps.remove(wt); @@ -4567,6 +4615,8 @@ public class WindowManagerService extends IWindowManager.Stub for (int i=0; i<N; i++) { AppWindowToken wt = findAppWindowToken(tokens.get(i)); if (wt != null) { + if (DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, + "Adding next to bottom: " + wt + " at " + pos); mAppTokens.add(pos, wt); if (mNextAppTransition != WindowManagerPolicy.TRANSIT_UNSET) { mToTopApps.remove(wt); @@ -4934,12 +4984,17 @@ public class WindowManagerService extends IWindowManager.Stub } } + if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION showStrictModeViolation"); Surface.openTransaction(); - if (mStrictModeFlash == null) { - mStrictModeFlash = new StrictModeFlash(mDisplay, mFxSession); + try { + if (mStrictModeFlash == null) { + mStrictModeFlash = new StrictModeFlash(mDisplay, mFxSession); + } + mStrictModeFlash.setVisibility(on); + } finally { + Surface.closeTransaction(); + if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION showStrictModeViolation"); } - mStrictModeFlash.setVisibility(on); - Surface.closeTransaction(); } } @@ -5084,7 +5139,7 @@ public class WindowManagerService extends IWindowManager.Stub long origId = Binder.clearCallingIdentity(); boolean changed; synchronized(mWindowMap) { - changed = setRotationUncheckedLocked(rotation, animFlags); + changed = setRotationUncheckedLocked(rotation, animFlags, false); } if (changed || alwaysSendConfiguration) { @@ -5102,7 +5157,7 @@ public class WindowManagerService extends IWindowManager.Stub * Returns null if the rotation has been changed. In this case YOU * MUST CALL setNewConfiguration() TO UNFREEZE THE SCREEN. */ - public boolean setRotationUncheckedLocked(int rotation, int animFlags) { + public boolean setRotationUncheckedLocked(int rotation, int animFlags, boolean inTransaction) { if (mDragState != null) { // Potential rotation during a drag. Don't do the rotation now, but make // a note to perform the rotation later. @@ -5137,17 +5192,28 @@ public class WindowManagerService extends IWindowManager.Stub 2000); mWaitingForConfig = true; mLayoutNeeded = true; - startFreezingDisplayLocked(); + startFreezingDisplayLocked(inTransaction); Slog.i(TAG, "Setting rotation to " + rotation + ", animFlags=" + animFlags); mInputManager.setDisplayOrientation(0, rotation); if (mDisplayEnabled) { if (CUSTOM_SCREEN_ROTATION) { Surface.freezeDisplay(0); - Surface.openTransaction(); - if (mScreenRotationAnimation != null) { - mScreenRotationAnimation.setRotation(rotation); + if (!inTransaction) { + if (SHOW_TRANSACTIONS) Slog.i(TAG, + ">>> OPEN TRANSACTION setRotationUnchecked"); + Surface.openTransaction(); + } + try { + if (mScreenRotationAnimation != null) { + mScreenRotationAnimation.setRotation(rotation); + } + } finally { + if (!inTransaction) { + Surface.closeTransaction(); + if (SHOW_TRANSACTIONS) Slog.i(TAG, + "<<< CLOSE TRANSACTION setRotationUnchecked"); + } } - Surface.closeTransaction(); Surface.setOrientation(0, rotation, animFlags); Surface.unfreezeDisplay(0); } else { @@ -5566,7 +5632,13 @@ public class WindowManagerService extends IWindowManager.Stub public Configuration computeNewConfiguration() { synchronized (mWindowMap) { - return computeNewConfigurationLocked(); + Configuration config = computeNewConfigurationLocked(); + if (config == null && mWaitingForConfig) { + // Nothing changed but we are waiting for something... stop that! + mWaitingForConfig = false; + performLayoutAndPlaceSurfacesLocked(); + } + return config; } } @@ -5952,7 +6024,7 @@ public class WindowManagerService extends IWindowManager.Stub * ordinary dispatch. */ public boolean interceptKeyBeforeDispatching( InputWindowHandle focus, KeyEvent event, int policyFlags) { - WindowState windowState = (WindowState) focus.windowState; + WindowState windowState = focus != null ? (WindowState) focus.windowState : null; return mPolicy.interceptKeyBeforeDispatching(windowState, event, policyFlags); } @@ -5960,7 +6032,7 @@ public class WindowManagerService extends IWindowManager.Stub * the application did not handle. */ public KeyEvent dispatchUnhandledKey( InputWindowHandle focus, KeyEvent event, int policyFlags) { - WindowState windowState = (WindowState) focus.windowState; + WindowState windowState = focus != null ? (WindowState) focus.windowState : null; return mPolicy.dispatchUnhandledKey(windowState, event, policyFlags); } @@ -6509,6 +6581,7 @@ public class WindowManagerService extends IWindowManager.Stub // Make the surface visible at the proper location final Surface surface = mDragState.mSurface; + if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION performDrag"); Surface.openTransaction(); try { surface.setPosition((int)(touchX - thumbCenterX), @@ -6518,6 +6591,7 @@ public class WindowManagerService extends IWindowManager.Stub surface.show(); } finally { Surface.closeTransaction(); + if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION performDrag"); } } @@ -6840,6 +6914,10 @@ public class WindowManagerService extends IWindowManager.Stub // Is this window now (or just being) removed? boolean mRemoved; + // Temp for keeping track of windows that have been removed when + // rebuilding window list. + boolean mRebuilding; + // For debugging, this is the last information given to the surface flinger. boolean mSurfaceShown; int mSurfaceX, mSurfaceY, mSurfaceW, mSurfaceH; @@ -6892,6 +6970,7 @@ public class WindowManagerService extends IWindowManager.Stub + TYPE_LAYER_OFFSET; mSubLayer = mPolicy.subWindowTypeToLayerLw(a.type); mAttachedWindow = attachedWindow; + if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Adding " + this + " to " + mAttachedWindow); mAttachedWindow.mChildWindows.add(this); mLayoutAttached = mAttrs.type != WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG; @@ -7197,9 +7276,8 @@ public class WindowManagerService extends IWindowManager.Stub + ", set left=" + mFrame.left + " top=" + mFrame.top + ", animLayer=" + mAnimLayer); if (SHOW_TRANSACTIONS) { - Slog.i(TAG, ">>> OPEN TRANSACTION"); - if (SHOW_TRANSACTIONS) logSurface(this, - "CREATE pos=(" + mFrame.left + "," + mFrame.top + ") (" + + Slog.i(TAG, ">>> OPEN TRANSACTION createSurfaceLocked"); + logSurface(this, "CREATE pos=(" + mFrame.left + "," + mFrame.top + ") (" + mFrame.width() + "x" + mFrame.height() + "), layer=" + mAnimLayer + " HIDE", null); } @@ -7224,8 +7302,8 @@ public class WindowManagerService extends IWindowManager.Stub } mLastHidden = true; } finally { - if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION"); Surface.closeTransaction(); + if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION createSurfaceLocked"); } if (localLOGV) Slog.v( TAG, "Created surface " + this); @@ -7897,6 +7975,7 @@ public class WindowManagerService extends IWindowManager.Stub disposeInputChannel(); if (mAttachedWindow != null) { + if (DEBUG_ADD_REMOVE) Slog.v(TAG, "Removing " + this + " from " + mAttachedWindow); mAttachedWindow.mChildWindows.remove(this); } destroySurfaceLocked(); @@ -9146,12 +9225,18 @@ public class WindowManagerService extends IWindowManager.Stub int lastWallpaper = -1; int numRemoved = 0; + if (mRebuildTmp.length < NW) { + mRebuildTmp = new WindowState[NW+10]; + } + // First remove all existing app windows. i=0; while (i < NW) { WindowState w = mWindows.get(i); if (w.mAppToken != null) { WindowState win = mWindows.remove(i); + win.mRebuilding = true; + mRebuildTmp[numRemoved] = win; mWindowsChanged = true; if (DEBUG_WINDOW_MOVEMENT) Slog.v(TAG, "Rebuild removing window: " + win); @@ -9189,6 +9274,21 @@ public class WindowManagerService extends IWindowManager.Stub if (i != numRemoved) { Slog.w(TAG, "Rebuild removed " + numRemoved + " windows but added " + i); + for (i=0; i<numRemoved; i++) { + WindowState ws = mRebuildTmp[i]; + if (ws.mRebuilding) { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + ws.dump(pw, ""); + pw.flush(); + Slog.w(TAG, "This window was lost: " + ws); + Slog.w(TAG, sw.toString()); + } + } + Slog.w(TAG, "Current app token list:"); + dumpAppTokensLocked(); + Slog.w(TAG, "Final window list:"); + dumpWindowsLocked(); } } @@ -9261,7 +9361,7 @@ public class WindowManagerService extends IWindowManager.Stub try { if (mForceRemoves != null) { recoveringMemory = true; - // Wait a little it for things to settle down, and off we go. + // Wait a little bit for things to settle down, and off we go. for (int i=0; i<mForceRemoves.size(); i++) { WindowState ws = mForceRemoves.get(i); Slog.i(TAG, "Force removing: " + ws); @@ -9284,14 +9384,17 @@ public class WindowManagerService extends IWindowManager.Stub try { performLayoutAndPlaceSurfacesLockedInner(recoveringMemory); - int i = mPendingRemove.size()-1; - if (i >= 0) { - while (i >= 0) { - WindowState w = mPendingRemove.get(i); - removeWindowInnerLocked(w.mSession, w); - i--; + int N = mPendingRemove.size(); + if (N > 0) { + if (mPendingRemoveTmp.length < N) { + mPendingRemoveTmp = new WindowState[N+10]; } + mPendingRemove.toArray(mPendingRemoveTmp); mPendingRemove.clear(); + for (int i=0; i<N; i++) { + WindowState w = mPendingRemoveTmp[i]; + removeWindowInnerLocked(w.mSession, w); + } mInLayout = false; assignLayersLocked(); @@ -9469,7 +9572,7 @@ public class WindowManagerService extends IWindowManager.Stub createWatermark = true; } - if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION"); + if (SHOW_TRANSACTIONS) Slog.i(TAG, ">>> OPEN TRANSACTION performLayoutAndPlaceSurfaces"); Surface.openTransaction(); @@ -9507,7 +9610,7 @@ public class WindowManagerService extends IWindowManager.Stub } if ((changes&WindowManagerPolicy.FINISH_LAYOUT_REDO_CONFIG) != 0) { if (DEBUG_LAYOUT) Slog.v(TAG, "Computing new config from layout"); - if (updateOrientationFromAppTokensLocked()) { + if (updateOrientationFromAppTokensLocked(true)) { mLayoutNeeded = true; mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION); } @@ -9735,12 +9838,9 @@ public class WindowManagerService extends IWindowManager.Stub if (tokenMayBeDrawn) { // See if any windows have been drawn, so they (and others // associated with them) can now be shown. - final int NT = mTokenList.size(); + final int NT = mAppTokens.size(); for (i=0; i<NT; i++) { - AppWindowToken wtoken = mTokenList.get(i).appWindowToken; - if (wtoken == null) { - continue; - } + AppWindowToken wtoken = mAppTokens.get(i); if (wtoken.freezingScreen) { int numInteresting = wtoken.numInterestingWindows; if (numInteresting > 0 && wtoken.numDrawnWindows >= numInteresting) { @@ -9966,7 +10066,8 @@ public class WindowManagerService extends IWindowManager.Stub // This has changed the visibility of windows, so perform // a new layout to get them all up-to-date. - changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT; + changes |= PhoneWindowManager.FINISH_LAYOUT_REDO_LAYOUT + | WindowManagerPolicy.FINISH_LAYOUT_REDO_CONFIG; mLayoutNeeded = true; if (!moveInputMethodWindowsIfNeededLocked(true)) { assignLayersLocked(); @@ -10192,7 +10293,7 @@ public class WindowManagerService extends IWindowManager.Stub // as running out of memory), don't take down the // entire system. Slog.e(TAG, "Failure updating surface of " + w - + "size=(" + width + "x" + height + + " size=(" + width + "x" + height + "), pos=(" + w.mShownFrame.left + "," + w.mShownFrame.top + ")", e); if (!recoveringMemory) { @@ -10543,8 +10644,6 @@ public class WindowManagerService extends IWindowManager.Stub } mBlurShown = false; } - - if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION"); } catch (RuntimeException e) { Slog.e(TAG, "Unhandled exception in Window Manager", e); } @@ -10553,6 +10652,8 @@ public class WindowManagerService extends IWindowManager.Stub Surface.closeTransaction(); + if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION performLayoutAndPlaceSurfaces"); + if (mWatermark != null) { mWatermark.drawIfNeeded(); } @@ -10642,6 +10743,8 @@ public class WindowManagerService extends IWindowManager.Stub // soon as their animations are complete token.animation = null; token.animating = false; + if (DEBUG_ADD_REMOVE || DEBUG_TOKEN_MOVEMENT) Slog.v(TAG, + "performLayout: App token exiting now removed" + token); mAppTokens.remove(token); mExitingAppTokens.remove(i); } @@ -10753,7 +10856,7 @@ public class WindowManagerService extends IWindowManager.Stub } return true; } catch (RuntimeException e) { - Slog.w(TAG, "Failure showing surface " + win.mSurface + " in " + win); + Slog.w(TAG, "Failure showing surface " + win.mSurface + " in " + win, e); } reclaimSomeSurfaceMemoryLocked(win, "show"); @@ -10788,6 +10891,7 @@ public class WindowManagerService extends IWindowManager.Stub + " token=" + win.mToken + " pid=" + ws.mSession.mPid + " uid=" + ws.mSession.mUid); + if (SHOW_TRANSACTIONS) logSurface(ws, "LEAK DESTROY", null); ws.mSurface.destroy(); ws.mSurfaceShown = false; ws.mSurface = null; @@ -10795,10 +10899,11 @@ public class WindowManagerService extends IWindowManager.Stub i--; N--; leakedSurface = true; - } else if (win.mAppToken != null && win.mAppToken.clientHidden) { + } else if (ws.mAppToken != null && ws.mAppToken.clientHidden) { Slog.w(TAG, "LEAKED SURFACE (app token hidden): " + ws + " surface=" + ws.mSurface + " token=" + win.mAppToken); + if (SHOW_TRANSACTIONS) logSurface(ws, "LEAK DESTROY", null); ws.mSurface.destroy(); ws.mSurfaceShown = false; ws.mSurface = null; @@ -10836,6 +10941,7 @@ public class WindowManagerService extends IWindowManager.Stub // surface and ask the app to request another one. Slog.w(TAG, "Looks like we have reclaimed some memory, clearing surface for retry."); if (surface != null) { + if (SHOW_TRANSACTIONS) logSurface(win, "RECOVER DESTROY", null); surface.destroy(); win.mSurfaceShown = false; win.mSurface = null; @@ -10963,7 +11069,7 @@ public class WindowManagerService extends IWindowManager.Stub return result; } - private void startFreezingDisplayLocked() { + private void startFreezingDisplayLocked(boolean inTransaction) { if (mDisplayFrozen) { return; } @@ -11005,7 +11111,7 @@ public class WindowManagerService extends IWindowManager.Stub } if (mScreenRotationAnimation == null) { mScreenRotationAnimation = new ScreenRotationAnimation(mContext, - mDisplay, mFxSession); + mDisplay, mFxSession, inTransaction); } } else { Surface.freezeDisplay(0); @@ -11046,7 +11152,7 @@ public class WindowManagerService extends IWindowManager.Stub // to avoid inconsistent states. However, something interesting // could have actually changed during that time so re-evaluate it // now to catch that. - if (updateOrientationFromAppTokensLocked()) { + if (updateOrientationFromAppTokensLocked(false)) { mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION); } @@ -11351,14 +11457,6 @@ public class WindowManagerService extends IWindowManager.Stub token.dump(pw, " "); } } - if (mTokenList.size() > 0) { - pw.println(" "); - pw.println(" Window token list:"); - for (int i=0; i<mTokenList.size(); i++) { - pw.print(" #"); pw.print(i); pw.print(": "); - pw.println(mTokenList.get(i)); - } - } if (mWallpaperTokens.size() > 0) { pw.println(" "); pw.println(" Wallpaper tokens:"); @@ -11482,6 +11580,8 @@ public class WindowManagerService extends IWindowManager.Stub } else { pw.println(" NO DISPLAY"); } + pw.println(" Policy:"); + mPolicy.dump(" ", fd, pw, args); } } diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 761dcd1..17ef88d 100755 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -2612,6 +2612,7 @@ public final class ActivityManagerService extends ActivityManagerNative if (localLOGV) Slog.v( TAG, "Removing this entry! frozen=" + r.haveState + " finishing=" + r.finishing); + r.makeFinishing(); mMainStack.mHistory.remove(i); r.inHistory = false; @@ -6607,7 +6608,7 @@ public final class ActivityManagerService extends ActivityManagerNative if (r.state == ActivityState.RESUMED || r.state == ActivityState.PAUSING || r.state == ActivityState.PAUSED) { - if (!r.isHomeActivity) { + if (!r.isHomeActivity || mHomeProcess != r.app) { Slog.w(TAG, " Force finishing activity " + r.intent.getComponent().flattenToShortString()); r.stack.finishActivityLocked(r, index, diff --git a/services/java/com/android/server/am/ActivityRecord.java b/services/java/com/android/server/am/ActivityRecord.java index 72ea7ce..e29da1c 100644 --- a/services/java/com/android/server/am/ActivityRecord.java +++ b/services/java/com/android/server/am/ActivityRecord.java @@ -321,6 +321,15 @@ class ActivityRecord extends IApplicationToken.Stub { } } + void makeFinishing() { + if (!finishing) { + finishing = true; + if (task != null) { + task.numActivities--; + } + } + } + UriPermissionOwner getUriPermissionsLocked() { if (uriPermissions == null) { uriPermissions = new UriPermissionOwner(service, this); diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java index eee9f7e..bc00478 100644 --- a/services/java/com/android/server/am/ActivityStack.java +++ b/services/java/com/android/server/am/ActivityStack.java @@ -50,7 +50,6 @@ import android.content.res.Resources; import android.graphics.Bitmap; import android.net.Uri; import android.os.Binder; -import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Message; @@ -3071,7 +3070,7 @@ public class ActivityStack { return false; } - r.finishing = true; + r.makeFinishing(); EventLog.writeEvent(EventLogTags.AM_FINISH_ACTIVITY, System.identityHashCode(r), r.task.taskId, r.shortComponentName, reason); @@ -3276,6 +3275,7 @@ public class ActivityStack { private final void removeActivityFromHistoryLocked(ActivityRecord r) { if (r.state != ActivityState.DESTROYED) { + r.makeFinishing(); mHistory.remove(r); r.inHistory = false; r.state = ActivityState.DESTROYED; @@ -3440,6 +3440,7 @@ public class ActivityStack { ActivityRecord hr = (ActivityRecord)mHistory.get(i); if (hr.isHomeActivity) { homeTask = hr.task; + break; } } if (homeTask != null) { diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp index 8a021cb..0c1fcf9 100644 --- a/services/surfaceflinger/LayerBase.cpp +++ b/services/surfaceflinger/LayerBase.cpp @@ -503,12 +503,18 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const void LayerBase::setBufferCrop(const Rect& crop) { if (!crop.isEmpty()) { - mBufferCrop = crop; + if (mBufferCrop != crop) { + mBufferCrop = crop; + mFlinger->invalidateHwcGeometry(); + } } } void LayerBase::setBufferTransform(uint32_t transform) { - mBufferTransform = transform; + if (mBufferTransform != transform) { + mBufferTransform = transform; + mFlinger->invalidateHwcGeometry(); + } } void LayerBase::dump(String8& result, char* buffer, size_t SIZE) const diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 967ff1a..77695d7 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -465,7 +465,7 @@ void SurfaceFlinger::handleTransaction(uint32_t transactionFlags) handleTransactionLocked(transactionFlags, ditchedLayers); mLastTransactionTime = systemTime() - now; mDebugInTransaction = 0; - mHwWorkListDirty = true; + invalidateHwcGeometry(); // here the transaction has been committed } @@ -731,13 +731,18 @@ void SurfaceFlinger::handlePageFlip() mWormholeRegion = screenRegion.subtract(opaqueRegion); mVisibleRegionsDirty = false; - mHwWorkListDirty = true; + invalidateHwcGeometry(); } unlockPageFlip(currentLayers); mDirtyRegion.andSelf(screenRegion); } +void SurfaceFlinger::invalidateHwcGeometry() +{ + mHwWorkListDirty = true; +} + bool SurfaceFlinger::lockPageFlip(const LayerVector& currentLayers) { bool recomputeVisibleRegions = false; @@ -1591,7 +1596,7 @@ status_t SurfaceFlinger::onTransact( case 1008: // toggle use of hw composer n = data.readInt32(); mDebugDisableHWC = n ? 1 : 0; - mHwWorkListDirty = true; + invalidateHwcGeometry(); // fall-through... case 1004:{ // repaint everything Mutex::Autolock _l(mStateLock); diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index 2f2977a..2591123 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -225,6 +225,7 @@ public: status_t removeLayer(const sp<LayerBase>& layer); status_t addLayer(const sp<LayerBase>& layer); status_t invalidateLayerVisibility(const sp<LayerBase>& layer); + void invalidateHwcGeometry(); sp<Layer> getLayer(const sp<ISurface>& sur) const; diff --git a/tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java b/tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java index 4982c46..e5a46b9 100644 --- a/tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java +++ b/tests/DumpRenderTree/src/com/android/dumprendertree/LoadTestsAutoTest.java @@ -93,11 +93,8 @@ public class LoadTestsAutoTest extends ActivityInstrumentationTestCase2<TestShel final VMRuntime runtime = VMRuntime.getRuntime(); runtime.gcSoftReferences(); - runtime.runFinalizationSync(); runtime.gcSoftReferences(); - runtime.runFinalizationSync(); runtime.gcSoftReferences(); - runtime.runFinalizationSync(); Runtime.getRuntime().runFinalization(); Runtime.getRuntime().gc(); Runtime.getRuntime().gc(); diff --git a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java index 0d9efba..8bfaf40 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Canvas_Delegate.java @@ -1009,7 +1009,7 @@ public final class Canvas_Delegate { /*package*/ static void native_drawTextRun(int nativeCanvas, char[] text, int start, int count, int contextStart, int contextCount, float x, float y, int flags, int paint) { - native_drawText(nativeCanvas, text, 0, count, x, y, flags, paint); + native_drawText(nativeCanvas, text, start, count, x, y, flags, paint); } /*package*/ static void native_drawPosText(int nativeCanvas, |