diff options
474 files changed, 8639 insertions, 2950 deletions
@@ -29401,6 +29401,23 @@ visibility="public" > </method> +<method name="listenUsingInsecureRfcommWithServiceRecord" + return="android.bluetooth.BluetoothServerSocket" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="name" type="java.lang.String"> +</parameter> +<parameter name="uuid" type="java.util.UUID"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> <method name="listenUsingRfcommWithServiceRecord" return="android.bluetooth.BluetoothServerSocket" abstract="false" @@ -30587,6 +30604,21 @@ > <implements name="android.os.Parcelable"> </implements> +<method name="createInsecureRfcommSocketToServiceRecord" + return="android.bluetooth.BluetoothSocket" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="uuid" type="java.util.UUID"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> <method name="createRfcommSocketToServiceRecord" return="android.bluetooth.BluetoothSocket" abstract="false" @@ -35673,6 +35705,17 @@ visibility="public" > </field> +<field name="NFC_SERVICE" + type="java.lang.String" + transient="false" + volatile="false" + value=""nfc"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="NOTIFICATION_SERVICE" type="java.lang.String" transient="false" @@ -59851,6 +59894,16 @@ visibility="public" > </field> +<field name="inPreferQualityOverSpeed" + type="boolean" + transient="false" + volatile="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="inPreferredConfig" type="android.graphics.Bitmap.Config" transient="false" @@ -59963,6 +60016,146 @@ > </field> </class> +<class name="BitmapRegionDecoder" + extends="java.lang.Object" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="decodeRegion" + return="android.graphics.Bitmap" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="rect" type="android.graphics.Rect"> +</parameter> +<parameter name="options" type="android.graphics.BitmapFactory.Options"> +</parameter> +</method> +<method name="getHeight" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getWidth" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="isRecycled" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="newInstance" + return="android.graphics.BitmapRegionDecoder" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="data" type="byte[]"> +</parameter> +<parameter name="offset" type="int"> +</parameter> +<parameter name="length" type="int"> +</parameter> +<parameter name="isShareable" type="boolean"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="newInstance" + return="android.graphics.BitmapRegionDecoder" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="fd" type="java.io.FileDescriptor"> +</parameter> +<parameter name="isShareable" type="boolean"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="newInstance" + return="android.graphics.BitmapRegionDecoder" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="is" type="java.io.InputStream"> +</parameter> +<parameter name="isShareable" type="boolean"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="newInstance" + return="android.graphics.BitmapRegionDecoder" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="pathName" type="java.lang.String"> +</parameter> +<parameter name="isShareable" type="boolean"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="recycle" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +</class> <class name="BitmapShader" extends="android.graphics.Shader" abstract="false" @@ -85926,6 +86119,385 @@ </parameter> </method> </interface> +<class name="MediaMetadataRetriever" + extends="java.lang.Object" + abstract="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<constructor name="MediaMetadataRetriever" + type="android.media.MediaMetadataRetriever" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</constructor> +<method name="extractMetadata" + return="java.lang.String" + abstract="false" + native="true" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="keyCode" type="int"> +</parameter> +</method> +<method name="getEmbeddedPicture" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getFrameAtTime" + return="android.graphics.Bitmap" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="timeUs" type="long"> +</parameter> +<parameter name="option" type="int"> +</parameter> +</method> +<method name="getFrameAtTime" + return="android.graphics.Bitmap" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="timeUs" type="long"> +</parameter> +</method> +<method name="getFrameAtTime" + return="android.graphics.Bitmap" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="release" + return="void" + abstract="false" + native="true" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="setDataSource" + return="void" + abstract="false" + native="true" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="path" type="java.lang.String"> +</parameter> +<exception name="IllegalArgumentException" type="java.lang.IllegalArgumentException"> +</exception> +</method> +<method name="setDataSource" + return="void" + abstract="false" + native="true" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="fd" type="java.io.FileDescriptor"> +</parameter> +<parameter name="offset" type="long"> +</parameter> +<parameter name="length" type="long"> +</parameter> +<exception name="IllegalArgumentException" type="java.lang.IllegalArgumentException"> +</exception> +</method> +<method name="setDataSource" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="fd" type="java.io.FileDescriptor"> +</parameter> +<exception name="IllegalArgumentException" type="java.lang.IllegalArgumentException"> +</exception> +</method> +<method name="setDataSource" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="context" type="android.content.Context"> +</parameter> +<parameter name="uri" type="android.net.Uri"> +</parameter> +<exception name="IllegalArgumentException" type="java.lang.IllegalArgumentException"> +</exception> +<exception name="SecurityException" type="java.lang.SecurityException"> +</exception> +</method> +<field name="METADATA_KEY_ALBUM" + type="int" + transient="false" + volatile="false" + value="1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="METADATA_KEY_ALBUMARTIST" + type="int" + transient="false" + volatile="false" + value="13" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="METADATA_KEY_ARTIST" + type="int" + transient="false" + volatile="false" + value="2" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="METADATA_KEY_AUTHOR" + type="int" + transient="false" + volatile="false" + value="3" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="METADATA_KEY_CD_TRACK_NUMBER" + type="int" + transient="false" + volatile="false" + value="0" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="METADATA_KEY_COMPILATION" + type="int" + transient="false" + volatile="false" + value="15" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="METADATA_KEY_COMPOSER" + type="int" + transient="false" + volatile="false" + value="4" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="METADATA_KEY_DATE" + type="int" + transient="false" + volatile="false" + value="5" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="METADATA_KEY_DISC_NUMBER" + type="int" + transient="false" + volatile="false" + value="14" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="METADATA_KEY_DURATION" + type="int" + transient="false" + volatile="false" + value="9" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="METADATA_KEY_GENRE" + type="int" + transient="false" + volatile="false" + value="6" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="METADATA_KEY_MIMETYPE" + type="int" + transient="false" + volatile="false" + value="12" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="METADATA_KEY_NUM_TRACKS" + type="int" + transient="false" + volatile="false" + value="10" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="METADATA_KEY_TITLE" + type="int" + transient="false" + volatile="false" + value="7" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="METADATA_KEY_WRITER" + type="int" + transient="false" + volatile="false" + value="11" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="METADATA_KEY_YEAR" + type="int" + transient="false" + volatile="false" + value="8" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="OPTION_CLOSEST" + type="int" + transient="false" + volatile="false" + value="3" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="OPTION_CLOSEST_SYNC" + type="int" + transient="false" + volatile="false" + value="2" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="OPTION_NEXT_SYNC" + type="int" + transient="false" + volatile="false" + value="1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="OPTION_PREVIOUS_SYNC" + type="int" + transient="false" + volatile="false" + value="0" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +</class> <class name="MediaPlayer" extends="java.lang.Object" abstract="false" @@ -87195,6 +87767,17 @@ deprecated="not deprecated" visibility="public" > +<field name="AAC" + type="int" + transient="false" + volatile="false" + value="3" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="AMR_NB" type="int" transient="false" @@ -87206,6 +87789,17 @@ visibility="public" > </field> +<field name="AMR_WB" + type="int" + transient="false" + volatile="false" + value="2" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="DEFAULT" type="int" transient="false" @@ -87362,6 +87956,28 @@ deprecated="not deprecated" visibility="public" > +<field name="AMR_NB" + type="int" + transient="false" + volatile="false" + value="3" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="AMR_WB" + type="int" + transient="false" + volatile="false" + value="4" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="DEFAULT" type="int" transient="false" @@ -100173,6 +100789,66 @@ deprecated="not deprecated" visibility="public" > +<method name="disableForegroundDispatch" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="activity" type="android.app.Activity"> +</parameter> +</method> +<method name="disableForegroundNdefPush" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="activity" type="android.app.Activity"> +</parameter> +</method> +<method name="enableForegroundDispatch" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="activity" type="android.app.Activity"> +</parameter> +<parameter name="intent" type="android.app.PendingIntent"> +</parameter> +<parameter name="filters" type="android.content.IntentFilter[]"> +</parameter> +<parameter name="techLists" type="java.lang.String[][]"> +</parameter> +</method> +<method name="enableForegroundNdefPush" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="activity" type="android.app.Activity"> +</parameter> +<parameter name="msg" type="android.nfc.NdefMessage"> +</parameter> +</method> <method name="getDefaultAdapter" return="android.nfc.NfcAdapter" abstract="false" @@ -100183,6 +100859,19 @@ deprecated="not deprecated" visibility="public" > +<parameter name="context" type="android.content.Context"> +</parameter> +</method> +<method name="getDefaultAdapter" + return="android.nfc.NfcAdapter" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="deprecated" + visibility="public" +> </method> <method name="isEnabled" return="boolean" @@ -100195,6 +100884,17 @@ visibility="public" > </method> +<field name="ACTION_NDEF_DISCOVERED" + type="java.lang.String" + transient="false" + volatile="false" + value=""android.nfc.action.NDEF_DISCOVERED"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="ACTION_TAG_DISCOVERED" type="java.lang.String" transient="false" @@ -100206,6 +100906,17 @@ visibility="public" > </field> +<field name="ACTION_TECHNOLOGY_DISCOVERED" + type="java.lang.String" + transient="false" + volatile="false" + value=""android.nfc.action.TECH_DISCOVERED"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="EXTRA_ID" type="java.lang.String" transient="false" @@ -100228,7 +100939,1327 @@ visibility="public" > </field> +<field name="EXTRA_TAG" + type="java.lang.String" + transient="false" + volatile="false" + value=""android.nfc.extra.TAG"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +</class> +<class name="NfcManager" + extends="java.lang.Object" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="getDefaultAdapter" + return="android.nfc.NfcAdapter" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +</class> +<class name="Tag" + extends="java.lang.Object" + abstract="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<implements name="android.os.Parcelable"> +</implements> +<method name="createMockTag" + return="android.nfc.Tag" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="id" type="byte[]"> +</parameter> +<parameter name="techList" type="int[]"> +</parameter> +<parameter name="techListExtras" type="android.os.Bundle[]"> +</parameter> +</method> +<method name="describeContents" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getId" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getTechList" + return="java.lang.String[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="writeToParcel" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="dest" type="android.os.Parcel"> +</parameter> +<parameter name="flags" type="int"> +</parameter> +</method> +<field name="CREATOR" + type="android.os.Parcelable.Creator" + transient="false" + volatile="false" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +</class> +<class name="TagLostException" + extends="java.io.IOException" + abstract="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<constructor name="TagLostException" + type="android.nfc.TagLostException" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</constructor> +<constructor name="TagLostException" + type="android.nfc.TagLostException" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="message" type="java.lang.String"> +</parameter> +</constructor> +</class> +</package> +<package name="android.nfc.tech" +> +<class name="BasicTagTechnology" + extends="java.lang.Object" + abstract="true" + static="false" + final="false" + deprecated="not deprecated" + visibility="" +> +<implements name="android.nfc.tech.TagTechnology"> +</implements> +<method name="close" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="connect" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="getTag" + return="android.nfc.Tag" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="isConnected" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="reconnect" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +</class> +<class name="IsoDep" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="get" + return="android.nfc.tech.IsoDep" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +<method name="getHiLayerResponse" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getHistoricalBytes" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="setTimeout" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="timeout" type="int"> +</parameter> +</method> +<method name="transceive" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +</class> +<class name="MifareClassic" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="authenticateSectorWithKeyA" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="sectorIndex" type="int"> +</parameter> +<parameter name="key" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="authenticateSectorWithKeyB" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="sectorIndex" type="int"> +</parameter> +<parameter name="key" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="blockToSector" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="blockIndex" type="int"> +</parameter> +</method> +<method name="decrement" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="blockIndex" type="int"> +</parameter> +<parameter name="value" type="int"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="get" + return="android.nfc.tech.MifareClassic" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +<method name="getBlockCount" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getBlockCountInSector" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="sectorIndex" type="int"> +</parameter> +</method> +<method name="getSectorCount" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getSize" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getType" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="increment" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="blockIndex" type="int"> +</parameter> +<parameter name="value" type="int"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="readBlock" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="blockIndex" type="int"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="restore" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="blockIndex" type="int"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="sectorToBlock" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="sectorIndex" type="int"> +</parameter> +</method> +<method name="transceive" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="transfer" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="blockIndex" type="int"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="writeBlock" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="blockIndex" type="int"> +</parameter> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<field name="BLOCK_SIZE" + type="int" + transient="false" + volatile="false" + value="16" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="KEY_DEFAULT" + type="byte[]" + transient="false" + volatile="false" + value="null" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="KEY_MIFARE_APPLICATION_DIRECTORY" + type="byte[]" + transient="false" + volatile="false" + value="null" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="KEY_NFC_FORUM" + type="byte[]" + transient="false" + volatile="false" + value="null" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="SIZE_1K" + type="int" + transient="false" + volatile="false" + value="1024" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="SIZE_2K" + type="int" + transient="false" + volatile="false" + value="2048" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="SIZE_4K" + type="int" + transient="false" + volatile="false" + value="4096" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="SIZE_MINI" + type="int" + transient="false" + volatile="false" + value="320" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TYPE_CLASSIC" + type="int" + transient="false" + volatile="false" + value="0" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TYPE_PLUS" + type="int" + transient="false" + volatile="false" + value="1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TYPE_PRO" + type="int" + transient="false" + volatile="false" + value="2" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TYPE_UNKNOWN" + type="int" + transient="false" + volatile="false" + value="-1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +</class> +<class name="MifareUltralight" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="get" + return="android.nfc.tech.MifareUltralight" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +<method name="getType" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="readPages" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="pageOffset" type="int"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="transceive" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="writePage" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="pageOffset" type="int"> +</parameter> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<field name="PAGE_SIZE" + type="int" + transient="false" + volatile="false" + value="4" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TYPE_ULTRALIGHT" + type="int" + transient="false" + volatile="false" + value="1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TYPE_ULTRALIGHT_C" + type="int" + transient="false" + volatile="false" + value="2" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TYPE_UNKNOWN" + type="int" + transient="false" + volatile="false" + value="-1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> </class> +<class name="Ndef" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="canMakeReadonly" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="get" + return="android.nfc.tech.Ndef" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +<method name="getCachedNdefMessage" + return="android.nfc.NdefMessage" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getMaxSize" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getNdefMessage" + return="android.nfc.NdefMessage" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<exception name="FormatException" type="android.nfc.FormatException"> +</exception> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="getType" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="isWritable" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="makeReadonly" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="writeNdefMessage" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="msg" type="android.nfc.NdefMessage"> +</parameter> +<exception name="FormatException" type="android.nfc.FormatException"> +</exception> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<field name="MIFARE_CLASSIC" + type="int" + transient="false" + volatile="false" + value="101" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="NFC_FORUM_TYPE_1" + type="int" + transient="false" + volatile="false" + value="1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="NFC_FORUM_TYPE_2" + type="int" + transient="false" + volatile="false" + value="2" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="NFC_FORUM_TYPE_3" + type="int" + transient="false" + volatile="false" + value="3" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="NFC_FORUM_TYPE_4" + type="int" + transient="false" + volatile="false" + value="4" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="OTHER" + type="int" + transient="false" + volatile="false" + value="-1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +</class> +<class name="NdefFormatable" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="format" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="firstMessage" type="android.nfc.NdefMessage"> +</parameter> +<exception name="FormatException" type="android.nfc.FormatException"> +</exception> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="get" + return="android.nfc.tech.NdefFormatable" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +</class> +<class name="NfcA" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="get" + return="android.nfc.tech.NfcA" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +<method name="getAtqa" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getSak" + return="short" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="transceive" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +</class> +<class name="NfcB" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="get" + return="android.nfc.tech.NfcB" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +<method name="getApplicationData" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getProtocolInfo" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="transceive" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +</class> +<class name="NfcF" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="get" + return="android.nfc.tech.NfcF" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +<method name="getManufacturer" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getSystemCode" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="transceive" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +</class> +<class name="NfcV" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="get" + return="android.nfc.tech.NfcV" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +<method name="getDsfId" + return="byte" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getResponseFlags" + return="byte" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="transceive" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +</class> +<interface name="TagTechnology" + abstract="true" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<implements name="java.io.Closeable"> +</implements> +<method name="close" + return="void" + abstract="true" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="connect" + return="void" + abstract="true" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="getTag" + return="android.nfc.Tag" + abstract="true" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="reconnect" + return="void" + abstract="true" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +</interface> </package> <package name="android.opengl" > @@ -120245,6 +122276,17 @@ visibility="public" > </field> +<field name="GINGERBREAD_MR1" + type="int" + transient="false" + volatile="false" + value="10" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> </class> <class name="Bundle" extends="java.lang.Object" @@ -147050,6 +149092,92 @@ > </field> </class> +<class name="RecognizerResultsIntent" + extends="java.lang.Object" + abstract="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<field name="ACTION_VOICE_SEARCH_RESULTS" + type="java.lang.String" + transient="false" + volatile="false" + value=""android.speech.action.VOICE_SEARCH_RESULTS"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="EXTRA_VOICE_SEARCH_RESULT_HTML" + type="java.lang.String" + transient="false" + volatile="false" + value=""android.speech.extras.VOICE_SEARCH_RESULT_HTML"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="EXTRA_VOICE_SEARCH_RESULT_HTML_BASE_URLS" + type="java.lang.String" + transient="false" + volatile="false" + value=""android.speech.extras.VOICE_SEARCH_RESULT_HTML_BASE_URLS"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="EXTRA_VOICE_SEARCH_RESULT_HTTP_HEADERS" + type="java.lang.String" + transient="false" + volatile="false" + value=""android.speech.extras.EXTRA_VOICE_SEARCH_RESULT_HTTP_HEADERS"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="EXTRA_VOICE_SEARCH_RESULT_STRINGS" + type="java.lang.String" + transient="false" + volatile="false" + value=""android.speech.extras.VOICE_SEARCH_RESULT_STRINGS"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="EXTRA_VOICE_SEARCH_RESULT_URLS" + type="java.lang.String" + transient="false" + volatile="false" + value=""android.speech.extras.VOICE_SEARCH_RESULT_URLS"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="URI_SCHEME_INLINE" + type="java.lang.String" + transient="false" + volatile="false" + value=""inline"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +</class> <class name="SpeechRecognizer" extends="java.lang.Object" abstract="false" @@ -1885,6 +1885,28 @@ visibility="public" > </field> +<field name="actionMenuTextAppearance" + type="int" + transient="false" + volatile="false" + value="16843616" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="actionMenuTextColor" + type="int" + transient="false" + volatile="false" + value="16843617" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="actionModeBackground" type="int" transient="false" @@ -11809,6 +11831,28 @@ visibility="public" > </field> +<field name="dialog_holo_dark_frame" + type="int" + transient="false" + volatile="false" + value="17301682" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="dialog_holo_light_frame" + type="int" + transient="false" + volatile="false" + value="17301683" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="divider_horizontal_bright" type="int" transient="false" @@ -24777,6 +24821,28 @@ visibility="public" > </method> +<method name="getLauncherLargeIconDensity" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getLauncherLargeIconSize" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> <method name="getMemoryClass" return="int" abstract="false" @@ -26563,6 +26629,39 @@ <parameter name="viewSpacingBottom" type="int"> </parameter> </method> +<field name="THEME_HOLO_DARK" + type="int" + transient="false" + volatile="false" + value="2" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="THEME_HOLO_LIGHT" + type="int" + transient="false" + volatile="false" + value="3" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="THEME_TRADITIONAL" + type="int" + transient="false" + volatile="false" + value="1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> </class> <class name="AlertDialog.Builder" extends="java.lang.Object" @@ -43664,19 +43763,6 @@ <parameter name="data" type="D"> </parameter> </method> -<method name="onCancelled" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="deprecated" - visibility="public" -> -<parameter name="data" type="D"> -</parameter> -</method> <method name="onLoadInBackground" return="D" abstract="false" @@ -55510,6 +55596,17 @@ <parameter name="context" type="android.content.Context"> </parameter> </constructor> +<method name="abandon" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> <method name="dataToString" return="java.lang.String" abstract="false" @@ -55588,6 +55685,17 @@ visibility="public" > </method> +<method name="isAbandoned" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> <method name="isReset" return="boolean" abstract="false" @@ -55610,6 +55718,17 @@ visibility="public" > </method> +<method name="onAbandon" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="protected" +> +</method> <method name="onContentChanged" return="void" abstract="false" @@ -94202,6 +94321,17 @@ visibility="public" > </constructor> +<method name="getBackDisposition" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> <method name="getCandidatesHiddenVisibility" return="int" abstract="false" @@ -94927,6 +95057,19 @@ <parameter name="charCode" type="char"> </parameter> </method> +<method name="setBackDisposition" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="disposition" type="int"> +</parameter> +</method> <method name="setCandidatesView" return="void" abstract="false" @@ -95053,6 +95196,39 @@ visibility="public" > </method> +<field name="BACK_DISPOSITION_DEFAULT" + type="int" + transient="false" + volatile="false" + value="0" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="BACK_DISPOSITION_WILL_DISMISS" + type="int" + transient="false" + volatile="false" + value="2" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="BACK_DISPOSITION_WILL_NOT_DISMISS" + type="int" + transient="false" + volatile="false" + value="1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> </class> <class name="InputMethodService.InputMethodImpl" extends="android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodImpl" @@ -118346,6 +118522,66 @@ deprecated="not deprecated" visibility="public" > +<method name="disableForegroundDispatch" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="activity" type="android.app.Activity"> +</parameter> +</method> +<method name="disableForegroundNdefPush" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="activity" type="android.app.Activity"> +</parameter> +</method> +<method name="enableForegroundDispatch" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="activity" type="android.app.Activity"> +</parameter> +<parameter name="intent" type="android.app.PendingIntent"> +</parameter> +<parameter name="filters" type="android.content.IntentFilter[]"> +</parameter> +<parameter name="techLists" type="java.lang.String[][]"> +</parameter> +</method> +<method name="enableForegroundNdefPush" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="activity" type="android.app.Activity"> +</parameter> +<parameter name="msg" type="android.nfc.NdefMessage"> +</parameter> +</method> <method name="getDefaultAdapter" return="android.nfc.NfcAdapter" abstract="false" @@ -118381,6 +118617,17 @@ visibility="public" > </method> +<field name="ACTION_NDEF_DISCOVERED" + type="java.lang.String" + transient="false" + volatile="false" + value=""android.nfc.action.NDEF_DISCOVERED"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="ACTION_TAG_DISCOVERED" type="java.lang.String" transient="false" @@ -118392,6 +118639,17 @@ visibility="public" > </field> +<field name="ACTION_TECHNOLOGY_DISCOVERED" + type="java.lang.String" + transient="false" + volatile="false" + value=""android.nfc.action.TECH_DISCOVERED"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="EXTRA_ID" type="java.lang.String" transient="false" @@ -118414,6 +118672,17 @@ visibility="public" > </field> +<field name="EXTRA_TAG" + type="java.lang.String" + transient="false" + volatile="false" + value=""android.nfc.extra.TAG"" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> </class> <class name="NfcManager" extends="java.lang.Object" @@ -118435,6 +118704,1295 @@ > </method> </class> +<class name="Tag" + extends="java.lang.Object" + abstract="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<implements name="android.os.Parcelable"> +</implements> +<method name="createMockTag" + return="android.nfc.Tag" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="id" type="byte[]"> +</parameter> +<parameter name="techList" type="int[]"> +</parameter> +<parameter name="techListExtras" type="android.os.Bundle[]"> +</parameter> +</method> +<method name="describeContents" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getId" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getTechList" + return="java.lang.String[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="writeToParcel" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="dest" type="android.os.Parcel"> +</parameter> +<parameter name="flags" type="int"> +</parameter> +</method> +<field name="CREATOR" + type="android.os.Parcelable.Creator" + transient="false" + volatile="false" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +</class> +<class name="TagLostException" + extends="java.io.IOException" + abstract="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<constructor name="TagLostException" + type="android.nfc.TagLostException" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</constructor> +<constructor name="TagLostException" + type="android.nfc.TagLostException" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="message" type="java.lang.String"> +</parameter> +</constructor> +</class> +</package> +<package name="android.nfc.tech" +> +<class name="BasicTagTechnology" + extends="java.lang.Object" + abstract="true" + static="false" + final="false" + deprecated="not deprecated" + visibility="" +> +<implements name="android.nfc.tech.TagTechnology"> +</implements> +<method name="close" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="connect" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="getTag" + return="android.nfc.Tag" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="isConnected" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="reconnect" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +</class> +<class name="IsoDep" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="get" + return="android.nfc.tech.IsoDep" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +<method name="getHiLayerResponse" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getHistoricalBytes" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="setTimeout" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="timeout" type="int"> +</parameter> +</method> +<method name="transceive" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +</class> +<class name="MifareClassic" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="authenticateSectorWithKeyA" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="sectorIndex" type="int"> +</parameter> +<parameter name="key" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="authenticateSectorWithKeyB" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="sectorIndex" type="int"> +</parameter> +<parameter name="key" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="blockToSector" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="blockIndex" type="int"> +</parameter> +</method> +<method name="decrement" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="blockIndex" type="int"> +</parameter> +<parameter name="value" type="int"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="get" + return="android.nfc.tech.MifareClassic" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +<method name="getBlockCount" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getBlockCountInSector" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="sectorIndex" type="int"> +</parameter> +</method> +<method name="getSectorCount" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getSize" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getType" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="increment" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="blockIndex" type="int"> +</parameter> +<parameter name="value" type="int"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="readBlock" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="blockIndex" type="int"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="restore" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="blockIndex" type="int"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="sectorToBlock" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="sectorIndex" type="int"> +</parameter> +</method> +<method name="transceive" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="transfer" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="blockIndex" type="int"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="writeBlock" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="blockIndex" type="int"> +</parameter> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<field name="BLOCK_SIZE" + type="int" + transient="false" + volatile="false" + value="16" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="KEY_DEFAULT" + type="byte[]" + transient="false" + volatile="false" + value="null" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="KEY_MIFARE_APPLICATION_DIRECTORY" + type="byte[]" + transient="false" + volatile="false" + value="null" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="KEY_NFC_FORUM" + type="byte[]" + transient="false" + volatile="false" + value="null" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="SIZE_1K" + type="int" + transient="false" + volatile="false" + value="1024" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="SIZE_2K" + type="int" + transient="false" + volatile="false" + value="2048" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="SIZE_4K" + type="int" + transient="false" + volatile="false" + value="4096" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="SIZE_MINI" + type="int" + transient="false" + volatile="false" + value="320" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TYPE_CLASSIC" + type="int" + transient="false" + volatile="false" + value="0" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TYPE_PLUS" + type="int" + transient="false" + volatile="false" + value="1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TYPE_PRO" + type="int" + transient="false" + volatile="false" + value="2" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TYPE_UNKNOWN" + type="int" + transient="false" + volatile="false" + value="-1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +</class> +<class name="MifareUltralight" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="get" + return="android.nfc.tech.MifareUltralight" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +<method name="getType" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="readPages" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="pageOffset" type="int"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="transceive" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="writePage" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="pageOffset" type="int"> +</parameter> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<field name="PAGE_SIZE" + type="int" + transient="false" + volatile="false" + value="4" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TYPE_ULTRALIGHT" + type="int" + transient="false" + volatile="false" + value="1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TYPE_ULTRALIGHT_C" + type="int" + transient="false" + volatile="false" + value="2" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="TYPE_UNKNOWN" + type="int" + transient="false" + volatile="false" + value="-1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +</class> +<class name="Ndef" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="canMakeReadonly" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="get" + return="android.nfc.tech.Ndef" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +<method name="getCachedNdefMessage" + return="android.nfc.NdefMessage" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getMaxSize" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getNdefMessage" + return="android.nfc.NdefMessage" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<exception name="FormatException" type="android.nfc.FormatException"> +</exception> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="getType" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="isWritable" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="makeReadonly" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="writeNdefMessage" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="msg" type="android.nfc.NdefMessage"> +</parameter> +<exception name="FormatException" type="android.nfc.FormatException"> +</exception> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<field name="MIFARE_CLASSIC" + type="int" + transient="false" + volatile="false" + value="101" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="NFC_FORUM_TYPE_1" + type="int" + transient="false" + volatile="false" + value="1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="NFC_FORUM_TYPE_2" + type="int" + transient="false" + volatile="false" + value="2" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="NFC_FORUM_TYPE_3" + type="int" + transient="false" + volatile="false" + value="3" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="NFC_FORUM_TYPE_4" + type="int" + transient="false" + volatile="false" + value="4" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="OTHER" + type="int" + transient="false" + volatile="false" + value="-1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +</class> +<class name="NdefFormatable" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="format" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="firstMessage" type="android.nfc.NdefMessage"> +</parameter> +<exception name="FormatException" type="android.nfc.FormatException"> +</exception> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="get" + return="android.nfc.tech.NdefFormatable" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +</class> +<class name="NfcA" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="get" + return="android.nfc.tech.NfcA" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +<method name="getAtqa" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getSak" + return="short" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="transceive" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +</class> +<class name="NfcB" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="get" + return="android.nfc.tech.NfcB" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +<method name="getApplicationData" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getProtocolInfo" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="transceive" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +</class> +<class name="NfcF" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="get" + return="android.nfc.tech.NfcF" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +<method name="getManufacturer" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getSystemCode" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="transceive" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +</class> +<class name="NfcV" + extends="android.nfc.tech.BasicTagTechnology" + abstract="false" + static="false" + final="true" + deprecated="not deprecated" + visibility="public" +> +<method name="get" + return="android.nfc.tech.NfcV" + abstract="false" + native="false" + synchronized="false" + static="true" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="tag" type="android.nfc.Tag"> +</parameter> +</method> +<method name="getDsfId" + return="byte" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="getResponseFlags" + return="byte" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="transceive" + return="byte[]" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="data" type="byte[]"> +</parameter> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +</class> +<interface name="TagTechnology" + abstract="true" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<implements name="java.io.Closeable"> +</implements> +<method name="close" + return="void" + abstract="true" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="connect" + return="void" + abstract="true" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +<method name="getTag" + return="android.nfc.Tag" + abstract="true" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> +<method name="reconnect" + return="void" + abstract="true" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<exception name="IOException" type="java.io.IOException"> +</exception> +</method> +</interface> </package> <package name="android.opengl" > @@ -225865,6 +227423,16 @@ visibility="public" > </field> +<field name="systemUiVisibility" + type="int" + transient="false" + volatile="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="token" type="android.os.IBinder" transient="false" @@ -260439,7 +262007,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 bd35ecf..bf5fb5a 100644 --- a/api/current.xml +++ b/api/current.xml @@ -1896,6 +1896,28 @@ visibility="public" > </field> +<field name="actionMenuTextAppearance" + type="int" + transient="false" + volatile="false" + value="16843616" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="actionMenuTextColor" + type="int" + transient="false" + volatile="false" + value="16843617" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="actionModeBackground" type="int" transient="false" @@ -11820,6 +11842,28 @@ visibility="public" > </field> +<field name="dialog_holo_dark_frame" + type="int" + transient="false" + volatile="false" + value="17301682" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="dialog_holo_light_frame" + type="int" + transient="false" + volatile="false" + value="17301683" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="divider_horizontal_bright" type="int" transient="false" @@ -26622,6 +26666,39 @@ <parameter name="viewSpacingBottom" type="int"> </parameter> </method> +<field name="THEME_HOLO_DARK" + type="int" + transient="false" + volatile="false" + value="2" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="THEME_HOLO_LIGHT" + type="int" + transient="false" + volatile="false" + value="3" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="THEME_TRADITIONAL" + type="int" + transient="false" + volatile="false" + value="1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> </class> <class name="AlertDialog.Builder" extends="java.lang.Object" @@ -43783,19 +43860,6 @@ <parameter name="data" type="D"> </parameter> </method> -<method name="onCancelled" - return="void" - abstract="false" - native="false" - synchronized="false" - static="false" - final="false" - deprecated="deprecated" - visibility="public" -> -<parameter name="data" type="D"> -</parameter> -</method> <method name="onLoadInBackground" return="D" abstract="false" @@ -55640,6 +55704,17 @@ <parameter name="context" type="android.content.Context"> </parameter> </constructor> +<method name="abandon" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> <method name="dataToString" return="java.lang.String" abstract="false" @@ -55718,6 +55793,17 @@ visibility="public" > </method> +<method name="isAbandoned" + return="boolean" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> <method name="isReset" return="boolean" abstract="false" @@ -55740,6 +55826,17 @@ visibility="public" > </method> +<method name="onAbandon" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="protected" +> +</method> <method name="onContentChanged" return="void" abstract="false" @@ -95622,6 +95719,17 @@ visibility="public" > </constructor> +<method name="getBackDisposition" + return="int" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +</method> <method name="getCandidatesHiddenVisibility" return="int" abstract="false" @@ -96347,6 +96455,19 @@ <parameter name="charCode" type="char"> </parameter> </method> +<method name="setBackDisposition" + return="void" + abstract="false" + native="false" + synchronized="false" + static="false" + final="false" + deprecated="not deprecated" + visibility="public" +> +<parameter name="disposition" type="int"> +</parameter> +</method> <method name="setCandidatesView" return="void" abstract="false" @@ -96473,6 +96594,39 @@ visibility="public" > </method> +<field name="BACK_DISPOSITION_DEFAULT" + type="int" + transient="false" + volatile="false" + value="0" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="BACK_DISPOSITION_WILL_DISMISS" + type="int" + transient="false" + volatile="false" + value="2" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> +<field name="BACK_DISPOSITION_WILL_NOT_DISMISS" + type="int" + transient="false" + volatile="false" + value="1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> </class> <class name="InputMethodService.InputMethodImpl" extends="android.inputmethodservice.AbstractInputMethodService.AbstractInputMethodImpl" @@ -120214,6 +120368,8 @@ deprecated="not deprecated" visibility="public" > +<exception name="IOException" type="java.io.IOException"> +</exception> </method> <method name="connect" return="void" @@ -120684,33 +120840,33 @@ visibility="public" > </field> -<field name="TYPE_OTHER" +<field name="TYPE_PLUS" type="int" transient="false" volatile="false" - value="-1" + value="1" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> -<field name="TYPE_PLUS" +<field name="TYPE_PRO" type="int" transient="false" volatile="false" - value="1" + value="2" static="true" final="true" deprecated="not deprecated" visibility="public" > </field> -<field name="TYPE_PRO" +<field name="TYPE_UNKNOWN" type="int" transient="false" volatile="false" - value="2" + value="-1" static="true" final="true" deprecated="not deprecated" @@ -120750,7 +120906,7 @@ visibility="public" > </method> -<method name="readBlock" +<method name="readPages" return="byte[]" abstract="false" native="false" @@ -120760,7 +120916,7 @@ deprecated="not deprecated" visibility="public" > -<parameter name="page" type="int"> +<parameter name="pageOffset" type="int"> </parameter> <exception name="IOException" type="java.io.IOException"> </exception> @@ -120790,13 +120946,24 @@ deprecated="not deprecated" visibility="public" > -<parameter name="page" type="int"> +<parameter name="pageOffset" type="int"> </parameter> <parameter name="data" type="byte[]"> </parameter> <exception name="IOException" type="java.io.IOException"> </exception> </method> +<field name="PAGE_SIZE" + type="int" + transient="false" + volatile="false" + value="4" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="TYPE_ULTRALIGHT" type="int" transient="false" @@ -120823,7 +120990,7 @@ type="int" transient="false" volatile="false" - value="10" + value="-1" static="true" final="true" deprecated="not deprecated" @@ -121301,6 +121468,8 @@ deprecated="not deprecated" visibility="public" > +<implements name="java.io.Closeable"> +</implements> <method name="close" return="void" abstract="true" @@ -121311,6 +121480,8 @@ deprecated="not deprecated" visibility="public" > +<exception name="IOException" type="java.io.IOException"> +</exception> </method> <method name="connect" return="void" @@ -221922,6 +222093,17 @@ visibility="public" > </method> +<field name="DRAG_FLAG_GLOBAL" + type="int" + transient="false" + volatile="false" + value="1" + static="true" + final="true" + deprecated="not deprecated" + visibility="public" +> +</field> <field name="DRAWING_CACHE_QUALITY_AUTO" type="int" transient="false" diff --git a/core/java/android/animation/LayoutTransition.java b/core/java/android/animation/LayoutTransition.java index f13d940..d3e10f3 100644 --- a/core/java/android/animation/LayoutTransition.java +++ b/core/java/android/animation/LayoutTransition.java @@ -166,6 +166,7 @@ public class LayoutTransition { * we cache all of the current animations in this map for possible cancellation on * another layout event. */ + private final HashMap<View, Animator> pendingAnimations = new HashMap<View, Animator>(); private final HashMap<View, Animator> currentChangingAnimations = new HashMap<View, Animator>(); private final HashMap<View, Animator> currentVisibilityAnimations = new HashMap<View, Animator>(); @@ -542,6 +543,8 @@ public class LayoutTransition { // reset the inter-animation delay, in case we use it later staggerDelay = 0; + final long duration = (changeReason == APPEARING) ? + mChangingAppearingDuration : mChangingDisappearingDuration; final ViewTreeObserver observer = parent.getViewTreeObserver(); // used for later cleanup if (!observer.isAlive()) { @@ -556,12 +559,6 @@ public class LayoutTransition { // only animate the views not being added or removed if (child != newView) { - // If there's an animation running on this view already, cancel it - Animator currentAnimation = currentChangingAnimations.get(child); - if (currentAnimation != null) { - currentAnimation.cancel(); - currentChangingAnimations.remove(child); - } // Make a copy of the appropriate animation final Animator anim = baseAnimator.clone(); @@ -573,6 +570,30 @@ public class LayoutTransition { // its target object anim.setupStartValues(); + // If there's an animation running on this view already, cancel it + Animator currentAnimation = pendingAnimations.get(child); + if (currentAnimation != null) { + currentAnimation.cancel(); + pendingAnimations.remove(child); + } + // Cache the animation in case we need to cancel it later + pendingAnimations.put(child, anim); + + // For the animations which don't get started, we have to have a means of + // removing them from the cache, lest we leak them and their target objects. + // We run an animator for the default duration+100 (an arbitrary time, but one + // which should far surpass the delay between setting them up here and + // handling layout events which start them. + ValueAnimator pendingAnimRemover = ValueAnimator.ofFloat(0f, 1f). + setDuration(duration+100); + pendingAnimRemover.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + pendingAnimations.remove(child); + } + }); + pendingAnimRemover.start(); + // Add a listener to track layout changes on this view. If we don't get a callback, // then there's nothing to animate. final View.OnLayoutChangeListener listener = new View.OnLayoutChangeListener() { @@ -583,19 +604,25 @@ public class LayoutTransition { anim.setupEndValues(); long startDelay; - long duration; if (changeReason == APPEARING) { startDelay = mChangingAppearingDelay + staggerDelay; staggerDelay += mChangingAppearingStagger; - duration = mChangingAppearingDuration; } else { startDelay = mChangingDisappearingDelay + staggerDelay; staggerDelay += mChangingDisappearingStagger; - duration = mChangingDisappearingDuration; } anim.setStartDelay(startDelay); anim.setDuration(duration); + Animator prevAnimation = currentChangingAnimations.get(child); + if (prevAnimation != null) { + prevAnimation.cancel(); + currentChangingAnimations.remove(child); + } + Animator pendingAnimation = pendingAnimations.get(child); + if (pendingAnimation != null) { + pendingAnimations.remove(child); + } // Cache the animation in case we need to cancel it later currentChangingAnimations.put(child, anim); diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java index 79890ef..04d839d 100644 --- a/core/java/android/app/Activity.java +++ b/core/java/android/app/Activity.java @@ -4318,7 +4318,7 @@ public class Activity extends ContextThemeWrapper mWindow = PolicyManager.makeNewWindow(this); mWindow.setCallback(this); - mWindow.getLayoutInflater().setFactory2(this); + mWindow.getLayoutInflater().setPrivateFactory(this); if (info.softInputMode != WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED) { mWindow.setSoftInputMode(info.softInputMode); } diff --git a/core/java/android/app/AlertDialog.java b/core/java/android/app/AlertDialog.java index 428f4e3..e83d104 100644 --- a/core/java/android/app/AlertDialog.java +++ b/core/java/android/app/AlertDialog.java @@ -58,29 +58,69 @@ import android.widget.ListView; public class AlertDialog extends Dialog implements DialogInterface { private AlertController mAlert; + /** + * Special theme constant for {@link #AlertDialog(Context, int)}: use + * the traditional (pre-Holo) alert dialog theme. + */ + public static final int THEME_TRADITIONAL = 1; + + /** + * Special theme constant for {@link #AlertDialog(Context, int)}: use + * the holographic alert theme with a dark background. + */ + public static final int THEME_HOLO_DARK = 2; + + /** + * Special theme constant for {@link #AlertDialog(Context, int)}: use + * the holographic alert theme with a light background. + */ + public static final int THEME_HOLO_LIGHT = 3; + protected AlertDialog(Context context) { - this(context, getDefaultDialogTheme(context)); + this(context, resolveDialogTheme(context, 0), true); } + /** + * Construct an AlertDialog that uses an explicit theme. The actual style + * that an AlertDialog uses is a private implementation, however you can + * here supply either the name of an attribute in the theme from which + * to get the dialog's style (such as {@link android.R.attr#alertDialogTheme} + * or one of the constants {@link #THEME_TRADITIONAL}, + * {@link #THEME_HOLO_DARK}, or {@link #THEME_HOLO_LIGHT}. + */ protected AlertDialog(Context context, int theme) { - super(context, theme == 0 ? getDefaultDialogTheme(context) : theme); + this(context, theme, true); + } + + AlertDialog(Context context, int theme, boolean createContextWrapper) { + super(context, resolveDialogTheme(context, theme), createContextWrapper); mWindow.alwaysReadCloseOnTouchAttr(); - mAlert = new AlertController(context, this, getWindow()); + mAlert = new AlertController(getContext(), this, getWindow()); } protected AlertDialog(Context context, boolean cancelable, OnCancelListener cancelListener) { - super(context, getDefaultDialogTheme(context)); + super(context, resolveDialogTheme(context, 0)); mWindow.alwaysReadCloseOnTouchAttr(); setCancelable(cancelable); setOnCancelListener(cancelListener); mAlert = new AlertController(context, this, getWindow()); } - private static int getDefaultDialogTheme(Context context) { - TypedValue outValue = new TypedValue(); - context.getTheme().resolveAttribute(com.android.internal.R.attr.alertDialogTheme, - outValue, true); - return outValue.resourceId; + static int resolveDialogTheme(Context context, int resid) { + if (resid == THEME_TRADITIONAL) { + return com.android.internal.R.style.Theme_Dialog_Alert; + } else if (resid == THEME_HOLO_DARK) { + return com.android.internal.R.style.Theme_Holo_Dialog_Alert; + } else if (resid == THEME_HOLO_LIGHT) { + return com.android.internal.R.style.Theme_Holo_Light_Dialog_Alert; + } else if (resid >= 0x01000000) { // start of real resource IDs. + return resid; + } else { + TypedValue outValue = new TypedValue(); + context.getTheme().resolveAttribute(com.android.internal.R.attr.alertDialogTheme, + outValue, true); + return outValue.resourceId; + } } /** @@ -294,15 +334,23 @@ public class AlertDialog extends Dialog implements DialogInterface { * Constructor using a context for this builder and the {@link AlertDialog} it creates. */ public Builder(Context context) { - this(context, getDefaultDialogTheme(context)); + this(context, resolveDialogTheme(context, 0)); } /** * Constructor using a context and theme for this builder and - * the {@link AlertDialog} it creates. + * the {@link AlertDialog} it creates. The actual theme + * that an AlertDialog uses is a private implementation, however you can + * here supply either the name of an attribute in the theme from which + * to get the dialog's style (such as {@link android.R.attr#alertDialogTheme} + * or one of the constants + * {@link AlertDialog#THEME_TRADITIONAL AlertDialog.THEME_TRADITIONAL}, + * {@link AlertDialog#THEME_HOLO_DARK AlertDialog.THEME_HOLO_DARK}, or + * {@link AlertDialog#THEME_HOLO_LIGHT AlertDialog.THEME_HOLO_LIGHT}. */ public Builder(Context context, int theme) { - P = new AlertController.AlertParams(new ContextThemeWrapper(context, theme)); + P = new AlertController.AlertParams(new ContextThemeWrapper( + context, resolveDialogTheme(context, theme))); mTheme = theme; } @@ -840,7 +888,7 @@ public class AlertDialog extends Dialog implements DialogInterface { * to do and want this to be created and displayed. */ public AlertDialog create() { - final AlertDialog dialog = new AlertDialog(P.mContext, mTheme); + final AlertDialog dialog = new AlertDialog(P.mContext, mTheme, false); P.apply(dialog.mAlert); dialog.setCancelable(P.mCancelable); dialog.setOnCancelListener(P.mOnCancelListener); diff --git a/core/java/android/app/Dialog.java b/core/java/android/app/Dialog.java index 2bf1ff9..de5d6a1 100644 --- a/core/java/android/app/Dialog.java +++ b/core/java/android/app/Dialog.java @@ -119,7 +119,7 @@ public class Dialog implements DialogInterface, Window.Callback, * present its UI. */ public Dialog(Context context) { - this(context, 0); + this(context, 0, true); } /** @@ -135,6 +135,10 @@ public class Dialog implements DialogInterface, Window.Callback, * <var>context</var>. If 0, the default dialog theme will be used. */ public Dialog(Context context, int theme) { + this(context, theme, true); + } + + Dialog(Context context, int theme, boolean createContextWrapper) { if (theme == 0) { TypedValue outValue = new TypedValue(); context.getTheme().resolveAttribute(com.android.internal.R.attr.dialogTheme, @@ -142,7 +146,7 @@ public class Dialog implements DialogInterface, Window.Callback, theme = outValue.resourceId; } - mContext = new ContextThemeWrapper(context, theme); + mContext = createContextWrapper ? new ContextThemeWrapper(context, theme) : context; mWindowManager = (WindowManager)context.getSystemService(Context.WINDOW_SERVICE); Window w = PolicyManager.makeNewWindow(mContext); mWindow = w; @@ -152,7 +156,7 @@ public class Dialog implements DialogInterface, Window.Callback, mUiThread = Thread.currentThread(); mListenersHandler = new ListenersHandler(this); } - + /** * @deprecated * @hide diff --git a/core/java/android/app/LoaderManager.java b/core/java/android/app/LoaderManager.java index 431be05..1ee386d 100644 --- a/core/java/android/app/LoaderManager.java +++ b/core/java/android/app/LoaderManager.java @@ -587,6 +587,7 @@ class LoaderManagerImpl extends LoaderManager { if (DEBUG) Log.v(TAG, " Removing last inactive loader: " + info); inactive.mDeliveredData = false; inactive.destroy(); + info.mLoader.abandon(); mInactiveLoaders.put(id, info); } else { // We already have an inactive loader for this ID that we are @@ -617,6 +618,7 @@ class LoaderManagerImpl extends LoaderManager { // Keep track of the previous instance of this loader so we can destroy // it when the new one completes. if (DEBUG) Log.v(TAG, " Making last loader inactive: " + info); + info.mLoader.abandon(); mInactiveLoaders.put(id, info); } } diff --git a/core/java/android/app/Notification.java b/core/java/android/app/Notification.java index de84c56..5049e19 100644 --- a/core/java/android/app/Notification.java +++ b/core/java/android/app/Notification.java @@ -927,9 +927,8 @@ public class Notification implements Parcelable if (mContentInfo != null) { contentView.setTextViewText(R.id.info, mContentInfo); } else if (mNumber > 0) { - if (mNumber > 100) { - contentView.setTextViewText(R.id.info, mContext.getString( - R.string.status_bar_notification_info_overflow)); + if (mNumber > 999) { + contentView.setTextViewText(R.id.info, "999+"); } else { NumberFormat f = NumberFormat.getIntegerInstance(); contentView.setTextViewText(R.id.info, f.format(mNumber)); diff --git a/core/java/android/app/StatusBarManager.java b/core/java/android/app/StatusBarManager.java index 97e6931..1af0983 100644 --- a/core/java/android/app/StatusBarManager.java +++ b/core/java/android/app/StatusBarManager.java @@ -22,6 +22,7 @@ import android.os.Binder; import android.os.RemoteException; import android.os.IBinder; import android.os.ServiceManager; +import android.view.View; import com.android.internal.statusbar.IStatusBarService; @@ -31,52 +32,24 @@ import com.android.internal.statusbar.IStatusBarService; * @hide */ public class StatusBarManager { - /** - * Flag for {@link #disable} to make the status bar not expandable. Unless you also - * set {@link #DISABLE_NOTIFICATION_ICONS}, new notifications will continue to show. - */ - public static final int DISABLE_EXPAND = 0x00000001; - - /** - * Flag for {@link #disable} to hide notification icons and scrolling ticker text. - */ - public static final int DISABLE_NOTIFICATION_ICONS = 0x00000002; - - /** - * Flag for {@link #disable} to disable incoming notification alerts. This will not block - * icons, but it will block sound, vibrating and other visual or aural notifications. - */ - public static final int DISABLE_NOTIFICATION_ALERTS = 0x00000004; - /** - * Flag for {@link #disable} to hide only the scrolling ticker. Note that - * {@link #DISABLE_NOTIFICATION_ICONS} implies {@link #DISABLE_NOTIFICATION_TICKER}. - */ - public static final int DISABLE_NOTIFICATION_TICKER = 0x00000008; + public static final int DISABLE_EXPAND = View.STATUS_BAR_DISABLE_EXPAND; + public static final int DISABLE_NOTIFICATION_ICONS = View.STATUS_BAR_DISABLE_NOTIFICATION_ICONS; + public static final int DISABLE_NOTIFICATION_ALERTS + = View.STATUS_BAR_DISABLE_NOTIFICATION_ALERTS; + public static final int DISABLE_NOTIFICATION_TICKER + = View.STATUS_BAR_DISABLE_NOTIFICATION_TICKER; + public static final int DISABLE_SYSTEM_INFO = View.STATUS_BAR_DISABLE_SYSTEM_INFO; + public static final int DISABLE_NAVIGATION = View.STATUS_BAR_DISABLE_NAVIGATION; + public static final int DISABLE_BACK = View.STATUS_BAR_DISABLE_BACK; + public static final int DISABLE_CLOCK = View.STATUS_BAR_DISABLE_CLOCK; - /** - * Flag for {@link #disable} to hide the center system info area. - */ - public static final int DISABLE_SYSTEM_INFO = 0x00000010; - - /** - * Flag for {@link #disable} to hide only the navigation buttons. Don't use this - * unless you're a special part of the system UI (i.e., setup wizard, keyguard). - */ - public static final int DISABLE_NAVIGATION = 0x00000020; - - /** - * Flag for {@link #disable} to hide only the clock. You might use this if your activity has - * its own clock making the status bar's clock redundant. - */ - public static final int DISABLE_CLOCK = 0x00000040; - - - /** - * Re-enable all of the status bar features that you've disabled. - */ public static final int DISABLE_NONE = 0x00000000; + public static final int DISABLE_MASK = DISABLE_EXPAND | DISABLE_NOTIFICATION_ICONS + | DISABLE_NOTIFICATION_ALERTS | DISABLE_NOTIFICATION_TICKER + | DISABLE_SYSTEM_INFO| DISABLE_NAVIGATION | DISABLE_BACK | DISABLE_CLOCK; + private Context mContext; private IStatusBarService mService; private IBinder mToken = new Binder(); diff --git a/core/java/android/content/AsyncTaskLoader.java b/core/java/android/content/AsyncTaskLoader.java index a7dd5fb..383cb6b 100644 --- a/core/java/android/content/AsyncTaskLoader.java +++ b/core/java/android/content/AsyncTaskLoader.java @@ -169,11 +169,6 @@ public abstract class AsyncTaskLoader<D> extends Loader<D> { * to properly dispose of the result. */ public void onCanceled(D data) { - onCancelled(data); - } - - @Deprecated - public void onCancelled(D data) { } void executePendingTask() { @@ -214,10 +209,15 @@ public abstract class AsyncTaskLoader<D> extends Loader<D> { if (DEBUG) Slog.v(TAG, "Load complete of old task, trying to cancel"); dispatchOnCancelled(task, data); } else { - mLastLoadCompleteTime = SystemClock.uptimeMillis(); - mTask = null; - if (DEBUG) Slog.v(TAG, "Delivering result"); - deliverResult(data); + if (isAbandoned()) { + // This cursor has been abandoned; just cancel the new data. + onCanceled(data); + } else { + mLastLoadCompleteTime = SystemClock.uptimeMillis(); + mTask = null; + if (DEBUG) Slog.v(TAG, "Delivering result"); + deliverResult(data); + } } } diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index 6e3663e..e7b96e7 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -2794,7 +2794,7 @@ public class Intent implements Parcelable, Cloneable { * @param action The Intent action, such as ACTION_VIEW. */ public Intent(String action) { - mAction = action; + setAction(action); } /** @@ -2814,7 +2814,7 @@ public class Intent implements Parcelable, Cloneable { * @param uri The Intent data URI. */ public Intent(String action, Uri uri) { - mAction = action; + setAction(action); mData = uri; } @@ -2863,7 +2863,7 @@ public class Intent implements Parcelable, Cloneable { */ public Intent(String action, Uri uri, Context packageContext, Class<?> cls) { - mAction = action; + setAction(action); mData = uri; mComponent = new ComponentName(packageContext, cls); } @@ -2985,7 +2985,7 @@ public class Intent implements Parcelable, Cloneable { // action if (uri.startsWith("action=", i)) { - intent.mAction = value; + intent.setAction(value); } // categories @@ -4061,7 +4061,7 @@ public class Intent implements Parcelable, Cloneable { * @see #getAction */ public Intent setAction(String action) { - mAction = action; + mAction = action != null ? action.intern() : null; return this; } @@ -4165,7 +4165,7 @@ public class Intent implements Parcelable, Cloneable { if (mCategories == null) { mCategories = new HashSet<String>(); } - mCategories.add(category); + mCategories.add(category.intern()); return this; } @@ -5678,7 +5678,7 @@ public class Intent implements Parcelable, Cloneable { } public void readFromParcel(Parcel in) { - mAction = in.readString(); + setAction(in.readString()); mData = Uri.CREATOR.createFromParcel(in); mType = in.readString(); mFlags = in.readInt(); @@ -5694,7 +5694,7 @@ public class Intent implements Parcelable, Cloneable { mCategories = new HashSet<String>(); int i; for (i=0; i<N; i++) { - mCategories.add(in.readString()); + mCategories.add(in.readString().intern()); } } else { mCategories = null; diff --git a/core/java/android/content/IntentFilter.java b/core/java/android/content/IntentFilter.java index 452fd8a..61d7424 100644 --- a/core/java/android/content/IntentFilter.java +++ b/core/java/android/content/IntentFilter.java @@ -461,7 +461,7 @@ public class IntentFilter implements Parcelable { * @return True if the action is explicitly mentioned in the filter. */ public final boolean hasAction(String action) { - return mActions.contains(action); + return action != null && mActions.contains(action); } /** @@ -470,14 +470,10 @@ public class IntentFilter implements Parcelable { * * @param action The desired action to look for. * - * @return True if the action is listed in the filter or the filter does - * not specify any actions. + * @return True if the action is listed in the filter. */ public final boolean matchAction(String action) { - if (action == null || mActions == null || mActions.size() == 0) { - return false; - } - return mActions.contains(action); + return hasAction(action); } /** @@ -818,9 +814,9 @@ public class IntentFilter implements Parcelable { if (mDataPaths == null) { return false; } - Iterator<PatternMatcher> i = mDataPaths.iterator(); - while (i.hasNext()) { - final PatternMatcher pe = i.next(); + final int numDataPaths = mDataPaths.size(); + for (int i = 0; i < numDataPaths; i++) { + final PatternMatcher pe = mDataPaths.get(i); if (pe.match(data)) { return true; } @@ -849,9 +845,9 @@ public class IntentFilter implements Parcelable { if (mDataAuthorities == null) { return NO_MATCH_DATA; } - Iterator<AuthorityEntry> i = mDataAuthorities.iterator(); - while (i.hasNext()) { - final AuthorityEntry ae = i.next(); + final int numDataAuthorities = mDataAuthorities.size(); + for (int i = 0; i < numDataAuthorities; i++) { + final AuthorityEntry ae = mDataAuthorities.get(i); int match = ae.match(data); if (match >= 0) { return match; @@ -1098,7 +1094,7 @@ public class IntentFilter implements Parcelable { */ public final int match(String action, String type, String scheme, Uri data, Set<String> categories, String logTag) { - if (action != null && !matchAction(action)) { + if (!matchAction(action)) { if (Config.LOGV) Log.v( logTag, "No matching action " + action + " for " + this); return NO_MATCH_ACTION; @@ -1119,11 +1115,11 @@ public class IntentFilter implements Parcelable { return dataMatch; } - String categoryMatch = matchCategories(categories); - if (categoryMatch != null) { - if (Config.LOGV) Log.v( - logTag, "No matching category " - + categoryMatch + " for " + this); + String categoryMismatch = matchCategories(categories); + if (categoryMismatch != null) { + if (Config.LOGV) { + Log.v(logTag, "No matching category " + categoryMismatch + " for " + this); + } return NO_MATCH_CATEGORY; } @@ -1469,9 +1465,9 @@ public class IntentFilter implements Parcelable { if (typeLength == slashpos+2 && type.charAt(slashpos+1) == '*') { // Need to look through all types for one that matches // our base... - final Iterator<String> it = t.iterator(); - while (it.hasNext()) { - String v = it.next(); + final int numTypes = t.size(); + for (int i = 0; i < numTypes; i++) { + final String v = t.get(i); if (type.regionMatches(0, v, 0, slashpos+1)) { return true; } diff --git a/core/java/android/content/Loader.java b/core/java/android/content/Loader.java index d63fe69..a9d6117 100644 --- a/core/java/android/content/Loader.java +++ b/core/java/android/content/Loader.java @@ -45,6 +45,7 @@ public class Loader<D> { OnLoadCompleteListener<D> mListener; Context mContext; boolean mStarted = false; + boolean mAbandoned = false; boolean mReset = true; boolean mContentChanged = false; @@ -151,6 +152,15 @@ public class Loader<D> { } /** + * Return whether this loader has been abandoned. In this state, the + * loader <em>must not</em> report any new data, and <em>must</em> keep + * its last reported data valid until it is finally reset. + */ + public boolean isAbandoned() { + return mAbandoned; + } + + /** * Return whether this load has been reset. That is, either the loader * has not yet been started for the first time, or its {@link #reset()} * has been called. @@ -177,6 +187,7 @@ public class Loader<D> { public final void startLoading() { mStarted = true; mReset = false; + mAbandoned = false; onStartLoading(); } @@ -236,6 +247,28 @@ public class Loader<D> { } /** + * Tell the Loader that it is being abandoned. This is called prior + * to {@link #reset} to have it retain its current data but not report + * any new data. + */ + public void abandon() { + mAbandoned = true; + onAbandon(); + } + + /** + * Subclasses implement this to take care of being abandoned. This is + * an optional intermediate state prior to {@link #onReset()} -- it means that + * the client is no longer interested in any new data from the loader, + * so the loader must not report any further updates. However, the + * loader <em>must</em> keep its last reported data valid until the final + * {@link #onReset()} happens. You can retrieve the current abandoned + * state with {@link #isAbandoned}. + */ + protected void onAbandon() { + } + + /** * Resets the state of the Loader. The Loader should at this point free * all of its resources, since it may never be called again; however, its * {@link #startLoading()} may later be called at which point it must be @@ -251,6 +284,7 @@ public class Loader<D> { onReset(); mReset = true; mStarted = false; + mAbandoned = false; mContentChanged = false; } @@ -327,6 +361,7 @@ public class Loader<D> { writer.print(" mListener="); writer.println(mListener); writer.print(prefix); writer.print("mStarted="); writer.print(mStarted); writer.print(" mContentChanged="); writer.print(mContentChanged); + writer.print(" mAbandoned="); writer.print(mAbandoned); writer.print(" mReset="); writer.println(mReset); } }
\ No newline at end of file diff --git a/core/java/android/content/res/CompatibilityInfo.java b/core/java/android/content/res/CompatibilityInfo.java index 6baf1c2..e403ac2 100644 --- a/core/java/android/content/res/CompatibilityInfo.java +++ b/core/java/android/content/res/CompatibilityInfo.java @@ -141,10 +141,16 @@ public class CompatibilityInfo { appFlags = appInfo.flags; if ((appInfo.flags & ApplicationInfo.FLAG_SUPPORTS_LARGE_SCREENS) != 0) { - mCompatibilityFlags |= LARGE_SCREENS | CONFIGURED_LARGE_SCREENS; + // Saying you support large screens also implies you support xlarge + // screens; there is no compatibility mode for a large app on an + // xlarge screen. + mCompatibilityFlags |= LARGE_SCREENS | CONFIGURED_LARGE_SCREENS + | XLARGE_SCREENS | CONFIGURED_XLARGE_SCREENS + | EXPANDABLE | CONFIGURED_EXPANDABLE; } if ((appInfo.flags & ApplicationInfo.FLAG_SUPPORTS_XLARGE_SCREENS) != 0) { - mCompatibilityFlags |= XLARGE_SCREENS | CONFIGURED_XLARGE_SCREENS; + mCompatibilityFlags |= XLARGE_SCREENS | CONFIGURED_XLARGE_SCREENS + | EXPANDABLE | CONFIGURED_EXPANDABLE; } if ((appInfo.flags & ApplicationInfo.FLAG_RESIZEABLE_FOR_SCREENS) != 0) { mCompatibilityFlags |= EXPANDABLE | CONFIGURED_EXPANDABLE; diff --git a/core/java/android/database/sqlite/SQLiteCompiledSql.java b/core/java/android/database/sqlite/SQLiteCompiledSql.java index feea47e..bdb96b1 100644 --- a/core/java/android/database/sqlite/SQLiteCompiledSql.java +++ b/core/java/android/database/sqlite/SQLiteCompiledSql.java @@ -103,6 +103,11 @@ import android.util.Log; protected void finalize() throws Throwable { try { if (nStatement == 0) return; + // don't worry about finalizing this object if it is ALREADY in the + // queue of statements to be finalized later + if (mDatabase.isInQueueOfStatementsToBeFinalized(nStatement)) { + return; + } // finalizer should NEVER get called // but if the database itself is not closed and is GC'ed, then // all sub-objects attached to the database could end up getting GC'ed too. diff --git a/core/java/android/database/sqlite/SQLiteDatabase.java b/core/java/android/database/sqlite/SQLiteDatabase.java index b3fd914..8c5483f 100644 --- a/core/java/android/database/sqlite/SQLiteDatabase.java +++ b/core/java/android/database/sqlite/SQLiteDatabase.java @@ -2274,6 +2274,17 @@ public class SQLiteDatabase extends SQLiteClosable { } } + /* package */ boolean isInQueueOfStatementsToBeFinalized(int id) { + if (!isOpen()) { + // database already closed. this statement will already have been finalized. + // return true so that the caller doesn't have to worry about finalizing this statement. + return true; + } + synchronized(mClosedStatementIds) { + return mClosedStatementIds.contains(id); + } + } + /* package */ void closePendingStatements() { if (!isOpen()) { // since this database is already closed, no need to finalize anything. diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 255eb6c..feb246e 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -219,7 +219,34 @@ import java.io.PrintWriter; public class InputMethodService extends AbstractInputMethodService { static final String TAG = "InputMethodService"; static final boolean DEBUG = false; - + + /** + * The back button will close the input window. + */ + public static final int BACK_DISPOSITION_DEFAULT = 0; // based on window + + /** + * This input method will not consume the back key. + */ + public static final int BACK_DISPOSITION_WILL_NOT_DISMISS = 1; // back + + /** + * This input method will consume the back key. + */ + public static final int BACK_DISPOSITION_WILL_DISMISS = 2; // down + + /** + * @hide + * The IME is active. It may or may not be visible. + */ + public static final int IME_ACTIVE = 0x1; + + /** + * @hide + * The IME is visible. + */ + public static final int IME_VISIBLE = 0x2; + InputMethodManager mImm; int mTheme = 0; @@ -271,6 +298,7 @@ public class InputMethodService extends AbstractInputMethodService { boolean mIsInputViewShown; int mStatusIcon; + int mBackDisposition; final Insets mTmpInsets = new Insets(); final int[] mTmpLocation = new int[2]; @@ -394,9 +422,9 @@ public class InputMethodService extends AbstractInputMethodService { showWindow(true); } // If user uses hard keyboard, IME button should always be shown. - if (!onEvaluateInputViewShown()) { - mImm.setIMEButtonVisible(mToken, true); - } + boolean showing = onEvaluateInputViewShown(); + mImm.setImeWindowStatus(mToken, IME_ACTIVE | (showing ? IME_VISIBLE : 0), + mBackDisposition); if (resultReceiver != null) { resultReceiver.send(wasVis != isInputViewShown() ? InputMethodManager.RESULT_SHOWN @@ -704,9 +732,9 @@ public class InputMethodService extends AbstractInputMethodService { hideWindow(); } // If user uses hard keyboard, IME button should always be shown. - if (!onEvaluateInputViewShown()) { - mImm.setIMEButtonVisible(mToken, true); - } + boolean showing = onEvaluateInputViewShown(); + mImm.setImeWindowStatus(mToken, IME_ACTIVE | (showing ? IME_VISIBLE : 0), + mBackDisposition); } } @@ -736,6 +764,14 @@ public class InputMethodService extends AbstractInputMethodService { return mWindow; } + public void setBackDisposition(int disposition) { + mBackDisposition = disposition; + } + + public int getBackDisposition() { + return mBackDisposition; + } + /** * Return the maximum width, in pixels, available the input method. * Input methods are positioned at the bottom of the screen and, unless @@ -1029,7 +1065,7 @@ public class InputMethodService extends AbstractInputMethodService { public boolean onEvaluateInputViewShown() { Configuration config = getResources().getConfiguration(); return config.keyboard == Configuration.KEYBOARD_NOKEYS - || config.hardKeyboardHidden == Configuration.KEYBOARDHIDDEN_YES; + || config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES; } /** @@ -1378,7 +1414,7 @@ public class InputMethodService extends AbstractInputMethodService { if (!wasVisible) { if (DEBUG) Log.v(TAG, "showWindow: showing!"); - mImm.setIMEButtonVisible(mToken, true); + mImm.setImeWindowStatus(mToken, IME_ACTIVE, mBackDisposition); onWindowShown(); mWindow.show(); } @@ -1394,7 +1430,7 @@ public class InputMethodService extends AbstractInputMethodService { } mInputViewStarted = false; mCandidatesViewStarted = false; - mImm.setIMEButtonVisible(mToken, false); + mImm.setImeWindowStatus(mToken, 0, mBackDisposition); if (mWindowVisible) { mWindow.hide(); mWindowVisible = false; diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index 7e809f5..cab8ed2 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -221,6 +221,8 @@ public class ConnectivityManager /** {@hide} */ public static final int TYPE_DUMMY = 8; + /** {@hide} */ + public static final int TYPE_ETHERNET = 9; /** {@hide} TODO: Need to adjust this for WiMAX. */ public static final int MAX_RADIO_TYPE = TYPE_DUMMY; /** {@hide} TODO: Need to adjust this for WiMAX. */ diff --git a/core/java/android/net/TrafficStats.java b/core/java/android/net/TrafficStats.java index 0492fce..d143243 100644 --- a/core/java/android/net/TrafficStats.java +++ b/core/java/android/net/TrafficStats.java @@ -219,7 +219,7 @@ public class TrafficStats { public static native long getUidTcpTxSegments(int uid); /** - * Get the number of TCP payload bytes received for this UID. + * Get the number of TCP segments received for this UID. * Does not include TCP control packets (SYN/ACKs/FIN/..). * The statistics are across all interfaces. * diff --git a/core/java/android/nfc/tech/BasicTagTechnology.java b/core/java/android/nfc/tech/BasicTagTechnology.java index e635f21..32a850d 100644 --- a/core/java/android/nfc/tech/BasicTagTechnology.java +++ b/core/java/android/nfc/tech/BasicTagTechnology.java @@ -117,7 +117,7 @@ import java.io.IOException; } @Override - public void close() { + public void close() throws IOException { try { /* Note that we don't want to physically disconnect the tag, * but just reconnect to it to reset its state diff --git a/core/java/android/nfc/tech/IsoDep.java b/core/java/android/nfc/tech/IsoDep.java index f6d141a..774982e 100644 --- a/core/java/android/nfc/tech/IsoDep.java +++ b/core/java/android/nfc/tech/IsoDep.java @@ -92,7 +92,7 @@ public final class IsoDep extends BasicTagTechnology { } @Override - public void close() { + public void close() throws IOException { try { mTag.getTagService().resetIsoDepTimeout(); } catch (RemoteException e) { diff --git a/core/java/android/nfc/tech/MifareClassic.java b/core/java/android/nfc/tech/MifareClassic.java index 34fd7cf..d337ead 100644 --- a/core/java/android/nfc/tech/MifareClassic.java +++ b/core/java/android/nfc/tech/MifareClassic.java @@ -55,14 +55,14 @@ public final class MifareClassic extends BasicTagTechnology { public static final byte[] KEY_NFC_FORUM = {(byte)0xD3,(byte)0xF7,(byte)0xD3,(byte)0xF7,(byte)0xD3,(byte)0xF7}; + /** A Mifare Classic compatible card of unknown type */ + public static final int TYPE_UNKNOWN = -1; /** A MIFARE Classic tag */ public static final int TYPE_CLASSIC = 0; /** A MIFARE Plus tag */ public static final int TYPE_PLUS = 1; /** A MIFARE Pro tag */ public static final int TYPE_PRO = 2; - /** A Mifare Classic compatible card that does not match the other types */ - public static final int TYPE_OTHER = -1; /** The tag contains 16 sectors, each holding 4 blocks. */ public static final int SIZE_1K = 1024; @@ -360,12 +360,6 @@ public final class MifareClassic extends BasicTagTechnology { transceive(cmd.array(), false); } - private void validateValueOperand(int value) { - if (value < 0) { - throw new IllegalArgumentException("value operand negative"); - } - } - /** * Copy from temporary memory to value block. * @param blockIndex @@ -410,7 +404,7 @@ public final class MifareClassic extends BasicTagTechnology { return transceive(data, true); } - private void validateSector(int sector) { + private static void validateSector(int sector) { // Do not be too strict on upper bounds checking, since some cards // have more addressable memory than they report. For example, // Mifare Plus 2k cards will appear as Mifare Classic 1k cards when in @@ -423,10 +417,16 @@ public final class MifareClassic extends BasicTagTechnology { } } - private void validateBlock(int block) { + private static void validateBlock(int block) { // Just looking for obvious out of bounds... if (block < 0 || block >= MAX_BLOCK_COUNT) { throw new IndexOutOfBoundsException("block out of bounds: " + block); } } + + private static void validateValueOperand(int value) { + if (value < 0) { + throw new IllegalArgumentException("value operand negative"); + } + } } diff --git a/core/java/android/nfc/tech/MifareUltralight.java b/core/java/android/nfc/tech/MifareUltralight.java index f096298..b514f1c 100644 --- a/core/java/android/nfc/tech/MifareUltralight.java +++ b/core/java/android/nfc/tech/MifareUltralight.java @@ -21,24 +21,43 @@ import android.os.RemoteException; import java.io.IOException; +//TOOD: Ultralight C 3-DES authentication, one-way counter + /** * Technology class representing MIFARE Ultralight and MIFARE Ultralight C tags. * * <p>Support for this technology type is optional. If the NFC stack doesn't support this technology * MIFARE Ultralight class tags will still be scanned, but will only show the NfcA technology. * - * <p>MIFARE Ultralight class tags have a series of 4 bytes pages that can be individually written - * and read in chunks of 4 for a total read of 16 bytes. + * <p>MIFARE Ultralight compatible tags have 4 byte pages. The read command + * returns 4 pages (16 bytes) at a time, for speed. The write command operates + * on a single page (4 bytes) to minimize EEPROM write cycles. + * + * <p>The original MIFARE Ultralight consists of a 64 byte EEPROM. The first + * 4 pages are for the OTP area, manufacturer data, and locking bits. They are + * readable and some bits are writable. The final 12 pages are the user + * read/write area. For more information see the NXP data sheet MF0ICU1. + * + * <p>The MIFARE Ultralight C consists of a 192 byte EEPROM. The first 4 pages + * are for OTP, manufacturer data, and locking bits. The next 36 pages are the + * user read/write area. The next 4 pages are additional locking bits, counters + * and authentication configuration and are readable. The final 4 pages are for + * the authentication key and are not readable. For more information see the + * NXP data sheet MF0ICU2. */ public final class MifareUltralight extends BasicTagTechnology { + /** A MIFARE Ultralight compatible tag of unknown type */ + public static final int TYPE_UNKNOWN = -1; /** A MIFARE Ultralight tag */ public static final int TYPE_ULTRALIGHT = 1; /** A MIFARE Ultralight C tag */ public static final int TYPE_ULTRALIGHT_C = 2; - /** The tag type is unknown */ - public static final int TYPE_UNKNOWN = 10; + + /** Size of a MIFARE Ultralight page in bytes */ + public static final int PAGE_SIZE = 4; private static final int NXP_MANUFACTURER_ID = 0x04; + private static final int MAX_PAGE_COUNT = 256; private int mType; @@ -68,48 +87,62 @@ public final class MifareUltralight extends BasicTagTechnology { if (a.getSak() == 0x00 && tag.getId()[0] == NXP_MANUFACTURER_ID) { // could be UL or UL-C + //TODO: stack should use NXP AN1303 procedure to make a best guess + // attempt at classifying Ultralight vs Ultralight C. mType = TYPE_ULTRALIGHT; } } - /** Returns the type of the tag */ + /** Returns the type of the tag. + * <p>It is very hard to always accurately classify a MIFARE Ultralight + * compatible tag as Ultralight original or Ultralight C. So consider + * {@link #getType} a hint. */ public int getType() { return mType; } // Methods that require connect() /** - * Reads a single 16 byte block from the given page offset. - * - * <p>This requires a that the tag be connected. + * Read 4 pages (16 bytes). + * <p>The MIFARE Ultralight protocol always reads 4 pages at a time. + * <p>If the read spans past the last readable block, then the tag will + * return pages that have been wrapped back to the first blocks. MIFARE + * Ultralight tags have readable blocks 0x00 through 0x0F. So a read to + * block offset 0x0E would return blocks 0x0E, 0x0F, 0x00, 0x01. MIFARE + * Ultralight C tags have readable blocks 0x00 through 0x2B. So a read to + * block 0x2A would return blocks 0x2A, 0x2B, 0x00, 0x01. + * <p>This requires that the tag be connected. * + * @return 4 pages (16 bytes) * @throws IOException */ - public byte[] readBlock(int page) throws IOException { + public byte[] readPages(int pageOffset) throws IOException { + validatePageOffset(pageOffset); checkConnected(); - byte[] blockread_cmd = { 0x30, (byte) page}; // phHal_eMifareRead - return transceive(blockread_cmd, false); + byte[] cmd = { 0x30, (byte) pageOffset}; + return transceive(cmd, false); } /** - * Writes a 4 byte page to the tag. + * Write 1 page (4 bytes). + * <p>The MIFARE Ultralight protocol always writes 1 page at a time. + * <p>This requires that the tag be connected. * - * <p>This requires a that the tag be connected. - * - * @param page The offset of the page to write + * @param pageOffset The offset of the page to write * @param data The data to write * @throws IOException */ - public void writePage(int page, byte[] data) throws IOException { + public void writePage(int pageOffset, byte[] data) throws IOException { + validatePageOffset(pageOffset); checkConnected(); - byte[] pagewrite_cmd = new byte[data.length + 2]; - pagewrite_cmd[0] = (byte) 0xA2; - pagewrite_cmd[1] = (byte) page; - System.arraycopy(data, 0, pagewrite_cmd, 2, data.length); + byte[] cmd = new byte[data.length + 2]; + cmd[0] = (byte) 0xA2; + cmd[1] = (byte) pageOffset; + System.arraycopy(data, 0, cmd, 2, data.length); - transceive(pagewrite_cmd, false); + transceive(cmd, false); } /** @@ -127,4 +160,15 @@ public final class MifareUltralight extends BasicTagTechnology { public byte[] transceive(byte[] data) throws IOException { return transceive(data, true); } + + private static void validatePageOffset(int pageOffset) { + // Do not be too strict on upper bounds checking, since some cards + // may have more addressable memory than they report. + // Note that issuing a command to an out-of-bounds block is safe - the + // tag will wrap the read to an addressable area. This validation is a + // helper to guard against obvious programming mistakes. + if (pageOffset < 0 || pageOffset >= MAX_PAGE_COUNT) { + throw new IndexOutOfBoundsException("page out of bounds: " + pageOffset); + } + } } diff --git a/core/java/android/nfc/tech/TagTechnology.java b/core/java/android/nfc/tech/TagTechnology.java index aebb3e8..c8ccdcf 100644 --- a/core/java/android/nfc/tech/TagTechnology.java +++ b/core/java/android/nfc/tech/TagTechnology.java @@ -18,9 +18,10 @@ package android.nfc.tech; import android.nfc.Tag; +import java.io.Closeable; import java.io.IOException; -public interface TagTechnology { +public interface TagTechnology extends Closeable { /** * This technology is an instance of {@link NfcA}. * <p>Support for this technology type is mandatory. @@ -135,5 +136,5 @@ public interface TagTechnology { * @see #connect() * @see #reconnect() */ - public void close(); + public void close() throws IOException; } diff --git a/core/java/android/os/storage/IMountService.java b/core/java/android/os/storage/IMountService.java index b9d4711..4c83515 100644 --- a/core/java/android/os/storage/IMountService.java +++ b/core/java/android/os/storage/IMountService.java @@ -26,7 +26,7 @@ import android.os.RemoteException; * WARNING! Update IMountService.h and IMountService.cpp if you change this * file. In particular, the ordering of the methods below must match the * _TRANSACTION enum in IMountService.cpp - * + * * @hide - Applications should use android.os.storage.StorageManager to access * storage functions. */ @@ -620,6 +620,23 @@ public interface IMountService extends IInterface { } return _result; } + + public int changeEncryptionPassword(String password) throws RemoteException { + Parcel _data = Parcel.obtain(); + Parcel _reply = Parcel.obtain(); + int _result; + try { + _data.writeInterfaceToken(DESCRIPTOR); + _data.writeString(password); + mRemote.transact(Stub.TRANSACTION_changeEncryptionPassword, _data, _reply, 0); + _reply.readException(); + _result = _reply.readInt(); + } finally { + _reply.recycle(); + _data.recycle(); + } + return _result; + } } private static final String DESCRIPTOR = "IMountService"; @@ -680,6 +697,8 @@ public interface IMountService extends IInterface { static final int TRANSACTION_encryptStorage = IBinder.FIRST_CALL_TRANSACTION + 27; + static final int TRANSACTION_changeEncryptionPassword = IBinder.FIRST_CALL_TRANSACTION + 28; + /** * Cast an IBinder object into an IMountService interface, generating a * proxy if needed. @@ -977,6 +996,14 @@ public interface IMountService extends IInterface { reply.writeInt(result); return true; } + case TRANSACTION_changeEncryptionPassword: { + data.enforceInterface(DESCRIPTOR); + String password = data.readString(); + int result = changeEncryptionPassword(password); + reply.writeNoException(); + reply.writeInt(result); + return true; + } } return super.onTransact(code, data, reply, flags); } @@ -1146,4 +1173,10 @@ public interface IMountService extends IInterface { * Encrypts storage. */ public int encryptStorage(String password) throws RemoteException; + + /** + * Changes the encryption password. + */ + public int changeEncryptionPassword(String password) throws RemoteException; + } diff --git a/core/java/android/os/storage/IObbActionListener.java b/core/java/android/os/storage/IObbActionListener.java index d6afbaa..35da4b0 100644 --- a/core/java/android/os/storage/IObbActionListener.java +++ b/core/java/android/os/storage/IObbActionListener.java @@ -113,7 +113,7 @@ public interface IObbActionListener extends IInterface { _data.writeInt(nonce); _data.writeInt(status); mRemote.transact(Stub.TRANSACTION_onObbResult, _data, _reply, - IBinder.FLAG_ONEWAY); + android.os.IBinder.FLAG_ONEWAY); _reply.readException(); } finally { _reply.recycle(); diff --git a/core/java/android/provider/Applications.java b/core/java/android/provider/Applications.java index 7aabc50..3686d17 100644 --- a/core/java/android/provider/Applications.java +++ b/core/java/android/provider/Applications.java @@ -18,6 +18,7 @@ package android.provider; import android.content.ComponentName; import android.content.ContentResolver; +import android.content.ContentValues; import android.database.Cursor; import android.net.Uri; @@ -26,10 +27,12 @@ import java.util.List; /** * The Applications provider gives information about installed applications. * - * @hide Only used by ApplicationsProvider so far. + * @hide Only used by ApplicationsProvider and Launchers so far. */ public class Applications { + private static final String TAG = "ApplicationsProvider"; + /** * The content authority for this provider. */ @@ -65,6 +68,26 @@ public class Applications { ContentResolver.CURSOR_DIR_BASE_TYPE + "/" + APPLICATION_SUB_TYPE; /** + * The path that should be used when an application is launched. The aim is + * to help ApplicationsProvider keep track of which applications the user + * uses the most, and improve app ranking based on this. + */ + public static final String INCREASE_LAUNCH_COUNT_PATH = "increase_launch_count"; + + public static final Uri INCREASE_LAUNCH_COUNT_URI = CONTENT_URI.buildUpon() + .appendPath(INCREASE_LAUNCH_COUNT_PATH).build(); + + /** + * The package name parameter for the "increase launch count" call. + */ + public static final String INCREASE_LAUNCH_COUNT_PACKAGE = "packageName"; + + /** + * The classname parameter for the "increase launch count" call. + */ + public static final String INCREASE_LAUNCH_COUNT_CLASS = "className"; + + /** * no public constructor since this is a utility class */ private Applications() {} @@ -79,6 +102,20 @@ public class Applications { } /** + * Increases the launch count of an application. Launch counts are used + * by the ApplicationsProvider to improve ranking. + */ + public static void increaseLaunchCount( + final ContentResolver resolver, final ComponentName componentName) { + + ContentValues parameters = new ContentValues(); + parameters.put(INCREASE_LAUNCH_COUNT_PACKAGE, componentName.getPackageName()); + parameters.put(INCREASE_LAUNCH_COUNT_CLASS, componentName.getClassName()); + + resolver.insert(INCREASE_LAUNCH_COUNT_URI, parameters); + } + + /** * Gets the application component name from an application URI. * * @param appUri A URI of the form diff --git a/core/java/android/text/DynamicLayout.java b/core/java/android/text/DynamicLayout.java index 403f20e..f196b34 100644 --- a/core/java/android/text/DynamicLayout.java +++ b/core/java/android/text/DynamicLayout.java @@ -92,7 +92,7 @@ extends Layout } else { mInts = new PackedIntVector(COLUMNS_NORMAL); mEllipsizedWidth = width; - mEllipsizeAt = ellipsize; + mEllipsizeAt = null; } mObjects = new PackedObjectVector<Directions>(1); @@ -259,10 +259,9 @@ extends Layout reflowed = new StaticLayout(true); reflowed.generate(text, where, where + after, - getPaint(), getWidth(), getAlignment(), - getSpacingMultiplier(), getSpacingAdd(), - false, true, mEllipsize, - mEllipsizedWidth, mEllipsizeAt); + getPaint(), getWidth(), getAlignment(), + getSpacingMultiplier(), getSpacingAdd(), + false, true, mEllipsizedWidth, mEllipsizeAt); int n = reflowed.getLineCount(); // If the new layout has a blank line at the end, but it is not @@ -391,9 +390,7 @@ extends Layout return mEllipsizedWidth; } - private static class ChangeWatcher - implements TextWatcher, SpanWatcher - { + private static class ChangeWatcher implements TextWatcher, SpanWatcher { public ChangeWatcher(DynamicLayout layout) { mLayout = new WeakReference<DynamicLayout>(layout); } @@ -407,12 +404,10 @@ extends Layout ((Spannable) s).removeSpan(this); } - public void beforeTextChanged(CharSequence s, - int where, int before, int after) { + public void beforeTextChanged(CharSequence s, int where, int before, int after) { } - public void onTextChanged(CharSequence s, - int where, int before, int after) { + public void onTextChanged(CharSequence s, int where, int before, int after) { reflow(s, where, before, after); } @@ -429,8 +424,7 @@ extends Layout reflow(s, start, end - start, end - start); } - public void onSpanChanged(Spannable s, Object o, int start, int end, - int nstart, int nend) { + public void onSpanChanged(Spannable s, Object o, int start, int end, int nstart, int nend) { if (o instanceof UpdateLayout) { reflow(s, start, end - start, end - start); reflow(s, nstart, nend - nstart, nend - nstart); diff --git a/core/java/android/text/Layout.java b/core/java/android/text/Layout.java index 3fe4f4c..8700af8 100644 --- a/core/java/android/text/Layout.java +++ b/core/java/android/text/Layout.java @@ -1764,4 +1764,15 @@ public abstract class Layout { new Directions(new int[] { 0, RUN_LENGTH_MASK }); /* package */ static final Directions DIRS_ALL_RIGHT_TO_LEFT = new Directions(new int[] { 0, RUN_LENGTH_MASK | RUN_RTL_FLAG }); + + /** + * Inform this layout that not all of its lines will be displayed, because a maximum number of + * lines has been set on the associated TextView. + * + * A non positive value means that all lines are displayed. + * + * @param line line number of the last visible line (line numbers start at 1 for the first line) + * @hide + */ + public void setMaximumVisibleLineCount(int line) {} } diff --git a/core/java/android/text/StaticLayout.java b/core/java/android/text/StaticLayout.java index 43dce53..ac3df79 100644 --- a/core/java/android/text/StaticLayout.java +++ b/core/java/android/text/StaticLayout.java @@ -98,7 +98,7 @@ public class StaticLayout extends Layout generate(source, bufstart, bufend, paint, outerwidth, align, spacingmult, spacingadd, includepad, includepad, - ellipsize != null, ellipsizedWidth, ellipsize); + ellipsizedWidth, ellipsize); mMeasured = MeasuredText.recycle(mMeasured); mFontMetricsInt = null; @@ -119,8 +119,7 @@ public class StaticLayout extends Layout Alignment align, float spacingmult, float spacingadd, boolean includepad, boolean trackpad, - boolean breakOnlyAtSpaces, - float ellipsizedWidth, TextUtils.TruncateAt where) { + float ellipsizedWidth, TextUtils.TruncateAt ellipsize) { mLineCount = 0; int v = 0; @@ -281,8 +280,7 @@ public class StaticLayout extends Layout int emoji = Character.codePointAt(chs, j - paraStart); if (emoji >= MIN_EMOJI && emoji <= MAX_EMOJI) { - Bitmap bm = EMOJI_FACTORY. - getBitmapFromAndroidPua(emoji); + Bitmap bm = EMOJI_FACTORY.getBitmapFromAndroidPua(emoji); if (bm != null) { Paint whichPaint; @@ -362,7 +360,8 @@ public class StaticLayout extends Layout okbottom = fitbottom; } } else { - if (breakOnlyAtSpaces) { + if (ellipsize != null) { + // Break only at spaces using ok indexes. if (ok != here) { // Log.e("text", "output ok " + here + " to " +ok); @@ -379,7 +378,7 @@ public class StaticLayout extends Layout needMultiply, paraStart, chdirs, dir, easy, ok == bufend, includepad, trackpad, chs, widths, here - paraStart, - where, ellipsizedWidth, okwidth, + ellipsize, ellipsizedWidth, okwidth, paint); here = ok; @@ -415,7 +414,7 @@ public class StaticLayout extends Layout needMultiply, paraStart, chdirs, dir, easy, ok == bufend, includepad, trackpad, chs, widths, here - paraStart, - where, ellipsizedWidth, okwidth, + ellipsize, ellipsizedWidth, okwidth, paint); here = ok; @@ -431,7 +430,7 @@ public class StaticLayout extends Layout needMultiply, paraStart, chdirs, dir, easy, fit == bufend, includepad, trackpad, chs, widths, here - paraStart, - where, ellipsizedWidth, fitwidth, + ellipsize, ellipsizedWidth, fitwidth, paint); here = fit; @@ -453,7 +452,7 @@ public class StaticLayout extends Layout here + 1 == bufend, includepad, trackpad, chs, widths, here - paraStart, - where, ellipsizedWidth, + ellipsize, ellipsizedWidth, widths[here - paraStart], paint); here = here + 1; @@ -502,7 +501,7 @@ public class StaticLayout extends Layout needMultiply, paraStart, chdirs, dir, easy, paraEnd == bufend, includepad, trackpad, chs, widths, here - paraStart, - where, ellipsizedWidth, w, paint); + ellipsize, ellipsizedWidth, w, paint); } paraStart = paraEnd; @@ -525,7 +524,7 @@ public class StaticLayout extends Layout needMultiply, bufend, null, DEFAULT_DIR, true, true, includepad, trackpad, null, null, bufstart, - where, ellipsizedWidth, 0, paint); + ellipsize, ellipsizedWidth, 0, paint); } } @@ -738,13 +737,13 @@ public class StaticLayout extends Layout } else { mLineDirections[j] = AndroidBidi.directions(dir, chdirs, widstart, chs, widstart, end - start); + } - // If ellipsize is in marquee mode, do not apply ellipsis on the first line - if (ellipsize != null && (ellipsize != TextUtils.TruncateAt.MARQUEE || j != 0)) { - calculateEllipsis(start, end, widths, widstart, - ellipsiswidth, ellipsize, j, - textwidth, paint); - } + // If ellipsize is in marquee mode, do not apply ellipsis on the first line + if (ellipsize != null && (ellipsize != TextUtils.TruncateAt.MARQUEE || j != 0)) { + calculateEllipsis(start, end, widths, widstart, + ellipsiswidth, ellipsize, j, + textwidth, paint); } mLineCount++; @@ -755,7 +754,6 @@ public class StaticLayout extends Layout float[] widths, int widstart, float avail, TextUtils.TruncateAt where, int line, float textwidth, TextPaint paint) { - int len = lineend - linestart; if (textwidth <= avail) { // Everything fits! @@ -766,6 +764,7 @@ public class StaticLayout extends Layout float ellipsiswid = paint.measureText("\u2026"); int ellipsisStart, ellipsisCount; + int len = lineend - linestart; if (where == TextUtils.TruncateAt.START) { float sum = 0; @@ -865,12 +864,22 @@ public class StaticLayout extends Layout @Override public int getLineTop(int line) { - return mLines[mColumns * line + TOP]; + int top = mLines[mColumns * line + TOP]; + if (mMaximumVisibleLineCount > 0 && line >= mMaximumVisibleLineCount && + line != mLineCount) { + top += getBottomPadding(); + } + return top; } @Override public int getLineDescent(int line) { - return mLines[mColumns * line + DESCENT]; + int descent = mLines[mColumns * line + DESCENT]; + if (mMaximumVisibleLineCount > 0 && line >= mMaximumVisibleLineCount - 1 && + line != mLineCount) { + descent += getBottomPadding(); + } + return descent; } @Override @@ -926,6 +935,14 @@ public class StaticLayout extends Layout return mEllipsizedWidth; } + /** + * @hide + */ + @Override + public void setMaximumVisibleLineCount(int line) { + mMaximumVisibleLineCount = line; + } + private int mLineCount; private int mTopPadding, mBottomPadding; private int mColumns; @@ -943,6 +960,7 @@ public class StaticLayout extends Layout private int[] mLines; private Directions[] mLineDirections; + private int mMaximumVisibleLineCount = 0; private static final int START_MASK = 0x1FFFFFFF; private static final int DIR_SHIFT = 30; diff --git a/core/java/android/text/TextUtils.java b/core/java/android/text/TextUtils.java index 7748265..d5010c6 100644 --- a/core/java/android/text/TextUtils.java +++ b/core/java/android/text/TextUtils.java @@ -1142,7 +1142,7 @@ public class TextUtils { // XXX this is probably ok, but need to look at it more tempMt.setPara(format, 0, format.length(), request); - float moreWid = mt.addStyleRun(p, mt.mLen, null); + float moreWid = tempMt.addStyleRun(p, tempMt.mLen, null); if (w + moreWid <= avail) { ok = i + 1; diff --git a/core/java/android/util/FastImmutableArraySet.java b/core/java/android/util/FastImmutableArraySet.java new file mode 100644 index 0000000..4175c60 --- /dev/null +++ b/core/java/android/util/FastImmutableArraySet.java @@ -0,0 +1,78 @@ +/* + * 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 android.util; + +import java.util.AbstractSet; +import java.util.Iterator; + +/** + * A fast immutable set wrapper for an array that is optimized for non-concurrent iteration. + * The same iterator instance is reused each time to avoid creating lots of garbage. + * Iterating over an array in this fashion is 2.5x faster than iterating over a {@link HashSet} + * so it is worth copying the contents of the set to an array when iterating over it + * hundreds of times. + * @hide + */ +public final class FastImmutableArraySet<T> extends AbstractSet<T> { + FastIterator<T> mIterator; + T[] mContents; + + public FastImmutableArraySet(T[] contents) { + mContents = contents; + } + + @Override + public Iterator<T> iterator() { + FastIterator<T> it = mIterator; + if (it == null) { + it = new FastIterator<T>(mContents); + mIterator = it; + } else { + it.mIndex = 0; + } + return it; + } + + @Override + public int size() { + return mContents.length; + } + + private static final class FastIterator<T> implements Iterator<T> { + private final T[] mContents; + int mIndex; + + public FastIterator(T[] contents) { + mContents = contents; + } + + @Override + public boolean hasNext() { + return mIndex != mContents.length; + } + + @Override + public T next() { + return mContents[mIndex++]; + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + } +} diff --git a/core/java/android/view/DragEvent.java b/core/java/android/view/DragEvent.java index 4d83891..8f491ef 100644 --- a/core/java/android/view/DragEvent.java +++ b/core/java/android/view/DragEvent.java @@ -21,7 +21,100 @@ import android.content.ClipDescription; import android.os.Parcel; import android.os.Parcelable; -/** !!! TODO: real docs */ +//TODO: Improve Javadoc +/** + * Represents an event that is sent out by the system at various times during a drag and drop + * operation. It is a complex data structure that contains several important pieces of data about + * the operation and the underlying data. + * <p> + * View objects that receive a DragEvent call {@link #getAction()}, which returns + * an action type that indicates the state of the drag and drop operation. This allows a View + * object to react to a change in state by changing its appearance or performing other actions. + * For example, a View can react to the {@link #ACTION_DRAG_ENTERED} action type by + * by changing one or more colors in its displayed image. + * </p> + * <p> + * During a drag and drop operation, the system displays an image that the user drags. This image + * is called a drag shadow. Several action types reflect the position of the drag shadow relative + * to the View receiving the event. + * </p> + * <p> + * Most methods return valid data only for certain event actions. This is summarized in the + * following table. Each possible {@link #getAction()} value is listed in the first column. The + * other columns indicate which method or methods return valid data for that getAction() value: + * </p> + * <table> + * <tr> + * <th scope="col">getAction() Value</th> + * <th scope="col">getClipDescription()</th> + * <th scope="col">getLocalState()</th> + * <th scope="col">getX()</th> + * <th scope="col">getY()</th> + * <th scope="col">getClipData()</th> + * <th scope="col">getResult()</th> + * </tr> + * <tr> + * <td>ACTION_DRAG_STARTED</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;"> </td> + * <td style="text-align: center;"> </td> + * </tr> + * <tr> + * <td>ACTION_DRAG_ENTERED</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;"> </td> + * <td style="text-align: center;"> </td> + * <td style="text-align: center;"> </td> + * <td style="text-align: center;"> </td> + * </tr> + * <tr> + * <td>ACTION_DRAG_LOCATION</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;"> </td> + * <td style="text-align: center;"> </td> + * </tr> + * <tr> + * <td>ACTION_DRAG_EXITED</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;"> </td> + * <td style="text-align: center;"> </td> + * <td style="text-align: center;"> </td> + * <td style="text-align: center;"> </td> + * </tr> + * <tr> + * <td>ACTION_DROP</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;"> </td> + * </tr> + * <tr> + * <td>ACTION_DRAG_ENDED</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;">X</td> + * <td style="text-align: center;"> </td> + * <td style="text-align: center;"> </td> + * <td style="text-align: center;"> </td> + * <td style="text-align: center;">X</td> + * </tr> + * </table> + * <p> + * The {@link android.view.DragEvent#getAction()}, + * {@link android.view.DragEvent#describeContents()}, + * {@link android.view.DragEvent#writeToParcel(Parcel,int)}, and + * {@link android.view.DragEvent#toString()} methods always return valid data. + * </p> + */ public class DragEvent implements Parcelable { private static final boolean TRACK_RECYCLED_LOCATION = false; @@ -42,89 +135,113 @@ public class DragEvent implements Parcelable { private static DragEvent gRecyclerTop = null; /** - * Action constant returned by {@link #getAction()}. Delivery of a DragEvent whose - * action is ACTION_DRAG_STARTED means that a drag operation has been initiated. The - * view receiving this DragEvent should inspect the metadata of the dragged content, - * available via {@link #getClipDescription()}, and return {@code true} from - * {@link View#onDragEvent(DragEvent)} if the view is prepared to accept a drop of - * that clip data. If the view chooses to present a visual indication that it is - * a valid target of the ongoing drag, then it should draw that indication in response - * to this event. + * Action constant returned by {@link #getAction()}: Signals the start of a + * drag and drop operation. The View should return {@code true} from its + * {@link View#onDragEvent(DragEvent) onDragEvent()} handler method or + * {@link View.View.OnDragListener#onDrag(View,DragEvent) OnDragListener.onDrag()} listener + * if it can accept a drop. The onDragEvent() or onDrag() methods usually inspect the metadata + * from {@link #getClipDescription()} to determine if they can accept the data contained in + * this drag. For an operation that doesn't represent data transfer, these methods may + * perform other actions to determine whether or not the View should accept the drag. + * If the View wants to indicate that it is a valid drop target, it can also react by + * changing its appearance. * <p> - * A view will only receive ACTION_DRAG_ENTERED, ACTION_DRAG_LOCATION, ACTION_DRAG_EXITED, - * and ACTION_DRAG_LOCATION events if it returns {@code true} in response to the - * ACTION_DRAG_STARTED event. + * A View only receives further drag events if it returns {@code true} in response to + * ACTION_DRAG_STARTED. + * </p> + * @see #ACTION_DRAG_ENDED */ public static final int ACTION_DRAG_STARTED = 1; /** - * Action constant returned by {@link #getAction()}. Delivery of a DragEvent whose - * action is ACTION_DRAG_LOCATION means that the drag operation is currently hovering - * over the view. The {@link #getX()} and {@link #getY()} methods supply the location - * of the drag point within the view's coordinate system. + * Action constant returned by {@link #getAction()}: Sent to a View after + * {@link #ACTION_DRAG_ENTERED} if the drag shadow is still within the View object's bounding + * box. The {@link #getX()} and {@link #getY()} methods supply + * the X and Y position of of the drag point within the View object's bounding box. + * <p> + * A View receives an {@link #ACTION_DRAG_ENTERED} event before receiving any + * ACTION_DRAG_LOCATION events. + * </p> * <p> - * A view will receive an ACTION_DRAG_ENTERED event before receiving any - * ACTION_DRAG_LOCATION events. If the drag point leaves the view, then an - * ACTION_DRAG_EXITED event is delivered to the view, after which no more - * ACTION_DRAG_LOCATION events will be sent (unless the drag re-enters the view, - * of course). + * The system stops sending ACTION_DRAG_LOCATION events to a View once the user moves the + * drag shadow out of the View object's bounding box. If the user moves the drag shadow back + * into the View object's bounding box, the View receives an ACTION_DRAG_ENTERED again before + * receiving any more ACTION_DRAG_LOCATION events. + * </p> + * @see #ACTION_DRAG_ENTERED + * @see #getX() + * @see #getY() */ public static final int ACTION_DRAG_LOCATION = 2; /** - * Action constant returned by {@link #getAction()}. Delivery of a DragEvent whose - * action is ACTION_DROP means that the dragged content has been dropped on this view. - * The view should retrieve the content via {@link #getClipData()} and act on it - * appropriately. The {@link #getX()} and {@link #getY()} methods supply the location - * of the drop point within the view's coordinate system. + * Action constant returned by {@link #getAction()}: Signals to a View that the user + * has released the drag shadow, and the drag point is within the bounding box of the View. + * The View should retrieve the data from the DragEvent by calling {@link #getClipData()}. + * The methods {@link #getX()} and {@link #getY()} return the X and Y position of the drop point + * within the View object's bounding box. + * <p> + * The View should return {@code true} from its {@link View#onDragEvent(DragEvent)} + * handler or {@link View.View.OnDragListener#onDrag(View,DragEvent) OnDragListener.onDrag()} + * listener if it accepted the drop, and {@code false} if it ignored the drop. + * </p> * <p> - * The view should return {@code true} from its {@link View#onDragEvent(DragEvent)} - * method in response to this event if it accepted the content, and {@code false} - * if it ignored the drop. + * The View can also react to this action by changing its appearance. + * </p> + * @see #getClipData() + * @see #getX() + * @see #getY() */ public static final int ACTION_DROP = 3; /** - * Action constant returned by {@link #getAction()}. Delivery of a DragEvent whose - * action is ACTION_DRAG_ENDED means that the drag operation has concluded. A view - * that is drawing a visual indication of drag acceptance should return to its usual - * drawing state in response to this event. + * Action constant returned by {@link #getAction()}: Signals to a View that the drag and drop + * operation has concluded. A View that changed its appearance during the operation should + * return to its usual drawing state in response to this event. * <p> * All views that received an ACTION_DRAG_STARTED event will receive the - * ACTION_DRAG_ENDED event even if they are not currently visible when the drag - * ends. + * ACTION_DRAG_ENDED event even if they are not currently visible when the drag ends. + * </p> + * <p> + * The View object can call {@link #getResult()} to see the result of the operation. + * If a View returned {@code true} in response to {@link #ACTION_DROP}, then + * getResult() returns {@code true}, otherwise it returns {@code false}. + * </p> + * @see #ACTION_DRAG_STARTED + * @see #getResult() */ public static final int ACTION_DRAG_ENDED = 4; /** - * Action constant returned by {@link #getAction()}. Delivery of a DragEvent whose - * action is ACTION_DRAG_ENTERED means that the drag point has entered the view's - * bounds. If the view changed its visual state in response to the ACTION_DRAG_ENTERED - * event, it should return to its normal drag-in-progress visual state in response to - * this event. + * Action constant returned by {@link #getAction()}: Signals to a View that the drag point has + * entered the bounding box of the View. * <p> - * A view will receive an ACTION_DRAG_ENTERED event before receiving any - * ACTION_DRAG_LOCATION events. If the drag point leaves the view, then an - * ACTION_DRAG_EXITED event is delivered to the view, after which no more - * ACTION_DRAG_LOCATION events will be sent (unless the drag re-enters the view, - * of course). + * If the View can accept a drop, it can react to ACTION_DRAG_ENTERED + * by changing its appearance in a way that tells the user that the View is the current + * drop target. + * </p> + * The system stops sending ACTION_DRAG_LOCATION events to a View once the user moves the + * drag shadow out of the View object's bounding box. If the user moves the drag shadow back + * into the View object's bounding box, the View receives an ACTION_DRAG_ENTERED again before + * receiving any more ACTION_DRAG_LOCATION events. + * </p> + * @see #ACTION_DRAG_ENTERED + * @see #ACTION_DRAG_LOCATION */ public static final int ACTION_DRAG_ENTERED = 5; /** - * Action constant returned by {@link #getAction()}. Delivery of a DragEvent whose - * action is ACTION_DRAG_ENTERED means that the drag point has entered the view's - * bounds. If the view chooses to present a visual indication that it will receive - * the drop if it occurs now, then it should draw that indication in response to - * this event. + * Action constant returned by {@link #getAction()}: Signals that the user has moved the + * drag shadow outside the bounding box of the View. + * The View can react by changing its appearance in a way that tells the user that + * View is no longer the immediate drop target. * <p> - * A view will receive an ACTION_DRAG_ENTERED event before receiving any - * ACTION_DRAG_LOCATION events. If the drag point leaves the view, then an - * ACTION_DRAG_EXITED event is delivered to the view, after which no more - * ACTION_DRAG_LOCATION events will be sent (unless the drag re-enters the view, - * of course). + * After the system sends an ACTION_DRAG_EXITED event to the View, the View receives no more + * ACTION_DRAG_LOCATION events until the user drags the drag shadow back over the View. + * </p> + * */ -public static final int ACTION_DRAG_EXITED = 6; + public static final int ACTION_DRAG_EXITED = 6; private DragEvent() { } @@ -175,64 +292,101 @@ public static final int ACTION_DRAG_EXITED = 6; /** * Inspect the action value of this event. - * @return One of {@link #ACTION_DRAG_STARTED}, {@link #ACTION_DRAG_ENDED}, - * {@link #ACTION_DROP}, {@link #ACTION_DRAG_ENTERED}, {@link #ACTION_DRAG_EXITED}, - * or {@link #ACTION_DRAG_LOCATION}. + * @return One of the following action constants, in the order in which they usually occur + * during a drag and drop operation: + * <ul> + * <li>{@link #ACTION_DRAG_STARTED}</li> + * <li>{@link #ACTION_DRAG_ENTERED}</li> + * <li>{@link #ACTION_DRAG_LOCATION}</li> + * <li>{@link #ACTION_DROP}</li> + * <li>{@link #ACTION_DRAG_EXITED}</li> + * <li>{@link #ACTION_DRAG_ENDED}</li> + * </ul> */ public int getAction() { return mAction; } /** - * For ACTION_DRAG_LOCATION and ACTION_DROP events, returns the x coordinate of the - * drag point. - * @return The current drag point's x coordinate, when relevant. + * Gets the X coordinate of the drag point. The value is only valid if the event action is + * {@link #ACTION_DRAG_LOCATION} or {@link #ACTION_DROP}. + * @return The current drag point's Y coordinate */ public float getX() { return mX; } /** - * For ACTION_DRAG_LOCATION and ACTION_DROP events, returns the y coordinate of the - * drag point. - * @return The current drag point's y coordinate, when relevant. + * Gets the Y coordinate of the drag point. The value is valid if the + * event action is {@link #ACTION_DRAG_ENTERED}, {@link #ACTION_DRAG_LOCATION}, + * {@link #ACTION_DROP}, or {@link #ACTION_DRAG_EXITED}. + * @return The current drag point's Y coordinate */ public float getY() { return mY; } /** - * Provides the data payload of the drag operation. This payload is only available - * for events whose action value is ACTION_DROP. - * @return The ClipData containing the data being dropped on the view. + * Returns the {@link android.content.ClipData} object sent to the system as part of the call + * to + * {@link android.view.View#startDrag(ClipData,View.DragShadowBuilder,Object,int) startDrag()}. + * This method only returns valid data if the event action is {@link #ACTION_DROP}. + * @return The ClipData sent to the system by startDrag(). */ public ClipData getClipData() { return mClipData; } /** - * Provides a description of the drag operation's data payload. This payload is - * available for all DragEvents other than ACTION_DROP. - * @return A ClipDescription describing the contents of the data being dragged. + * Returns the {@link android.content.ClipDescription} object contained in the + * {@link android.content.ClipData} object sent to the system as part of the call to + * {@link android.view.View#startDrag(ClipData,View.DragShadowBuilder,Object,int) startDrag()}. + * The drag handler or listener for a View can use the metadata in this object to decide if the + * View can accept the dragged View object's data. + * <p> + * This method returns valid data for all event actions. + * @return The ClipDescription that was part of the ClipData sent to the system by startDrag(). */ public ClipDescription getClipDescription() { return mClipDescription; } /** - * Provides the local state object passed as the {@code myLocalState} parameter to - * View.startDrag(). The object will always be null here if the application receiving - * the DragEvent is not the one that started the drag. + * Returns the local state object sent to the system as part of the call to + * {@link android.view.View#startDrag(ClipData,View.DragShadowBuilder,Object,int) startDrag()}. + * The object is intended to provide local information about the drag and drop operation. For + * example, it can indicate whether the drag and drop operation is a copy or a move. + * <p> + * This method returns valid data for all event actions. + * </p> + * @return The local state object sent to the system by startDrag(). */ public Object getLocalState() { return mLocalState; } /** - * Provides an indication of whether the drag operation concluded successfully. - * This method is only available on ACTION_DRAG_ENDED events. - * @return {@code true} if the drag operation ended with an accepted drop; {@code false} - * otherwise. + * <p> + * Returns an indication of the result of the drag and drop operation. + * This method only returns valid data if the action type is {@link #ACTION_DRAG_ENDED}. + * The return value depends on what happens after the user releases the drag shadow. + * </p> + * <p> + * If the user releases the drag shadow on a View that can accept a drop, the system sends an + * {@link #ACTION_DROP} event to the View object's drag event listener. If the listener + * returns {@code true}, then getResult() will return {@code true}. + * If the listener returns {@code false}, then getResult() returns {@code false}. + * </p> + * <p> + * Notice that getResult() also returns {@code false} if no {@link #ACTION_DROP} is sent. This + * happens, for example, when the user releases the drag shadow over an area outside of the + * application. In this case, the system sends out {@link #ACTION_DRAG_ENDED} for the current + * operation, but never sends out {@link #ACTION_DROP}. + * </p> + * @return {@code true} if a drag event listener returned {@code true} in response to + * {@link #ACTION_DROP}. If the system did not send {@link #ACTION_DROP} before + * {@link #ACTION_DRAG_ENDED}, or if the listener returned {@code false} in response to + * {@link #ACTION_DROP}, then {@code false} is returned. */ public boolean getResult() { return mDragResult; @@ -271,6 +425,11 @@ public static final int ACTION_DRAG_EXITED = 6; } } + /** + * Returns a string containing a concise, human-readable representation of this DragEvent + * object. + * @return A string representation of the DragEvent object. + */ @Override public String toString() { return "DragEvent{" + Integer.toHexString(System.identityHashCode(this)) @@ -281,10 +440,20 @@ public static final int ACTION_DRAG_EXITED = 6; /* Parcelable interface */ + /** + * Returns information about the {@link android.os.Parcel} representation of this DragEvent + * object. + * @return Information about the {@link android.os.Parcel} representation. + */ public int describeContents() { return 0; } + /** + * Creates a {@link android.os.Parcel} object from this DragEvent object. + * @param dest A {@link android.os.Parcel} object in which to put the DragEvent object. + * @param flags Flags to store in the Parcel. + */ public void writeToParcel(Parcel dest, int flags) { dest.writeInt(mAction); dest.writeFloat(mX); @@ -304,6 +473,9 @@ public static final int ACTION_DRAG_EXITED = 6; } } + /** + * A container for creating a DragEvent from a Parcel. + */ public static final Parcelable.Creator<DragEvent> CREATOR = new Parcelable.Creator<DragEvent>() { public DragEvent createFromParcel(Parcel in) { diff --git a/core/java/android/view/LayoutInflater.java b/core/java/android/view/LayoutInflater.java index 6b44f9e..81346b4 100644 --- a/core/java/android/view/LayoutInflater.java +++ b/core/java/android/view/LayoutInflater.java @@ -68,6 +68,7 @@ public abstract class LayoutInflater { private boolean mFactorySet; private Factory mFactory; private Factory2 mFactory2; + private Factory2 mPrivateFactory; private Filter mFilter; private final Object[] mConstructorArgs = new Object[2]; @@ -193,6 +194,7 @@ public abstract class LayoutInflater { mContext = newContext; mFactory = original.mFactory; mFactory2 = original.mFactory2; + mPrivateFactory = original.mPrivateFactory; mFilter = original.mFilter; } @@ -300,6 +302,13 @@ public abstract class LayoutInflater { } /** + * @hide for use by framework + */ + public void setPrivateFactory(Factory2 factory) { + mPrivateFactory = factory; + } + + /** * @return The {@link Filter} currently used by this LayoutInflater to restrict the set of Views * that are allowed to be inflated. */ @@ -651,6 +660,10 @@ public abstract class LayoutInflater { else if (mFactory != null) view = mFactory.onCreateView(name, mContext, attrs); else view = null; + if (view == null && mPrivateFactory != null) { + view = mPrivateFactory.onCreateView(parent, name, mContext, attrs); + } + if (view == null) { if (-1 == name.indexOf('.')) { view = onCreateView(parent, name, attrs); diff --git a/core/java/android/view/MenuInflater.java b/core/java/android/view/MenuInflater.java index ab515c9..372ac15 100644 --- a/core/java/android/view/MenuInflater.java +++ b/core/java/android/view/MenuInflater.java @@ -228,8 +228,8 @@ public class MenuInflater { private boolean itemAdded; private int itemId; private int itemCategoryOrder; - private String itemTitle; - private String itemTitleCondensed; + private CharSequence itemTitle; + private CharSequence itemTitleCondensed; private int itemIconResId; private char itemAlphabeticShortcut; private char itemNumericShortcut; @@ -311,8 +311,8 @@ public class MenuInflater { final int category = a.getInt(com.android.internal.R.styleable.MenuItem_menuCategory, groupCategory); final int order = a.getInt(com.android.internal.R.styleable.MenuItem_orderInCategory, groupOrder); itemCategoryOrder = (category & Menu.CATEGORY_MASK) | (order & Menu.USER_MASK); - itemTitle = a.getString(com.android.internal.R.styleable.MenuItem_title); - itemTitleCondensed = a.getString(com.android.internal.R.styleable.MenuItem_titleCondensed); + itemTitle = a.getText(com.android.internal.R.styleable.MenuItem_title); + itemTitleCondensed = a.getText(com.android.internal.R.styleable.MenuItem_titleCondensed); itemIconResId = a.getResourceId(com.android.internal.R.styleable.MenuItem_icon, 0); itemAlphabeticShortcut = getShortcut(a.getString(com.android.internal.R.styleable.MenuItem_alphabeticShortcut)); diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java index 0326a8f..83f9119 100644 --- a/core/java/android/view/Surface.java +++ b/core/java/android/view/Surface.java @@ -99,6 +99,17 @@ public class Surface implements Parcelable { */ public static final int OPAQUE = 0x00000400; + /** + * Application requires a hardware-protected path to an + * external display sink. If a hardware-protected path is not available, + * then this surface will not be displayed on the external sink. + * + * @hide + */ + public static final int PROTECTED_APP = 0x00000800; + + // 0x1000 is reserved for an independent DRM protected flag in framework + /** Creates a normal surface. This is the default. */ public static final int FX_SURFACE_NORMAL = 0x00000000; diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index 966bd8d..87b3d79 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -174,6 +174,7 @@ public class SurfaceView extends View { return true; } }; + private boolean mGlobalListenersAdded; public SurfaceView(Context context) { super(context); @@ -212,9 +213,13 @@ public class SurfaceView extends View { mLayout.token = getWindowToken(); mLayout.setTitle("SurfaceView"); mViewVisibility = getVisibility() == VISIBLE; - ViewTreeObserver observer = getViewTreeObserver(); - observer.addOnScrollChangedListener(mScrollChangedListener); - observer.addOnPreDrawListener(mDrawListener); + + if (!mGlobalListenersAdded) { + ViewTreeObserver observer = getViewTreeObserver(); + observer.addOnScrollChangedListener(mScrollChangedListener); + observer.addOnPreDrawListener(mDrawListener); + mGlobalListenersAdded = true; + } } @Override @@ -275,9 +280,13 @@ public class SurfaceView extends View { @Override protected void onDetachedFromWindow() { - ViewTreeObserver observer = getViewTreeObserver(); - observer.removeOnScrollChangedListener(mScrollChangedListener); - observer.removeOnPreDrawListener(mDrawListener); + if (mGlobalListenersAdded) { + ViewTreeObserver observer = getViewTreeObserver(); + observer.removeOnScrollChangedListener(mScrollChangedListener); + observer.removeOnPreDrawListener(mDrawListener); + mGlobalListenersAdded = false; + } + mRequestedVisible = false; updateWindow(false, false); mHaveFrame = false; @@ -285,6 +294,7 @@ public class SurfaceView extends View { try { mSession.remove(mWindow); } catch (RemoteException ex) { + // Not much we can do here... } mWindow = null; } diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 7536be1..4fc9d80 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -521,7 +521,7 @@ import java.util.WeakHashMap; * The framework provides basic support for views that wish to internally * scroll their content. This includes keeping track of the X and Y scroll * offset as well as mechanisms for drawing scrollbars. See - * {@link #scrollBy(int, int)}, {@link #scrollTo(int, int)}, and + * {@link #scrollBy(int, int)}, {@link #scrollTo(int, int)}, and * {@link #awakenScrollBars()} for more details. * </p> * @@ -1645,27 +1645,27 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * @hide */ static final int OPAQUE_MASK = 0x01800000; - + /** * Indicates a prepressed state; * the short time between ACTION_DOWN and recognizing * a 'real' press. Prepressed is used to recognize quick taps * even when they are shorter than ViewConfiguration.getTapTimeout(). - * + * * @hide */ private static final int PREPRESSED = 0x02000000; - + /** * Indicates whether the view is temporarily detached. * * @hide */ static final int CANCEL_NEXT_UP_EVENT = 0x04000000; - + /** * Indicates that we should awaken scroll bars once attached - * + * * @hide */ private static final int AWAKEN_SCROLL_BARS_ON_ATTACH = 0x08000000; @@ -1720,18 +1720,114 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility /** * View has requested the status bar to be visible (the default). * - * @see #setSystemUiVisibility(int) + * @see #setSystemUiVisibility(int) */ public static final int STATUS_BAR_VISIBLE = 0; /** * View has requested the status bar to be visible (the default). * - * @see #setSystemUiVisibility(int) + * @see #setSystemUiVisibility(int) */ public static final int STATUS_BAR_HIDDEN = 0x00000001; /** + * @hide + * + * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked + * out of the public fields to keep the undefined bits out of the developer's way. + * + * Flag to make the status bar not expandable. Unless you also + * set {@link #STATUS_BAR_DISABLE_NOTIFICATION_ICONS}, new notifications will continue to show. + */ + public static final int STATUS_BAR_DISABLE_EXPAND = 0x00010000; + + /** + * @hide + * + * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked + * out of the public fields to keep the undefined bits out of the developer's way. + * + * Flag to hide notification icons and scrolling ticker text. + */ + public static final int STATUS_BAR_DISABLE_NOTIFICATION_ICONS = 0x00020000; + + /** + * @hide + * + * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked + * out of the public fields to keep the undefined bits out of the developer's way. + * + * Flag to disable incoming notification alerts. This will not block + * icons, but it will block sound, vibrating and other visual or aural notifications. + */ + public static final int STATUS_BAR_DISABLE_NOTIFICATION_ALERTS = 0x00040000; + + /** + * @hide + * + * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked + * out of the public fields to keep the undefined bits out of the developer's way. + * + * Flag to hide only the scrolling ticker. Note that + * {@link #STATUS_BAR_DISABLE_NOTIFICATION_ICONS} implies + * {@link #STATUS_BAR_DISABLE_NOTIFICATION_TICKER}. + */ + public static final int STATUS_BAR_DISABLE_NOTIFICATION_TICKER = 0x00080000; + + /** + * @hide + * + * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked + * out of the public fields to keep the undefined bits out of the developer's way. + * + * Flag to hide the center system info area. + */ + public static final int STATUS_BAR_DISABLE_SYSTEM_INFO = 0x00100000; + + /** + * @hide + * + * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked + * out of the public fields to keep the undefined bits out of the developer's way. + * + * Flag to hide only the navigation buttons. Don't use this + * unless you're a special part of the system UI (i.e., setup wizard, keyguard). + * + * THIS DOES NOT DISABLE THE BACK BUTTON + */ + public static final int STATUS_BAR_DISABLE_NAVIGATION = 0x00200000; + + /** + * @hide + * + * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked + * out of the public fields to keep the undefined bits out of the developer's way. + * + * Flag to hide only the back button. Don't use this + * unless you're a special part of the system UI (i.e., setup wizard, keyguard). + */ + public static final int STATUS_BAR_DISABLE_BACK = 0x00400000; + + /** + * @hide + * + * NOTE: This flag may only be used in subtreeSystemUiVisibility. It is masked + * out of the public fields to keep the undefined bits out of the developer's way. + * + * Flag to hide only the clock. You might use this if your activity has + * its own clock making the status bar's clock redundant. + */ + public static final int STATUS_BAR_DISABLE_CLOCK = 0x00800000; + + + /** + * @hide + */ + public static final int PUBLIC_STATUS_BAR_VISIBILITY_MASK = STATUS_BAR_HIDDEN; + + + /** * Controls the over-scroll mode for this view. * See {@link #overScrollBy(int, int, int, int, int, int, int, int, boolean)}, * {@link #OVER_SCROLL_ALWAYS}, {@link #OVER_SCROLL_IF_CONTENT_SCROLLS}, @@ -1773,6 +1869,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * This view's request for the visibility of the status bar. * @hide */ + @ViewDebug.ExportedProperty() int mSystemUiVisibility; /** @@ -1854,8 +1951,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility private int mPrevWidth = -1; private int mPrevHeight = -1; - private boolean mLastIsOpaque; - + private boolean mLastIsOpaque; + /** * Convenience value to check for float values that are close enough to zero to be considered * zero. @@ -2129,7 +2226,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility private CheckForLongPress mPendingCheckForLongPress; private CheckForTap mPendingCheckForTap = null; private PerformClick mPerformClick; - + private UnsetPressedState mUnsetPressedState; /** @@ -2170,7 +2267,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * Special tree observer used when mAttachInfo is null. */ private ViewTreeObserver mFloatingTreeObserver; - + /** * Cache the touch slop from the context that created the view. */ @@ -2183,8 +2280,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility boolean mCanAcceptDrop; /** - * Flag indicating that a drag can cross window boundaries - * @hide + * Flag indicating that a drag can cross window boundaries. When + * {@link #startDrag(ClipData, DragShadowBuilder, Object, int)} is called + * with this flag set, all visible applications will be able to participate + * in the drag operation and receive the dragged content. */ public static final int DRAG_FLAG_GLOBAL = 1; @@ -2210,11 +2309,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility /** * Indicates that the view does not have a layer. - * - * @see #getLayerType() - * @see #setLayerType(int, android.graphics.Paint) + * + * @see #getLayerType() + * @see #setLayerType(int, android.graphics.Paint) * @see #LAYER_TYPE_SOFTWARE - * @see #LAYER_TYPE_HARDWARE + * @see #LAYER_TYPE_HARDWARE */ public static final int LAYER_TYPE_NONE = 0; @@ -2222,7 +2321,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * <p>Indicates that the view has a software layer. A software layer is backed * by a bitmap and causes the view to be rendered using Android's software * rendering pipeline, even if hardware acceleration is enabled.</p> - * + * * <p>Software layers have various usages:</p> * <p>When the application is not using hardware acceleration, a software layer * is useful to apply a specific color filter and/or blending mode and/or @@ -2238,11 +2337,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * potentially be slow (particularly when hardware acceleration is turned on * since the layer will have to be uploaded into a hardware texture after every * update.)</p> - * - * @see #getLayerType() - * @see #setLayerType(int, android.graphics.Paint) + * + * @see #getLayerType() + * @see #setLayerType(int, android.graphics.Paint) * @see #LAYER_TYPE_NONE - * @see #LAYER_TYPE_HARDWARE + * @see #LAYER_TYPE_HARDWARE */ public static final int LAYER_TYPE_SOFTWARE = 1; @@ -2253,7 +2352,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * rendering pipeline, but only if hardware acceleration is turned on for the * view hierarchy. When hardware acceleration is turned off, hardware layers * behave exactly as {@link #LAYER_TYPE_SOFTWARE software layers}.</p> - * + * * <p>A hardware layer is useful to apply a specific color filter and/or * blending mode and/or translucency to a view and all its children.</p> * <p>A hardware layer can be used to cache a complex view tree into a @@ -2263,14 +2362,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * <p>A hardware layer can also be used to increase the rendering quality when * rotation transformations are applied on a view. It can also be used to * prevent potential clipping issues when applying 3D transforms on a view.</p> - * - * @see #getLayerType() + * + * @see #getLayerType() * @see #setLayerType(int, android.graphics.Paint) * @see #LAYER_TYPE_NONE * @see #LAYER_TYPE_SOFTWARE */ public static final int LAYER_TYPE_HARDWARE = 2; - + @ViewDebug.ExportedProperty(category = "drawing", mapping = { @ViewDebug.IntToString(from = LAYER_TYPE_NONE, to = "NONE"), @ViewDebug.IntToString(from = LAYER_TYPE_SOFTWARE, to = "SOFTWARE"), @@ -2572,7 +2671,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility break; case R.styleable.View_onClick: if (context.isRestricted()) { - throw new IllegalStateException("The android:onClick attribute cannot " + throw new IllegalStateException("The android:onClick attribute cannot " + "be used within a restricted context"); } @@ -2811,19 +2910,19 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility initScrollCache(); final ScrollabilityCache scrollabilityCache = mScrollCache; - + if (scrollabilityCache.scrollBar == null) { scrollabilityCache.scrollBar = new ScrollBarDrawable(); } - + final boolean fadeScrollbars = a.getBoolean(R.styleable.View_fadeScrollbars, true); if (!fadeScrollbars) { scrollabilityCache.state = ScrollabilityCache.ON; } scrollabilityCache.fadeScrollBars = fadeScrollbars; - - + + scrollabilityCache.scrollBarFadeDuration = a.getInt( R.styleable.View_scrollbarFadeDuration, ViewConfiguration .getScrollBarFadeDuration()); @@ -2831,7 +2930,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility R.styleable.View_scrollbarDefaultDelayBeforeFade, ViewConfiguration.getScrollDefaultDelay()); - + scrollabilityCache.scrollBarSize = a.getDimensionPixelSize( com.android.internal.R.styleable.View_scrollbarSize, ViewConfiguration.get(mContext).getScaledScrollBarSize()); @@ -3067,8 +3166,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } /** - * Register a callback to be invoked when a drag event is sent to this view. - * @param l The drag listener to attach to this view + * Register a drag event listener callback object for this View. The parameter is + * an implementation of {@link android.view.View.OnDragListener}. To send a drag event to a + * View, the system calls the + * {@link android.view.View.OnDragListener#onDrag(View,DragEvent)} method. + * @param l An implementation of {@link android.view.View.OnDragListener}. */ public void setOnDragListener(OnDragListener l) { mOnDragListener = l; @@ -3279,7 +3381,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility if (mOnFocusChangeListener != null) { mOnFocusChangeListener.onFocusChange(this, gainFocus); } - + if (mAttachInfo != null) { mAttachInfo.mKeyDispatchState.reset(this); } @@ -4427,7 +4529,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility public KeyEvent.DispatcherState getKeyDispatcherState() { return mAttachInfo != null ? mAttachInfo.mKeyDispatchState : null; } - + /** * Dispatch a key event before it is processed by any input method * associated with the view hierarchy. This can be used to intercept @@ -4505,7 +4607,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * * @param event The motion event to be filtered. * @return True if the event should be dispatched, false if the event should be dropped. - * + * * @see #getFilterTouchesWhenObscured */ public boolean onFilterTouchEventForSecurity(MotionEvent event) { @@ -4622,7 +4724,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * a View moves out of the screen, it might receives a display hint indicating * the view is not displayed. Applications should not <em>rely</em> on this hint * as there is no guarantee that they will receive one. - * + * * @param hint A hint about whether or not this view is displayed: * {@link #VISIBLE} or {@link #INVISIBLE}. */ @@ -4635,7 +4737,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * a View moves out of the screen, it might receives a display hint indicating * the view is not displayed. Applications should not <em>rely</em> on this hint * as there is no guarantee that they will receive one. - * + * * @param hint A hint about whether or not this view is displayed: * {@link #VISIBLE} or {@link #INVISIBLE}. */ @@ -5119,7 +5221,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility mPrivateFlags |= PRESSED; refreshDrawableState(); } - + if (!mHasPerformedLongPress) { // This is a tap, so remove the longpress check removeLongPressCallback(); @@ -5622,7 +5724,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility /** * Returns true if the transform matrix is the identity matrix. * Recomputes the matrix if necessary. - * + * * @return True if the transform matrix is the identity matrix, false otherwise. */ final boolean hasIdentityMatrix() { @@ -5963,16 +6065,16 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility /** * <p>Sets the opacity of the view. This is a value from 0 to 1, where 0 means the view is * completely transparent and 1 means the view is completely opaque.</p> - * + * * <p>If this view overrides {@link #onSetAlpha(int)} to return true, then this view is * responsible for applying the opacity itself. Otherwise, calling this method is * equivalent to calling {@link #setLayerType(int, android.graphics.Paint)} and - * setting a hardware layer.</p> + * setting a hardware layer.</p> * * @param alpha The opacity of the view. * - * @see #setLayerType(int, android.graphics.Paint) - * + * @see #setLayerType(int, android.graphics.Paint) + * * @attr ref android.R.styleable#View_alpha */ public void setAlpha(float alpha) { @@ -6238,7 +6340,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility /** * The visual x position of this view, in pixels. This is equivalent to the * {@link #setTranslationX(float) translationX} property plus the current - * {@link #getLeft() left} property. + * {@link #getLeft() left} property. * * @return The visual x position of this view, in pixels. */ @@ -6635,7 +6737,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * provides animated scrolling, the start delay should equal the duration of * the scrolling animation. * </p> - * + * * <p> * The animation starts only if at least one of the scrollbars is enabled, * as specified by {@link #isHorizontalScrollBarEnabled()} and @@ -6644,17 +6746,17 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * started, this method calls {@link #invalidate()}; in that case the caller * should not call {@link #invalidate()}. * </p> - * + * * <p> * This method should be invoked everytime a subclass directly updates the * scroll parameters. * </p> - * + * * @param startDelay the delay, in milliseconds, after which the animation * should start; when the delay is 0, the animation starts * immediately * @return true if the animation is played, false otherwise - * + * * @see #scrollBy(int, int) * @see #scrollTo(int, int) * @see #isHorizontalScrollBarEnabled() @@ -6665,7 +6767,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility protected boolean awakenScrollBars(int startDelay) { return awakenScrollBars(startDelay, true); } - + /** * <p> * Trigger the scrollbars to draw. When invoked this method starts an @@ -6673,30 +6775,30 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * provides animated scrolling, the start delay should equal the duration of * the scrolling animation. * </p> - * + * * <p> * The animation starts only if at least one of the scrollbars is enabled, * as specified by {@link #isHorizontalScrollBarEnabled()} and * {@link #isVerticalScrollBarEnabled()}. When the animation is started, * this method returns true, and false otherwise. If the animation is - * started, this method calls {@link #invalidate()} if the invalidate parameter + * started, this method calls {@link #invalidate()} if the invalidate parameter * is set to true; in that case the caller * should not call {@link #invalidate()}. * </p> - * + * * <p> * This method should be invoked everytime a subclass directly updates the * scroll parameters. * </p> - * + * * @param startDelay the delay, in milliseconds, after which the animation * should start; when the delay is 0, the animation starts * immediately - * + * * @param invalidate Wheter this method should call invalidate - * + * * @return true if the animation is played, false otherwise - * + * * @see #scrollBy(int, int) * @see #scrollTo(int, int) * @see #isHorizontalScrollBarEnabled() @@ -6706,7 +6808,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility */ protected boolean awakenScrollBars(int startDelay, boolean invalidate) { final ScrollabilityCache scrollCache = mScrollCache; - + if (scrollCache == null || !scrollCache.fadeScrollBars) { return false; } @@ -6839,7 +6941,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility public void invalidate() { invalidate(true); } - + /** * This is where the invalidate() work actually happens. A full invalidate() * causes the drawing cache to be invalidated, but this function can be called with @@ -6901,7 +7003,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility ((View) mParent).mPrivateFlags |= INVALIDATED; } } - + /** * Used to indicate that the parent of this view should be invalidated. This functionality * is used to force the parent to rebuild its display list (when hardware-accelerated), @@ -7330,12 +7432,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility protected void recomputePadding() { setPadding(mUserPaddingLeft, mPaddingTop, mUserPaddingRight, mUserPaddingBottom); } - + /** * Define whether scrollbars will fade when the view is not scrolling. - * + * * @param fadeScrollbars wheter to enable fading - * + * */ public void setScrollbarFadingEnabled(boolean fadeScrollbars) { initScrollCache(); @@ -7347,17 +7449,17 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility scrollabilityCache.state = ScrollabilityCache.ON; } } - + /** - * + * * Returns true if scrollbars will fade when this view is not scrolling - * + * * @return true if scrollbar fading is enabled */ public boolean isScrollbarFadingEnabled() { - return mScrollCache != null && mScrollCache.fadeScrollBars; + return mScrollCache != null && mScrollCache.fadeScrollBars; } - + /** * <p>Specify the style of the scrollbars. The scrollbars can be overlaid or * inset. When inset, they add to the padding of the view. And the scrollbars @@ -7524,30 +7626,30 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * scrollbars are painted only if they have been awakened first.</p> * * @param canvas the canvas on which to draw the scrollbars - * + * * @see #awakenScrollBars(int) */ protected final void onDrawScrollBars(Canvas canvas) { // scrollbars are drawn only when the animation is running final ScrollabilityCache cache = mScrollCache; if (cache != null) { - + int state = cache.state; - + if (state == ScrollabilityCache.OFF) { return; } - + boolean invalidate = false; - + if (state == ScrollabilityCache.FADING) { // We're fading -- get our fade interpolation if (cache.interpolatorValues == null) { cache.interpolatorValues = new float[1]; } - + float[] values = cache.interpolatorValues; - + // Stops the animation if we're done if (cache.scrollBarInterpolator.timeToValues(values) == Interpolator.Result.FREEZE_END) { @@ -7555,8 +7657,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } else { cache.scrollBar.setAlpha(Math.round(values[0])); } - - // This will make the scroll bars inval themselves after + + // This will make the scroll bars inval themselves after // drawing. We only want this when we're fading so that // we prevent excessive redraws invalidate = true; @@ -7566,7 +7668,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility cache.scrollBar.setAlpha(255); } - + final int viewFlags = mViewFlags; final boolean drawHorizontalScrollBar = @@ -7586,7 +7688,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility final int inside = (viewFlags & SCROLLBARS_OUTSIDE_MASK) == 0 ? ~0 : 0; int left, top, right, bottom; - + if (drawHorizontalScrollBar) { int size = scrollBar.getSize(false); if (size <= 0) { @@ -7598,7 +7700,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility computeHorizontalScrollExtent(), false); final int verticalScrollBarGap = drawVerticalScrollBar ? getVerticalScrollbarWidth() : 0; - top = scrollY + height - size - (mUserPaddingBottom & inside); + top = scrollY + height - size - (mUserPaddingBottom & inside); left = scrollX + (mPaddingLeft & inside); right = scrollX + width - (mUserPaddingRight & inside) - verticalScrollBarGap; bottom = top + size; @@ -7842,7 +7944,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } void dispatchDetachedFromWindow() { - //System.out.println("Detached! " + this); AttachInfo info = mAttachInfo; if (info != null) { int vis = info.mWindowVisibility; @@ -7852,10 +7953,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } onDetachedFromWindow(); - if ((mPrivateFlags&SCROLL_CONTAINER_ADDED) != 0) { + + if ((mPrivateFlags & SCROLL_CONTAINER_ADDED) != 0) { mAttachInfo.mScrollContainers.remove(this); mPrivateFlags &= ~SCROLL_CONTAINER_ADDED; } + mAttachInfo = null; } @@ -7982,8 +8085,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility if (state != BaseSavedState.EMPTY_STATE && state != null) { throw new IllegalArgumentException("Wrong state class, expecting View State but " + "received " + state.getClass().toString() + " instead. This usually happens " - + "when two views of different type have the same id in the same hierarchy. " - + "This view's id is " + ViewDebug.resolveId(mContext, getId()) + ". Make sure " + + "when two views of different type have the same id in the same hierarchy. " + + "This view's id is " + ViewDebug.resolveId(mContext, getId()) + ". Make sure " + "other views do not use the same id."); } } @@ -8008,7 +8111,7 @@ 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> * @@ -8039,7 +8142,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * <p>Specifies the type of layer backing this view. The layer can be * {@link #LAYER_TYPE_NONE disabled}, {@link #LAYER_TYPE_SOFTWARE software} or * {@link #LAYER_TYPE_HARDWARE hardware}.</p> - * + * * <p>A layer is associated with an optional {@link android.graphics.Paint} * instance that controls how the layer is composed on screen. The following * properties of the paint are taken into account when composing the layer:</p> @@ -8048,35 +8151,35 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * <li>{@link android.graphics.Paint#getXfermode() Blending mode}</li> * <li>{@link android.graphics.Paint#getColorFilter() Color filter}</li> * </ul> - * + * * <p>If this view has an alpha value set to < 1.0 by calling * {@link #setAlpha(float)}, the alpha value of the layer's paint is replaced by * this view's alpha value. Calling {@link #setAlpha(float)} is therefore * equivalent to setting a hardware layer on this view and providing a paint with * the desired alpha value.<p> - * + * * <p>Refer to the documentation of {@link #LAYER_TYPE_NONE disabled}, * {@link #LAYER_TYPE_SOFTWARE software} and {@link #LAYER_TYPE_HARDWARE hardware} * for more information on when and how to use layers.</p> - * + * * @param layerType The ype of layer to use with this view, must be one of * {@link #LAYER_TYPE_NONE}, {@link #LAYER_TYPE_SOFTWARE} or * {@link #LAYER_TYPE_HARDWARE} * @param paint The paint used to compose the layer. This argument is optional * and can be null. It is ignored when the layer type is * {@link #LAYER_TYPE_NONE} - * - * @see #getLayerType() + * + * @see #getLayerType() * @see #LAYER_TYPE_NONE * @see #LAYER_TYPE_SOFTWARE * @see #LAYER_TYPE_HARDWARE - * @see #setAlpha(float) - * + * @see #setAlpha(float) + * * @attr ref android.R.styleable#View_layerType */ public void setLayerType(int layerType, Paint paint) { if (layerType < LAYER_TYPE_NONE || layerType > LAYER_TYPE_HARDWARE) { - throw new IllegalArgumentException("Layer type can only be one of: LAYER_TYPE_NONE, " + throw new IllegalArgumentException("Layer type can only be one of: LAYER_TYPE_NONE, " + "LAYER_TYPE_SOFTWARE or LAYER_TYPE_HARDWARE"); } @@ -8096,7 +8199,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility mDrawingCache.recycle(); mDrawingCache = null; } - + if (mUnscaledDrawingCache != null) { mUnscaledDrawingCache.recycle(); mUnscaledDrawingCache = null; @@ -8124,11 +8227,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * a view does not have a layer, and the layer type is {@link #LAYER_TYPE_NONE}. * Refer to the documentation of {@link #setLayerType(int, android.graphics.Paint)} * for more information on the different types of layers. - * + * * @return {@link #LAYER_TYPE_NONE}, {@link #LAYER_TYPE_SOFTWARE} or * {@link #LAYER_TYPE_HARDWARE} - * - * @see #setLayerType(int, android.graphics.Paint) + * + * @see #setLayerType(int, android.graphics.Paint) * @see #LAYER_TYPE_NONE * @see #LAYER_TYPE_SOFTWARE * @see #LAYER_TYPE_HARDWARE @@ -8136,7 +8239,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility public int getLayerType() { return mLayerType; } - + /** * <p>Returns a hardware layer that can be used to draw this view again * without executing its draw method.</p> @@ -8150,7 +8253,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility final int width = mRight - mLeft; final int height = mBottom - mTop; - + if (width == 0 || height == 0) { return null; } @@ -8177,7 +8280,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility canvas.translate(-mScrollX, -mScrollY); mPrivateFlags |= DRAWN | DRAWING_CACHE_VALID; - + // Fast path for layouts with no backgrounds if ((mPrivateFlags & SKIP_DRAW) == SKIP_DRAW) { mPrivateFlags &= ~DIRTY_MASK; @@ -8185,7 +8288,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } else { draw(canvas); } - + canvas.restoreToCount(restoreCount); } finally { canvas.onPostDraw(); @@ -8204,7 +8307,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * the cache is enabled. To benefit from the cache, you must request the drawing cache by * calling {@link #getDrawingCache()} and draw it on screen if the returned bitmap is not * null.</p> - * + * * <p>Enabling the drawing cache is similar to * {@link #setLayerType(int, android.graphics.Paint) setting a layer} when hardware * acceleration is turned off. When hardware acceleration is turned on, enabling the @@ -8222,7 +8325,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * @see #isDrawingCacheEnabled() * @see #getDrawingCache() * @see #buildDrawingCache() - * @see #setLayerType(int, android.graphics.Paint) + * @see #setLayerType(int, android.graphics.Paint) */ public void setDrawingCacheEnabled(boolean enabled) { setFlags(enabled ? DRAWING_CACHE_ENABLED : 0, DRAWING_CACHE_ENABLED); @@ -8244,7 +8347,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility /** * Debugging utility which recursively outputs the dirty state of a view and its * descendants. - * + * * @hide */ public void outputDirtyFlags(String indent, boolean clear, int clearMask) { @@ -8289,11 +8392,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } return true; } - + /** * <p>Returns a display list that can be used to draw this view again * without executing its draw method.</p> - * + * * @return A DisplayList ready to replay, or null if caching is not enabled. * * @hide @@ -8342,7 +8445,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility computeScroll(); canvas.translate(-mScrollX, -mScrollY); mPrivateFlags |= DRAWN | DRAWING_CACHE_VALID; - + // Fast path for layouts with no backgrounds if ((mPrivateFlags & SKIP_DRAW) == SKIP_DRAW) { mPrivateFlags &= ~DIRTY_MASK; @@ -8350,7 +8453,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } else { draw(canvas); } - + canvas.restoreToCount(restoreCount); } finally { canvas.onPostDraw(); @@ -8367,9 +8470,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility /** * <p>Calling this method is equivalent to calling <code>getDrawingCache(false)</code>.</p> - * + * * @return A non-scaled bitmap representing this view or null if cache is disabled. - * + * * @see #getDrawingCache(boolean) */ public Bitmap getDrawingCache() { @@ -8383,7 +8486,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * draw from the cache when the cache is enabled. To benefit from the cache, you must * request the drawing cache by calling this method and draw it on screen if the * returned bitmap is not null.</p> - * + * * <p>Note about auto scaling in compatibility mode: When auto scaling is not enabled, * this method will create a bitmap of the same size as this view. Because this bitmap * will be drawn scaled by the parent ViewGroup, the result on screen might show @@ -8391,13 +8494,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * the auto scaling to true. Doing so, however, will generate a bitmap of a different * size than the view. This implies that your application must be able to handle this * size.</p> - * + * * @param autoScale Indicates whether the generated bitmap should be scaled based on * the current density of the screen when the application is in compatibility * mode. * * @return A bitmap representing this view or null if cache is disabled. - * + * * @see #setDrawingCacheEnabled(boolean) * @see #isDrawingCacheEnabled() * @see #buildDrawingCache(boolean) @@ -8463,7 +8566,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility /** * <p>Calling this method is equivalent to calling <code>buildDrawingCache(false)</code>.</p> - * + * * @see #buildDrawingCache(boolean) */ public void buildDrawingCache() { @@ -8476,7 +8579,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * <p>If you call {@link #buildDrawingCache()} manually without calling * {@link #setDrawingCacheEnabled(boolean) setDrawingCacheEnabled(true)}, you * should cleanup the cache by calling {@link #destroyDrawingCache()} afterwards.</p> - * + * * <p>Note about auto scaling in compatibility mode: When auto scaling is not enabled, * this method will create a bitmap of the same size as this view. Because this bitmap * will be drawn scaled by the parent ViewGroup, the result on screen might show @@ -8484,10 +8587,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * the auto scaling to true. Doing so, however, will generate a bitmap of a different * size than the view. This implies that your application must be able to handle this * size.</p> - * + * * <p>You should avoid calling this method when hardware acceleration is enabled. If * you do not need the drawing cache bitmap, calling this method will increase memory - * usage and cause the view to be rendered in software once, thus negatively impacting + * usage and cause the view to be rendered in software once, thus negatively impacting * performance.</p> * * @see #getDrawingCache() @@ -8600,12 +8703,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility computeScroll(); final int restoreCount = canvas.save(); - + if (autoScale && scalingRequired) { final float scale = attachInfo.mApplicationScale; canvas.scale(scale, scale); } - + canvas.translate(-mScrollX, -mScrollY); mPrivateFlags |= DRAWN; @@ -8646,14 +8749,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility final float scale = attachInfo != null ? attachInfo.mApplicationScale : 1.0f; width = (int) ((width * scale) + 0.5f); height = (int) ((height * scale) + 0.5f); - + Bitmap bitmap = Bitmap.createBitmap(width > 0 ? width : 1, height > 0 ? height : 1, quality); if (bitmap == null) { throw new OutOfMemoryError(); } bitmap.setDensity(getResources().getDisplayMetrics().densityDpi); - + Canvas canvas; if (attachInfo != null) { canvas = attachInfo.mCanvas; @@ -8803,7 +8906,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility /** * <p>Indicates whether this view is attached to an hardware accelerated * window or not.</p> - * + * * <p>Even if this method returns true, it does not mean that every call * to {@link #draw(android.graphics.Canvas)} will be made with an hardware * accelerated {@link android.graphics.Canvas}. For instance, if this view @@ -8811,14 +8914,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * window is hardware accelerated, * {@link android.graphics.Canvas#isHardwareAccelerated()} will likely * return false, and this method will return true.</p> - * + * * @return True if the view is attached to a window and the window is * hardware accelerated; false in any other case. */ public boolean isHardwareAccelerated() { return mAttachInfo != null && mAttachInfo.mHardwareAccelerated; } - + /** * Manually render this view (and all of its children) to the given Canvas. * The view must have already done a full layout before this function is @@ -10878,28 +10981,42 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility /** */ public void dispatchSystemUiVisibilityChanged(int visibility) { - mSystemUiVisibility = visibility; if (mOnSystemUiVisibilityChangeListener != null) { - mOnSystemUiVisibilityChangeListener.onSystemUiVisibilityChange(visibility); + mOnSystemUiVisibilityChangeListener.onSystemUiVisibilityChange( + visibility & PUBLIC_STATUS_BAR_VISIBILITY_MASK); } } /** - * !!! TODO: real docs - * - * The base class implementation makes the shadow the same size and appearance - * as the view itself, and positions it with its center at the touch point. + * Creates an image that the system displays during the drag and drop + * operation. This is called a "drag shadow". The default implementation + * for a DragShadowBuilder based on a View returns an image that has exactly the same + * appearance as the given View. The default also positions the center of the drag shadow + * directly under the touch point. If no View is provided (the constructor with no parameters + * is used), and {@link #onProvideShadowMetrics(Point,Point) onProvideShadowMetrics()} and + * {@link #onDrawShadow(Canvas) onDrawShadow()} are not overriden, then the + * default is an invisible drag shadow. + * <p> + * You are not required to use the View you provide to the constructor as the basis of the + * drag shadow. The {@link #onDrawShadow(Canvas) onDrawShadow()} method allows you to draw + * anything you want as the drag shadow. + * </p> + * <p> + * You pass a DragShadowBuilder object to the system when you start the drag. The system + * calls {@link #onProvideShadowMetrics(Point,Point) onProvideShadowMetrics()} to get the + * size and position of the drag shadow. It uses this data to construct a + * {@link android.graphics.Canvas} object, then it calls {@link #onDrawShadow(Canvas) onDrawShadow()} + * so that your application can draw the shadow image in the Canvas. + * </p> */ public static class DragShadowBuilder { private final WeakReference<View> mView; /** - * Construct a shadow builder object for use with the given View object. The - * default implementation will construct a drag shadow the same size and - * appearance as the supplied View. - * - * @param view A view within the application's layout whose appearance - * should be replicated as the drag shadow. + * Constructs a shadow image builder based on a View. By default, the resulting drag + * shadow will have the same appearance and dimensions as the View, with the touch point + * over the center of the View. + * @param view A View. Any View in scope can be used. */ public DragShadowBuilder(View view) { mView = new WeakReference<View>(view); @@ -10910,7 +11027,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * constructor variant is only useful when the {@link #onProvideShadowMetrics(Point, Point)} * and {@link #onDrawShadow(Canvas)} methods are also overridden in order * to supply the drag shadow's dimensions and appearance without - * reference to any View object. + * reference to any View object. If they are not overridden, then the result is an + * invisible drag shadow. */ public DragShadowBuilder() { mView = new WeakReference<View>(null); @@ -10931,22 +11049,24 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } /** - * Provide the draggable-shadow metrics for the operation: the dimensions of - * the shadow image itself, and the point within that shadow that should + * Provides the metrics for the shadow image. These include the dimensions of + * the shadow image, and the point within that shadow that should * be centered under the touch location while dragging. * <p> * The default implementation sets the dimensions of the shadow to be the - * same as the dimensions of the View object that had been supplied to the - * {@link #View.DragShadowBuilder(View)} constructor - * when the builder object was instantiated, and centers the shadow under the touch - * point. + * same as the dimensions of the View itself and centers the shadow under + * the touch point. + * </p> + * + * @param shadowSize A {@link android.graphics.Point} containing the width and height + * of the shadow image. Your application must set {@link android.graphics.Point#x} to the + * desired width and must set {@link android.graphics.Point#y} to the desired height of the + * image. * - * @param shadowSize The application should set the {@code x} member of this - * parameter to the desired shadow width, and the {@code y} member to - * the desired height. - * @param shadowTouchPoint The application should set this point to be the - * location within the shadow that should track directly underneath - * the touch point on the screen during a drag. + * @param shadowTouchPoint A {@link android.graphics.Point} for the position within the + * shadow image that should be underneath the touch point during the drag and drop + * operation. Your application must set {@link android.graphics.Point#x} to the + * X coordinate and {@link android.graphics.Point#y} to the Y coordinate of this position. */ public void onProvideShadowMetrics(Point shadowSize, Point shadowTouchPoint) { final View view = mView.get(); @@ -10959,16 +11079,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } /** - * Draw the shadow image for the upcoming drag. The shadow canvas was - * created with the dimensions supplied by the + * Draws the shadow image. The system creates the {@link android.graphics.Canvas} object + * based on the dimensions it received from the * {@link #onProvideShadowMetrics(Point, Point)} callback. - * <p> - * The default implementation replicates the appearance of the View object - * that had been supplied to the - * {@link #View.DragShadowBuilder(View)} - * constructor when the builder object was instantiated. * - * @param canvas + * @param canvas A {@link android.graphics.Canvas} object in which to draw the shadow image. */ public void onDrawShadow(Canvas canvas) { final View view = mView.get(); @@ -10981,24 +11096,43 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } /** - * Drag and drop. App calls startDrag(), then callbacks to the shadow builder's - * {@link DragShadowBuilder#onProvideShadowMetrics(Point, Point)} and - * {@link DragShadowBuilder#onDrawShadow(Canvas)} methods happen, then the drag - * operation is handed over to the OS. - * !!! TODO: real docs - * - * @param data !!! TODO - * @param shadowBuilder !!! TODO - * @param myLocalState An arbitrary object that will be passed as part of every DragEvent - * delivered to the calling application during the course of the current drag operation. - * This object is private to the application that called startDrag(), and is not - * visible to other applications. It provides a lightweight way for the application to - * propagate information from the initiator to the recipient of a drag within its own - * application; for example, to help disambiguate between 'copy' and 'move' semantics. - * @param flags Flags affecting the drag operation. At present no flags are defined; - * pass 0 for this parameter. - * @return {@code true} if the drag operation was initiated successfully; {@code false} if - * an error prevented the drag from taking place. + * Starts a drag and drop operation. When your application calls this method, it passes a + * {@link android.view.View.DragShadowBuilder} object to the system. The + * system calls this object's {@link DragShadowBuilder#onProvideShadowMetrics(Point, Point)} + * to get metrics for the drag shadow, and then calls the object's + * {@link DragShadowBuilder#onDrawShadow(Canvas)} to draw the drag shadow itself. + * <p> + * Once the system has the drag shadow, it begins the drag and drop operation by sending + * drag events to all the View objects in your application that are currently visible. It does + * this either by calling the View object's drag listener (an implementation of + * {@link android.view.View.OnDragListener#onDrag(View,DragEvent) onDrag()} or by calling the + * View object's {@link android.view.View#onDragEvent(DragEvent) onDragEvent()} method. + * Both are passed a {@link android.view.DragEvent} object that has a + * {@link android.view.DragEvent#getAction()} value of + * {@link android.view.DragEvent#ACTION_DRAG_STARTED}. + * </p> + * <p> + * Your application can invoke startDrag() on any attached View object. The View object does not + * need to be the one used in {@link android.view.View.DragShadowBuilder}, nor does it need to + * be related to the View the user selected for dragging. + * </p> + * @param data A {@link android.content.ClipData} object pointing to the data to be + * transferred by the drag and drop operation. + * @param shadowBuilder A {@link android.view.View.DragShadowBuilder} object for building the + * drag shadow. + * @param myLocalState An {@link java.lang.Object} containing local data about the drag and + * drop operation. This Object is put into every DragEvent object sent by the system during the + * current drag. + * <p> + * myLocalState is a lightweight mechanism for the sending information from the dragged View + * to the target Views. For example, it can contain flags that differentiate between a + * a copy operation and a move operation. + * </p> + * @param flags Flags that control the drag and drop operation. No flags are currently defined, + * so the parameter should be set to 0. + * @return {@code true} if the method completes successfully, or + * {@code false} if it fails anywhere. Returning {@code false} means the system was unable to + * do a drag, and so no drag operation is in progress. */ public final boolean startDrag(ClipData data, DragShadowBuilder shadowBuilder, Object myLocalState, int flags) { @@ -11057,42 +11191,48 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility } /** - * Drag-and-drop event dispatch. The event.getAction() verb is one of the DragEvent - * constants DRAG_STARTED_EVENT, DRAG_EVENT, DROP_EVENT, and DRAG_ENDED_EVENT. - * - * For DRAG_STARTED_EVENT, event.getClipDescription() describes the content - * being dragged. onDragEvent() should return 'true' if the view can handle - * a drop of that content. A view that returns 'false' here will receive no - * further calls to onDragEvent() about the drag/drop operation. - * - * For DRAG_ENTERED, event.getClipDescription() describes the content being - * dragged. This will be the same content description passed in the - * DRAG_STARTED_EVENT invocation. - * - * For DRAG_EXITED, event.getClipDescription() describes the content being - * dragged. This will be the same content description passed in the - * DRAG_STARTED_EVENT invocation. The view should return to its approriate - * drag-acceptance visual state. - * - * For DRAG_LOCATION_EVENT, event.getX() and event.getY() give the location in View - * coordinates of the current drag point. The view must return 'true' if it - * can accept a drop of the current drag content, false otherwise. - * - * For DROP_EVENT, event.getX() and event.getY() give the location of the drop - * within the view; also, event.getClipData() returns the full data payload - * being dropped. The view should return 'true' if it consumed the dropped - * content, 'false' if it did not. - * - * For DRAG_ENDED_EVENT, the 'event' argument may be null. The view should return - * to its normal visual state. + * Handles drag events sent by the system following a call to + * {@link android.view.View#startDrag(ClipData,DragShadowBuilder,Object,int) startDrag()}. + *<p> + * When the system calls this method, it passes a + * {@link android.view.DragEvent} object. A call to + * {@link android.view.DragEvent#getAction()} returns one of the action type constants defined + * in DragEvent. The method uses these to determine what is happening in the drag and drop + * operation. + * @param event The {@link android.view.DragEvent} sent by the system. + * The {@link android.view.DragEvent#getAction()} method returns an action type constant defined + * in DragEvent, indicating the type of drag event represented by this object. + * @return {@code true} if the method was successful, otherwise {@code false}. + * <p> + * The method should return {@code true} in response to an action type of + * {@link android.view.DragEvent#ACTION_DRAG_STARTED} to receive drag events for the current + * operation. + * </p> + * <p> + * The method should also return {@code true} in response to an action type of + * {@link android.view.DragEvent#ACTION_DROP} if it consumed the drop, or + * {@code false} if it didn't. + * </p> */ public boolean onDragEvent(DragEvent event) { return false; } /** - * Views typically don't need to override dispatchDragEvent(); it just calls - * onDragEvent(event) and passes the result up appropriately. + * Detects if this View is enabled and has a drag event listener. + * If both are true, then it calls the drag event listener with the + * {@link android.view.DragEvent} it received. If the drag event listener returns + * {@code true}, then dispatchDragEvent() returns {@code true}. + * <p> + * For all other cases, the method calls the + * {@link android.view.View#onDragEvent(DragEvent) onDragEvent()} drag event handler + * method and returns its result. + * </p> + * <p> + * This ensures that a drag event is always consumed, even if the View does not have a drag + * event listener. However, if the View has a listener and the listener returns true, then + * onDragEvent() is not called. + * </p> */ public boolean dispatchDragEvent(DragEvent event) { if (mOnDragListener != null && (mViewFlags & ENABLED_MASK) == ENABLED @@ -11109,7 +11249,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility */ public void onCloseSystemDialogs(String reason) { } - + /** * Given a Drawable whose bounds have been set to draw into this view, * update a Region being computed for {@link #gatherTransparentRegion} so @@ -11441,7 +11581,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility mOriginalWindowAttachCount = mWindowAttachCount; } } - + private final class CheckForTap implements Runnable { public void run() { mPrivateFlags &= ~PREPRESSED; @@ -11463,7 +11603,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility public void hackTurnOffWindowResizeAnim(boolean off) { mAttachInfo.mTurnOffWindowResizeAnim = off; } - + /** * Interface definition for a callback to be invoked when a key event is * dispatched to this view. The callback will be invoked before the key @@ -11526,11 +11666,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * Called when a drag event is dispatched to a view. This allows listeners * to get a chance to override base View behavior. * - * @param v The view the drag has been dispatched to. - * @param event The DragEvent object containing full information - * about the event. - * @return true if the listener consumed the DragEvent, false in order to fall - * back to the view's default handling. + * @param v The View that received the drag event. + * @param event The {@link android.view.DragEvent} object for the drag event. + * @return {@code true} if the drag event was handled successfully, or {@code false} + * if the drag event was not handled. Note that {@code false} will trigger the View + * to call its {@link #onDragEvent(DragEvent) onDragEvent()} handler. */ boolean onDrag(View v, DragEvent event); } @@ -11718,7 +11858,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility boolean mHardwareAccelerated; boolean mHardwareAccelerationRequested; HardwareRenderer mHardwareRenderer; - + /** * Scale factor used by the compatibility mode */ @@ -11733,7 +11873,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * If set, ViewRoot doesn't use its lame animation for when the window resizes. */ boolean mTurnOffWindowResizeAnim; - + /** * Left position of this view's window */ @@ -11926,7 +12066,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility * instances of View.</p> */ private static class ScrollabilityCache implements Runnable { - + /** * Scrollbars are not visible */ @@ -11943,7 +12083,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility public static final int FADING = 2; public boolean fadeScrollBars; - + public int fadingEdgeLength; public int scrollBarDefaultDelayBeforeFade; public int scrollBarFadeDuration; @@ -11961,7 +12101,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility private static final float[] OPAQUE = { 255 }; private static final float[] TRANSPARENT = { 0.0f }; - + /** * When fading should start. This time moves into the future every time * a new scroll happens. Measured based on SystemClock.uptimeMillis() @@ -12006,7 +12146,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility paint.setXfermode(null); } } - + public void run() { long now = AnimationUtils.currentAnimationTimeMillis(); if (now >= fadeStartTime) { diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java index e1f6b00..ec1a373 100644 --- a/core/java/android/view/ViewRoot.java +++ b/core/java/android/view/ViewRoot.java @@ -1556,11 +1556,13 @@ public final class ViewRoot extends Handler implements ViewParent, Log.e(TAG, "OutOfResourcesException locking surface", e); // TODO: we should ask the window manager to do something! // for now we just do nothing + mLayoutRequested = true; // ask wm for a new surface next time. return; } catch (IllegalArgumentException e) { Log.e(TAG, "IllegalArgumentException locking surface", e); // TODO: we should ask the window manager to do something! // for now we just do nothing + mLayoutRequested = true; // ask wm for a new surface next time. return; } diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 02e5b63..ca932e9 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -537,7 +537,7 @@ public interface WindowManager extends ViewManager { public static final int FLAG_DITHER = 0x00001000; /** Window flag: don't allow screen shots while this window is - * displayed. */ + * displayed. Maps to Surface.SECURE. */ public static final int FLAG_SECURE = 0x00002000; /** Window flag: a special mode where the layout parameters are used diff --git a/core/java/android/view/inputmethod/InputMethodManager.java b/core/java/android/view/inputmethod/InputMethodManager.java index 7edfd7b..cb67b78 100644 --- a/core/java/android/view/inputmethod/InputMethodManager.java +++ b/core/java/android/view/inputmethod/InputMethodManager.java @@ -531,9 +531,9 @@ public final class InputMethodManager { } /** @hide */ - public void setIMEButtonVisible(IBinder imeToken, boolean visible) { + public void setImeWindowStatus(IBinder imeToken, int vis, int backDisposition) { try { - mService.setIMEButtonVisible(imeToken, visible); + mService.setImeWindowStatus(imeToken, vis, backDisposition); } catch (RemoteException e) { throw new RuntimeException(e); } diff --git a/core/java/android/webkit/CookieManager.java b/core/java/android/webkit/CookieManager.java index ff9fe1c..1fea65a 100644 --- a/core/java/android/webkit/CookieManager.java +++ b/core/java/android/webkit/CookieManager.java @@ -294,6 +294,8 @@ public final class CookieManager { */ public void setCookie(String url, String value) { if (JniUtil.useChromiumHttpStack()) { + if (url.indexOf("://") == -1) + url = "http://" + url; nativeSetCookie(url, value); return; } @@ -425,6 +427,8 @@ public final class CookieManager { */ public String getCookie(String url) { if (JniUtil.useChromiumHttpStack()) { + if (url.indexOf("://") == -1) + url = "http://" + url; return nativeGetCookie(url); } diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 6363299..9b3a56b 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -350,6 +350,7 @@ public class WebView extends AbsoluteLayout private ZoomManager mZoomManager; private Rect mGLRectViewport = new Rect(); + private boolean mGLViewportEmpty = false; /** * Transportation object for returning WebView across thread boundaries. @@ -2505,6 +2506,7 @@ public class WebView extends AbsoluteLayout // Rect.equals() checks for null input. if (!rect.equals(mLastVisibleRectSent)) { Point pos = new Point(rect.left, rect.top); + mWebViewCore.removeMessages(EventHub.SET_SCROLL_OFFSET); mWebViewCore.sendMessage(EventHub.SET_SCROLL_OFFSET, nativeMoveGeneration(), mUserScroll ? 1 : 0, pos); mLastVisibleRectSent = rect; @@ -3734,6 +3736,10 @@ public class WebView extends AbsoluteLayout return; } + if (canvas.isHardwareAccelerated()) { + mZoomManager.setHardwareAccelerated(); + } + int saveCount = canvas.save(); if (mInOverScrollMode && !getSettings() .getUseWebViewBackgroundForOverscrollBackground()) { @@ -4071,7 +4077,8 @@ public class WebView extends AbsoluteLayout } if (canvas.isHardwareAccelerated()) { - int functor = nativeGetDrawGLFunction(mGLRectViewport, getScale(), extras); + int functor = nativeGetDrawGLFunction(mGLViewportEmpty ? null : mGLRectViewport, + getScale(), extras); ((HardwareCanvas) canvas).callDrawGLFunction(functor); } else { DrawFilter df = null; @@ -5155,16 +5162,21 @@ public class WebView extends AbsoluteLayout void setGLRectViewport() { // Use the getGlobalVisibleRect() to get the intersection among the parents - getGlobalVisibleRect(mGLRectViewport); - - // Then need to invert the Y axis, just for GL - View rootView = getRootView(); - int rootViewHeight = rootView.getHeight(); - int savedWebViewBottom = mGLRectViewport.bottom; - mGLRectViewport.bottom = rootViewHeight - mGLRectViewport.top - getVisibleTitleHeight(); - mGLRectViewport.top = rootViewHeight - savedWebViewBottom; - - nativeUpdateDrawGLFunction(mGLRectViewport); + // visible == false means we're clipped - send a null rect down to indicate that + // we should not draw + boolean visible = getGlobalVisibleRect(mGLRectViewport); + if (visible) { + // Then need to invert the Y axis, just for GL + View rootView = getRootView(); + int rootViewHeight = rootView.getHeight(); + int savedWebViewBottom = mGLRectViewport.bottom; + mGLRectViewport.bottom = rootViewHeight - mGLRectViewport.top - getVisibleTitleHeight(); + mGLRectViewport.top = rootViewHeight - savedWebViewBottom; + mGLViewportEmpty = false; + } else { + mGLViewportEmpty = true; + } + nativeUpdateDrawGLFunction(mGLViewportEmpty ? null : mGLRectViewport); } /** @@ -6613,15 +6625,10 @@ public class WebView extends AbsoluteLayout * @param y New y position of the WebTextView in view coordinates */ /* package */ void scrollFocusedTextInputY(int y) { - if (!inEditingMode()) { + if (!inEditingMode() || mWebViewCore == null) { return; } - int xPos = viewToContentX((mWebTextView.getLeft() + mWebTextView.getRight()) / 2); - int yPos = viewToContentY((mWebTextView.getTop() + mWebTextView.getBottom()) / 2); - int layer = nativeScrollableLayer(xPos, yPos, null, null); - if (layer != 0) { - nativeScrollLayer(layer, 0, viewToContentDimension(y)); - } + mWebViewCore.sendMessage(EventHub.SCROLL_TEXT_INPUT, 0, viewToContentDimension(y)); } /** @@ -6824,7 +6831,7 @@ public class WebView extends AbsoluteLayout previouslyFocusedRect); } else { result = super.requestFocus(direction, previouslyFocusedRect); - if (mWebViewCore.getSettings().getNeedInitialFocus()) { + if (mWebViewCore.getSettings().getNeedInitialFocus() && !isInTouchMode()) { // For cases such as GMail, where we gain focus from a direction, // we want to move to the first available link. // FIXME: If there are no visible links, we may not want to @@ -7137,6 +7144,16 @@ public class WebView extends AbsoluteLayout setContentScrollTo(msg.arg1, msg.arg2); break; case SCROLL_TO_MSG_ID: + if (((Boolean) msg.obj).booleanValue()) { + // This scroll is intended to bring the textfield into + // view, but is only necessary if the IME is showing + InputMethodManager imm = InputMethodManager.peekInstance(); + if (imm == null || !imm.isAcceptingText() + || (!imm.isActive(WebView.this) && (!inEditingMode() + || !imm.isActive(mWebTextView)))) { + break; + } + } if (setContentScrollTo(msg.arg1, msg.arg2)) { // if we can't scroll to the exact position due to pin, // send a message to WebCore to re-scroll when we get a @@ -7968,18 +7985,15 @@ public class WebView extends AbsoluteLayout * @param node Pointer to the node touched. * @param x x-position of the touch. * @param y y-position of the touch. - * @param scrollY Only used when touching on a textarea. Otherwise, use -1. - * Tells how much the textarea is scrolled. */ private void sendMotionUp(int touchGeneration, - int frame, int node, int x, int y, int scrollY) { + int frame, int node, int x, int y) { WebViewCore.TouchUpData touchUpData = new WebViewCore.TouchUpData(); touchUpData.mMoveGeneration = touchGeneration; touchUpData.mFrame = frame; touchUpData.mNode = node; touchUpData.mX = x; touchUpData.mY = y; - touchUpData.mScrollY = scrollY; mWebViewCore.sendMessage(EventHub.TOUCH_UP, touchUpData); } diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java index 3bde000..5bdf408 100644 --- a/core/java/android/webkit/WebViewCore.java +++ b/core/java/android/webkit/WebViewCore.java @@ -559,7 +559,7 @@ final class WebViewCore { private native String nativeRetrieveImageSource(int x, int y); private native void nativeTouchUp(int touchGeneration, - int framePtr, int nodePtr, int x, int y, int scrollY); + int framePtr, int nodePtr, int x, int y); private native boolean nativeHandleTouchEvent(int action, int[] idArray, int[] xArray, int[] yArray, int count, int metaState); @@ -777,8 +777,6 @@ final class WebViewCore { int mNode; int mX; int mY; - // Used in the case of a scrolled textarea - int mScrollY; } static class TouchHighlightData { @@ -1086,8 +1084,13 @@ final class WebViewCore { break; case SCROLL_TEXT_INPUT: - nativeScrollFocusedTextInput( - ((Float) msg.obj).floatValue(), msg.arg1); + float xPercent; + if (msg.obj == null) { + xPercent = 0f; + } else { + xPercent = ((Float) msg.obj).floatValue(); + } + nativeScrollFocusedTextInput(xPercent, msg.arg2); break; case LOAD_URL: { @@ -1307,8 +1310,7 @@ final class WebViewCore { TouchUpData touchUpData = (TouchUpData) msg.obj; nativeTouchUp(touchUpData.mMoveGeneration, touchUpData.mFrame, touchUpData.mNode, - touchUpData.mX, touchUpData.mY, - touchUpData.mScrollY); + touchUpData.mX, touchUpData.mY); break; case TOUCH_EVENT: { @@ -2118,7 +2120,7 @@ final class WebViewCore { } // called by JNI - private void contentScrollTo(int x, int y) { + private void contentScrollTo(int x, int y, boolean onlyIfImeIsShowing) { if (!mBrowserFrame.firstLayoutDone()) { /* * WebKit restore state will be called before didFirstLayout(), @@ -2131,7 +2133,8 @@ final class WebViewCore { } if (mWebView != null) { Message msg = Message.obtain(mWebView.mPrivateHandler, - WebView.SCROLL_TO_MSG_ID, x, y); + WebView.SCROLL_TO_MSG_ID, x, y, + Boolean.valueOf(onlyIfImeIsShowing)); if (mDrawIsScheduled) { mEventHub.sendMessage(Message.obtain(null, EventHub.MESSAGE_RELAY, msg)); diff --git a/core/java/android/webkit/ZoomManager.java b/core/java/android/webkit/ZoomManager.java index b47fe86..efbcd58 100644 --- a/core/java/android/webkit/ZoomManager.java +++ b/core/java/android/webkit/ZoomManager.java @@ -183,6 +183,9 @@ class ZoomManager { private ScaleGestureDetector mScaleDetector; private boolean mPinchToZoomAnimating = false; + private boolean mHardwareAccelerated = false; + private boolean mInHWAcceleratedZoom = false; + public ZoomManager(WebView webView, CallbackProxy callbackProxy) { mWebView = webView; mCallbackProxy = callbackProxy; @@ -384,6 +387,10 @@ class ZoomManager { scale = getReadingLevelScale(); } + if (mHardwareAccelerated) { + mInHWAcceleratedZoom = true; + } + setZoomScale(scale, reflowText); if (oldScale != mActualScale) { @@ -447,8 +454,18 @@ class ZoomManager { - titleHeight, mWebView.getViewHeight(), Math.round(mWebView.getContentHeight() * zoomScale)) + titleHeight) + mWebView.getScrollY(); - canvas.translate(tx, ty); - canvas.scale(zoomScale, zoomScale); + if (mHardwareAccelerated) { + mWebView.updateScrollCoordinates(mWebView.getScrollX() - tx, mWebView.getScrollY() - ty); + setZoomScale(zoomScale, false); + + if (mZoomScale == 0) { + // We've reached the end of the zoom animation. + mInHWAcceleratedZoom = false; + } + } else { + canvas.translate(tx, ty); + canvas.scale(zoomScale, zoomScale); + } } public boolean isZoomAnimating() { @@ -493,12 +510,14 @@ class ZoomManager { mActualScale = scale; mInvActualScale = 1 / scale; - if (!mWebView.drawHistory()) { + if (!mWebView.drawHistory() && !mInHWAcceleratedZoom) { // If history Picture is drawn, don't update scroll. They will // be updated when we get out of that mode. // update our scroll so we don't appear to jump // i.e. keep the center of the doc in the center of the view + // If this is part of a zoom on a HW accelerated canvas, we + // have already updated the scroll so don't do it again. int oldX = mWebView.getScrollX(); int oldY = mWebView.getScrollY(); float ratio = scale * oldInvScale; @@ -1020,4 +1039,8 @@ class ZoomManager { return null; } } + + public void setHardwareAccelerated() { + mHardwareAccelerated = true; + } } diff --git a/core/java/android/widget/DatePicker.java b/core/java/android/widget/DatePicker.java index 7293572..cd3862f 100644 --- a/core/java/android/widget/DatePicker.java +++ b/core/java/android/widget/DatePicker.java @@ -30,6 +30,7 @@ import android.util.AttributeSet; import android.util.Log; import android.util.SparseArray; import android.view.LayoutInflater; +import android.view.accessibility.AccessibilityEvent; import android.widget.NumberPicker.OnValueChangeListener; import java.text.ParseException; @@ -228,36 +229,34 @@ public class DatePicker extends FrameLayout { } else { setSpinnersShown(spinnersShown); setCalendarViewShown(calendarViewShown); + } - // set the min date giving priority of the minDate over startYear - mTempDate.clear(); - if (!TextUtils.isEmpty(minDate)) { - if (!parseDate(minDate, mTempDate)) { - mTempDate.set(startYear, 0, 1); - } - } else { + // set the min date giving priority of the minDate over startYear + mTempDate.clear(); + if (!TextUtils.isEmpty(minDate)) { + if (!parseDate(minDate, mTempDate)) { mTempDate.set(startYear, 0, 1); } - mMinDate.clear(); - setMinDate(mTempDate.getTimeInMillis()); - - // set the max date giving priority of the minDate over startYear - mTempDate.clear(); - if (!TextUtils.isEmpty(maxDate)) { - if (!parseDate(maxDate, mTempDate)) { - mTempDate.set(endYear, 11, 31); - } - } else { + } else { + mTempDate.set(startYear, 0, 1); + } + setMinDate(mTempDate.getTimeInMillis()); + + // set the max date giving priority of the maxDate over endYear + mTempDate.clear(); + if (!TextUtils.isEmpty(maxDate)) { + if (!parseDate(maxDate, mTempDate)) { mTempDate.set(endYear, 11, 31); } - mMaxDate.clear(); - setMaxDate(mTempDate.getTimeInMillis()); - - // initialize to current date - mCurrentDate.setTimeInMillis(System.currentTimeMillis()); - init(mCurrentDate.get(Calendar.YEAR), mCurrentDate.get(Calendar.MONTH), mCurrentDate - .get(Calendar.DAY_OF_MONTH), null); + } else { + mTempDate.set(endYear, 11, 31); } + setMaxDate(mTempDate.getTimeInMillis()); + + // initialize to current date + mCurrentDate.setTimeInMillis(System.currentTimeMillis()); + init(mCurrentDate.get(Calendar.YEAR), mCurrentDate.get(Calendar.MONTH), mCurrentDate + .get(Calendar.DAY_OF_MONTH), null); // re-order the number spinners to match the current date format reorderSpinners(); @@ -353,6 +352,16 @@ public class DatePicker extends FrameLayout { return mIsEnabled; } + @Override + public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { + int flags = DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_WEEKDAY + | DateUtils.FORMAT_SHOW_YEAR; + String selectedDateUtterance = DateUtils.formatDateTime(mContext, + mCurrentDate.getTimeInMillis(), flags); + event.getText().add(selectedDateUtterance); + return true; + } + /** * Gets whether the {@link CalendarView} is shown. * @@ -641,6 +650,7 @@ public class DatePicker extends FrameLayout { * Notifies the listener, if such, for a change in the selected date. */ private void notifyDateChanged() { + sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED); if (mOnDateChangedListener != null) { mOnDateChangedListener.onDateChanged(this, getYear(), getMonth(), getDayOfMonth()); } diff --git a/core/java/android/widget/StackView.java b/core/java/android/widget/StackView.java index 7a74241..6a09d35 100644 --- a/core/java/android/widget/StackView.java +++ b/core/java/android/widget/StackView.java @@ -546,12 +546,16 @@ public class StackView extends AdapterViewAnimator { private void onLayout() { if (!mFirstLayoutHappened) { - mSlideAmount = Math.round(SLIDE_UP_RATIO * getMeasuredHeight()); - mSwipeThreshold = Math.round(SWIPE_THRESHOLD_RATIO * mSlideAmount); mFirstLayoutHappened = true; updateChildTransforms(); } + final int newSlideAmount = Math.round(SLIDE_UP_RATIO * getMeasuredHeight()); + if (mSlideAmount != newSlideAmount) { + mSlideAmount = newSlideAmount; + mSwipeThreshold = Math.round(SWIPE_THRESHOLD_RATIO * newSlideAmount); + } + if (Float.compare(mPerspectiveShiftY, mNewPerspectiveShiftY) != 0 || Float.compare(mPerspectiveShiftX, mNewPerspectiveShiftX) != 0) { diff --git a/core/java/android/widget/TabWidget.java b/core/java/android/widget/TabWidget.java index 51ece33..22f6f4e 100644 --- a/core/java/android/widget/TabWidget.java +++ b/core/java/android/widget/TabWidget.java @@ -66,6 +66,10 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { private final Rect mBounds = new Rect(); + // When positive, the widths and heights of tabs will be imposed so that they fit in parent + private int mImposedTabsHeight = -1; + private int[] mImposedTabWidths; + public TabWidget(Context context) { this(context, null); } @@ -132,7 +136,17 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { mRightStrip = resources.getDrawable( com.android.internal.R.drawable.tab_bottom_right_v4); } - } + } else { + // Use modern color scheme for Eclair and beyond + if (mLeftStrip == null) { + mLeftStrip = resources.getDrawable( + com.android.internal.R.drawable.tab_bottom_left); + } + if (mRightStrip == null) { + mRightStrip = resources.getDrawable( + com.android.internal.R.drawable.tab_bottom_right); + } + } // Deal with focus, as we don't want the focus to go by default // to a tab other than the current tab @@ -140,52 +154,62 @@ public class TabWidget extends LinearLayout implements OnFocusChangeListener { setOnFocusChangeListener(this); } - /** - * {@inheritDoc} - */ + @Override + void measureChildBeforeLayout(View child, int childIndex, + int widthMeasureSpec, int totalWidth, + int heightMeasureSpec, int totalHeight) { + + if (mImposedTabsHeight >= 0) { + widthMeasureSpec = MeasureSpec.makeMeasureSpec( + totalWidth + mImposedTabWidths[childIndex], MeasureSpec.EXACTLY); + heightMeasureSpec = MeasureSpec.makeMeasureSpec(mImposedTabsHeight, + MeasureSpec.EXACTLY); + } + + super.measureChildBeforeLayout(child, childIndex, + widthMeasureSpec, totalWidth, heightMeasureSpec, totalHeight); + } + @Override void measureHorizontal(int widthMeasureSpec, int heightMeasureSpec) { - // First measure with no constraint + // First, measure with no constraint final int unspecifiedWidth = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); super.measureHorizontal(unspecifiedWidth, heightMeasureSpec); + mImposedTabsHeight = -1; - final int count = getChildCount(); - int totalWidth = 0; - int totalCount = 0; - for (int i = 0; i < count; i++) { - final View child = getChildAt(i); - if (child.getVisibility() == GONE) { - continue; - } - final int childWidth = child.getMeasuredWidth(); - totalWidth += childWidth; - totalCount++; - } + int extraWidth = getMeasuredWidth() - MeasureSpec.getSize(widthMeasureSpec); + if (extraWidth > 0) { + final int count = getChildCount(); - final int width = MeasureSpec.getSize(widthMeasureSpec); - if (totalWidth > width && totalCount > 0) { - int extraWidth = totalWidth - width; + int childCount = 0; for (int i = 0; i < count; i++) { final View child = getChildAt(i); - if (child.getVisibility() == GONE) { - continue; - } - final int childWidth = child.getMeasuredWidth(); - final int delta = extraWidth / totalCount; - final int tabWidth = Math.max(0, childWidth - delta); - - final int tabWidthMeasureSpec = MeasureSpec.makeMeasureSpec( - tabWidth, MeasureSpec.EXACTLY); - final int tabHeightMeasureSpec = MeasureSpec.makeMeasureSpec( - child.getMeasuredHeight(), MeasureSpec.EXACTLY); - - child.measure(tabWidthMeasureSpec, tabHeightMeasureSpec); + if (child.getVisibility() == GONE) continue; + childCount++; + } - // Make sure the extra width is evenly distributed, avoiding int division remainder - extraWidth -= delta; - totalCount--; + if (childCount > 0) { + if (mImposedTabWidths == null || mImposedTabWidths.length != count) { + mImposedTabWidths = new int[count]; + } + for (int i = 0; i < count; i++) { + final View child = getChildAt(i); + if (child.getVisibility() == GONE) continue; + final int childWidth = child.getMeasuredWidth(); + final int delta = extraWidth / childCount; + final int newWidth = Math.max(0, childWidth - delta); + mImposedTabWidths[i] = newWidth; + // Make sure the extra width is evenly distributed, no int division remainder + extraWidth -= childWidth - newWidth; // delta may have been clamped + childCount--; + mImposedTabsHeight = Math.max(mImposedTabsHeight, child.getMeasuredHeight()); + } } - setMeasuredDimension(width, getMeasuredHeight()); + } + + // Measure again, this time with imposed tab widths and respecting initial spec request + if (mImposedTabsHeight >= 0 || unspecifiedWidth != widthMeasureSpec) { + super.measureHorizontal(widthMeasureSpec, heightMeasureSpec); } } diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index b217052..772eefd 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -3489,8 +3489,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener com.android.internal.R.layout.textview_hint, null); final float scale = getResources().getDisplayMetrics().density; - mPopup = new ErrorPopup(err, (int) (200 * scale + 0.5f), - (int) (50 * scale + 0.5f)); + mPopup = new ErrorPopup(err, (int) (200 * scale + 0.5f), (int) (50 * scale + 0.5f)); mPopup.setFocusable(false); // The user is entering text, so the input method is needed. We // don't want the popup to be displayed on top of it. @@ -3514,6 +3513,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener ErrorPopup(TextView v, int width, int height) { super(v, width, height); mView = v; + // Make sure the TextView has a background set as it will be used the first time it is + // shown and positionned. Initialized with below background, which should have + // dimensions identical to the above version for this to work (and is more likely). + mPopupInlineErrorBackgroundId = getResourceId(mPopupInlineErrorBackgroundId, + com.android.internal.R.styleable.Theme_errorMessageBackground); + mView.setBackgroundResource(mPopupInlineErrorBackgroundId); } void fixDirection(boolean above) { @@ -3521,18 +3526,21 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener if (above) { mPopupInlineErrorAboveBackgroundId = - getResourceId(mPopupInlineErrorAboveBackgroundId, com.android.internal.R.styleable.Theme_errorMessageAboveBackground); + getResourceId(mPopupInlineErrorAboveBackgroundId, + com.android.internal.R.styleable.Theme_errorMessageAboveBackground); } else { - mPopupInlineErrorBackgroundId = - getResourceId(mPopupInlineErrorBackgroundId, com.android.internal.R.styleable.Theme_errorMessageBackground); + mPopupInlineErrorBackgroundId = getResourceId(mPopupInlineErrorBackgroundId, + com.android.internal.R.styleable.Theme_errorMessageBackground); } - mView.setBackgroundResource(above ? mPopupInlineErrorAboveBackgroundId : mPopupInlineErrorBackgroundId); + mView.setBackgroundResource(above ? mPopupInlineErrorAboveBackgroundId : + mPopupInlineErrorBackgroundId); } private int getResourceId(int currentId, int index) { if (currentId == 0) { - TypedArray styledAttributes = mView.getContext().obtainStyledAttributes(R.styleable.Theme); + TypedArray styledAttributes = mView.getContext().obtainStyledAttributes( + R.styleable.Theme); currentId = styledAttributes.getResourceId(index, 0); styledAttributes.recycle(); } @@ -3562,9 +3570,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener final float scale = getResources().getDisplayMetrics().density; final Drawables dr = mDrawables; - return getWidth() - mPopup.getWidth() - - getPaddingRight() - - (dr != null ? dr.mDrawableSizeRight : 0) / 2 + (int) (25 * scale + 0.5f); + return getWidth() - mPopup.getWidth() - getPaddingRight() - + (dr != null ? dr.mDrawableSizeRight : 0) / 2 + (int) (25 * scale + 0.5f); } /** @@ -3576,20 +3583,20 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * Compound, not extended, because the icon is not clipped * if the text height is smaller. */ - int vspace = mBottom - mTop - - getCompoundPaddingBottom() - getCompoundPaddingTop(); + final int compoundPaddingTop = getCompoundPaddingTop(); + int vspace = mBottom - mTop - getCompoundPaddingBottom() - compoundPaddingTop; final Drawables dr = mDrawables; - int icontop = getCompoundPaddingTop() - + (vspace - (dr != null ? dr.mDrawableHeightRight : 0)) / 2; + int icontop = compoundPaddingTop + + (vspace - (dr != null ? dr.mDrawableHeightRight : 0)) / 2; /* * The "2" is the distance between the point and the top edge * of the background. */ - - return icontop + (dr != null ? dr.mDrawableHeightRight : 0) - - getHeight() - 2; + final float scale = getResources().getDisplayMetrics().density; + return icontop + (dr != null ? dr.mDrawableHeightRight : 0) - getHeight() - + (int) (2 * scale + 0.5f); } private void hideError() { @@ -4608,9 +4615,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mInput.onKeyDown(this, (Editable)mText, keyCode, down); mInput.onKeyUp(this, (Editable)mText, keyCode, up); } - if (mError != null && !mErrorWasChanged) { - setError(null, null); - } + hideErrorIfUnchanged(); } else if (which == 2) { mMovement.onKeyUp(this, (Spannable)mText, keyCode, up); @@ -4731,23 +4736,14 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } if (mInput != null) { - /* - * Keep track of what the error was before doing the input - * so that if an input filter changed the error, we leave - * that error showing. Otherwise, we take down whatever - * error was showing when the user types something. - */ - mErrorWasChanged = false; + resetErrorChangedFlag(); boolean doDown = true; if (otherEvent != null) { try { beginBatchEdit(); - boolean handled = mInput.onKeyOther(this, (Editable) mText, - otherEvent); - if (mError != null && !mErrorWasChanged) { - setError(null, null); - } + final boolean handled = mInput.onKeyOther(this, (Editable) mText, otherEvent); + hideErrorIfUnchanged(); doDown = false; if (handled) { return -1; @@ -4762,14 +4758,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener if (doDown) { beginBatchEdit(); - if (mInput.onKeyDown(this, (Editable) mText, keyCode, event)) { - endBatchEdit(); - if (mError != null && !mErrorWasChanged) { - setError(null, null); - } - return 1; - } + final boolean handled = mInput.onKeyDown(this, (Editable) mText, keyCode, event); endBatchEdit(); + hideErrorIfUnchanged(); + if (handled) return 1; } } @@ -4800,6 +4792,30 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener return 0; } + /** + * Resets the mErrorWasChanged flag, so that future calls to {@link #setError(CharSequence)} + * can be recorded. + * @hide + */ + public void resetErrorChangedFlag() { + /* + * Keep track of what the error was before doing the input + * so that if an input filter changed the error, we leave + * that error showing. Otherwise, we take down whatever + * error was showing when the user types something. + */ + mErrorWasChanged = false; + } + + /** + * @hide + */ + public void hideErrorIfUnchanged() { + if (mError != null && !mErrorWasChanged) { + setError(null, null); + } + } + @Override public boolean onKeyUp(int keyCode, KeyEvent event) { if (!isEnabled()) { @@ -5763,11 +5779,10 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener int want = width - getCompoundPaddingLeft() - getCompoundPaddingRight(); int unpaddedWidth = want; - int hintWant = want; - if (mHorizontallyScrolling) - want = VERY_WIDE; + if (mHorizontallyScrolling) want = VERY_WIDE; + int hintWant = want; int hintWidth = mHintLayout == null ? hintWant : mHintLayout.getWidth(); if (mLayout == null) { @@ -5846,6 +5861,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } desired += pad; + layout.setMaximumVisibleLineCount(0); if (mMaxMode == LINES) { /* @@ -5854,8 +5870,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener */ if (cap) { if (linecount > mMaximum) { - desired = layout.getLineTop(mMaximum) + - layout.getBottomPadding(); + layout.setMaximumVisibleLineCount(mMaximum); + desired = layout.getLineTop(mMaximum); if (dr != null) { desired = Math.max(desired, dr.mDrawableHeightLeft); @@ -6423,7 +6439,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener if (applyTransformation) { setTransformationMethod(SingleLineTransformationMethod.getInstance()); } - // TODO setState } else { if (changeMaxLines) { setMaxLines(Integer.MAX_VALUE); @@ -6432,7 +6447,6 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener if (applyTransformation) { setTransformationMethod(null); } - // TODO setState } } @@ -7349,7 +7363,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener stopSelectionActionMode(); boolean selectAllGotFocus = mSelectAllOnFocus && mTouchFocusSelected; - if (hasInsertionController() && !selectAllGotFocus) { + if (hasInsertionController() && !selectAllGotFocus && mText.length() > 0) { getInsertionController().show(); } } @@ -7379,12 +7393,18 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener if (!mInsertionControllerEnabled) { hideInsertionPointCursorController(); - mInsertionPointCursorController = null; + if (mInsertionPointCursorController != null) { + mInsertionPointCursorController.onDetached(); + mInsertionPointCursorController = null; + } } if (!mSelectionControllerEnabled) { stopSelectionActionMode(); - mSelectionModifierCursorController = null; + if (mSelectionModifierCursorController != null) { + mSelectionModifierCursorController.onDetached(); + mSelectionModifierCursorController = null; + } } } @@ -8866,6 +8886,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mLastParentX = coords[0]; mLastParentY = coords[1]; mIsDragging = true; + if (mIsInsertionHandle) { + mTouchTimer = SystemClock.uptimeMillis(); + } break; } @@ -9014,6 +9037,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener if (offset != previousOffset) { updateOffset(handle, offset); + removePastePopupCallback(); } hideDelayed(); } diff --git a/core/java/android/widget/TimePicker.java b/core/java/android/widget/TimePicker.java index 2688b95..18d1825 100644 --- a/core/java/android/widget/TimePicker.java +++ b/core/java/android/widget/TimePicker.java @@ -23,9 +23,11 @@ import android.content.Context; import android.content.res.TypedArray; import android.os.Parcel; import android.os.Parcelable; +import android.text.format.DateUtils; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; +import android.view.accessibility.AccessibilityEvent; import android.widget.NumberPicker.OnValueChangeListener; import java.text.DateFormatSymbols; @@ -88,6 +90,8 @@ public class TimePicker extends FrameLayout { // callbacks private OnTimeChangedListener mOnTimeChangedListener; + private Calendar mTempCalendar; + /** * The callback interface used to indicate the time has been adjusted. */ @@ -128,12 +132,8 @@ public class TimePicker extends FrameLayout { mHourSpinner.setOnValueChangedListener(new NumberPicker.OnValueChangeListener() { public void onValueChange(NumberPicker spinner, int oldVal, int newVal) { if (!is24HourView()) { - int minValue = mHourSpinner.getMinValue(); - int maxValue = mHourSpinner.getMaxValue(); - // toggle AM/PM if the spinner has wrapped and not in 24 - // format - if ((oldVal == maxValue && newVal == minValue) - || (oldVal == minValue && newVal == maxValue)) { + if ((oldVal == HOURS_IN_HALF_DAY - 1 && newVal == HOURS_IN_HALF_DAY) + || (oldVal == HOURS_IN_HALF_DAY && newVal == HOURS_IN_HALF_DAY - 1)) { mIsAm = !mIsAm; updateAmPmControl(); } @@ -159,21 +159,19 @@ public class TimePicker extends FrameLayout { int minValue = mMinuteSpinner.getMinValue(); int maxValue = mMinuteSpinner.getMaxValue(); if (oldVal == maxValue && newVal == minValue) { - int currentHour = mHourSpinner.getValue(); - // toggle AM/PM if the spinner is about to wrap - if (!is24HourView() && currentHour == mHourSpinner.getMaxValue()) { + int newHour = mHourSpinner.getValue() + 1; + if (!is24HourView() && newHour == HOURS_IN_HALF_DAY) { mIsAm = !mIsAm; updateAmPmControl(); } - mHourSpinner.setValue(currentHour + 1); + mHourSpinner.setValue(newHour); } else if (oldVal == minValue && newVal == maxValue) { - int currentHour = mHourSpinner.getValue(); - // toggle AM/PM if the spinner is about to wrap - if (!is24HourView() && currentHour == mHourSpinner.getMinValue()) { + int newHour = mHourSpinner.getValue() - 1; + if (!is24HourView() && newHour == HOURS_IN_HALF_DAY - 1) { mIsAm = !mIsAm; updateAmPmControl(); } - mHourSpinner.setValue(currentHour - 1); + mHourSpinner.setValue(newHour); } onTimeChanged(); } @@ -214,12 +212,12 @@ public class TimePicker extends FrameLayout { updateAmPmControl(); // initialize to current time - Calendar calendar = Calendar.getInstance(); + mTempCalendar = Calendar.getInstance(); setOnTimeChangedListener(NO_OP_CHANGE_LISTENER); // set to current time - setCurrentHour(calendar.get(Calendar.HOUR_OF_DAY)); - setCurrentMinute(calendar.get(Calendar.MINUTE)); + setCurrentHour(mTempCalendar.get(Calendar.HOUR_OF_DAY)); + setCurrentMinute(mTempCalendar.get(Calendar.MINUTE)); if (!isEnabled()) { setEnabled(false); @@ -326,10 +324,12 @@ public class TimePicker extends FrameLayout { */ public Integer getCurrentHour() { int currentHour = mHourSpinner.getValue(); - if (is24HourView() || mIsAm) { + if (is24HourView()) { return currentHour; + } else if (mIsAm) { + return currentHour % HOURS_IN_HALF_DAY; } else { - return (currentHour == HOURS_IN_HALF_DAY) ? 0 : currentHour + HOURS_IN_HALF_DAY; + return (currentHour % HOURS_IN_HALF_DAY) + HOURS_IN_HALF_DAY; } } @@ -343,14 +343,16 @@ public class TimePicker extends FrameLayout { } if (!is24HourView()) { // convert [0,23] ordinal to wall clock display - if (currentHour > HOURS_IN_HALF_DAY) { - currentHour -= HOURS_IN_HALF_DAY; + if (currentHour >= HOURS_IN_HALF_DAY) { mIsAm = false; + if (currentHour > HOURS_IN_HALF_DAY) { + currentHour = currentHour - HOURS_IN_HALF_DAY; + } } else { + mIsAm = true; if (currentHour == 0) { currentHour = HOURS_IN_HALF_DAY; } - mIsAm = true; } updateAmPmControl(); } @@ -406,6 +408,22 @@ public class TimePicker extends FrameLayout { return mHourSpinner.getBaseline(); } + @Override + public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { + int flags = DateUtils.FORMAT_SHOW_TIME; + if (mIs24HourView) { + flags |= DateUtils.FORMAT_24HOUR; + } else { + flags |= DateUtils.FORMAT_12HOUR; + } + mTempCalendar.set(Calendar.HOUR_OF_DAY, getCurrentHour()); + mTempCalendar.set(Calendar.MINUTE, getCurrentMinute()); + String selectedDateUtterance = DateUtils.formatDateTime(mContext, + mTempCalendar.getTimeInMillis(), flags); + event.getText().add(selectedDateUtterance); + return true; + } + private void updateHourControl() { if (is24HourView()) { mHourSpinner.setMinValue(0); @@ -435,9 +453,11 @@ public class TimePicker extends FrameLayout { mAmPmButton.setVisibility(View.VISIBLE); } } + sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED); } private void onTimeChanged() { + sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED); if (mOnTimeChangedListener != null) { mOnTimeChangedListener.onTimeChanged(this, getCurrentHour(), getCurrentMinute()); } diff --git a/core/java/com/android/internal/app/ActionBarImpl.java b/core/java/com/android/internal/app/ActionBarImpl.java index b1b5d71..471a5a9 100644 --- a/core/java/com/android/internal/app/ActionBarImpl.java +++ b/core/java/com/android/internal/app/ActionBarImpl.java @@ -480,12 +480,12 @@ public class ActionBarImpl extends ActionBar { @Override public void show() { - if (mContainerView.getVisibility() == View.VISIBLE) { - return; - } if (mCurrentAnim != null) { mCurrentAnim.end(); } + if (mContainerView.getVisibility() == View.VISIBLE) { + return; + } mContainerView.setVisibility(View.VISIBLE); mContainerView.setAlpha(0); AnimatorSet anim = new AnimatorSet(); diff --git a/core/java/com/android/internal/statusbar/IStatusBar.aidl b/core/java/com/android/internal/statusbar/IStatusBar.aidl index 1cc068f..7f23ed5 100644 --- a/core/java/com/android/internal/statusbar/IStatusBar.aidl +++ b/core/java/com/android/internal/statusbar/IStatusBar.aidl @@ -32,6 +32,7 @@ oneway interface IStatusBar void animateCollapse(); void setLightsOn(boolean on); void setMenuKeyVisible(boolean visible); - void setIMEButtonVisible(in IBinder token, boolean visible); + void setImeWindowStatus(in IBinder token, int vis, int backDisposition); + void setHardKeyboardStatus(boolean available, boolean enabled); } diff --git a/core/java/com/android/internal/statusbar/IStatusBarService.aidl b/core/java/com/android/internal/statusbar/IStatusBarService.aidl index d1ea52e..d6ca426 100644 --- a/core/java/com/android/internal/statusbar/IStatusBarService.aidl +++ b/core/java/com/android/internal/statusbar/IStatusBarService.aidl @@ -31,7 +31,7 @@ interface IStatusBarService void setIconVisibility(String slot, boolean visible); void removeIcon(String slot); void setMenuKeyVisible(boolean visible); - void setIMEButtonVisible(in IBinder token, boolean visible); + void setImeWindowStatus(in IBinder token, int vis, int backDisposition); // ---- Methods below are for use by the status bar policy services ---- // You need the STATUS_BAR_SERVICE permission @@ -45,4 +45,5 @@ interface IStatusBarService void onClearAllNotifications(); void onNotificationClear(String pkg, String tag, int id); void setSystemUiVisibility(int vis); + void setHardKeyboardEnabled(boolean enabled); } diff --git a/core/java/com/android/internal/view/IInputMethodManager.aidl b/core/java/com/android/internal/view/IInputMethodManager.aidl index b2fbd3a..611d987 100644 --- a/core/java/com/android/internal/view/IInputMethodManager.aidl +++ b/core/java/com/android/internal/view/IInputMethodManager.aidl @@ -59,7 +59,7 @@ interface IInputMethodManager { void hideMySoftInput(in IBinder token, int flags); void showMySoftInput(in IBinder token, int flags); void updateStatusIcon(in IBinder token, String packageName, int iconId); - void setIMEButtonVisible(in IBinder token, boolean visible); + void setImeWindowStatus(in IBinder token, int vis, int backDisposition); InputMethodSubtype getCurrentInputMethodSubtype(); boolean setCurrentInputMethodSubtype(in InputMethodSubtype subtype); boolean switchToLastInputMethod(in IBinder token); diff --git a/core/java/com/android/internal/widget/EditableInputConnection.java b/core/java/com/android/internal/widget/EditableInputConnection.java index e992e7c..9f9f020 100644 --- a/core/java/com/android/internal/widget/EditableInputConnection.java +++ b/core/java/com/android/internal/widget/EditableInputConnection.java @@ -138,9 +138,9 @@ public class EditableInputConnection extends BaseInputConnection { return super.commitText(text, newCursorPosition); } - CharSequence errorBefore = mTextView.getError(); + mTextView.resetErrorChangedFlag(); boolean success = super.commitText(text, newCursorPosition); - CharSequence errorAfter = mTextView.getError(); + mTextView.hideErrorIfUnchanged(); return success; } diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java index bf59753..2621dd0 100644 --- a/core/java/com/android/internal/widget/LockPatternUtils.java +++ b/core/java/com/android/internal/widget/LockPatternUtils.java @@ -16,13 +16,19 @@ package com.android.internal.widget; +import com.android.internal.R; +import com.android.internal.telephony.ITelephony; +import com.google.android.collect.Lists; + import android.app.admin.DevicePolicyManager; import android.content.ContentResolver; import android.content.Context; import android.os.FileObserver; +import android.os.IBinder; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemClock; +import android.os.storage.IMountService; import android.provider.Settings; import android.security.MessageDigest; import android.telephony.TelephonyManager; @@ -30,10 +36,6 @@ import android.text.TextUtils; import android.util.Log; import android.widget.Button; -import com.android.internal.R; -import com.android.internal.telephony.ITelephony; -import com.google.android.collect.Lists; - import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; @@ -139,6 +141,7 @@ public class LockPatternUtils { int fileObserverMask = FileObserver.CLOSE_WRITE | FileObserver.DELETE | FileObserver.MOVED_TO | FileObserver.CREATE; sPasswordObserver = new FileObserver(dataSystemDirectory, fileObserverMask) { + @Override public void onEvent(int event, String path) { if (LOCK_PATTERN_FILE.equals(path)) { Log.d(TAG, "lock pattern file changed"); @@ -439,6 +442,27 @@ public class LockPatternUtils { return DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED; } + /** Update the encryption password if it is enabled **/ + private void updateEncryptionPassword(String password) { + DevicePolicyManager dpm = getDevicePolicyManager(); + if (dpm.getStorageEncryptionStatus() != DevicePolicyManager.ENCRYPTION_STATUS_ACTIVE) { + return; + } + + IBinder service = ServiceManager.getService("mount"); + if (service == null) { + Log.e(TAG, "Could not find the mount service to update the encryption password"); + return; + } + + IMountService mountService = IMountService.Stub.asInterface(service); + try { + mountService.changeEncryptionPassword(password); + } catch (RemoteException e) { + Log.e(TAG, "Error changing encryption password", e); + } + } + /** * Save a lock password. Does not ensure that the password is as good * as the requested mode, but will adjust the mode to be as good as the @@ -461,6 +485,9 @@ public class LockPatternUtils { raf.close(); DevicePolicyManager dpm = getDevicePolicyManager(); if (password != null) { + // Update the encryption password. + updateEncryptionPassword(password); + int computedQuality = computePasswordQuality(password); setLong(PASSWORD_TYPE_KEY, Math.max(quality, computedQuality)); if (computedQuality != DevicePolicyManager.PASSWORD_QUALITY_UNSPECIFIED) { diff --git a/core/res/res/anim/lock_screen_behind_enter.xml b/core/res/res/anim/lock_screen_behind_enter.xml index c01e265..6c7782e 100644 --- a/core/res/res/anim/lock_screen_behind_enter.xml +++ b/core/res/res/anim/lock_screen_behind_enter.xml @@ -3,21 +3,34 @@ /* ** Copyright 2007, 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 +** 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 +** 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 +** 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. */ --> -<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@interpolator/accelerate_cubic"> - <alpha android:fromAlpha="0.0" android:toAlpha="1.0" - android:duration="@android:integer/config_activityDefaultDur" /> -</set> +<set xmlns:android="http://schemas.android.com/apk/res/android" + android:detachWallpaper="true" android:shareInterpolator="false"> + <scale + android:fromXScale="0.9" android:toXScale="1.0" + android:fromYScale="0.9" android:toYScale="1.0" + android:pivotX="50%p" android:pivotY="50%p" + android:fillEnabled="true" android:fillBefore="true" + android:interpolator="@interpolator/decelerate_cubic" + android:startOffset="@android:integer/config_mediumAnimTime" + android:duration="@android:integer/config_mediumAnimTime" /> + <alpha + android:fromAlpha="0" android:toAlpha="1.0" + android:fillEnabled="true" android:fillBefore="true" + android:interpolator="@interpolator/decelerate_quad" + android:startOffset="@android:integer/config_mediumAnimTime" + android:duration="@android:integer/config_mediumAnimTime"/> +</set>
\ No newline at end of file diff --git a/core/res/res/anim/lock_screen_exit.xml b/core/res/res/anim/lock_screen_exit.xml index 44ca736..d9c3a33 100644 --- a/core/res/res/anim/lock_screen_exit.xml +++ b/core/res/res/anim/lock_screen_exit.xml @@ -3,22 +3,33 @@ /* ** Copyright 2007, 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 +** 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 +** 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 +** 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. */ --> <set xmlns:android="http://schemas.android.com/apk/res/android" - android:interpolator="@interpolator/decelerate_cubic"> - <alpha android:fromAlpha="1.0" android:toAlpha="0.0" - android:duration="@android:integer/config_activityDefaultDur" /> -</set> + android:zAdjustment="top" + android:shareInterpolator="false"> + <scale + android:fromXScale="1.0" android:toXScale="1.2" + android:fromYScale="1.0" android:toYScale="1.2" + android:pivotX="50%p" android:pivotY="50%p" + android:fillEnabled="true" android:fillAfter="true" + android:interpolator="@interpolator/accelerate_quint" + android:duration="@android:integer/config_mediumAnimTime" /> + <alpha + android:fromAlpha="1.0" android:toAlpha="0" + android:fillEnabled="true" android:fillAfter="true" + android:interpolator="@interpolator/accelerate_quad" + android:duration="@android:integer/config_mediumAnimTime"/> +</set>
\ No newline at end of file diff --git a/core/res/res/drawable-hdpi/ic_menu_account_list.png b/core/res/res/drawable-hdpi/ic_menu_account_list.png Binary files differindex f858d2c..0f17170 100644 --- a/core/res/res/drawable-hdpi/ic_menu_account_list.png +++ b/core/res/res/drawable-hdpi/ic_menu_account_list.png diff --git a/core/res/res/drawable-hdpi/ic_menu_add.png b/core/res/res/drawable-hdpi/ic_menu_add.png Binary files differindex 65cc01e..444e8a5 100644 --- a/core/res/res/drawable-hdpi/ic_menu_add.png +++ b/core/res/res/drawable-hdpi/ic_menu_add.png diff --git a/core/res/res/drawable-hdpi/ic_menu_agenda.png b/core/res/res/drawable-hdpi/ic_menu_agenda.png Binary files differindex 6bb5cc8..9e08c29 100644 --- a/core/res/res/drawable-hdpi/ic_menu_agenda.png +++ b/core/res/res/drawable-hdpi/ic_menu_agenda.png diff --git a/core/res/res/drawable-hdpi/ic_menu_allfriends.png b/core/res/res/drawable-hdpi/ic_menu_allfriends.png Binary files differindex 8d11ca1..c42e96e 100644 --- a/core/res/res/drawable-hdpi/ic_menu_allfriends.png +++ b/core/res/res/drawable-hdpi/ic_menu_allfriends.png diff --git a/core/res/res/drawable-hdpi/ic_menu_always_landscape_portrait.png b/core/res/res/drawable-hdpi/ic_menu_always_landscape_portrait.png Binary files differindex 7ae1760..be3d314 100644 --- a/core/res/res/drawable-hdpi/ic_menu_always_landscape_portrait.png +++ b/core/res/res/drawable-hdpi/ic_menu_always_landscape_portrait.png diff --git a/core/res/res/drawable-hdpi/ic_menu_archive.png b/core/res/res/drawable-hdpi/ic_menu_archive.png Binary files differindex 9ca5c62..e2d9bc1 100644 --- a/core/res/res/drawable-hdpi/ic_menu_archive.png +++ b/core/res/res/drawable-hdpi/ic_menu_archive.png diff --git a/core/res/res/drawable-hdpi/ic_menu_attachment.png b/core/res/res/drawable-hdpi/ic_menu_attachment.png Binary files differindex 8f11153..4a37115 100644 --- a/core/res/res/drawable-hdpi/ic_menu_attachment.png +++ b/core/res/res/drawable-hdpi/ic_menu_attachment.png diff --git a/core/res/res/drawable-hdpi/ic_menu_back.png b/core/res/res/drawable-hdpi/ic_menu_back.png Binary files differindex a6cd712..661a4ae 100644 --- a/core/res/res/drawable-hdpi/ic_menu_back.png +++ b/core/res/res/drawable-hdpi/ic_menu_back.png diff --git a/core/res/res/drawable-hdpi/ic_menu_block.png b/core/res/res/drawable-hdpi/ic_menu_block.png Binary files differindex e1f9c2c..826c094 100644 --- a/core/res/res/drawable-hdpi/ic_menu_block.png +++ b/core/res/res/drawable-hdpi/ic_menu_block.png diff --git a/core/res/res/drawable-hdpi/ic_menu_blocked_user.png b/core/res/res/drawable-hdpi/ic_menu_blocked_user.png Binary files differindex 3dd9a4a..7ca5c6f 100644 --- a/core/res/res/drawable-hdpi/ic_menu_blocked_user.png +++ b/core/res/res/drawable-hdpi/ic_menu_blocked_user.png diff --git a/core/res/res/drawable-hdpi/ic_menu_btn_add.png b/core/res/res/drawable-hdpi/ic_menu_btn_add.png Binary files differnew file mode 100644 index 0000000..444e8a5 --- /dev/null +++ b/core/res/res/drawable-hdpi/ic_menu_btn_add.png diff --git a/core/res/res/drawable-hdpi/ic_menu_call.png b/core/res/res/drawable-hdpi/ic_menu_call.png Binary files differindex 2ccc087..f28c53935 100644 --- a/core/res/res/drawable-hdpi/ic_menu_call.png +++ b/core/res/res/drawable-hdpi/ic_menu_call.png diff --git a/core/res/res/drawable-hdpi/ic_menu_camera.png b/core/res/res/drawable-hdpi/ic_menu_camera.png Binary files differindex 5a3850f..4936d15 100644 --- a/core/res/res/drawable-hdpi/ic_menu_camera.png +++ b/core/res/res/drawable-hdpi/ic_menu_camera.png diff --git a/core/res/res/drawable-hdpi/ic_menu_cc.png b/core/res/res/drawable-hdpi/ic_menu_cc.png Binary files differindex 47905a5..18b2004 100644 --- a/core/res/res/drawable-hdpi/ic_menu_cc.png +++ b/core/res/res/drawable-hdpi/ic_menu_cc.png diff --git a/core/res/res/drawable-hdpi/ic_menu_chat_dashboard.png b/core/res/res/drawable-hdpi/ic_menu_chat_dashboard.png Binary files differindex dde6741..1f26180 100644 --- a/core/res/res/drawable-hdpi/ic_menu_chat_dashboard.png +++ b/core/res/res/drawable-hdpi/ic_menu_chat_dashboard.png diff --git a/core/res/res/drawable-hdpi/ic_menu_clear_playlist.png b/core/res/res/drawable-hdpi/ic_menu_clear_playlist.png Binary files differindex e6be48b..84a4a5b 100644 --- a/core/res/res/drawable-hdpi/ic_menu_clear_playlist.png +++ b/core/res/res/drawable-hdpi/ic_menu_clear_playlist.png diff --git a/core/res/res/drawable-hdpi/ic_menu_close_clear_cancel.png b/core/res/res/drawable-hdpi/ic_menu_close_clear_cancel.png Binary files differindex a54ea9d..60301d9 100644 --- a/core/res/res/drawable-hdpi/ic_menu_close_clear_cancel.png +++ b/core/res/res/drawable-hdpi/ic_menu_close_clear_cancel.png diff --git a/core/res/res/drawable-hdpi/ic_menu_compass.png b/core/res/res/drawable-hdpi/ic_menu_compass.png Binary files differindex 104270f..39760f8 100644 --- a/core/res/res/drawable-hdpi/ic_menu_compass.png +++ b/core/res/res/drawable-hdpi/ic_menu_compass.png diff --git a/core/res/res/drawable-hdpi/ic_menu_compose.png b/core/res/res/drawable-hdpi/ic_menu_compose.png Binary files differindex 6ad379e..1286a28 100644 --- a/core/res/res/drawable-hdpi/ic_menu_compose.png +++ b/core/res/res/drawable-hdpi/ic_menu_compose.png diff --git a/core/res/res/drawable-hdpi/ic_menu_crop.png b/core/res/res/drawable-hdpi/ic_menu_crop.png Binary files differindex 0d4c9fe..c2fc70d 100644 --- a/core/res/res/drawable-hdpi/ic_menu_crop.png +++ b/core/res/res/drawable-hdpi/ic_menu_crop.png diff --git a/core/res/res/drawable-hdpi/ic_menu_day.png b/core/res/res/drawable-hdpi/ic_menu_day.png Binary files differindex 84429aa..966de8b 100644 --- a/core/res/res/drawable-hdpi/ic_menu_day.png +++ b/core/res/res/drawable-hdpi/ic_menu_day.png diff --git a/core/res/res/drawable-hdpi/ic_menu_delete.png b/core/res/res/drawable-hdpi/ic_menu_delete.png Binary files differindex 2aed26a..24d8f6a 100644 --- a/core/res/res/drawable-hdpi/ic_menu_delete.png +++ b/core/res/res/drawable-hdpi/ic_menu_delete.png diff --git a/core/res/res/drawable-hdpi/ic_menu_directions.png b/core/res/res/drawable-hdpi/ic_menu_directions.png Binary files differindex 23f6eb3..358b249 100644 --- a/core/res/res/drawable-hdpi/ic_menu_directions.png +++ b/core/res/res/drawable-hdpi/ic_menu_directions.png diff --git a/core/res/res/drawable-hdpi/ic_menu_edit.png b/core/res/res/drawable-hdpi/ic_menu_edit.png Binary files differindex 602dd10..9bdba1b 100644 --- a/core/res/res/drawable-hdpi/ic_menu_edit.png +++ b/core/res/res/drawable-hdpi/ic_menu_edit.png diff --git a/core/res/res/drawable-hdpi/ic_menu_emoticons.png b/core/res/res/drawable-hdpi/ic_menu_emoticons.png Binary files differindex 2fab515..16ec4e4 100644 --- a/core/res/res/drawable-hdpi/ic_menu_emoticons.png +++ b/core/res/res/drawable-hdpi/ic_menu_emoticons.png diff --git a/core/res/res/drawable-hdpi/ic_menu_end_conversation.png b/core/res/res/drawable-hdpi/ic_menu_end_conversation.png Binary files differindex c05a207..c46b757 100644 --- a/core/res/res/drawable-hdpi/ic_menu_end_conversation.png +++ b/core/res/res/drawable-hdpi/ic_menu_end_conversation.png diff --git a/core/res/res/drawable-hdpi/ic_menu_forward.png b/core/res/res/drawable-hdpi/ic_menu_forward.png Binary files differindex 606e6aa..b1b0c89 100644 --- a/core/res/res/drawable-hdpi/ic_menu_forward.png +++ b/core/res/res/drawable-hdpi/ic_menu_forward.png diff --git a/core/res/res/drawable-hdpi/ic_menu_friendslist.png b/core/res/res/drawable-hdpi/ic_menu_friendslist.png Binary files differindex a90e573..02b4341 100644 --- a/core/res/res/drawable-hdpi/ic_menu_friendslist.png +++ b/core/res/res/drawable-hdpi/ic_menu_friendslist.png diff --git a/core/res/res/drawable-hdpi/ic_menu_gallery.png b/core/res/res/drawable-hdpi/ic_menu_gallery.png Binary files differindex 7c528fa..1f83b9a 100644 --- a/core/res/res/drawable-hdpi/ic_menu_gallery.png +++ b/core/res/res/drawable-hdpi/ic_menu_gallery.png diff --git a/core/res/res/drawable-hdpi/ic_menu_goto.png b/core/res/res/drawable-hdpi/ic_menu_goto.png Binary files differindex a1acecb..ca6e835 100644 --- a/core/res/res/drawable-hdpi/ic_menu_goto.png +++ b/core/res/res/drawable-hdpi/ic_menu_goto.png diff --git a/core/res/res/drawable-hdpi/ic_menu_help.png b/core/res/res/drawable-hdpi/ic_menu_help.png Binary files differindex 01a77da..a39eff3 100644 --- a/core/res/res/drawable-hdpi/ic_menu_help.png +++ b/core/res/res/drawable-hdpi/ic_menu_help.png diff --git a/core/res/res/drawable-hdpi/ic_menu_help_holo_light.png b/core/res/res/drawable-hdpi/ic_menu_help_holo_light.png Binary files differnew file mode 100644 index 0000000..a39eff3 --- /dev/null +++ b/core/res/res/drawable-hdpi/ic_menu_help_holo_light.png diff --git a/core/res/res/drawable-hdpi/ic_menu_home.png b/core/res/res/drawable-hdpi/ic_menu_home.png Binary files differindex 35cb52a..3baf1ca 100644 --- a/core/res/res/drawable-hdpi/ic_menu_home.png +++ b/core/res/res/drawable-hdpi/ic_menu_home.png diff --git a/core/res/res/drawable-hdpi/ic_menu_info_details.png b/core/res/res/drawable-hdpi/ic_menu_info_details.png Binary files differindex 7696ceb..6a7a1e9 100644 --- a/core/res/res/drawable-hdpi/ic_menu_info_details.png +++ b/core/res/res/drawable-hdpi/ic_menu_info_details.png diff --git a/core/res/res/drawable-hdpi/ic_menu_invite.png b/core/res/res/drawable-hdpi/ic_menu_invite.png Binary files differindex 3cb129f..ec88b99 100644 --- a/core/res/res/drawable-hdpi/ic_menu_invite.png +++ b/core/res/res/drawable-hdpi/ic_menu_invite.png diff --git a/core/res/res/drawable-hdpi/ic_menu_login.png b/core/res/res/drawable-hdpi/ic_menu_login.png Binary files differindex d23ebf0..afa152b 100644 --- a/core/res/res/drawable-hdpi/ic_menu_login.png +++ b/core/res/res/drawable-hdpi/ic_menu_login.png diff --git a/core/res/res/drawable-hdpi/ic_menu_manage.png b/core/res/res/drawable-hdpi/ic_menu_manage.png Binary files differindex c7c4cbc..5b7080a 100644 --- a/core/res/res/drawable-hdpi/ic_menu_manage.png +++ b/core/res/res/drawable-hdpi/ic_menu_manage.png diff --git a/core/res/res/drawable-hdpi/ic_menu_mapmode.png b/core/res/res/drawable-hdpi/ic_menu_mapmode.png Binary files differindex c895ccb..5ac4a02 100644 --- a/core/res/res/drawable-hdpi/ic_menu_mapmode.png +++ b/core/res/res/drawable-hdpi/ic_menu_mapmode.png diff --git a/core/res/res/drawable-hdpi/ic_menu_mark.png b/core/res/res/drawable-hdpi/ic_menu_mark.png Binary files differindex 724d787..95a3217 100644 --- a/core/res/res/drawable-hdpi/ic_menu_mark.png +++ b/core/res/res/drawable-hdpi/ic_menu_mark.png diff --git a/core/res/res/drawable-hdpi/ic_menu_month.png b/core/res/res/drawable-hdpi/ic_menu_month.png Binary files differindex 3e55ae6..99fe5c0 100644 --- a/core/res/res/drawable-hdpi/ic_menu_month.png +++ b/core/res/res/drawable-hdpi/ic_menu_month.png diff --git a/core/res/res/drawable-hdpi/ic_menu_more.png b/core/res/res/drawable-hdpi/ic_menu_more.png Binary files differindex ccecc1d..ede8a54 100644 --- a/core/res/res/drawable-hdpi/ic_menu_more.png +++ b/core/res/res/drawable-hdpi/ic_menu_more.png diff --git a/core/res/res/drawable-hdpi/ic_menu_moreoverflow_focused_holo_dark.png b/core/res/res/drawable-hdpi/ic_menu_moreoverflow_focused_holo_dark.png Binary files differnew file mode 100644 index 0000000..061f80a --- /dev/null +++ b/core/res/res/drawable-hdpi/ic_menu_moreoverflow_focused_holo_dark.png diff --git a/core/res/res/drawable-hdpi/ic_menu_moreoverflow_focused_holo_light.png b/core/res/res/drawable-hdpi/ic_menu_moreoverflow_focused_holo_light.png Binary files differnew file mode 100644 index 0000000..d818806 --- /dev/null +++ b/core/res/res/drawable-hdpi/ic_menu_moreoverflow_focused_holo_light.png diff --git a/core/res/res/drawable-hdpi/ic_menu_moreoverflow_normal_holo_dark.png b/core/res/res/drawable-hdpi/ic_menu_moreoverflow_normal_holo_dark.png Binary files differindex e21f534..8563c1a 100644 --- a/core/res/res/drawable-hdpi/ic_menu_moreoverflow_normal_holo_dark.png +++ b/core/res/res/drawable-hdpi/ic_menu_moreoverflow_normal_holo_dark.png diff --git a/core/res/res/drawable-hdpi/ic_menu_moreoverflow_normal_holo_light.png b/core/res/res/drawable-hdpi/ic_menu_moreoverflow_normal_holo_light.png Binary files differindex 9108fa1..1cd2384 100644 --- a/core/res/res/drawable-hdpi/ic_menu_moreoverflow_normal_holo_light.png +++ b/core/res/res/drawable-hdpi/ic_menu_moreoverflow_normal_holo_light.png diff --git a/core/res/res/drawable-hdpi/ic_menu_my_calendar.png b/core/res/res/drawable-hdpi/ic_menu_my_calendar.png Binary files differindex 3d6ea1f..360a915 100644 --- a/core/res/res/drawable-hdpi/ic_menu_my_calendar.png +++ b/core/res/res/drawable-hdpi/ic_menu_my_calendar.png diff --git a/core/res/res/drawable-hdpi/ic_menu_mylocation.png b/core/res/res/drawable-hdpi/ic_menu_mylocation.png Binary files differindex 1bcb0cd..ba82ee0 100644 --- a/core/res/res/drawable-hdpi/ic_menu_mylocation.png +++ b/core/res/res/drawable-hdpi/ic_menu_mylocation.png diff --git a/core/res/res/drawable-hdpi/ic_menu_myplaces.png b/core/res/res/drawable-hdpi/ic_menu_myplaces.png Binary files differindex 5f726d8..ade7532 100644 --- a/core/res/res/drawable-hdpi/ic_menu_myplaces.png +++ b/core/res/res/drawable-hdpi/ic_menu_myplaces.png diff --git a/core/res/res/drawable-hdpi/ic_menu_notifications.png b/core/res/res/drawable-hdpi/ic_menu_notifications.png Binary files differindex fb63937..ded4323 100644 --- a/core/res/res/drawable-hdpi/ic_menu_notifications.png +++ b/core/res/res/drawable-hdpi/ic_menu_notifications.png diff --git a/core/res/res/drawable-hdpi/ic_menu_play_clip.png b/core/res/res/drawable-hdpi/ic_menu_play_clip.png Binary files differindex ddde03a..2d0d2e2 100644 --- a/core/res/res/drawable-hdpi/ic_menu_play_clip.png +++ b/core/res/res/drawable-hdpi/ic_menu_play_clip.png diff --git a/core/res/res/drawable-hdpi/ic_menu_preferences.png b/core/res/res/drawable-hdpi/ic_menu_preferences.png Binary files differindex 81bca4a..5321f82 100644 --- a/core/res/res/drawable-hdpi/ic_menu_preferences.png +++ b/core/res/res/drawable-hdpi/ic_menu_preferences.png diff --git a/core/res/res/drawable-hdpi/ic_menu_recent_history.png b/core/res/res/drawable-hdpi/ic_menu_recent_history.png Binary files differindex 0dd1627..4101434 100644 --- a/core/res/res/drawable-hdpi/ic_menu_recent_history.png +++ b/core/res/res/drawable-hdpi/ic_menu_recent_history.png diff --git a/core/res/res/drawable-hdpi/ic_menu_refresh.png b/core/res/res/drawable-hdpi/ic_menu_refresh.png Binary files differindex 53cacca..e13315f 100644 --- a/core/res/res/drawable-hdpi/ic_menu_refresh.png +++ b/core/res/res/drawable-hdpi/ic_menu_refresh.png diff --git a/core/res/res/drawable-hdpi/ic_menu_report_image.png b/core/res/res/drawable-hdpi/ic_menu_report_image.png Binary files differindex b6aa5d6..7847b7b 100644 --- a/core/res/res/drawable-hdpi/ic_menu_report_image.png +++ b/core/res/res/drawable-hdpi/ic_menu_report_image.png diff --git a/core/res/res/drawable-hdpi/ic_menu_revert.png b/core/res/res/drawable-hdpi/ic_menu_revert.png Binary files differindex 11860a4..0b9cf2a 100644 --- a/core/res/res/drawable-hdpi/ic_menu_revert.png +++ b/core/res/res/drawable-hdpi/ic_menu_revert.png diff --git a/core/res/res/drawable-hdpi/ic_menu_rotate.png b/core/res/res/drawable-hdpi/ic_menu_rotate.png Binary files differindex 85115af..09efba4 100644 --- a/core/res/res/drawable-hdpi/ic_menu_rotate.png +++ b/core/res/res/drawable-hdpi/ic_menu_rotate.png diff --git a/core/res/res/drawable-hdpi/ic_menu_save.png b/core/res/res/drawable-hdpi/ic_menu_save.png Binary files differindex fc26c5d..36fc7f4 100644 --- a/core/res/res/drawable-hdpi/ic_menu_save.png +++ b/core/res/res/drawable-hdpi/ic_menu_save.png diff --git a/core/res/res/drawable-hdpi/ic_menu_search.png b/core/res/res/drawable-hdpi/ic_menu_search.png Binary files differindex f78234e..a7f9bbe 100644 --- a/core/res/res/drawable-hdpi/ic_menu_search.png +++ b/core/res/res/drawable-hdpi/ic_menu_search.png diff --git a/core/res/res/drawable-hdpi/ic_menu_search_holo_light.png b/core/res/res/drawable-hdpi/ic_menu_search_holo_light.png Binary files differnew file mode 100644 index 0000000..1cb61fa --- /dev/null +++ b/core/res/res/drawable-hdpi/ic_menu_search_holo_light.png diff --git a/core/res/res/drawable-hdpi/ic_menu_send.png b/core/res/res/drawable-hdpi/ic_menu_send.png Binary files differindex 2567b58..d94e692 100644 --- a/core/res/res/drawable-hdpi/ic_menu_send.png +++ b/core/res/res/drawable-hdpi/ic_menu_send.png diff --git a/core/res/res/drawable-hdpi/ic_menu_set_as.png b/core/res/res/drawable-hdpi/ic_menu_set_as.png Binary files differindex 7e79c15..41f931b 100644 --- a/core/res/res/drawable-hdpi/ic_menu_set_as.png +++ b/core/res/res/drawable-hdpi/ic_menu_set_as.png diff --git a/core/res/res/drawable-hdpi/ic_menu_settings_holo_light.png b/core/res/res/drawable-hdpi/ic_menu_settings_holo_light.png Binary files differnew file mode 100644 index 0000000..577e055 --- /dev/null +++ b/core/res/res/drawable-hdpi/ic_menu_settings_holo_light.png diff --git a/core/res/res/drawable-hdpi/ic_menu_share.png b/core/res/res/drawable-hdpi/ic_menu_share.png Binary files differindex b41b348..2837615 100644 --- a/core/res/res/drawable-hdpi/ic_menu_share.png +++ b/core/res/res/drawable-hdpi/ic_menu_share.png diff --git a/core/res/res/drawable-hdpi/ic_menu_slideshow.png b/core/res/res/drawable-hdpi/ic_menu_slideshow.png Binary files differindex 925f4eb..b2e65b4 100644 --- a/core/res/res/drawable-hdpi/ic_menu_slideshow.png +++ b/core/res/res/drawable-hdpi/ic_menu_slideshow.png diff --git a/core/res/res/drawable-hdpi/ic_menu_sort_alphabetically.png b/core/res/res/drawable-hdpi/ic_menu_sort_alphabetically.png Binary files differindex 5d68998..0f351a7 100644 --- a/core/res/res/drawable-hdpi/ic_menu_sort_alphabetically.png +++ b/core/res/res/drawable-hdpi/ic_menu_sort_alphabetically.png diff --git a/core/res/res/drawable-hdpi/ic_menu_sort_by_size.png b/core/res/res/drawable-hdpi/ic_menu_sort_by_size.png Binary files differindex c9388fd..39472a6 100644 --- a/core/res/res/drawable-hdpi/ic_menu_sort_by_size.png +++ b/core/res/res/drawable-hdpi/ic_menu_sort_by_size.png diff --git a/core/res/res/drawable-hdpi/ic_menu_star.png b/core/res/res/drawable-hdpi/ic_menu_star.png Binary files differindex 21a2c4b..4f667a4 100644 --- a/core/res/res/drawable-hdpi/ic_menu_star.png +++ b/core/res/res/drawable-hdpi/ic_menu_star.png diff --git a/core/res/res/drawable-hdpi/ic_menu_start_conversation.png b/core/res/res/drawable-hdpi/ic_menu_start_conversation.png Binary files differindex d63d3a7..395a5ec 100644 --- a/core/res/res/drawable-hdpi/ic_menu_start_conversation.png +++ b/core/res/res/drawable-hdpi/ic_menu_start_conversation.png diff --git a/core/res/res/drawable-hdpi/ic_menu_stop.png b/core/res/res/drawable-hdpi/ic_menu_stop.png Binary files differindex 7c99ed4..cf53a08 100644 --- a/core/res/res/drawable-hdpi/ic_menu_stop.png +++ b/core/res/res/drawable-hdpi/ic_menu_stop.png diff --git a/core/res/res/drawable-hdpi/ic_menu_today.png b/core/res/res/drawable-hdpi/ic_menu_today.png Binary files differindex 4a9352d..b0a7a48 100644 --- a/core/res/res/drawable-hdpi/ic_menu_today.png +++ b/core/res/res/drawable-hdpi/ic_menu_today.png diff --git a/core/res/res/drawable-hdpi/ic_menu_upload.png b/core/res/res/drawable-hdpi/ic_menu_upload.png Binary files differindex d845112..a81ad20 100644 --- a/core/res/res/drawable-hdpi/ic_menu_upload.png +++ b/core/res/res/drawable-hdpi/ic_menu_upload.png diff --git a/core/res/res/drawable-hdpi/ic_menu_upload_you_tube.png b/core/res/res/drawable-hdpi/ic_menu_upload_you_tube.png Binary files differindex df5fa7f..ce8d1b6 100644 --- a/core/res/res/drawable-hdpi/ic_menu_upload_you_tube.png +++ b/core/res/res/drawable-hdpi/ic_menu_upload_you_tube.png diff --git a/core/res/res/drawable-hdpi/ic_menu_view.png b/core/res/res/drawable-hdpi/ic_menu_view.png Binary files differindex 75155d4..25c2ff3 100644 --- a/core/res/res/drawable-hdpi/ic_menu_view.png +++ b/core/res/res/drawable-hdpi/ic_menu_view.png diff --git a/core/res/res/drawable-hdpi/ic_menu_week.png b/core/res/res/drawable-hdpi/ic_menu_week.png Binary files differindex c216eca..69dc015 100644 --- a/core/res/res/drawable-hdpi/ic_menu_week.png +++ b/core/res/res/drawable-hdpi/ic_menu_week.png diff --git a/core/res/res/drawable-hdpi/ic_menu_zoom.png b/core/res/res/drawable-hdpi/ic_menu_zoom.png Binary files differindex 9fa4d7e..e2f56f0 100644 --- a/core/res/res/drawable-hdpi/ic_menu_zoom.png +++ b/core/res/res/drawable-hdpi/ic_menu_zoom.png diff --git a/core/res/res/drawable-hdpi/indicator_input_error.png b/core/res/res/drawable-hdpi/indicator_input_error.png Binary files differindex 213976c..8785376 100644 --- a/core/res/res/drawable-hdpi/indicator_input_error.png +++ b/core/res/res/drawable-hdpi/indicator_input_error.png diff --git a/core/res/res/drawable-hdpi/popup_inline_error_above_holo_dark.9.png b/core/res/res/drawable-hdpi/popup_inline_error_above_holo_dark.9.png Binary files differnew file mode 100644 index 0000000..61ea2b0 --- /dev/null +++ b/core/res/res/drawable-hdpi/popup_inline_error_above_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/popup_inline_error_above_holo_light.9.png b/core/res/res/drawable-hdpi/popup_inline_error_above_holo_light.9.png Binary files differnew file mode 100644 index 0000000..83b2bce --- /dev/null +++ b/core/res/res/drawable-hdpi/popup_inline_error_above_holo_light.9.png diff --git a/core/res/res/drawable-hdpi/popup_inline_error_holo_dark.9.png b/core/res/res/drawable-hdpi/popup_inline_error_holo_dark.9.png Binary files differnew file mode 100644 index 0000000..daa47b7 --- /dev/null +++ b/core/res/res/drawable-hdpi/popup_inline_error_holo_dark.9.png diff --git a/core/res/res/drawable-hdpi/popup_inline_error_holo_light.9.png b/core/res/res/drawable-hdpi/popup_inline_error_holo_light.9.png Binary files differnew file mode 100644 index 0000000..6c45935 --- /dev/null +++ b/core/res/res/drawable-hdpi/popup_inline_error_holo_light.9.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 b2e65c6..9c713c8 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_sys_tether_bluetooth.png b/core/res/res/drawable-hdpi/stat_sys_tether_bluetooth.png Binary files differindex e43fbae..11869af 100644 --- a/core/res/res/drawable-hdpi/stat_sys_tether_bluetooth.png +++ b/core/res/res/drawable-hdpi/stat_sys_tether_bluetooth.png diff --git a/core/res/res/drawable-hdpi/stat_sys_tether_general.png b/core/res/res/drawable-hdpi/stat_sys_tether_general.png Binary files differindex c42b00c..f1606ba 100644 --- a/core/res/res/drawable-hdpi/stat_sys_tether_general.png +++ b/core/res/res/drawable-hdpi/stat_sys_tether_general.png diff --git a/core/res/res/drawable-hdpi/stat_sys_tether_usb.png b/core/res/res/drawable-hdpi/stat_sys_tether_usb.png Binary files differindex c6c533d..a05ab3e 100644 --- a/core/res/res/drawable-hdpi/stat_sys_tether_usb.png +++ b/core/res/res/drawable-hdpi/stat_sys_tether_usb.png diff --git a/core/res/res/drawable-hdpi/stat_sys_tether_wifi.png b/core/res/res/drawable-hdpi/stat_sys_tether_wifi.png Binary files differindex 9fcadef..6218c3f 100644 --- a/core/res/res/drawable-hdpi/stat_sys_tether_wifi.png +++ b/core/res/res/drawable-hdpi/stat_sys_tether_wifi.png diff --git a/core/res/res/drawable-mdpi/ic_menu_account_list.png b/core/res/res/drawable-mdpi/ic_menu_account_list.png Binary files differindex f0945b2..e4e717e 100644 --- a/core/res/res/drawable-mdpi/ic_menu_account_list.png +++ b/core/res/res/drawable-mdpi/ic_menu_account_list.png diff --git a/core/res/res/drawable-mdpi/ic_menu_add.png b/core/res/res/drawable-mdpi/ic_menu_add.png Binary files differindex 6752bfd..361c7c4 100755 --- a/core/res/res/drawable-mdpi/ic_menu_add.png +++ b/core/res/res/drawable-mdpi/ic_menu_add.png diff --git a/core/res/res/drawable-mdpi/ic_menu_agenda.png b/core/res/res/drawable-mdpi/ic_menu_agenda.png Binary files differindex 9f2c1dc..c63a12bf 100755 --- a/core/res/res/drawable-mdpi/ic_menu_agenda.png +++ b/core/res/res/drawable-mdpi/ic_menu_agenda.png diff --git a/core/res/res/drawable-mdpi/ic_menu_allfriends.png b/core/res/res/drawable-mdpi/ic_menu_allfriends.png Binary files differindex a5bd331..45256d1 100755 --- a/core/res/res/drawable-mdpi/ic_menu_allfriends.png +++ b/core/res/res/drawable-mdpi/ic_menu_allfriends.png diff --git a/core/res/res/drawable-mdpi/ic_menu_always_landscape_portrait.png b/core/res/res/drawable-mdpi/ic_menu_always_landscape_portrait.png Binary files differindex 68911c4..f9f475a 100644 --- a/core/res/res/drawable-mdpi/ic_menu_always_landscape_portrait.png +++ b/core/res/res/drawable-mdpi/ic_menu_always_landscape_portrait.png diff --git a/core/res/res/drawable-mdpi/ic_menu_archive.png b/core/res/res/drawable-mdpi/ic_menu_archive.png Binary files differindex a4599e3..49ac569 100644 --- a/core/res/res/drawable-mdpi/ic_menu_archive.png +++ b/core/res/res/drawable-mdpi/ic_menu_archive.png diff --git a/core/res/res/drawable-mdpi/ic_menu_attachment.png b/core/res/res/drawable-mdpi/ic_menu_attachment.png Binary files differindex 89d626f..d3d4812 100644 --- a/core/res/res/drawable-mdpi/ic_menu_attachment.png +++ b/core/res/res/drawable-mdpi/ic_menu_attachment.png diff --git a/core/res/res/drawable-mdpi/ic_menu_back.png b/core/res/res/drawable-mdpi/ic_menu_back.png Binary files differindex 5ce50eb..bb69245 100644 --- a/core/res/res/drawable-mdpi/ic_menu_back.png +++ b/core/res/res/drawable-mdpi/ic_menu_back.png diff --git a/core/res/res/drawable-mdpi/ic_menu_block.png b/core/res/res/drawable-mdpi/ic_menu_block.png Binary files differindex 422eeb1..63f952d 100644 --- a/core/res/res/drawable-mdpi/ic_menu_block.png +++ b/core/res/res/drawable-mdpi/ic_menu_block.png diff --git a/core/res/res/drawable-mdpi/ic_menu_blocked_user.png b/core/res/res/drawable-mdpi/ic_menu_blocked_user.png Binary files differindex 5a5619b..ac8cc10 100644 --- a/core/res/res/drawable-mdpi/ic_menu_blocked_user.png +++ b/core/res/res/drawable-mdpi/ic_menu_blocked_user.png diff --git a/core/res/res/drawable-mdpi/ic_menu_btn_add.png b/core/res/res/drawable-mdpi/ic_menu_btn_add.png Binary files differnew file mode 100644 index 0000000..361c7c4 --- /dev/null +++ b/core/res/res/drawable-mdpi/ic_menu_btn_add.png diff --git a/core/res/res/drawable-mdpi/ic_menu_call.png b/core/res/res/drawable-mdpi/ic_menu_call.png Binary files differindex a63f86b..b7ee91a 100644 --- a/core/res/res/drawable-mdpi/ic_menu_call.png +++ b/core/res/res/drawable-mdpi/ic_menu_call.png diff --git a/core/res/res/drawable-mdpi/ic_menu_camera.png b/core/res/res/drawable-mdpi/ic_menu_camera.png Binary files differindex cdf7ca3..f8cf93c 100755 --- a/core/res/res/drawable-mdpi/ic_menu_camera.png +++ b/core/res/res/drawable-mdpi/ic_menu_camera.png diff --git a/core/res/res/drawable-mdpi/ic_menu_cc.png b/core/res/res/drawable-mdpi/ic_menu_cc.png Binary files differindex 4876021..8e2ba09 100644 --- a/core/res/res/drawable-mdpi/ic_menu_cc.png +++ b/core/res/res/drawable-mdpi/ic_menu_cc.png diff --git a/core/res/res/drawable-mdpi/ic_menu_chat_dashboard.png b/core/res/res/drawable-mdpi/ic_menu_chat_dashboard.png Binary files differindex 37fd3cb..14b7482 100644 --- a/core/res/res/drawable-mdpi/ic_menu_chat_dashboard.png +++ b/core/res/res/drawable-mdpi/ic_menu_chat_dashboard.png diff --git a/core/res/res/drawable-mdpi/ic_menu_clear_playlist.png b/core/res/res/drawable-mdpi/ic_menu_clear_playlist.png Binary files differindex 750db62..9100a69 100644 --- a/core/res/res/drawable-mdpi/ic_menu_clear_playlist.png +++ b/core/res/res/drawable-mdpi/ic_menu_clear_playlist.png diff --git a/core/res/res/drawable-mdpi/ic_menu_close_clear_cancel.png b/core/res/res/drawable-mdpi/ic_menu_close_clear_cancel.png Binary files differindex 78222ea..5b385aa 100644 --- a/core/res/res/drawable-mdpi/ic_menu_close_clear_cancel.png +++ b/core/res/res/drawable-mdpi/ic_menu_close_clear_cancel.png diff --git a/core/res/res/drawable-mdpi/ic_menu_compass.png b/core/res/res/drawable-mdpi/ic_menu_compass.png Binary files differindex 7717dde..25235cc 100644 --- a/core/res/res/drawable-mdpi/ic_menu_compass.png +++ b/core/res/res/drawable-mdpi/ic_menu_compass.png diff --git a/core/res/res/drawable-mdpi/ic_menu_compose.png b/core/res/res/drawable-mdpi/ic_menu_compose.png Binary files differindex 1b4733e..a911141 100644 --- a/core/res/res/drawable-mdpi/ic_menu_compose.png +++ b/core/res/res/drawable-mdpi/ic_menu_compose.png diff --git a/core/res/res/drawable-mdpi/ic_menu_crop.png b/core/res/res/drawable-mdpi/ic_menu_crop.png Binary files differindex c0df996..30e40cf 100755 --- a/core/res/res/drawable-mdpi/ic_menu_crop.png +++ b/core/res/res/drawable-mdpi/ic_menu_crop.png diff --git a/core/res/res/drawable-mdpi/ic_menu_day.png b/core/res/res/drawable-mdpi/ic_menu_day.png Binary files differindex db5d3a4..88bc348 100755 --- a/core/res/res/drawable-mdpi/ic_menu_day.png +++ b/core/res/res/drawable-mdpi/ic_menu_day.png diff --git a/core/res/res/drawable-mdpi/ic_menu_delete.png b/core/res/res/drawable-mdpi/ic_menu_delete.png Binary files differindex 7d95494..e2c8700 100755 --- a/core/res/res/drawable-mdpi/ic_menu_delete.png +++ b/core/res/res/drawable-mdpi/ic_menu_delete.png diff --git a/core/res/res/drawable-mdpi/ic_menu_directions.png b/core/res/res/drawable-mdpi/ic_menu_directions.png Binary files differindex 00a288f..d10e0b1 100755 --- a/core/res/res/drawable-mdpi/ic_menu_directions.png +++ b/core/res/res/drawable-mdpi/ic_menu_directions.png diff --git a/core/res/res/drawable-mdpi/ic_menu_edit.png b/core/res/res/drawable-mdpi/ic_menu_edit.png Binary files differindex 41a9c2e..d0314e9 100755 --- a/core/res/res/drawable-mdpi/ic_menu_edit.png +++ b/core/res/res/drawable-mdpi/ic_menu_edit.png diff --git a/core/res/res/drawable-mdpi/ic_menu_emoticons.png b/core/res/res/drawable-mdpi/ic_menu_emoticons.png Binary files differindex e8c4e47..8d1780f 100644 --- a/core/res/res/drawable-mdpi/ic_menu_emoticons.png +++ b/core/res/res/drawable-mdpi/ic_menu_emoticons.png diff --git a/core/res/res/drawable-mdpi/ic_menu_end_conversation.png b/core/res/res/drawable-mdpi/ic_menu_end_conversation.png Binary files differindex 0ea0fcb..fb9f153 100644 --- a/core/res/res/drawable-mdpi/ic_menu_end_conversation.png +++ b/core/res/res/drawable-mdpi/ic_menu_end_conversation.png diff --git a/core/res/res/drawable-mdpi/ic_menu_forward.png b/core/res/res/drawable-mdpi/ic_menu_forward.png Binary files differindex 0936fac..4a0b6ef 100644 --- a/core/res/res/drawable-mdpi/ic_menu_forward.png +++ b/core/res/res/drawable-mdpi/ic_menu_forward.png diff --git a/core/res/res/drawable-mdpi/ic_menu_friendslist.png b/core/res/res/drawable-mdpi/ic_menu_friendslist.png Binary files differindex 8ec6b1a..8a29be3b 100644 --- a/core/res/res/drawable-mdpi/ic_menu_friendslist.png +++ b/core/res/res/drawable-mdpi/ic_menu_friendslist.png diff --git a/core/res/res/drawable-mdpi/ic_menu_gallery.png b/core/res/res/drawable-mdpi/ic_menu_gallery.png Binary files differindex a3deef1..d3a0200 100755 --- a/core/res/res/drawable-mdpi/ic_menu_gallery.png +++ b/core/res/res/drawable-mdpi/ic_menu_gallery.png diff --git a/core/res/res/drawable-mdpi/ic_menu_goto.png b/core/res/res/drawable-mdpi/ic_menu_goto.png Binary files differindex 40183eb..5471f5b 100644 --- a/core/res/res/drawable-mdpi/ic_menu_goto.png +++ b/core/res/res/drawable-mdpi/ic_menu_goto.png diff --git a/core/res/res/drawable-mdpi/ic_menu_help.png b/core/res/res/drawable-mdpi/ic_menu_help.png Binary files differindex 12ca235..010577f 100644 --- a/core/res/res/drawable-mdpi/ic_menu_help.png +++ b/core/res/res/drawable-mdpi/ic_menu_help.png diff --git a/core/res/res/drawable-mdpi/ic_menu_help_holo_light.png b/core/res/res/drawable-mdpi/ic_menu_help_holo_light.png Binary files differnew file mode 100644 index 0000000..010577f --- /dev/null +++ b/core/res/res/drawable-mdpi/ic_menu_help_holo_light.png diff --git a/core/res/res/drawable-mdpi/ic_menu_home.png b/core/res/res/drawable-mdpi/ic_menu_home.png Binary files differindex 34943f6..f19f58d 100644 --- a/core/res/res/drawable-mdpi/ic_menu_home.png +++ b/core/res/res/drawable-mdpi/ic_menu_home.png diff --git a/core/res/res/drawable-mdpi/ic_menu_info_details.png b/core/res/res/drawable-mdpi/ic_menu_info_details.png Binary files differindex 1786d1e..18b15b5 100755 --- a/core/res/res/drawable-mdpi/ic_menu_info_details.png +++ b/core/res/res/drawable-mdpi/ic_menu_info_details.png diff --git a/core/res/res/drawable-mdpi/ic_menu_invite.png b/core/res/res/drawable-mdpi/ic_menu_invite.png Binary files differindex 7577e6d..aa1898d 100644 --- a/core/res/res/drawable-mdpi/ic_menu_invite.png +++ b/core/res/res/drawable-mdpi/ic_menu_invite.png diff --git a/core/res/res/drawable-mdpi/ic_menu_login.png b/core/res/res/drawable-mdpi/ic_menu_login.png Binary files differindex 2b856bc..122ba33 100644 --- a/core/res/res/drawable-mdpi/ic_menu_login.png +++ b/core/res/res/drawable-mdpi/ic_menu_login.png diff --git a/core/res/res/drawable-mdpi/ic_menu_manage.png b/core/res/res/drawable-mdpi/ic_menu_manage.png Binary files differindex f155bbc..8d3a9fa 100755 --- a/core/res/res/drawable-mdpi/ic_menu_manage.png +++ b/core/res/res/drawable-mdpi/ic_menu_manage.png diff --git a/core/res/res/drawable-mdpi/ic_menu_mapmode.png b/core/res/res/drawable-mdpi/ic_menu_mapmode.png Binary files differindex d85cab5..1b50b5a 100644 --- a/core/res/res/drawable-mdpi/ic_menu_mapmode.png +++ b/core/res/res/drawable-mdpi/ic_menu_mapmode.png diff --git a/core/res/res/drawable-mdpi/ic_menu_mark.png b/core/res/res/drawable-mdpi/ic_menu_mark.png Binary files differindex 5e95da7..0c55506 100644 --- a/core/res/res/drawable-mdpi/ic_menu_mark.png +++ b/core/res/res/drawable-mdpi/ic_menu_mark.png diff --git a/core/res/res/drawable-mdpi/ic_menu_month.png b/core/res/res/drawable-mdpi/ic_menu_month.png Binary files differindex bf6cb89..ff201df 100755 --- a/core/res/res/drawable-mdpi/ic_menu_month.png +++ b/core/res/res/drawable-mdpi/ic_menu_month.png diff --git a/core/res/res/drawable-mdpi/ic_menu_more.png b/core/res/res/drawable-mdpi/ic_menu_more.png Binary files differindex b9fc5fa..263fef8 100644 --- a/core/res/res/drawable-mdpi/ic_menu_more.png +++ b/core/res/res/drawable-mdpi/ic_menu_more.png diff --git a/core/res/res/drawable-mdpi/ic_menu_moreoverflow_focused_holo_dark.png b/core/res/res/drawable-mdpi/ic_menu_moreoverflow_focused_holo_dark.png Binary files differnew file mode 100644 index 0000000..c369e6f --- /dev/null +++ b/core/res/res/drawable-mdpi/ic_menu_moreoverflow_focused_holo_dark.png diff --git a/core/res/res/drawable-mdpi/ic_menu_moreoverflow_focused_holo_light.png b/core/res/res/drawable-mdpi/ic_menu_moreoverflow_focused_holo_light.png Binary files differnew file mode 100644 index 0000000..a4df2bf --- /dev/null +++ b/core/res/res/drawable-mdpi/ic_menu_moreoverflow_focused_holo_light.png diff --git a/core/res/res/drawable-mdpi/ic_menu_my_calendar.png b/core/res/res/drawable-mdpi/ic_menu_my_calendar.png Binary files differindex 0c88fd3..991dfb0 100755 --- a/core/res/res/drawable-mdpi/ic_menu_my_calendar.png +++ b/core/res/res/drawable-mdpi/ic_menu_my_calendar.png diff --git a/core/res/res/drawable-mdpi/ic_menu_mylocation.png b/core/res/res/drawable-mdpi/ic_menu_mylocation.png Binary files differindex fdbd5ca..2a61a97 100755 --- a/core/res/res/drawable-mdpi/ic_menu_mylocation.png +++ b/core/res/res/drawable-mdpi/ic_menu_mylocation.png diff --git a/core/res/res/drawable-mdpi/ic_menu_myplaces.png b/core/res/res/drawable-mdpi/ic_menu_myplaces.png Binary files differindex 06f11ba..75f2c9b 100644 --- a/core/res/res/drawable-mdpi/ic_menu_myplaces.png +++ b/core/res/res/drawable-mdpi/ic_menu_myplaces.png diff --git a/core/res/res/drawable-mdpi/ic_menu_notifications.png b/core/res/res/drawable-mdpi/ic_menu_notifications.png Binary files differindex 866d4e0..2474d56 100644 --- a/core/res/res/drawable-mdpi/ic_menu_notifications.png +++ b/core/res/res/drawable-mdpi/ic_menu_notifications.png diff --git a/core/res/res/drawable-mdpi/ic_menu_play_clip.png b/core/res/res/drawable-mdpi/ic_menu_play_clip.png Binary files differindex 4669947..5983c22 100644 --- a/core/res/res/drawable-mdpi/ic_menu_play_clip.png +++ b/core/res/res/drawable-mdpi/ic_menu_play_clip.png diff --git a/core/res/res/drawable-mdpi/ic_menu_preferences.png b/core/res/res/drawable-mdpi/ic_menu_preferences.png Binary files differindex 60dbff6..ccc50e6 100644 --- a/core/res/res/drawable-mdpi/ic_menu_preferences.png +++ b/core/res/res/drawable-mdpi/ic_menu_preferences.png diff --git a/core/res/res/drawable-mdpi/ic_menu_recent_history.png b/core/res/res/drawable-mdpi/ic_menu_recent_history.png Binary files differindex 4ccae5d..e5f8e2d 100644 --- a/core/res/res/drawable-mdpi/ic_menu_recent_history.png +++ b/core/res/res/drawable-mdpi/ic_menu_recent_history.png diff --git a/core/res/res/drawable-mdpi/ic_menu_refresh.png b/core/res/res/drawable-mdpi/ic_menu_refresh.png Binary files differindex 77d70dd..30b660f 100644 --- a/core/res/res/drawable-mdpi/ic_menu_refresh.png +++ b/core/res/res/drawable-mdpi/ic_menu_refresh.png diff --git a/core/res/res/drawable-mdpi/ic_menu_report_image.png b/core/res/res/drawable-mdpi/ic_menu_report_image.png Binary files differindex 393d727..414b0ae 100644 --- a/core/res/res/drawable-mdpi/ic_menu_report_image.png +++ b/core/res/res/drawable-mdpi/ic_menu_report_image.png diff --git a/core/res/res/drawable-mdpi/ic_menu_revert.png b/core/res/res/drawable-mdpi/ic_menu_revert.png Binary files differindex e7e04f5..7a45163 100644 --- a/core/res/res/drawable-mdpi/ic_menu_revert.png +++ b/core/res/res/drawable-mdpi/ic_menu_revert.png diff --git a/core/res/res/drawable-mdpi/ic_menu_rotate.png b/core/res/res/drawable-mdpi/ic_menu_rotate.png Binary files differindex 27368b2..35fa56d 100755 --- a/core/res/res/drawable-mdpi/ic_menu_rotate.png +++ b/core/res/res/drawable-mdpi/ic_menu_rotate.png diff --git a/core/res/res/drawable-mdpi/ic_menu_save.png b/core/res/res/drawable-mdpi/ic_menu_save.png Binary files differindex 36d50b3..5f66864 100644 --- a/core/res/res/drawable-mdpi/ic_menu_save.png +++ b/core/res/res/drawable-mdpi/ic_menu_save.png diff --git a/core/res/res/drawable-mdpi/ic_menu_search.png b/core/res/res/drawable-mdpi/ic_menu_search.png Binary files differindex 94446db..5d3155e 100755 --- a/core/res/res/drawable-mdpi/ic_menu_search.png +++ b/core/res/res/drawable-mdpi/ic_menu_search.png diff --git a/core/res/res/drawable-mdpi/ic_menu_search_holo_light.png b/core/res/res/drawable-mdpi/ic_menu_search_holo_light.png Binary files differnew file mode 100644 index 0000000..2369d03 --- /dev/null +++ b/core/res/res/drawable-mdpi/ic_menu_search_holo_light.png diff --git a/core/res/res/drawable-mdpi/ic_menu_send.png b/core/res/res/drawable-mdpi/ic_menu_send.png Binary files differindex 74c096d..06b4717 100755 --- a/core/res/res/drawable-mdpi/ic_menu_send.png +++ b/core/res/res/drawable-mdpi/ic_menu_send.png diff --git a/core/res/res/drawable-mdpi/ic_menu_set_as.png b/core/res/res/drawable-mdpi/ic_menu_set_as.png Binary files differindex cb9dc49..98cc305 100755 --- a/core/res/res/drawable-mdpi/ic_menu_set_as.png +++ b/core/res/res/drawable-mdpi/ic_menu_set_as.png diff --git a/core/res/res/drawable-mdpi/ic_menu_settings_holo_light.png b/core/res/res/drawable-mdpi/ic_menu_settings_holo_light.png Binary files differnew file mode 100644 index 0000000..f32a37e --- /dev/null +++ b/core/res/res/drawable-mdpi/ic_menu_settings_holo_light.png diff --git a/core/res/res/drawable-mdpi/ic_menu_share.png b/core/res/res/drawable-mdpi/ic_menu_share.png Binary files differindex 44db9b1..d89ca5f 100755 --- a/core/res/res/drawable-mdpi/ic_menu_share.png +++ b/core/res/res/drawable-mdpi/ic_menu_share.png diff --git a/core/res/res/drawable-mdpi/ic_menu_slideshow.png b/core/res/res/drawable-mdpi/ic_menu_slideshow.png Binary files differindex 04fda7f..72bfcd9 100644 --- a/core/res/res/drawable-mdpi/ic_menu_slideshow.png +++ b/core/res/res/drawable-mdpi/ic_menu_slideshow.png diff --git a/core/res/res/drawable-mdpi/ic_menu_sort_alphabetically.png b/core/res/res/drawable-mdpi/ic_menu_sort_alphabetically.png Binary files differindex 2583eb8..452de5d 100755 --- a/core/res/res/drawable-mdpi/ic_menu_sort_alphabetically.png +++ b/core/res/res/drawable-mdpi/ic_menu_sort_alphabetically.png diff --git a/core/res/res/drawable-mdpi/ic_menu_sort_by_size.png b/core/res/res/drawable-mdpi/ic_menu_sort_by_size.png Binary files differindex 65e2786..19e8d1b 100755 --- a/core/res/res/drawable-mdpi/ic_menu_sort_by_size.png +++ b/core/res/res/drawable-mdpi/ic_menu_sort_by_size.png diff --git a/core/res/res/drawable-mdpi/ic_menu_star.png b/core/res/res/drawable-mdpi/ic_menu_star.png Binary files differindex 527d74a..0c22fe8 100755 --- a/core/res/res/drawable-mdpi/ic_menu_star.png +++ b/core/res/res/drawable-mdpi/ic_menu_star.png diff --git a/core/res/res/drawable-mdpi/ic_menu_start_conversation.png b/core/res/res/drawable-mdpi/ic_menu_start_conversation.png Binary files differindex aadcc2f..24b6540 100644 --- a/core/res/res/drawable-mdpi/ic_menu_start_conversation.png +++ b/core/res/res/drawable-mdpi/ic_menu_start_conversation.png diff --git a/core/res/res/drawable-mdpi/ic_menu_stop.png b/core/res/res/drawable-mdpi/ic_menu_stop.png Binary files differindex 4fc825c..efb4036 100644 --- a/core/res/res/drawable-mdpi/ic_menu_stop.png +++ b/core/res/res/drawable-mdpi/ic_menu_stop.png diff --git a/core/res/res/drawable-mdpi/ic_menu_today.png b/core/res/res/drawable-mdpi/ic_menu_today.png Binary files differindex c63b6af..8c248ae 100755 --- a/core/res/res/drawable-mdpi/ic_menu_today.png +++ b/core/res/res/drawable-mdpi/ic_menu_today.png diff --git a/core/res/res/drawable-mdpi/ic_menu_upload.png b/core/res/res/drawable-mdpi/ic_menu_upload.png Binary files differindex 1c0dd3f..9e8459a 100755 --- a/core/res/res/drawable-mdpi/ic_menu_upload.png +++ b/core/res/res/drawable-mdpi/ic_menu_upload.png diff --git a/core/res/res/drawable-mdpi/ic_menu_upload_you_tube.png b/core/res/res/drawable-mdpi/ic_menu_upload_you_tube.png Binary files differindex 0095564..a67c409 100755 --- a/core/res/res/drawable-mdpi/ic_menu_upload_you_tube.png +++ b/core/res/res/drawable-mdpi/ic_menu_upload_you_tube.png diff --git a/core/res/res/drawable-mdpi/ic_menu_view.png b/core/res/res/drawable-mdpi/ic_menu_view.png Binary files differindex 69828a9..082810d 100755 --- a/core/res/res/drawable-mdpi/ic_menu_view.png +++ b/core/res/res/drawable-mdpi/ic_menu_view.png diff --git a/core/res/res/drawable-mdpi/ic_menu_week.png b/core/res/res/drawable-mdpi/ic_menu_week.png Binary files differindex 62cd65e..e11e5f1 100755 --- a/core/res/res/drawable-mdpi/ic_menu_week.png +++ b/core/res/res/drawable-mdpi/ic_menu_week.png diff --git a/core/res/res/drawable-mdpi/ic_menu_zoom.png b/core/res/res/drawable-mdpi/ic_menu_zoom.png Binary files differindex 0b8c4e8..062d6f3 100644 --- a/core/res/res/drawable-mdpi/ic_menu_zoom.png +++ b/core/res/res/drawable-mdpi/ic_menu_zoom.png diff --git a/core/res/res/drawable-mdpi/indicator_input_error.png b/core/res/res/drawable-mdpi/indicator_input_error.png Binary files differindex ee60165..775e417 100755 --- a/core/res/res/drawable-mdpi/indicator_input_error.png +++ b/core/res/res/drawable-mdpi/indicator_input_error.png diff --git a/core/res/res/drawable-mdpi/popup_inline_error_above_holo_dark.9.png b/core/res/res/drawable-mdpi/popup_inline_error_above_holo_dark.9.png Binary files differindex dd4af6d..c03e658 100644 --- a/core/res/res/drawable-mdpi/popup_inline_error_above_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/popup_inline_error_above_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/popup_inline_error_above_holo_light.9.png b/core/res/res/drawable-mdpi/popup_inline_error_above_holo_light.9.png Binary files differindex 8925112..19b153b 100644 --- a/core/res/res/drawable-mdpi/popup_inline_error_above_holo_light.9.png +++ b/core/res/res/drawable-mdpi/popup_inline_error_above_holo_light.9.png diff --git a/core/res/res/drawable-mdpi/popup_inline_error_holo_dark.9.png b/core/res/res/drawable-mdpi/popup_inline_error_holo_dark.9.png Binary files differindex 66c2c09..4092728 100755 --- a/core/res/res/drawable-mdpi/popup_inline_error_holo_dark.9.png +++ b/core/res/res/drawable-mdpi/popup_inline_error_holo_dark.9.png diff --git a/core/res/res/drawable-mdpi/popup_inline_error_holo_light.9.png b/core/res/res/drawable-mdpi/popup_inline_error_holo_light.9.png Binary files differindex c5113f2..67a2cd4 100755 --- a/core/res/res/drawable-mdpi/popup_inline_error_holo_light.9.png +++ b/core/res/res/drawable-mdpi/popup_inline_error_holo_light.9.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 f98b032..91b4290 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_sys_tether_bluetooth.png b/core/res/res/drawable-mdpi/stat_sys_tether_bluetooth.png Binary files differindex efb64ad..b318b9c 100644 --- a/core/res/res/drawable-mdpi/stat_sys_tether_bluetooth.png +++ b/core/res/res/drawable-mdpi/stat_sys_tether_bluetooth.png diff --git a/core/res/res/drawable-mdpi/stat_sys_tether_general.png b/core/res/res/drawable-mdpi/stat_sys_tether_general.png Binary files differindex 3688803..952ff6b 100644 --- a/core/res/res/drawable-mdpi/stat_sys_tether_general.png +++ b/core/res/res/drawable-mdpi/stat_sys_tether_general.png diff --git a/core/res/res/drawable-mdpi/stat_sys_tether_usb.png b/core/res/res/drawable-mdpi/stat_sys_tether_usb.png Binary files differindex 73f1a81..3206557 100644 --- a/core/res/res/drawable-mdpi/stat_sys_tether_usb.png +++ b/core/res/res/drawable-mdpi/stat_sys_tether_usb.png diff --git a/core/res/res/drawable-mdpi/stat_sys_tether_wifi.png b/core/res/res/drawable-mdpi/stat_sys_tether_wifi.png Binary files differindex d448491..45a95f8 100644 --- a/core/res/res/drawable-mdpi/stat_sys_tether_wifi.png +++ b/core/res/res/drawable-mdpi/stat_sys_tether_wifi.png diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png Binary files differindex e936fac..8cc5535 100644 --- a/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png +++ b/core/res/res/drawable-xlarge-hdpi/stat_notify_chat.png diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png Binary files differindex eb626df..4441ba2 100644 --- a/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png +++ b/core/res/res/drawable-xlarge-hdpi/stat_notify_disk_full.png diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png Binary files differindex d6bc7d3..73891a3 100644 --- a/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png +++ b/core/res/res/drawable-xlarge-hdpi/stat_notify_email_generic.png diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png Binary files differindex 8c8f25d..db68eea 100644 --- a/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png +++ b/core/res/res/drawable-xlarge-hdpi/stat_notify_error.png diff --git a/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png b/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png Binary files differindex 661cc2f..7af6921 100644 --- a/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png +++ b/core/res/res/drawable-xlarge-hdpi/stat_notify_gmail.png diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png Binary files differindex b2d7186..22adc67 100644 --- a/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png +++ b/core/res/res/drawable-xlarge-mdpi/stat_notify_chat.png diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png Binary files differindex 36ab1ff..c434d12 100644 --- a/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png +++ b/core/res/res/drawable-xlarge-mdpi/stat_notify_disk_full.png diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png Binary files differindex a14b3c7..daf3b84 100644 --- a/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png +++ b/core/res/res/drawable-xlarge-mdpi/stat_notify_email_generic.png diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png Binary files differindex 81a66c1..7b097b1 100644 --- a/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png +++ b/core/res/res/drawable-xlarge-mdpi/stat_notify_error.png diff --git a/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png b/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png Binary files differindex a286ac6..8daef7c 100644 --- a/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png +++ b/core/res/res/drawable-xlarge-mdpi/stat_notify_gmail.png diff --git a/core/res/res/layout-xlarge/status_bar_latest_event_content.xml b/core/res/res/layout-xlarge/status_bar_latest_event_content.xml index 1a3ee82..676c38b 100644 --- a/core/res/res/layout-xlarge/status_bar_latest_event_content.xml +++ b/core/res/res/layout-xlarge/status_bar_latest_event_content.xml @@ -23,14 +23,14 @@ android:singleLine="true" android:ellipsize="marquee" android:fadingEdge="horizontal" - android:layout_marginBottom="-4dp" + android:layout_marginBottom="-3dp" /> <TextView android:id="@+id/text" android:textAppearance="@style/TextAppearance.StatusBar.EventContent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" - android:layout_marginTop="-4dp" + android:layout_marginTop="-2dp" android:singleLine="true" android:ellipsize="marquee" android:fadingEdge="horizontal" diff --git a/core/res/res/layout-xlarge/status_bar_latest_event_content_large_icon.xml b/core/res/res/layout-xlarge/status_bar_latest_event_content_large_icon.xml index e9b106d..ebdaaa3 100644 --- a/core/res/res/layout-xlarge/status_bar_latest_event_content_large_icon.xml +++ b/core/res/res/layout-xlarge/status_bar_latest_event_content_large_icon.xml @@ -17,40 +17,34 @@ android:singleLine="true" android:ellipsize="marquee" android:fadingEdge="horizontal" - android:layout_marginBottom="-4dp" + android:layout_marginBottom="-3dp" /> <TextView android:id="@+id/text" android:textAppearance="@style/TextAppearance.StatusBar.EventContent" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" - android:layout_marginTop="-4dp" + android:layout_marginTop="-2dp" android:singleLine="true" android:ellipsize="marquee" android:fadingEdge="horizontal" /> </LinearLayout> - <RelativeLayout + <TextView android:id="@+id/info" + android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Info" android:layout_width="wrap_content" android:layout_height="match_parent" - > - <TextView android:id="@+id/info" - android:textAppearance="@style/TextAppearance.StatusBar.EventContent.Info" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:singleLine="true" - android:gravity="center_vertical" - android:layout_alignParentLeft="true" - android:paddingLeft="8dp" - /> - <ImageView android:id="@+id/icon" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentBottom="true" - android:layout_alignRight="@id/info" - android:layout_marginBottom="8dip" - android:scaleType="center" - /> - </RelativeLayout> + android:singleLine="true" + android:gravity="center_vertical" + android:paddingLeft="4dp" + android:paddingRight="4dp" + /> + <ImageView android:id="@+id/icon" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:layout_marginBottom="13dip" + android:scaleType="center" + /> </LinearLayout> diff --git a/core/res/res/layout-xlarge/status_bar_latest_event_ticker_large_icon.xml b/core/res/res/layout-xlarge/status_bar_latest_event_ticker_large_icon.xml index b382c55..ff0f7d4 100644 --- a/core/res/res/layout-xlarge/status_bar_latest_event_ticker_large_icon.xml +++ b/core/res/res/layout-xlarge/status_bar_latest_event_ticker_large_icon.xml @@ -37,11 +37,13 @@ android:layout_marginTop="-10dp" /> <ImageView android:id="@+id/icon" - android:layout_width="48dp" - android:layout_height="32dp" - android:layout_gravity="top" - android:layout_marginTop="6dp" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:layout_marginBottom="13dip" android:scaleType="center" + android:layout_marginRight="4dip" + android:layout_marginLeft="16dip" /> </LinearLayout> diff --git a/core/res/res/layout/action_menu_item_layout.xml b/core/res/res/layout/action_menu_item_layout.xml index 4477df7..15dfea3 100644 --- a/core/res/res/layout/action_menu_item_layout.xml +++ b/core/res/res/layout/action_menu_item_layout.xml @@ -40,9 +40,9 @@ android:layout_height="wrap_content" android:layout_gravity="center" android:visibility="gone" - android:textAppearance="?attr/textAppearanceMedium" + android:textAppearance="?attr/actionMenuTextAppearance" style="?attr/buttonStyleSmall" - android:textColor="?attr/textColorPrimary" + android:textColor="?attr/actionMenuTextColor" android:background="@null" android:paddingLeft="4dip" android:paddingRight="4dip" /> diff --git a/core/res/res/layout/number_picker.xml b/core/res/res/layout/number_picker.xml index f92c1bc..807daf2 100644 --- a/core/res/res/layout/number_picker.xml +++ b/core/res/res/layout/number_picker.xml @@ -22,7 +22,8 @@ <ImageButton android:id="@+id/increment" android:layout_width="fill_parent" android:layout_height="wrap_content" - style="?android:attr/numberPickerUpButtonStyle" /> + style="?android:attr/numberPickerUpButtonStyle" + android:contentDescription="@string/number_picker_increment_button" /> <EditText android:id="@+id/numberpicker_input" android:layout_width="fill_parent" @@ -32,6 +33,7 @@ <ImageButton android:id="@+id/decrement" android:layout_width="fill_parent" android:layout_height="wrap_content" - style="?android:attr/numberPickerDownButtonStyle" /> + style="?android:attr/numberPickerDownButtonStyle" + android:contentDescription="@string/number_picker_decrement_button" /> </merge> diff --git a/core/res/res/layout/textview_hint.xml b/core/res/res/layout/textview_hint.xml index f9c4406..b94dfc9 100644 --- a/core/res/res/layout/textview_hint.xml +++ b/core/res/res/layout/textview_hint.xml @@ -18,5 +18,5 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:textAppearance="?android:attr/textAppearanceSmall" - android:textColor="@color/primary_text_light" + android:textColor="?android:attr/textColorPrimaryInverse" /> diff --git a/core/res/res/raw/fallbackring.ogg b/core/res/res/raw/fallbackring.ogg Binary files differindex 0cbf55d..a9adeb8 100644..100755 --- a/core/res/res/raw/fallbackring.ogg +++ b/core/res/res/raw/fallbackring.ogg diff --git a/core/res/res/values-xlarge/styles.xml b/core/res/res/values-xlarge/styles.xml index ed05cb1..dd78920 100644 --- a/core/res/res/values-xlarge/styles.xml +++ b/core/res/res/values-xlarge/styles.xml @@ -30,6 +30,7 @@ </style> <style name="TextAppearance.StatusBar.EventContent"> <item name="android:textColor">#ff999999</item> + <item name="android:textSize">14sp</item> </style> <style name="TextAppearance.StatusBar.EventContent.Title"> <item name="android:textColor">?android:attr/textColorPrimary</item> diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index a152d4c..8802003 100755 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -587,7 +587,11 @@ <attr name="actionBarSize" format="dimension" > <enum name="wrap_content" value="0" /> </attr> - + <!-- TextAppearance style that will be applied to text that + appears within action menu items. --> + <attr name="actionMenuTextAppearance" format="reference" /> + <!-- Color for text that appears within action menu items. --> + <attr name="actionMenuTextColor" format="color|reference" /> <!-- =================== --> <!-- Action mode styles --> @@ -3142,11 +3146,6 @@ <attr name="layout" /> </declare-styleable> - <declare-styleable name="DatePicker"> - <!-- @hide The layout of the time picker. --> - <attr name="layout" /> - </declare-styleable> - <!-- ========================= --> <!-- Drawable class attributes --> <!-- ========================= --> diff --git a/core/res/res/values/colors.xml b/core/res/res/values/colors.xml index ff9ef59..9c59cb6 100644 --- a/core/res/res/values/colors.xml +++ b/core/res/res/values/colors.xml @@ -72,6 +72,9 @@ <drawable name="editbox_dropdown_dark_frame">@drawable/editbox_dropdown_background_dark</drawable> <drawable name="editbox_dropdown_light_frame">@drawable/editbox_dropdown_background</drawable> + <drawable name="dialog_holo_dark_frame">@drawable/dialog_full_holo_dark</drawable> + <drawable name="dialog_holo_light_frame">@drawable/dialog_full_holo_light</drawable> + <drawable name="input_method_fullscreen_background">#fff9f9f9</drawable> <!-- For date picker widget --> diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index ae269df..aaf071b 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -1282,360 +1282,362 @@ Resources added in version 11 of the platform (Honeycomb / 3.0). =============================================================== --> <eat-comment /> - <public type="attr" name="allContactsName" /> - <public type="attr" name="windowActionBar" /> - <public type="attr" name="actionBarStyle" /> - <public type="attr" name="navigationMode" /> - <public type="attr" name="displayOptions" /> - <public type="attr" name="subtitle" /> - <public type="attr" name="customNavigationLayout" /> - <public type="attr" name="hardwareAccelerated" /> - <public type="attr" name="measureWithLargestChild" /> - <public type="attr" name="animateFirstView" /> - <public type="attr" name="dropDownSpinnerStyle" /> - <public type="attr" name="actionDropDownStyle" /> - <public type="attr" name="actionButtonStyle" /> - <public type="attr" name="showAsAction" /> - <public type="attr" name="previewImage" /> - <public type="attr" name="actionModeBackground" /> - <public type="attr" name="actionModeCloseDrawable" /> - <public type="attr" name="windowActionModeOverlay" /> - <public type="attr" name="valueFrom" /> - <public type="attr" name="valueTo" /> - <public type="attr" name="valueType" /> - <public type="attr" name="propertyName" /> - <public type="attr" name="ordering" /> - <public type="attr" name="fragment" /> - <public type="attr" name="windowActionBarOverlay" /> - <public type="attr" name="fragmentOpenEnterAnimation" /> - <public type="attr" name="fragmentOpenExitAnimation" /> - <public type="attr" name="fragmentCloseEnterAnimation" /> - <public type="attr" name="fragmentCloseExitAnimation" /> - <public type="attr" name="fragmentFadeEnterAnimation" /> - <public type="attr" name="fragmentFadeExitAnimation" /> - <public type="attr" name="actionBarSize" /> - <public type="attr" name="imeSubtypeLocale" /> - <public type="attr" name="imeSubtypeMode" /> - <public type="attr" name="imeSubtypeExtraValue" /> - <public type="attr" name="splitMotionEvents" /> - <public type="attr" name="listChoiceBackgroundIndicator" /> - <public type="attr" name="spinnerMode" /> - <public type="attr" name="animateLayoutChanges" /> - <public type="attr" name="actionBarTabStyle" /> - <public type="attr" name="actionBarTabBarStyle" /> - <public type="attr" name="actionBarTabTextStyle" /> - <public type="attr" name="actionOverflowButtonStyle" /> - <public type="attr" name="actionModeCloseButtonStyle" /> - <public type="attr" name="titleTextStyle" /> - <public type="attr" name="subtitleTextStyle" /> - <public type="attr" name="iconifiedByDefault" /> - <public type="attr" name="actionLayout" /> - <public type="attr" name="actionViewClass" /> - <public type="attr" name="activatedBackgroundIndicator" /> - <public type="attr" name="state_activated" /> - <public type="attr" name="listPopupWindowStyle" /> - <public type="attr" name="popupMenuStyle" /> - <public type="attr" name="textAppearanceLargePopupMenu" /> - <public type="attr" name="textAppearanceSmallPopupMenu" /> - <public type="attr" name="breadCrumbTitle" /> - <public type="attr" name="breadCrumbShortTitle" /> - <public type="attr" name="listDividerAlertDialog" /> - <public type="attr" name="textColorAlertDialogListItem" /> - <public type="attr" name="loopViews" /> - <public type="attr" name="dialogTheme" /> - <public type="attr" name="alertDialogTheme" /> - <public type="attr" name="dividerVertical" /> - <public type="attr" name="homeAsUpIndicator" /> - <public type="attr" name="enterFadeDuration" /> - <public type="attr" name="exitFadeDuration" /> - <public type="attr" name="selectableItemBackground" /> - <public type="attr" name="autoAdvanceViewId" /> - <public type="attr" name="useIntrinsicSizeAsMinimum" /> - <public type="attr" name="actionModeCutDrawable" /> - <public type="attr" name="actionModeCopyDrawable" /> - <public type="attr" name="actionModePasteDrawable" /> - <public type="attr" name="textEditPasteWindowLayout" /> - <public type="attr" name="textEditNoPasteWindowLayout" /> - <public type="attr" name="textIsSelectable" /> - <public type="attr" name="windowEnableSplitTouch" /> - <public type="attr" name="indeterminateProgressStyle" /> - <public type="attr" name="progressBarPadding" /> - <public type="attr" name="animationResolution" /> - <public type="attr" name="state_accelerated" /> - <public type="attr" name="baseline" /> - <public type="attr" name="homeLayout" /> - <public type="attr" name="opacity" /> - <public type="attr" name="alpha"/> - <public type="attr" name="transformPivotX"/> - <public type="attr" name="transformPivotY"/> - <public type="attr" name="translationX"/> - <public type="attr" name="translationY"/> - <public type="attr" name="scaleX"/> - <public type="attr" name="scaleY"/> - <public type="attr" name="rotation"/> - <public type="attr" name="rotationX"/> - <public type="attr" name="rotationY"/> - <public type="attr" name="showDividers" /> - <public type="attr" name="dividerPadding" /> - <public type="attr" name="borderlessButtonStyle" /> - <public type="attr" name="dividerHorizontal" /> - <public type="attr" name="itemPadding" /> - <public type="attr" name="buttonBarStyle" /> - <public type="attr" name="buttonBarButtonStyle" /> - <public type="attr" name="segmentedButtonStyle" /> - <public type="attr" name="staticWallpaperPreview" /> - <public type="attr" name="allowParallelSyncs" /> - <public type="attr" name="isAlwaysSyncable" /> - <public type="attr" name="verticalScrollbarPosition" /> - <public type="attr" name="fastScrollAlwaysVisible" /> - <public type="attr" name="fastScrollThumbDrawable" /> - <public type="attr" name="fastScrollPreviewBackgroundLeft" /> - <public type="attr" name="fastScrollPreviewBackgroundRight" /> - <public type="attr" name="fastScrollTrackDrawable" /> - <public type="attr" name="fastScrollOverlayPosition" /> - <public type="attr" name="customTokens" /> - <public type="attr" name="nextFocusForward" /> - <public type="attr" name="firstDayOfWeek" /> - <public type="attr" name="showWeekNumber" /> - <public type="attr" name="minDate" /> - <public type="attr" name="maxDate" /> - <public type="attr" name="shownWeekCount" /> - <public type="attr" name="selectedWeekBackgroundColor" /> - <public type="attr" name="focusedMonthDateColor" /> - <public type="attr" name="unfocusedMonthDateColor" /> - <public type="attr" name="weekNumberColor" /> - <public type="attr" name="weekSeparatorLineColor" /> - <public type="attr" name="selectedDateVerticalBar" /> - <public type="attr" name="weekDayTextAppearance" /> - <public type="attr" name="dateTextAppearance" /> - <public type="attr" name="solidColor" /> - <public type="attr" name="spinnersShown" /> - <public type="attr" name="calendarViewShown" /> - <public type="attr" name="state_multiline" /> - <public type="attr" name="detailsElementBackground" /> - <public type="attr" name="textColorHighlightInverse" /> - <public type="attr" name="textColorLinkInverse" /> - <public type="attr" name="editTextColor" /> - <public type="attr" name="editTextBackground" /> - <public type="attr" name="horizontalScrollViewStyle" /> - <public type="attr" name="layerType" /> - <public type="attr" name="alertDialogIcon" /> - <public type="attr" name="windowMinWidthMajor" /> - <public type="attr" name="windowMinWidthMinor" /> - <public type="attr" name="queryHint" /> - <public type="attr" name="fastScrollTextColor" /> - <public type="attr" name="largeHeap" /> - <public type="attr" name="windowCloseOnTouchOutside" /> - <public type="attr" name="datePickerStyle" /> - <public type="attr" name="calendarViewStyle" /> - <public type="attr" name="textEditSidePasteWindowLayout" /> - <public type="attr" name="textEditSideNoPasteWindowLayout" /> + <public type="attr" name="allContactsName" id="0x010102cc" /> + <public type="attr" name="windowActionBar" id="0x010102cd" /> + <public type="attr" name="actionBarStyle" id="0x010102ce" /> + <public type="attr" name="navigationMode" id="0x010102cf" /> + <public type="attr" name="displayOptions" id="0x010102d0" /> + <public type="attr" name="subtitle" id="0x010102d1" /> + <public type="attr" name="customNavigationLayout" id="0x010102d2" /> + <public type="attr" name="hardwareAccelerated" id="0x010102d3" /> + <public type="attr" name="measureWithLargestChild" id="0x010102d4" /> + <public type="attr" name="animateFirstView" id="0x010102d5" /> + <public type="attr" name="dropDownSpinnerStyle" id="0x010102d6" /> + <public type="attr" name="actionDropDownStyle" id="0x010102d7" /> + <public type="attr" name="actionButtonStyle" id="0x010102d8" /> + <public type="attr" name="showAsAction" id="0x010102d9" /> + <public type="attr" name="previewImage" id="0x010102da" /> + <public type="attr" name="actionModeBackground" id="0x010102db" /> + <public type="attr" name="actionModeCloseDrawable" id="0x010102dc" /> + <public type="attr" name="windowActionModeOverlay" id="0x010102dd" /> + <public type="attr" name="valueFrom" id="0x010102de" /> + <public type="attr" name="valueTo" id="0x010102df" /> + <public type="attr" name="valueType" id="0x010102e0" /> + <public type="attr" name="propertyName" id="0x010102e1" /> + <public type="attr" name="ordering" id="0x010102e2" /> + <public type="attr" name="fragment" id="0x010102e3" /> + <public type="attr" name="windowActionBarOverlay" id="0x010102e4" /> + <public type="attr" name="fragmentOpenEnterAnimation" id="0x010102e5" /> + <public type="attr" name="fragmentOpenExitAnimation" id="0x010102e6" /> + <public type="attr" name="fragmentCloseEnterAnimation" id="0x010102e7" /> + <public type="attr" name="fragmentCloseExitAnimation" id="0x010102e8" /> + <public type="attr" name="fragmentFadeEnterAnimation" id="0x010102e9" /> + <public type="attr" name="fragmentFadeExitAnimation" id="0x010102ea" /> + <public type="attr" name="actionBarSize" id="0x010102eb" /> + <public type="attr" name="imeSubtypeLocale" id="0x010102ec" /> + <public type="attr" name="imeSubtypeMode" id="0x010102ed" /> + <public type="attr" name="imeSubtypeExtraValue" id="0x010102ee" /> + <public type="attr" name="splitMotionEvents" id="0x010102ef" /> + <public type="attr" name="listChoiceBackgroundIndicator" id="0x010102f0" /> + <public type="attr" name="spinnerMode" id="0x010102f1" /> + <public type="attr" name="animateLayoutChanges" id="0x010102f2" /> + <public type="attr" name="actionBarTabStyle" id="0x010102f3" /> + <public type="attr" name="actionBarTabBarStyle" id="0x010102f4" /> + <public type="attr" name="actionBarTabTextStyle" id="0x010102f5" /> + <public type="attr" name="actionOverflowButtonStyle" id="0x010102f6" /> + <public type="attr" name="actionModeCloseButtonStyle" id="0x010102f7" /> + <public type="attr" name="titleTextStyle" id="0x010102f8" /> + <public type="attr" name="subtitleTextStyle" id="0x010102f9" /> + <public type="attr" name="iconifiedByDefault" id="0x010102fa" /> + <public type="attr" name="actionLayout" id="0x010102fb" /> + <public type="attr" name="actionViewClass" id="0x010102fc" /> + <public type="attr" name="activatedBackgroundIndicator" id="0x010102fd" /> + <public type="attr" name="state_activated" id="0x010102fe" /> + <public type="attr" name="listPopupWindowStyle" id="0x010102ff" /> + <public type="attr" name="popupMenuStyle" id="0x01010300" /> + <public type="attr" name="textAppearanceLargePopupMenu" id="0x01010301" /> + <public type="attr" name="textAppearanceSmallPopupMenu" id="0x01010302" /> + <public type="attr" name="breadCrumbTitle" id="0x01010303" /> + <public type="attr" name="breadCrumbShortTitle" id="0x01010304" /> + <public type="attr" name="listDividerAlertDialog" id="0x01010305" /> + <public type="attr" name="textColorAlertDialogListItem" id="0x01010306" /> + <public type="attr" name="loopViews" id="0x01010307" /> + <public type="attr" name="dialogTheme" id="0x01010308" /> + <public type="attr" name="alertDialogTheme" id="0x01010309" /> + <public type="attr" name="dividerVertical" id="0x0101030a" /> + <public type="attr" name="homeAsUpIndicator" id="0x0101030b" /> + <public type="attr" name="enterFadeDuration" id="0x0101030c" /> + <public type="attr" name="exitFadeDuration" id="0x0101030d" /> + <public type="attr" name="selectableItemBackground" id="0x0101030e" /> + <public type="attr" name="autoAdvanceViewId" id="0x0101030f" /> + <public type="attr" name="useIntrinsicSizeAsMinimum" id="0x01010310" /> + <public type="attr" name="actionModeCutDrawable" id="0x01010311" /> + <public type="attr" name="actionModeCopyDrawable" id="0x01010312" /> + <public type="attr" name="actionModePasteDrawable" id="0x01010313" /> + <public type="attr" name="textEditPasteWindowLayout" id="0x01010314" /> + <public type="attr" name="textEditNoPasteWindowLayout" id="0x01010315" /> + <public type="attr" name="textIsSelectable" id="0x01010316" /> + <public type="attr" name="windowEnableSplitTouch" id="0x01010317" /> + <public type="attr" name="indeterminateProgressStyle" id="0x01010318" /> + <public type="attr" name="progressBarPadding" id="0x01010319" /> + <public type="attr" name="animationResolution" id="0x0101031a" /> + <public type="attr" name="state_accelerated" id="0x0101031b" /> + <public type="attr" name="baseline" id="0x0101031c" /> + <public type="attr" name="homeLayout" id="0x0101031d" /> + <public type="attr" name="opacity" id="0x0101031e" /> + <public type="attr" name="alpha" id="0x0101031f" /> + <public type="attr" name="transformPivotX" id="0x01010320" /> + <public type="attr" name="transformPivotY" id="0x01010321" /> + <public type="attr" name="translationX" id="0x01010322" /> + <public type="attr" name="translationY" id="0x01010323" /> + <public type="attr" name="scaleX" id="0x01010324" /> + <public type="attr" name="scaleY" id="0x01010325" /> + <public type="attr" name="rotation" id="0x01010326" /> + <public type="attr" name="rotationX" id="0x01010327" /> + <public type="attr" name="rotationY" id="0x01010328" /> + <public type="attr" name="showDividers" id="0x01010329" /> + <public type="attr" name="dividerPadding" id="0x0101032a" /> + <public type="attr" name="borderlessButtonStyle" id="0x0101032b" /> + <public type="attr" name="dividerHorizontal" id="0x0101032c" /> + <public type="attr" name="itemPadding" id="0x0101032d" /> + <public type="attr" name="buttonBarStyle" id="0x0101032e" /> + <public type="attr" name="buttonBarButtonStyle" id="0x0101032f" /> + <public type="attr" name="segmentedButtonStyle" id="0x01010330" /> + <public type="attr" name="staticWallpaperPreview" id="0x01010331" /> + <public type="attr" name="allowParallelSyncs" id="0x01010332" /> + <public type="attr" name="isAlwaysSyncable" id="0x01010333" /> + <public type="attr" name="verticalScrollbarPosition" id="0x01010334" /> + <public type="attr" name="fastScrollAlwaysVisible" id="0x01010335" /> + <public type="attr" name="fastScrollThumbDrawable" id="0x01010336" /> + <public type="attr" name="fastScrollPreviewBackgroundLeft" id="0x01010337" /> + <public type="attr" name="fastScrollPreviewBackgroundRight" id="0x01010338" /> + <public type="attr" name="fastScrollTrackDrawable" id="0x01010339" /> + <public type="attr" name="fastScrollOverlayPosition" id="0x0101033a" /> + <public type="attr" name="customTokens" id="0x0101033b" /> + <public type="attr" name="nextFocusForward" id="0x0101033c" /> + <public type="attr" name="firstDayOfWeek" id="0x0101033d" /> + <public type="attr" name="showWeekNumber" id="0x0101033e" /> + <public type="attr" name="minDate" id="0x0101033f" /> + <public type="attr" name="maxDate" id="0x01010340" /> + <public type="attr" name="shownWeekCount" id="0x01010341" /> + <public type="attr" name="selectedWeekBackgroundColor" id="0x01010342" /> + <public type="attr" name="focusedMonthDateColor" id="0x01010343" /> + <public type="attr" name="unfocusedMonthDateColor" id="0x01010344" /> + <public type="attr" name="weekNumberColor" id="0x01010345" /> + <public type="attr" name="weekSeparatorLineColor" id="0x01010346" /> + <public type="attr" name="selectedDateVerticalBar" id="0x01010347" /> + <public type="attr" name="weekDayTextAppearance" id="0x01010348" /> + <public type="attr" name="dateTextAppearance" id="0x01010349" /> + <public type="attr" name="solidColor" id="0x0101034a" /> + <public type="attr" name="spinnersShown" id="0x0101034b" /> + <public type="attr" name="calendarViewShown" id="0x0101034c" /> + <public type="attr" name="state_multiline" id="0x0101034d" /> + <public type="attr" name="detailsElementBackground" id="0x0101034e" /> + <public type="attr" name="textColorHighlightInverse" id="0x0101034f" /> + <public type="attr" name="textColorLinkInverse" id="0x01010350" /> + <public type="attr" name="editTextColor" id="0x01010351" /> + <public type="attr" name="editTextBackground" id="0x01010352" /> + <public type="attr" name="horizontalScrollViewStyle" id="0x01010353" /> + <public type="attr" name="layerType" id="0x01010354" /> + <public type="attr" name="alertDialogIcon" id="0x01010355" /> + <public type="attr" name="windowMinWidthMajor" id="0x01010356" /> + <public type="attr" name="windowMinWidthMinor" id="0x01010357" /> + <public type="attr" name="queryHint" id="0x01010358" /> + <public type="attr" name="fastScrollTextColor" id="0x01010359" /> + <public type="attr" name="largeHeap" id="0x0101035a" /> + <public type="attr" name="windowCloseOnTouchOutside" id="0x0101035b" /> + <public type="attr" name="datePickerStyle" id="0x0101035c" /> + <public type="attr" name="calendarViewStyle" id="0x0101035d" /> + <public type="attr" name="textEditSidePasteWindowLayout" id="0x0101035e" /> + <public type="attr" name="textEditSideNoPasteWindowLayout" id="0x0101035f" /> + <public type="attr" name="actionMenuTextAppearance" id="0x01010360" /> + <public type="attr" name="actionMenuTextColor" id="0x01010361" /> <!-- A simple fade-in animation. --> <public type="animator" name="fade_in" id="0x010b0000" /> <!-- A simple fade-out animation. --> - <public type="animator" name="fade_out" /> + <public type="animator" name="fade_out" id="0x010b0001" /> <!-- Acceleration curve matching a quadtratic ease out function. --> <public type="interpolator" name="accelerate_quad" id="0x010c0000" /> <!-- Acceleration curve matching a quadtratic ease in function. --> - <public type="interpolator" name="decelerate_quad" /> + <public type="interpolator" name="decelerate_quad" id="0x010c0001" /> <!-- Acceleration curve matching a cubic ease out function. --> - <public type="interpolator" name="accelerate_cubic" /> + <public type="interpolator" name="accelerate_cubic" id="0x010c0002" /> <!-- Acceleration curve matching a cubic ease in function. --> - <public type="interpolator" name="decelerate_cubic" /> + <public type="interpolator" name="decelerate_cubic" id="0x010c0003" /> <!-- Acceleration curve matching a quint ease out function. --> - <public type="interpolator" name="accelerate_quint" /> + <public type="interpolator" name="accelerate_quint" id="0x010c0004" /> <!-- Acceleration curve matching a quint ease in function. --> - <public type="interpolator" name="decelerate_quint" /> + <public type="interpolator" name="decelerate_quint" id="0x010c0005" /> <!-- Acceleration curve matching an ease in + ease out function --> - <public type="interpolator" name="accelerate_decelerate" /> + <public type="interpolator" name="accelerate_decelerate" id="0x010c0006" /> <!-- An interpolator where the change starts backward then flings forward. --> - <public type="interpolator" name="anticipate" /> + <public type="interpolator" name="anticipate" id="0x010c0007" /> <!-- An interpolator where the change flings forward and overshoots the last value then comes back. --> - <public type="interpolator" name="overshoot" /> + <public type="interpolator" name="overshoot" id="0x010c0008" /> <!-- An interpolator where the change starts backward then flings forward and overshoots the target value and finally goes back to the final value. --> - <public type="interpolator" name="anticipate_overshoot" /> + <public type="interpolator" name="anticipate_overshoot" id="0x010c0009" /> <!-- An interpolator where the change bounces at the end. --> - <public type="interpolator" name="bounce" /> + <public type="interpolator" name="bounce" id="0x010c000a" /> <!-- An interpolator where the rate of change is constant. --> - <public type="interpolator" name="linear" /> + <public type="interpolator" name="linear" id="0x010c000b" /> <!-- Repeats the animation for one cycle. The rate of change follows a sinusoidal pattern. --> - <public type="interpolator" name="cycle" /> + <public type="interpolator" name="cycle" id="0x010c000c" /> - <public type="id" name="home" /> + <public type="id" name="home" id="0x0102002c" /> <!-- Context menu ID for the "Select text..." menu item to switch to text selection context mode in text views. --> - <public type="id" name="selectTextMode" /> + <public type="id" name="selectTextMode" id="0x0102002d" /> - <public type="dimen" name="dialog_min_width_major" /> - <public type="dimen" name="dialog_min_width_minor" /> - <public type="dimen" name="notification_large_icon_width" /> - <public type="dimen" name="notification_large_icon_height" /> + <public type="dimen" name="dialog_min_width_major" id="0x01050003" /> + <public type="dimen" name="dialog_min_width_minor" id="0x01050004" /> + <public type="dimen" name="notification_large_icon_width" id="0x01050005" /> + <public type="dimen" name="notification_large_icon_height" id="0x01050006" /> <!-- Standard content view for a {@link android.app.ListFragment}. If you are implementing a subclass of ListFragment with your own customized content, you can include this layout in that content to still retain all of the standard functionality of the base class. --> - <public type="layout" name="list_content" /> + <public type="layout" name="list_content" id="0x01090014" /> <!-- A simple ListView item layout which can contain text and support (single or multiple) item selection. --> - <public type="layout" name="simple_selectable_list_item" /> + <public type="layout" name="simple_selectable_list_item" id="0x01090015" /> <!-- A version of {@link #simple_list_item_1} that is able to change its background state to indicate when it is activated (that is checked by a ListView). --> - <public type="layout" name="simple_list_item_activated_1" /> + <public type="layout" name="simple_list_item_activated_1" id="0x01090016" /> <!-- A version of {@link #simple_list_item_2} that is able to change its background state to indicate when it is activated (that is checked by a ListView). --> - <public type="layout" name="simple_list_item_activated_2" /> - - <public type="style" name="Theme.WithActionBar" /> - <public type="style" name="Theme.NoTitleBar.OverlayActionModes" /> - - <public type="style" name="Theme.Holo" /> - <public type="style" name="Theme.Holo.NoActionBar" /> - <public type="style" name="Theme.Holo.NoActionBar.Fullscreen" /> - <public type="style" name="Theme.Holo.Light" /> - <public type="style" name="Theme.Holo.Dialog" /> - <public type="style" name="Theme.Holo.Dialog.MinWidth" /> - <public type="style" name="Theme.Holo.Dialog.NoActionBar" /> - <public type="style" name="Theme.Holo.Dialog.NoActionBar.MinWidth" /> - <public type="style" name="Theme.Holo.Light.Dialog" /> - <public type="style" name="Theme.Holo.Light.Dialog.MinWidth" /> - <public type="style" name="Theme.Holo.Light.Dialog.NoActionBar" /> - <public type="style" name="Theme.Holo.Light.Dialog.NoActionBar.MinWidth" /> - <public type="style" name="Theme.Holo.DialogWhenLarge" /> - <public type="style" name="Theme.Holo.DialogWhenLarge.NoActionBar" /> - <public type="style" name="Theme.Holo.Light.DialogWhenLarge" /> - <public type="style" name="Theme.Holo.Light.DialogWhenLarge.NoActionBar" /> - <public type="style" name="Theme.Holo.Panel" /> - <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" /> - - <public type="style" name="Widget.ActionBar" /> - <public type="style" name="Widget.Spinner.DropDown" /> - <public type="style" name="Widget.ActionButton" /> - <public type="style" name="Widget.ListPopupWindow" /> - <public type="style" name="Widget.PopupMenu" /> - <public type="style" name="Widget.ActionButton.Overflow" /> - <public type="style" name="Widget.ActionButton.CloseMode" /> - <public type="style" name="Widget.FragmentBreadCrumbs" /> - <public type="style" name="Widget.Holo" /> - <public type="style" name="Widget.Holo.Button" /> - <public type="style" name="Widget.Holo.Button.Small" /> - <public type="style" name="Widget.Holo.Button.Inset" /> - <public type="style" name="Widget.Holo.Button.Toggle" /> - <public type="style" name="Widget.Holo.TextView" /> - <public type="style" name="Widget.Holo.AutoCompleteTextView" /> - <public type="style" name="Widget.Holo.CompoundButton.CheckBox" /> - <public type="style" name="Widget.Holo.ListView.DropDown" /> - <public type="style" name="Widget.Holo.EditText" /> - <public type="style" name="Widget.Holo.ExpandableListView" /> - <public type="style" name="Widget.Holo.GridView" /> - <public type="style" name="Widget.Holo.ImageButton" /> - <public type="style" name="Widget.Holo.ListView" /> - <public type="style" name="Widget.Holo.PopupWindow" /> - <public type="style" name="Widget.Holo.ProgressBar" /> - <public type="style" name="Widget.Holo.ProgressBar.Horizontal" /> - <public type="style" name="Widget.Holo.ProgressBar.Small" /> - <public type="style" name="Widget.Holo.ProgressBar.Small.Title" /> - <public type="style" name="Widget.Holo.ProgressBar.Large" /> - <public type="style" name="Widget.Holo.SeekBar" /> - <public type="style" name="Widget.Holo.RatingBar" /> - <public type="style" name="Widget.Holo.RatingBar.Indicator" /> - <public type="style" name="Widget.Holo.RatingBar.Small" /> - <public type="style" name="Widget.Holo.CompoundButton.RadioButton" /> - <public type="style" name="Widget.Holo.ScrollView" /> - <public type="style" name="Widget.Holo.HorizontalScrollView" /> - <public type="style" name="Widget.Holo.Spinner" /> - <public type="style" name="Widget.Holo.CompoundButton.Star" /> - <public type="style" name="Widget.Holo.TabWidget" /> - <public type="style" name="Widget.Holo.WebTextView" /> - <public type="style" name="Widget.Holo.WebView" /> - <public type="style" name="Widget.Holo.DropDownItem" /> - <public type="style" name="Widget.Holo.DropDownItem.Spinner" /> - <public type="style" name="Widget.Holo.TextView.SpinnerItem" /> - <public type="style" name="Widget.Holo.ListPopupWindow" /> - <public type="style" name="Widget.Holo.PopupMenu" /> - <public type="style" name="Widget.Holo.ActionButton" /> - <public type="style" name="Widget.Holo.ActionButton.Overflow" /> - <public type="style" name="Widget.Holo.ActionButton.TextButton" /> - <public type="style" name="Widget.Holo.ActionMode" /> - <public type="style" name="Widget.Holo.ActionButton.CloseMode" /> - <public type="style" name="Widget.Holo.ActionBar" /> - <public type="style" name="Widget.Holo.Light" /> - <public type="style" name="Widget.Holo.Light.Button" /> - <public type="style" name="Widget.Holo.Light.Button.Small" /> - <public type="style" name="Widget.Holo.Light.Button.Inset" /> - <public type="style" name="Widget.Holo.Light.Button.Toggle" /> - <public type="style" name="Widget.Holo.Light.TextView" /> - <public type="style" name="Widget.Holo.Light.AutoCompleteTextView" /> - <public type="style" name="Widget.Holo.Light.CompoundButton.CheckBox" /> - <public type="style" name="Widget.Holo.Light.ListView.DropDown" /> - <public type="style" name="Widget.Holo.Light.EditText" /> - <public type="style" name="Widget.Holo.Light.ExpandableListView" /> - <public type="style" name="Widget.Holo.Light.GridView" /> - <public type="style" name="Widget.Holo.Light.ImageButton" /> - <public type="style" name="Widget.Holo.Light.ListView" /> - <public type="style" name="Widget.Holo.Light.PopupWindow" /> - <public type="style" name="Widget.Holo.Light.ProgressBar" /> - <public type="style" name="Widget.Holo.Light.ProgressBar.Horizontal" /> - <public type="style" name="Widget.Holo.Light.ProgressBar.Small" /> - <public type="style" name="Widget.Holo.Light.ProgressBar.Small.Title" /> - <public type="style" name="Widget.Holo.Light.ProgressBar.Large" /> - <public type="style" name="Widget.Holo.Light.ProgressBar.Inverse" /> - <public type="style" name="Widget.Holo.Light.ProgressBar.Small.Inverse" /> - <public type="style" name="Widget.Holo.Light.ProgressBar.Large.Inverse" /> - <public type="style" name="Widget.Holo.Light.SeekBar" /> - <public type="style" name="Widget.Holo.Light.RatingBar" /> - <public type="style" name="Widget.Holo.Light.RatingBar.Indicator" /> - <public type="style" name="Widget.Holo.Light.RatingBar.Small" /> - <public type="style" name="Widget.Holo.Light.CompoundButton.RadioButton" /> - <public type="style" name="Widget.Holo.Light.ScrollView" /> - <public type="style" name="Widget.Holo.Light.HorizontalScrollView" /> - <public type="style" name="Widget.Holo.Light.Spinner" /> - <public type="style" name="Widget.Holo.Light.CompoundButton.Star" /> - <public type="style" name="Widget.Holo.Light.TabWidget" /> - <public type="style" name="Widget.Holo.Light.WebTextView" /> - <public type="style" name="Widget.Holo.Light.WebView" /> - <public type="style" name="Widget.Holo.Light.DropDownItem" /> - <public type="style" name="Widget.Holo.Light.DropDownItem.Spinner" /> - <public type="style" name="Widget.Holo.Light.TextView.SpinnerItem" /> - <public type="style" name="Widget.Holo.Light.ListPopupWindow" /> - <public type="style" name="Widget.Holo.Light.PopupMenu" /> - <public type="style" name="Widget.Holo.Light.ActionButton" /> - <public type="style" name="Widget.Holo.Light.ActionButton.Overflow" /> - <public type="style" name="Widget.Holo.Light.ActionMode" /> - <public type="style" name="Widget.Holo.Light.ActionButton.CloseMode" /> - <public type="style" name="Widget.Holo.Light.ActionBar" /> - <public type="style" name="Widget.Holo.Button.Borderless" /> - <public type="style" name="Widget.Holo.Tab" /> - <public type="style" name="Widget.Holo.Light.Tab" /> - <public type="style" name="Holo.ButtonBar" /> - <public type="style" name="Holo.Light.ButtonBar" /> - <public type="style" name="Holo.ButtonBar.AlertDialog" /> - <public type="style" name="Holo.Light.ButtonBar.AlertDialog" /> - <public type="style" name="Holo.SegmentedButton" /> - <public type="style" name="Holo.Light.SegmentedButton" /> - <public type="style" name="Widget.CalendarView" /> - <public type="style" name="Widget.Holo.CalendarView" /> - <public type="style" name="Widget.Holo.Light.CalendarView" /> - <public type="style" name="Widget.DatePicker" /> - <public type="style" name="Widget.Holo.DatePicker" /> - - <public type="string" name="selectTextMode" /> + <public type="layout" name="simple_list_item_activated_2" id="0x01090017" /> + + <public type="drawable" name="dialog_holo_dark_frame" id="0x010800b2" /> + <public type="drawable" name="dialog_holo_light_frame" id="0x010800b3" /> + + <public type="style" name="Theme.WithActionBar" id="0x01030069" /> + <public type="style" name="Theme.NoTitleBar.OverlayActionModes" id="0x0103006a" /> + <public type="style" name="Theme.Holo" id="0x0103006b" /> + <public type="style" name="Theme.Holo.NoActionBar" id="0x0103006c" /> + <public type="style" name="Theme.Holo.NoActionBar.Fullscreen" id="0x0103006d" /> + <public type="style" name="Theme.Holo.Light" id="0x0103006e" /> + <public type="style" name="Theme.Holo.Dialog" id="0x0103006f" /> + <public type="style" name="Theme.Holo.Dialog.MinWidth" id="0x01030070" /> + <public type="style" name="Theme.Holo.Dialog.NoActionBar" id="0x01030071" /> + <public type="style" name="Theme.Holo.Dialog.NoActionBar.MinWidth" id="0x01030072" /> + <public type="style" name="Theme.Holo.Light.Dialog" id="0x01030073" /> + <public type="style" name="Theme.Holo.Light.Dialog.MinWidth" id="0x01030074" /> + <public type="style" name="Theme.Holo.Light.Dialog.NoActionBar" id="0x01030075" /> + <public type="style" name="Theme.Holo.Light.Dialog.NoActionBar.MinWidth" id="0x01030076" /> + <public type="style" name="Theme.Holo.DialogWhenLarge" id="0x01030077" /> + <public type="style" name="Theme.Holo.DialogWhenLarge.NoActionBar" id="0x01030078" /> + <public type="style" name="Theme.Holo.Light.DialogWhenLarge" id="0x01030079" /> + <public type="style" name="Theme.Holo.Light.DialogWhenLarge.NoActionBar" id="0x0103007a" /> + <public type="style" name="Theme.Holo.Panel" id="0x0103007b" /> + <public type="style" name="Theme.Holo.Light.Panel" id="0x0103007c" /> + <public type="style" name="Theme.Holo.Wallpaper" id="0x0103007d" /> + <public type="style" name="Theme.Holo.Wallpaper.NoTitleBar" id="0x0103007e" /> + <public type="style" name="Theme.Holo.InputMethod" id="0x0103007f" /> + <public type="style" name="TextAppearance.Widget.PopupMenu.Large" id="0x01030080" /> + <public type="style" name="TextAppearance.Widget.PopupMenu.Small" id="0x01030081" /> + <public type="style" name="Widget.ActionBar" id="0x01030082" /> + <public type="style" name="Widget.Spinner.DropDown" id="0x01030083" /> + <public type="style" name="Widget.ActionButton" id="0x01030084" /> + <public type="style" name="Widget.ListPopupWindow" id="0x01030085" /> + <public type="style" name="Widget.PopupMenu" id="0x01030086" /> + <public type="style" name="Widget.ActionButton.Overflow" id="0x01030087" /> + <public type="style" name="Widget.ActionButton.CloseMode" id="0x01030088" /> + <public type="style" name="Widget.FragmentBreadCrumbs" id="0x01030089" /> + <public type="style" name="Widget.Holo" id="0x0103008a" /> + <public type="style" name="Widget.Holo.Button" id="0x0103008b" /> + <public type="style" name="Widget.Holo.Button.Small" id="0x0103008c" /> + <public type="style" name="Widget.Holo.Button.Inset" id="0x0103008d" /> + <public type="style" name="Widget.Holo.Button.Toggle" id="0x0103008e" /> + <public type="style" name="Widget.Holo.TextView" id="0x0103008f" /> + <public type="style" name="Widget.Holo.AutoCompleteTextView" id="0x01030090" /> + <public type="style" name="Widget.Holo.CompoundButton.CheckBox" id="0x01030091" /> + <public type="style" name="Widget.Holo.ListView.DropDown" id="0x01030092" /> + <public type="style" name="Widget.Holo.EditText" id="0x01030093" /> + <public type="style" name="Widget.Holo.ExpandableListView" id="0x01030094" /> + <public type="style" name="Widget.Holo.GridView" id="0x01030095" /> + <public type="style" name="Widget.Holo.ImageButton" id="0x01030096" /> + <public type="style" name="Widget.Holo.ListView" id="0x01030097" /> + <public type="style" name="Widget.Holo.PopupWindow" id="0x01030098" /> + <public type="style" name="Widget.Holo.ProgressBar" id="0x01030099" /> + <public type="style" name="Widget.Holo.ProgressBar.Horizontal" id="0x0103009a" /> + <public type="style" name="Widget.Holo.ProgressBar.Small" id="0x0103009b" /> + <public type="style" name="Widget.Holo.ProgressBar.Small.Title" id="0x0103009c" /> + <public type="style" name="Widget.Holo.ProgressBar.Large" id="0x0103009d" /> + <public type="style" name="Widget.Holo.SeekBar" id="0x0103009e" /> + <public type="style" name="Widget.Holo.RatingBar" id="0x0103009f" /> + <public type="style" name="Widget.Holo.RatingBar.Indicator" id="0x010300a0" /> + <public type="style" name="Widget.Holo.RatingBar.Small" id="0x010300a1" /> + <public type="style" name="Widget.Holo.CompoundButton.RadioButton" id="0x010300a2" /> + <public type="style" name="Widget.Holo.ScrollView" id="0x010300a3" /> + <public type="style" name="Widget.Holo.HorizontalScrollView" id="0x010300a4" /> + <public type="style" name="Widget.Holo.Spinner" id="0x010300a5" /> + <public type="style" name="Widget.Holo.CompoundButton.Star" id="0x010300a6" /> + <public type="style" name="Widget.Holo.TabWidget" id="0x010300a7" /> + <public type="style" name="Widget.Holo.WebTextView" id="0x010300a8" /> + <public type="style" name="Widget.Holo.WebView" id="0x010300a9" /> + <public type="style" name="Widget.Holo.DropDownItem" id="0x010300aa" /> + <public type="style" name="Widget.Holo.DropDownItem.Spinner" id="0x010300ab" /> + <public type="style" name="Widget.Holo.TextView.SpinnerItem" id="0x010300ac" /> + <public type="style" name="Widget.Holo.ListPopupWindow" id="0x010300ad" /> + <public type="style" name="Widget.Holo.PopupMenu" id="0x010300ae" /> + <public type="style" name="Widget.Holo.ActionButton" id="0x010300af" /> + <public type="style" name="Widget.Holo.ActionButton.Overflow" id="0x010300b0" /> + <public type="style" name="Widget.Holo.ActionButton.TextButton" id="0x010300b1" /> + <public type="style" name="Widget.Holo.ActionMode" id="0x010300b2" /> + <public type="style" name="Widget.Holo.ActionButton.CloseMode" id="0x010300b3" /> + <public type="style" name="Widget.Holo.ActionBar" id="0x010300b4" /> + <public type="style" name="Widget.Holo.Light" id="0x010300b5" /> + <public type="style" name="Widget.Holo.Light.Button" id="0x010300b6" /> + <public type="style" name="Widget.Holo.Light.Button.Small" id="0x010300b7" /> + <public type="style" name="Widget.Holo.Light.Button.Inset" id="0x010300b8" /> + <public type="style" name="Widget.Holo.Light.Button.Toggle" id="0x010300b9" /> + <public type="style" name="Widget.Holo.Light.TextView" id="0x010300ba" /> + <public type="style" name="Widget.Holo.Light.AutoCompleteTextView" id="0x010300bb" /> + <public type="style" name="Widget.Holo.Light.CompoundButton.CheckBox" id="0x010300bc" /> + <public type="style" name="Widget.Holo.Light.ListView.DropDown" id="0x010300bd" /> + <public type="style" name="Widget.Holo.Light.EditText" id="0x010300be" /> + <public type="style" name="Widget.Holo.Light.ExpandableListView" id="0x010300bf" /> + <public type="style" name="Widget.Holo.Light.GridView" id="0x010300c0" /> + <public type="style" name="Widget.Holo.Light.ImageButton" id="0x010300c1" /> + <public type="style" name="Widget.Holo.Light.ListView" id="0x010300c2" /> + <public type="style" name="Widget.Holo.Light.PopupWindow" id="0x010300c3" /> + <public type="style" name="Widget.Holo.Light.ProgressBar" id="0x010300c4" /> + <public type="style" name="Widget.Holo.Light.ProgressBar.Horizontal" id="0x010300c5" /> + <public type="style" name="Widget.Holo.Light.ProgressBar.Small" id="0x010300c6" /> + <public type="style" name="Widget.Holo.Light.ProgressBar.Small.Title" id="0x010300c7" /> + <public type="style" name="Widget.Holo.Light.ProgressBar.Large" id="0x010300c8" /> + <public type="style" name="Widget.Holo.Light.ProgressBar.Inverse" id="0x010300c9" /> + <public type="style" name="Widget.Holo.Light.ProgressBar.Small.Inverse" id="0x010300ca" /> + <public type="style" name="Widget.Holo.Light.ProgressBar.Large.Inverse" id="0x010300cb" /> + <public type="style" name="Widget.Holo.Light.SeekBar" id="0x010300cc" /> + <public type="style" name="Widget.Holo.Light.RatingBar" id="0x010300cd" /> + <public type="style" name="Widget.Holo.Light.RatingBar.Indicator" id="0x010300ce" /> + <public type="style" name="Widget.Holo.Light.RatingBar.Small" id="0x010300cf" /> + <public type="style" name="Widget.Holo.Light.CompoundButton.RadioButton" id="0x010300d0" /> + <public type="style" name="Widget.Holo.Light.ScrollView" id="0x010300d1" /> + <public type="style" name="Widget.Holo.Light.HorizontalScrollView" id="0x010300d2" /> + <public type="style" name="Widget.Holo.Light.Spinner" id="0x010300d3" /> + <public type="style" name="Widget.Holo.Light.CompoundButton.Star" id="0x010300d4" /> + <public type="style" name="Widget.Holo.Light.TabWidget" id="0x010300d5" /> + <public type="style" name="Widget.Holo.Light.WebTextView" id="0x010300d6" /> + <public type="style" name="Widget.Holo.Light.WebView" id="0x010300d7" /> + <public type="style" name="Widget.Holo.Light.DropDownItem" id="0x010300d8" /> + <public type="style" name="Widget.Holo.Light.DropDownItem.Spinner" id="0x010300d9" /> + <public type="style" name="Widget.Holo.Light.TextView.SpinnerItem" id="0x010300da" /> + <public type="style" name="Widget.Holo.Light.ListPopupWindow" id="0x010300db" /> + <public type="style" name="Widget.Holo.Light.PopupMenu" id="0x010300dc" /> + <public type="style" name="Widget.Holo.Light.ActionButton" id="0x010300dd" /> + <public type="style" name="Widget.Holo.Light.ActionButton.Overflow" id="0x010300de" /> + <public type="style" name="Widget.Holo.Light.ActionMode" id="0x010300df" /> + <public type="style" name="Widget.Holo.Light.ActionButton.CloseMode" id="0x010300e0" /> + <public type="style" name="Widget.Holo.Light.ActionBar" id="0x010300e1" /> + <public type="style" name="Widget.Holo.Button.Borderless" id="0x010300e2" /> + <public type="style" name="Widget.Holo.Tab" id="0x010300e3" /> + <public type="style" name="Widget.Holo.Light.Tab" id="0x010300e4" /> + <public type="style" name="Holo.ButtonBar" id="0x010300e5" /> + <public type="style" name="Holo.Light.ButtonBar" id="0x010300e6" /> + <public type="style" name="Holo.ButtonBar.AlertDialog" id="0x010300e7" /> + <public type="style" name="Holo.Light.ButtonBar.AlertDialog" id="0x010300e8" /> + <public type="style" name="Holo.SegmentedButton" id="0x010300e9" /> + <public type="style" name="Holo.Light.SegmentedButton" id="0x010300ea" /> + <public type="style" name="Widget.CalendarView" id="0x010300eb" /> + <public type="style" name="Widget.Holo.CalendarView" id="0x010300ec" /> + <public type="style" name="Widget.Holo.Light.CalendarView" id="0x010300ed" /> + <public type="style" name="Widget.DatePicker" id="0x010300ee" /> + <public type="style" name="Widget.Holo.DatePicker" id="0x010300ef" /> + + <public type="string" name="selectTextMode" id="0x01040016" /> <!-- Default icon for applications that don't specify an icon. --> <public type="mipmap" name="sym_def_app_icon" id="0x010d0000" /> diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 529111e..d09210e 100755 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -2690,4 +2690,11 @@ <!-- Choose Account Activity label --> <string name="choose_account_label">Select an account</string> + + <!-- NumberPicker - accessibility support --> + <!-- Description of the button to increment the NumberPicker value. [CHAR LIMIT=NONE] --> + <string name="number_picker_increment_button">Increment</string> + <!-- Description of the button to decrement the NumberPicker value. [CHAR LIMIT=NONE] --> + <string name="number_picker_decrement_button">Decrement</string> + </resources> diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml index b828318..f54f8cc 100644 --- a/core/res/res/values/styles.xml +++ b/core/res/res/values/styles.xml @@ -224,7 +224,7 @@ <item name="android:textStyle">bold</item> </style> <style name="TextAppearance.StatusBar.EventContent"> - <item name="android:textSize">10sp</item> + <item name="android:textAppearance">?android:attr/textAppearanceSmall</item> <item name="android:textColor">?android:attr/textColorPrimaryInverse</item> </style> <style name="TextAppearance.StatusBar.EventContent.Title"> diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml index c5ae77f..38b068e 100644 --- a/core/res/res/values/themes.xml +++ b/core/res/res/values/themes.xml @@ -270,6 +270,8 @@ <item name="actionBarStyle">@android:style/Widget.ActionBar</item> <item name="actionBarSize">56dip</item> <item name="actionModePopupWindowStyle">?android:attr/popupWindowStyle</item> + <item name="actionMenuTextAppearance">?android:attr/textAppearanceMedium</item> + <item name="actionMenuTextColor">?android:attr/textColorPrimary</item> <item name="dividerVertical">@drawable/divider_vertical_dark</item> <item name="dividerHorizontal">@drawable/divider_vertical_dark</item> diff --git a/core/tests/coretests/res/raw/install_uses_feature b/core/tests/coretests/res/raw/install_uses_feature Binary files differindex 769a246..eeeb309 100644 --- a/core/tests/coretests/res/raw/install_uses_feature +++ b/core/tests/coretests/res/raw/install_uses_feature diff --git a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java index 0e65df5..7af64e4 100755 --- a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java +++ b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java @@ -3098,10 +3098,19 @@ public class PackageManagerTests extends AndroidTestCase { fail, retCode, PackageInfo.INSTALL_LOCATION_UNSPECIFIED); } + /** + * Unknown features should be allowed to install. This prevents older phones + * from rejecting new packages that specify features that didn't exist when + * an older phone existed. All older phones are assumed to have those + * features. + * <p> + * Right now we allow all packages to be installed regardless of their + * features. + */ @LargeTest - public void testUsesFeatureMissingFeature() { - int retCode = PackageManager.INSTALL_FAILED_MISSING_FEATURE; - installFromRawResource("install.apk", R.raw.install_uses_feature, 0, true, true, retCode, + public void testUsesFeatureUnknownFeature() { + int retCode = PackageManager.INSTALL_SUCCEEDED; + installFromRawResource("install.apk", R.raw.install_uses_feature, 0, true, false, retCode, PackageInfo.INSTALL_LOCATION_UNSPECIFIED); } diff --git a/data/etc/android.hardware.touchscreen.multitouch.distinct.xml b/data/etc/android.hardware.touchscreen.multitouch.distinct.xml index a3c116a..35eeefd 100644 --- a/data/etc/android.hardware.touchscreen.multitouch.distinct.xml +++ b/data/etc/android.hardware.touchscreen.multitouch.distinct.xml @@ -20,4 +20,5 @@ <feature name="android.hardware.touchscreen" /> <feature name="android.hardware.touchscreen.multitouch" /> <feature name="android.hardware.touchscreen.multitouch.distinct" /> + <feature name="android.hardware.faketouch" /> </permissions> diff --git a/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml b/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml index 80bf859..ed6606d 100644 --- a/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml +++ b/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml @@ -21,4 +21,5 @@ <feature name="android.hardware.touchscreen.multitouch" /> <feature name="android.hardware.touchscreen.multitouch.distinct" /> <feature name="android.hardware.touchscreen.multitouch.jazzhand" /> + <feature name="android.hardware.faketouch" /> </permissions> diff --git a/data/etc/android.hardware.touchscreen.multitouch.xml b/data/etc/android.hardware.touchscreen.multitouch.xml index 34b518a..1d59a27 100644 --- a/data/etc/android.hardware.touchscreen.multitouch.xml +++ b/data/etc/android.hardware.touchscreen.multitouch.xml @@ -20,4 +20,5 @@ <permissions> <feature name="android.hardware.touchscreen" /> <feature name="android.hardware.touchscreen.multitouch" /> + <feature name="android.hardware.faketouch" /> </permissions> diff --git a/data/etc/android.hardware.touchscreen.xml b/data/etc/android.hardware.touchscreen.xml index 10c91f1..5b5ddf9 100644 --- a/data/etc/android.hardware.touchscreen.xml +++ b/data/etc/android.hardware.touchscreen.xml @@ -18,4 +18,5 @@ support multitouch. --> <permissions> <feature name="android.hardware.touchscreen" /> + <feature name="android.hardware.faketouch" /> </permissions> diff --git a/data/fonts/DroidSansFallback.ttf b/data/fonts/DroidSansFallback.ttf Binary files differindex 206621f..8c6fabe 100644 --- a/data/fonts/DroidSansFallback.ttf +++ b/data/fonts/DroidSansFallback.ttf diff --git a/data/sounds/AudioPackage6.mk b/data/sounds/AudioPackage6.mk index e39a02e..92bf416 100755 --- a/data/sounds/AudioPackage6.mk +++ b/data/sounds/AudioPackage6.mk @@ -8,35 +8,39 @@ LOCAL_PATH:= frameworks/base/data/sounds PRODUCT_COPY_FILES += \ - $(LOCAL_PATH)/Alarm_Buzzer.ogg:system/media/audio/alarms/Alarm_Buzzer.ogg \ - $(LOCAL_PATH)/Alarm_Beep_01.ogg:system/media/audio/alarms/Alarm_Beep_01.ogg \ - $(LOCAL_PATH)/Alarm_Beep_02.ogg:system/media/audio/alarms/Alarm_Beep_02.ogg \ - $(LOCAL_PATH)/Alarm_Classic.ogg:system/media/audio/alarms/Alarm_Classic.ogg \ - $(LOCAL_PATH)/Alarm_Beep_03.ogg:system/media/audio/alarms/Alarm_Beep_03.ogg \ - $(LOCAL_PATH)/effects/Effect_Tick.ogg:system/media/audio/ui/Effect_Tick.ogg \ - $(LOCAL_PATH)/effects/KeypressStandard.ogg:system/media/audio/ui/KeypressStandard.ogg \ - $(LOCAL_PATH)/effects/KeypressSpacebar.ogg:system/media/audio/ui/KeypressSpacebar.ogg \ - $(LOCAL_PATH)/effects/KeypressDelete.ogg:system/media/audio/ui/KeypressDelete.ogg \ - $(LOCAL_PATH)/effects/KeypressReturn.ogg:system/media/audio/ui/KeypressReturn.ogg \ - $(LOCAL_PATH)/effects/VideoRecord.ogg:system/media/audio/ui/VideoRecord.ogg \ - $(LOCAL_PATH)/effects/camera_click.ogg:system/media/audio/ui/camera_click.ogg \ - $(LOCAL_PATH)/effects/LowBattery.ogg:system/media/audio/ui/LowBattery.ogg \ - $(LOCAL_PATH)/effects/Dock.ogg:system/media/audio/ui/Dock.ogg \ - $(LOCAL_PATH)/effects/Undock.ogg:system/media/audio/ui/Undock.ogg \ - $(LOCAL_PATH)/effects/Lock.ogg:system/media/audio/ui/Lock.ogg \ - $(LOCAL_PATH)/effects/Unlock.ogg:system/media/audio/ui/Unlock.ogg \ - $(LOCAL_PATH)/notifications/aidos.ogg:system/media/audio/notifications/aidos.ogg \ - $(LOCAL_PATH)/notifications/nomos1.ogg:system/media/audio/notifications/nomos1.ogg \ - $(LOCAL_PATH)/notifications/hypnos1.ogg:system/media/audio/notifications/hypnos1.ogg \ - $(LOCAL_PATH)/notifications/thrasos1.ogg:system/media/audio/notifications/thrasos1.ogg \ - $(LOCAL_PATH)/notifications/nomos2.ogg:system/media/audio/notifications/nomos2.ogg \ - $(LOCAL_PATH)/notifications/horkos.ogg:system/media/audio/notifications/horkos.ogg \ - $(LOCAL_PATH)/notifications/kratos1.ogg:system/media/audio/notifications/kratos1.ogg \ - $(LOCAL_PATH)/notifications/circios.ogg:system/media/audio/notifications/circios.ogg \ - $(LOCAL_PATH)/notifications/ouranos.ogg:system/media/audio/notifications/ouranos.ogg \ - $(LOCAL_PATH)/notifications/poros.ogg:system/media/audio/notifications/poros.ogg \ - $(LOCAL_PATH)/notifications/phantasos.ogg:system/media/audio/notifications/phantasos.ogg \ - $(LOCAL_PATH)/notifications/kratos2.ogg:system/media/audio/notifications/kratos2.ogg \ + $(LOCAL_PATH)/alarms/ogg/Analysis.ogg:system/media/audio/alarms/Analysis.ogg \ + $(LOCAL_PATH)/alarms/ogg/Departure.ogg:system/media/audio/alarms/Departure.ogg \ + $(LOCAL_PATH)/alarms/ogg/FireDrill.ogg:system/media/audio/alarms/FireDrill.ogg \ + $(LOCAL_PATH)/alarms/ogg/Timing.ogg:system/media/audio/alarms/Timing.ogg \ + $(LOCAL_PATH)/effects/ogg/Effect_Tick.ogg:system/media/audio/ui/Effect_Tick.ogg \ + $(LOCAL_PATH)/effects/ogg/KeypressStandard.ogg:system/media/audio/ui/KeypressStandard.ogg \ + $(LOCAL_PATH)/effects/ogg/KeypressSpacebar.ogg:system/media/audio/ui/KeypressSpacebar.ogg \ + $(LOCAL_PATH)/effects/ogg/KeypressDelete.ogg:system/media/audio/ui/KeypressDelete.ogg \ + $(LOCAL_PATH)/effects/ogg/KeypressReturn.ogg:system/media/audio/ui/KeypressReturn.ogg \ + $(LOCAL_PATH)/effects/ogg/VideoRecord.ogg:system/media/audio/ui/VideoRecord.ogg \ + $(LOCAL_PATH)/effects/ogg/camera_click.ogg:system/media/audio/ui/camera_click.ogg \ + $(LOCAL_PATH)/effects/ogg/LowBattery.ogg:system/media/audio/ui/LowBattery.ogg \ + $(LOCAL_PATH)/effects/ogg/Dock.ogg:system/media/audio/ui/Dock.ogg \ + $(LOCAL_PATH)/effects/ogg/Undock.ogg:system/media/audio/ui/Undock.ogg \ + $(LOCAL_PATH)/effects/ogg/Lock.ogg:system/media/audio/ui/Lock.ogg \ + $(LOCAL_PATH)/effects/ogg/Unlock.ogg:system/media/audio/ui/Unlock.ogg \ + $(LOCAL_PATH)/notifications/ogg/Antimony.ogg:system/media/audio/notifications/Antimony.ogg \ + $(LOCAL_PATH)/notifications/ogg/Argon.ogg:system/media/audio/notifications/Argon.ogg \ + $(LOCAL_PATH)/notifications/ogg/Beryllium.ogg:system/media/audio/notifications/Beryllium.ogg \ + $(LOCAL_PATH)/notifications/ogg/Cobalt.ogg:system/media/audio/notifications/Cobalt.ogg \ + $(LOCAL_PATH)/notifications/ogg/Fluorine.ogg:system/media/audio/notifications/Fluorine.ogg \ + $(LOCAL_PATH)/notifications/ogg/Gallium.ogg:system/media/audio/notifications/Gallium.ogg \ + $(LOCAL_PATH)/notifications/ogg/Helium.ogg:system/media/audio/notifications/Helium.ogg \ + $(LOCAL_PATH)/notifications/ogg/Iridium.ogg:system/media/audio/notifications/Iridium.ogg \ + $(LOCAL_PATH)/notifications/ogg/Krypton.ogg:system/media/audio/notifications/Krypton.ogg \ + $(LOCAL_PATH)/notifications/ogg/Palladium.ogg:system/media/audio/notifications/Palladium.ogg \ + $(LOCAL_PATH)/notifications/ogg/Radon.ogg:system/media/audio/notifications/Radon.ogg \ + $(LOCAL_PATH)/notifications/ogg/Rubidium.ogg:system/media/audio/notifications/Rubidium.ogg \ + $(LOCAL_PATH)/notifications/ogg/Selenium.ogg:system/media/audio/notifications/Selenium.ogg \ + $(LOCAL_PATH)/notifications/ogg/Strontium.ogg:system/media/audio/notifications/Strontium.ogg \ + $(LOCAL_PATH)/notifications/ogg/Thallium.ogg:system/media/audio/notifications/Thallium.ogg \ + $(LOCAL_PATH)/notifications/ogg/Xenon.ogg:system/media/audio/notifications/Xenon.ogg \ + $(LOCAL_PATH)/notifications/ogg/Zirconium.ogg:system/media/audio/notifications/Zirconium.ogg \ $(LOCAL_PATH)/ringtones/ANDROMEDA.ogg:system/media/audio/ringtones/ANDROMEDA.ogg \ $(LOCAL_PATH)/ringtones/Aquila.ogg:system/media/audio/ringtones/Aquila.ogg \ $(LOCAL_PATH)/ringtones/ArgoNavis.ogg:system/media/audio/ringtones/ArgoNavis.ogg \ @@ -61,25 +65,4 @@ PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/ringtones/Solarium.ogg:system/media/audio/ringtones/Solarium.ogg \ $(LOCAL_PATH)/ringtones/Testudo.ogg:system/media/audio/ringtones/Testudo.ogg \ $(LOCAL_PATH)/ringtones/URSAMINOR.ogg:system/media/audio/ringtones/URSAMINOR.ogg \ - $(LOCAL_PATH)/ringtones/Vespa.ogg:system/media/audio/ringtones/Vespa.ogg \ - $(LOCAL_PATH)/ringtones/ringtone18.ogg:system/media/audio/ringtones/ringtone18.ogg \ - $(LOCAL_PATH)/ringtones/ringtone19.ogg:system/media/audio/ringtones/ringtone19.ogg \ - $(LOCAL_PATH)/ringtones/ringtone20.ogg:system/media/audio/ringtones/ringtone20.ogg \ - $(LOCAL_PATH)/ringtones/ringtone21.ogg:system/media/audio/ringtones/ringtone21.ogg \ - $(LOCAL_PATH)/ringtones/ringtone22.ogg:system/media/audio/ringtones/ringtone22.ogg \ - $(LOCAL_PATH)/ringtones/ringtone23.ogg:system/media/audio/ringtones/ringtone23.ogg \ - $(LOCAL_PATH)/ringtones/ringtone24.ogg:system/media/audio/ringtones/ringtone24.ogg \ - $(LOCAL_PATH)/ringtones/ringtone25.ogg:system/media/audio/ringtones/ringtone25.ogg \ - $(LOCAL_PATH)/ringtones/ringtone26.ogg:system/media/audio/ringtones/ringtone26.ogg \ - $(LOCAL_PATH)/ringtones/ringtone27.ogg:system/media/audio/ringtones/ringtone27.ogg \ - $(LOCAL_PATH)/ringtones/ringtone28.ogg:system/media/audio/ringtones/ringtone28.ogg \ - $(LOCAL_PATH)/ringtones/ringtone29.ogg:system/media/audio/ringtones/ringtone29.ogg \ - $(LOCAL_PATH)/ringtones/ringtone30.ogg:system/media/audio/ringtones/ringtone30.ogg \ - $(LOCAL_PATH)/ringtones/ringtone31.ogg:system/media/audio/ringtones/ringtone31.ogg \ - $(LOCAL_PATH)/ringtones/ringtone32.ogg:system/media/audio/ringtones/ringtone32.ogg \ - $(LOCAL_PATH)/ringtones/ringtone33.ogg:system/media/audio/ringtones/ringtone33.ogg \ - $(LOCAL_PATH)/ringtones/ringtone34.ogg:system/media/audio/ringtones/ringtone34.ogg \ - $(LOCAL_PATH)/ringtones/ringtone35.ogg:system/media/audio/ringtones/ringtone35.ogg \ - $(LOCAL_PATH)/ringtones/ringtone36.ogg:system/media/audio/ringtones/ringtone36.ogg \ - $(LOCAL_PATH)/ringtones/ringtone37.ogg:system/media/audio/ringtones/ringtone37.ogg \ - $(LOCAL_PATH)/ringtones/ringtone38.ogg:system/media/audio/ringtones/ringtone38.ogg + $(LOCAL_PATH)/ringtones/Vespa.ogg:system/media/audio/ringtones/Vespa.ogg diff --git a/data/sounds/alarms/ogg/Analysis.ogg b/data/sounds/alarms/ogg/Analysis.ogg Binary files differnew file mode 100644 index 0000000..cef9bd8 --- /dev/null +++ b/data/sounds/alarms/ogg/Analysis.ogg diff --git a/data/sounds/alarms/ogg/Departure.ogg b/data/sounds/alarms/ogg/Departure.ogg Binary files differnew file mode 100644 index 0000000..fe83899 --- /dev/null +++ b/data/sounds/alarms/ogg/Departure.ogg diff --git a/data/sounds/alarms/ogg/FireDrill.ogg b/data/sounds/alarms/ogg/FireDrill.ogg Binary files differnew file mode 100644 index 0000000..038353c --- /dev/null +++ b/data/sounds/alarms/ogg/FireDrill.ogg diff --git a/data/sounds/alarms/ogg/Timing.ogg b/data/sounds/alarms/ogg/Timing.ogg Binary files differnew file mode 100644 index 0000000..45a213b --- /dev/null +++ b/data/sounds/alarms/ogg/Timing.ogg diff --git a/data/sounds/effects/ogg/Dock.ogg b/data/sounds/effects/ogg/Dock.ogg Binary files differnew file mode 100644 index 0000000..1462813d --- /dev/null +++ b/data/sounds/effects/ogg/Dock.ogg diff --git a/data/sounds/effects/ogg/Effect_Tick.ogg b/data/sounds/effects/ogg/Effect_Tick.ogg Binary files differnew file mode 100644 index 0000000..27fe79f --- /dev/null +++ b/data/sounds/effects/ogg/Effect_Tick.ogg diff --git a/data/sounds/effects/ogg/KeypressDelete.ogg b/data/sounds/effects/ogg/KeypressDelete.ogg Binary files differnew file mode 100644 index 0000000..5cc7f3c --- /dev/null +++ b/data/sounds/effects/ogg/KeypressDelete.ogg diff --git a/data/sounds/effects/ogg/KeypressReturn.ogg b/data/sounds/effects/ogg/KeypressReturn.ogg Binary files differnew file mode 100644 index 0000000..260cbf5 --- /dev/null +++ b/data/sounds/effects/ogg/KeypressReturn.ogg diff --git a/data/sounds/effects/ogg/KeypressSpacebar.ogg b/data/sounds/effects/ogg/KeypressSpacebar.ogg Binary files differnew file mode 100644 index 0000000..6229330 --- /dev/null +++ b/data/sounds/effects/ogg/KeypressSpacebar.ogg diff --git a/data/sounds/effects/ogg/KeypressStandard.ogg b/data/sounds/effects/ogg/KeypressStandard.ogg Binary files differnew file mode 100644 index 0000000..947b169 --- /dev/null +++ b/data/sounds/effects/ogg/KeypressStandard.ogg diff --git a/data/sounds/effects/ogg/Lock.ogg b/data/sounds/effects/ogg/Lock.ogg Binary files differnew file mode 100644 index 0000000..cf70d01 --- /dev/null +++ b/data/sounds/effects/ogg/Lock.ogg diff --git a/data/sounds/effects/ogg/LowBattery.ogg b/data/sounds/effects/ogg/LowBattery.ogg Binary files differnew file mode 100644 index 0000000..f1cf199 --- /dev/null +++ b/data/sounds/effects/ogg/LowBattery.ogg diff --git a/data/sounds/effects/ogg/Undock.ogg b/data/sounds/effects/ogg/Undock.ogg Binary files differnew file mode 100644 index 0000000..0053066 --- /dev/null +++ b/data/sounds/effects/ogg/Undock.ogg diff --git a/data/sounds/effects/ogg/Unlock.ogg b/data/sounds/effects/ogg/Unlock.ogg Binary files differnew file mode 100644 index 0000000..3639dba --- /dev/null +++ b/data/sounds/effects/ogg/Unlock.ogg diff --git a/data/sounds/effects/ogg/VideoRecord.ogg b/data/sounds/effects/ogg/VideoRecord.ogg Binary files differnew file mode 100644 index 0000000..a6f3d34 --- /dev/null +++ b/data/sounds/effects/ogg/VideoRecord.ogg diff --git a/data/sounds/effects/ogg/camera_click.ogg b/data/sounds/effects/ogg/camera_click.ogg Binary files differnew file mode 100644 index 0000000..1b0ee9e --- /dev/null +++ b/data/sounds/effects/ogg/camera_click.ogg diff --git a/data/sounds/notifications/ogg/Antimony.ogg b/data/sounds/notifications/ogg/Antimony.ogg Binary files differnew file mode 100755 index 0000000..6f83fe4 --- /dev/null +++ b/data/sounds/notifications/ogg/Antimony.ogg diff --git a/data/sounds/notifications/ogg/Argon.ogg b/data/sounds/notifications/ogg/Argon.ogg Binary files differnew file mode 100755 index 0000000..f160562 --- /dev/null +++ b/data/sounds/notifications/ogg/Argon.ogg diff --git a/data/sounds/notifications/ogg/Beryllium.ogg b/data/sounds/notifications/ogg/Beryllium.ogg Binary files differnew file mode 100755 index 0000000..5f7bd3c --- /dev/null +++ b/data/sounds/notifications/ogg/Beryllium.ogg diff --git a/data/sounds/notifications/ogg/Cobalt.ogg b/data/sounds/notifications/ogg/Cobalt.ogg Binary files differnew file mode 100755 index 0000000..a9adeb8 --- /dev/null +++ b/data/sounds/notifications/ogg/Cobalt.ogg diff --git a/data/sounds/notifications/ogg/Fluorine.ogg b/data/sounds/notifications/ogg/Fluorine.ogg Binary files differnew file mode 100755 index 0000000..6340cf3 --- /dev/null +++ b/data/sounds/notifications/ogg/Fluorine.ogg diff --git a/data/sounds/notifications/ogg/Gallium.ogg b/data/sounds/notifications/ogg/Gallium.ogg Binary files differnew file mode 100755 index 0000000..61dd85c --- /dev/null +++ b/data/sounds/notifications/ogg/Gallium.ogg diff --git a/data/sounds/notifications/ogg/Helium.ogg b/data/sounds/notifications/ogg/Helium.ogg Binary files differnew file mode 100755 index 0000000..33b4702 --- /dev/null +++ b/data/sounds/notifications/ogg/Helium.ogg diff --git a/data/sounds/notifications/ogg/Iridium.ogg b/data/sounds/notifications/ogg/Iridium.ogg Binary files differnew file mode 100755 index 0000000..fabda89 --- /dev/null +++ b/data/sounds/notifications/ogg/Iridium.ogg diff --git a/data/sounds/notifications/ogg/Krypton.ogg b/data/sounds/notifications/ogg/Krypton.ogg Binary files differnew file mode 100755 index 0000000..44f9175 --- /dev/null +++ b/data/sounds/notifications/ogg/Krypton.ogg diff --git a/data/sounds/notifications/ogg/Palladium.ogg b/data/sounds/notifications/ogg/Palladium.ogg Binary files differnew file mode 100755 index 0000000..2fd2b76 --- /dev/null +++ b/data/sounds/notifications/ogg/Palladium.ogg diff --git a/data/sounds/notifications/ogg/Radon.ogg b/data/sounds/notifications/ogg/Radon.ogg Binary files differnew file mode 100755 index 0000000..246403d --- /dev/null +++ b/data/sounds/notifications/ogg/Radon.ogg diff --git a/data/sounds/notifications/ogg/Rubidium.ogg b/data/sounds/notifications/ogg/Rubidium.ogg Binary files differnew file mode 100755 index 0000000..18f8d7d --- /dev/null +++ b/data/sounds/notifications/ogg/Rubidium.ogg diff --git a/data/sounds/notifications/ogg/Selenium.ogg b/data/sounds/notifications/ogg/Selenium.ogg Binary files differnew file mode 100755 index 0000000..7918ba8 --- /dev/null +++ b/data/sounds/notifications/ogg/Selenium.ogg diff --git a/data/sounds/notifications/ogg/Strontium.ogg b/data/sounds/notifications/ogg/Strontium.ogg Binary files differnew file mode 100755 index 0000000..daf4826 --- /dev/null +++ b/data/sounds/notifications/ogg/Strontium.ogg diff --git a/data/sounds/notifications/ogg/Thallium.ogg b/data/sounds/notifications/ogg/Thallium.ogg Binary files differnew file mode 100755 index 0000000..721915c --- /dev/null +++ b/data/sounds/notifications/ogg/Thallium.ogg diff --git a/data/sounds/notifications/ogg/Xenon.ogg b/data/sounds/notifications/ogg/Xenon.ogg Binary files differnew file mode 100755 index 0000000..22fae9f --- /dev/null +++ b/data/sounds/notifications/ogg/Xenon.ogg diff --git a/data/sounds/notifications/ogg/Zirconium.ogg b/data/sounds/notifications/ogg/Zirconium.ogg Binary files differnew file mode 100755 index 0000000..afbd8d7 --- /dev/null +++ b/data/sounds/notifications/ogg/Zirconium.ogg diff --git a/docs/html/sdk/android-3.0-highlights.jd b/docs/html/sdk/android-3.0-highlights.jd index f48aed8..ed49307 100644 --- a/docs/html/sdk/android-3.0-highlights.jd +++ b/docs/html/sdk/android-3.0-highlights.jd @@ -129,7 +129,7 @@ This document provides a glimpse of some of the new features and technologies, a <p style="margin-top:1em;margin-bottom:.75em;"><strong>Camera and Gallery</strong></p> -<p>The Camera application has been redesigned to take advantage of a larger screen for quick access to exposure, focus, flash, zoom, front-facing camera, and more. The Gallery application lets users view albums and other collections in full-screen mode, with easy access to thumbnails for other photos in the collection. </p> +<p>The Camera application has been redesigned to take advantage of a larger screen for quick access to exposure, focus, flash, zoom, front-facing camera, and more. To let users capture scenes in new ways, it adds built-in support for time-lapse video recording. Gallery application lets users view albums and other collections in full-screen mode, with easy access to thumbnails for other photos in the collection. </p> <p style="margin-top:1em;margin-bottom:.75em;"><strong>Contacts</strong></p> diff --git a/docs/html/sdk/tools-notes.jd b/docs/html/sdk/tools-notes.jd index 212d3c0..97ca8ab 100644 --- a/docs/html/sdk/tools-notes.jd +++ b/docs/html/sdk/tools-notes.jd @@ -103,8 +103,10 @@ Tools will delete the file.</p> <li>The LogCat view in DDMS now properly displays UTF-8 characters.</li> <li>The SDK Manager is more reliable on Windows. For details on the improvements, see the <a href="http://tools.android.com/recent/sdkmanagerfixes">Android Tools Project Site</a>. </li> - <li>If you enabled snapshots for an AVD, they are automatically captured. The emulator also now restores to the state when - it last closed almost instantly.</li> + <li>Early look at the new snapshot feature: To improve startup time for the emulator, you can +enable snapshots for the system state. The emulator will then restore to the state when it last +closed almost instantly. <strong>Note:</strong> The snapshot feature is still under active +development and might not always perform as expected.</li> <li>Fixed the missing JAR file error that prevented <code>draw9patch</code> from running.</li> <li>Fixed the Windows launch scripts <code>hierarchyviewer</code> and <code>ddms</code> to support the new location of <code>adb</code>.</li> diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java index b739d83..d8a7f9d 100644 --- a/graphics/java/android/graphics/Paint.java +++ b/graphics/java/android/graphics/Paint.java @@ -1690,7 +1690,7 @@ public class Paint { int contextLen = contextEnd - contextStart; char[] buf = TemporaryBuffer.obtain(contextLen); TextUtils.getChars(text, contextStart, contextEnd, buf, 0); - int result = getTextRunCursor(buf, 0, contextLen, flags, offset, cursorOpt); + int result = getTextRunCursor(buf, 0, contextLen, flags, offset - contextStart, cursorOpt); TemporaryBuffer.recycle(buf); return result; } diff --git a/graphics/java/android/graphics/SurfaceTexture.java b/graphics/java/android/graphics/SurfaceTexture.java index 64c209a..1fc2722 100644 --- a/graphics/java/android/graphics/SurfaceTexture.java +++ b/graphics/java/android/graphics/SurfaceTexture.java @@ -24,16 +24,32 @@ import android.os.Message; /** * Captures frames from an image stream as an OpenGL ES texture. * - * <p>The image stream may come from either video playback or camera preview. A SurfaceTexture may - * be used in place of a SurfaceHolder when specifying the output destination of a MediaPlayer or - * Camera object. This will cause all the frames from that image stream to be sent to the + * <p>The image stream may come from either camera preview. A SurfaceTexture may be used in place + * of a SurfaceHolder when specifying the output destination of a {@link android.hardware.Camera} + * object. Doing so will cause all the frames from the image stream to be sent to the * SurfaceTexture object rather than to the device's display. When {@link #updateTexImage} is * called, the contents of the texture object specified when the SurfaceTexture was created is * updated to contain the most recent image from the image stream. This may cause some frames of * the stream to be skipped. * + * <p>When sampling from the texture one should first transform the texture coordinates using the + * matrix queried via {@link #getTransformMatrix}. The transform matrix may change each time {@link + * #updateTexImage} is called, so it should be re-queried each time the texture image is updated. + * This matrix transforms traditional 2D OpenGL ES texture coordinate column vectors of the form (s, + * t, 0, 1) where s and t are on the inclusive interval [0, 1] to the proper sampling location in + * the streamed texture. This transform compensates for any properties of the image stream source + * that cause it to appear different from a traditional OpenGL ES texture. For example, sampling + * from the bottom left corner of the image can be accomplished by transforming the column vector + * (0, 0, 0, 1) using the queried matrix, while sampling from the top right corner of the image can + * be done by transforming (1, 1, 0, 1). + * * <p>The texture object uses the GL_TEXTURE_EXTERNAL_OES texture target, which is defined by the * OES_EGL_image_external OpenGL ES extension. This limits how the texture may be used. + * + * <p>SurfaceTexture objects may be created on any thread. {@link #updateTexImage} may only be + * called on the thread with the OpenGL ES context that contains the texture object. The + * frame-available callback is called on an arbitrary thread, so unless special care is taken {@link + * #updateTexImage} should not be called directly from the callback. */ public class SurfaceTexture { diff --git a/include/surfaceflinger/ISurfaceComposer.h b/include/surfaceflinger/ISurfaceComposer.h index 56ed3a4..361e7dc 100644 --- a/include/surfaceflinger/ISurfaceComposer.h +++ b/include/surfaceflinger/ISurfaceComposer.h @@ -44,6 +44,8 @@ public: eSecure = 0x00000080, eNonPremultiplied = 0x00000100, eOpaque = 0x00000400, + eProtectedByApp = 0x00000800, + eProtectedByDRM = 0x00001000, eFXSurfaceNormal = 0x00000000, eFXSurfaceBlur = 0x00010000, diff --git a/include/ui/GraphicBuffer.h b/include/ui/GraphicBuffer.h index 8b256f4..02d6f8f 100644 --- a/include/ui/GraphicBuffer.h +++ b/include/ui/GraphicBuffer.h @@ -54,9 +54,11 @@ public: USAGE_SW_WRITE_RARELY = GRALLOC_USAGE_SW_WRITE_RARELY, USAGE_SW_WRITE_OFTEN = GRALLOC_USAGE_SW_WRITE_OFTEN, USAGE_SW_WRITE_MASK = GRALLOC_USAGE_SW_WRITE_MASK, - + USAGE_SOFTWARE_MASK = USAGE_SW_READ_MASK|USAGE_SW_WRITE_MASK, - + + USAGE_PROTECTED = GRALLOC_USAGE_PROTECTED, + USAGE_HW_TEXTURE = GRALLOC_USAGE_HW_TEXTURE, USAGE_HW_RENDER = GRALLOC_USAGE_HW_RENDER, USAGE_HW_2D = GRALLOC_USAGE_HW_2D, diff --git a/include/ui/egl/android_natives.h b/include/ui/egl/android_natives.h index 654d0f3..fdc8105 100644 --- a/include/ui/egl/android_natives.h +++ b/include/ui/egl/android_natives.h @@ -315,6 +315,8 @@ static inline int native_window_set_buffer_count( * If all parameters are 0, the normal behavior is restored. That is, * dequeued buffers following this call will be sized to the window's size. * + * Calling this function will reset the window crop to a NULL value, which + * disables cropping of the buffers. */ static inline int native_window_set_buffers_geometry( ANativeWindow* window, diff --git a/include/utils/ResourceTypes.h b/include/utils/ResourceTypes.h index ed7f53d..6227f3e 100644 --- a/include/utils/ResourceTypes.h +++ b/include/utils/ResourceTypes.h @@ -1985,6 +1985,7 @@ public: #ifndef HAVE_ANDROID_OS void print(bool inclValues) const; + static String8 normalizeForOutput(const char* input); #endif private: diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp index 1dadd53..236ff4f 100644 --- a/libs/gui/SurfaceTexture.cpp +++ b/libs/gui/SurfaceTexture.cpp @@ -219,11 +219,19 @@ status_t SurfaceTexture::updateTexImage() { mSlots[mLastQueued].mEglImage = image; mSlots[mLastQueued].mEglDisplay = dpy; } + + GLint error; + while ((error = glGetError()) != GL_NO_ERROR) { + LOGE("GL error cleared before updating SurfaceTexture: %#04x", error); + } glEGLImageTargetTexture2DOES(GL_TEXTURE_EXTERNAL_OES, (GLeglImageOES)image); - GLint error = glGetError(); - if (error != GL_NO_ERROR) { + bool failed = false; + while ((error = glGetError()) != GL_NO_ERROR) { LOGE("error binding external texture image %p (slot %d): %#04x", image, mLastQueued, error); + failed = true; + } + if (failed) { return -EINVAL; } diff --git a/libs/gui/SurfaceTextureClient.cpp b/libs/gui/SurfaceTextureClient.cpp index 0ed8be5..50cbdb8 100644 --- a/libs/gui/SurfaceTextureClient.cpp +++ b/libs/gui/SurfaceTextureClient.cpp @@ -88,7 +88,7 @@ int SurfaceTextureClient::dequeueBuffer(android_native_buffer_t** buffer) { int buf = -1; status_t err = mSurfaceTexture->dequeueBuffer(&buf); if (err < 0) { - LOGE("dequeueBuffer: ISurfaceTexture::dequeueBuffer failed: %d", err); + LOGV("dequeueBuffer: ISurfaceTexture::dequeueBuffer failed: %d", err); return err; } sp<GraphicBuffer>& gbuf(mSlots[buf]); @@ -238,13 +238,15 @@ int SurfaceTextureClient::setCrop(Rect const* rect) LOGV("SurfaceTextureClient::setCrop"); Mutex::Autolock lock(mMutex); - // empty/invalid rects are not allowed - if (rect->isEmpty()) - return BAD_VALUE; + Rect realRect; + if (rect == NULL || rect->isEmpty()) { + realRect = Rect(0, 0); + } else { + realRect = *rect; + } status_t err = mSurfaceTexture->setCrop(*rect); - LOGE_IF(err, "ISurfaceTexture::setCrop(...) returned %s", - strerror(-err)); + LOGE_IF(err, "ISurfaceTexture::setCrop(...) returned %s", strerror(-err)); return err; } @@ -280,7 +282,10 @@ int SurfaceTextureClient::setBuffersGeometry(int w, int h, int format) mReqHeight = h; mReqFormat = format; - return NO_ERROR; + status_t err = mSurfaceTexture->setCrop(Rect(0, 0)); + LOGE_IF(err, "ISurfaceTexture::setCrop(...) returned %s", strerror(-err)); + + return err; } int SurfaceTextureClient::setBuffersTransform(int transform) diff --git a/libs/hwui/OpenGLDebugRenderer.cpp b/libs/hwui/OpenGLDebugRenderer.cpp index 58d6c26..05870bb 100644 --- a/libs/hwui/OpenGLDebugRenderer.cpp +++ b/libs/hwui/OpenGLDebugRenderer.cpp @@ -23,10 +23,11 @@ namespace android { namespace uirenderer { -void OpenGLDebugRenderer::prepare(bool opaque) { +void OpenGLDebugRenderer::prepareDirty(float left, float top, + float right, float bottom, bool opaque) { mPrimitivesCount = 0; LOGD("========= Frame start ========="); - OpenGLRenderer::prepare(opaque); + OpenGLRenderer::prepareDirty(left, top, right, bottom, opaque); } void OpenGLDebugRenderer::finish() { @@ -105,6 +106,33 @@ void OpenGLDebugRenderer::drawRect(float left, float top, float right, float bot OpenGLRenderer::drawRect(left, top, right, bottom, paint); } +void OpenGLDebugRenderer::drawRoundRect(float left, float top, float right, float bottom, + float rx, float ry, SkPaint* paint) { + mPrimitivesCount++; + StopWatch w("drawRoundRect"); + OpenGLRenderer::drawRoundRect(left, top, right, bottom, rx, ry, paint); +} + +void OpenGLDebugRenderer::drawCircle(float x, float y, float radius, SkPaint* paint) { + mPrimitivesCount++; + StopWatch w("drawCircle"); + OpenGLRenderer::drawCircle(x, y, radius, paint); +} + +void OpenGLDebugRenderer::drawOval(float left, float top, float right, float bottom, + SkPaint* paint) { + mPrimitivesCount++; + StopWatch w("drawOval"); + OpenGLRenderer::drawOval(left, top, right, bottom, paint); +} + +void OpenGLDebugRenderer::drawArc(float left, float top, float right, float bottom, + float startAngle, float sweepAngle, bool useCenter, SkPaint* paint) { + mPrimitivesCount++; + StopWatch w("drawArc"); + OpenGLRenderer::drawArc(left, top, right, bottom, startAngle, sweepAngle, useCenter, paint); +} + void OpenGLDebugRenderer::drawPath(SkPath* path, SkPaint* paint) { mPrimitivesCount++; StopWatch w("drawPath"); diff --git a/libs/hwui/OpenGLDebugRenderer.h b/libs/hwui/OpenGLDebugRenderer.h index 76e6a2e..1a18a67 100644 --- a/libs/hwui/OpenGLDebugRenderer.h +++ b/libs/hwui/OpenGLDebugRenderer.h @@ -34,7 +34,7 @@ public: ~OpenGLDebugRenderer() { } - void prepare(bool opaque); + void prepareDirty(float left, float top, float right, float bottom, bool opaque); void finish(); int saveLayer(float left, float top, float right, float bottom, @@ -52,6 +52,12 @@ public: float left, float top, float right, float bottom, SkPaint* paint); void drawColor(int color, SkXfermode::Mode mode); void drawRect(float left, float top, float right, float bottom, SkPaint* paint); + void drawRoundRect(float left, float top, float right, float bottom, + float rx, float ry, SkPaint* paint); + void drawCircle(float x, float y, float radius, SkPaint* paint); + void drawOval(float left, float top, float right, float bottom, SkPaint* paint); + void drawArc(float left, float top, float right, float bottom, + float startAngle, float sweepAngle, bool useCenter, SkPaint* paint); void drawPath(SkPath* path, SkPaint* paint); void drawLines(float* points, int count, SkPaint* paint); void drawText(const char* text, int bytesCount, int count, float x, float y, diff --git a/libs/rs/Android.mk b/libs/rs/Android.mk index 3835852..25c8beb 100644 --- a/libs/rs/Android.mk +++ b/libs/rs/Android.mk @@ -130,6 +130,28 @@ LOCAL_MODULE_TAGS := optional include $(BUILD_SHARED_LIBRARY) +# Now build a host version for serialization +include $(CLEAR_VARS) +LOCAL_CFLAGS += -DANDROID_RS_SERIALIZE + +LOCAL_SRC_FILES:= \ + rsAllocation.cpp \ + rsComponent.cpp \ + rsElement.cpp \ + rsFileA3D.cpp \ + rsObjectBase.cpp \ + rsMesh.cpp \ + rsStream.cpp \ + rsType.cpp + +LOCAL_STATIC_LIBRARIES := libcutils libutils + +LOCAL_LDLIBS := -lpthread +LOCAL_MODULE:= libRSserialize +LOCAL_MODULE_TAGS := optional + +include $(BUILD_HOST_STATIC_LIBRARY) + # include the java examples include $(addprefix $(LOCAL_PATH)/,$(addsuffix /Android.mk,\ java \ diff --git a/libs/rs/RenderScript.h b/libs/rs/RenderScript.h index f160ef1..bb5e4aa 100644 --- a/libs/rs/RenderScript.h +++ b/libs/rs/RenderScript.h @@ -365,6 +365,9 @@ RsAllocation rsaAllocationCreateFromBitmap(RsContext con, RsType vtype, RsAllocation rsaAllocationCubeCreateFromBitmap(RsContext con, RsType vtype, RsAllocationMipmapControl mips, const void *data, uint32_t usages); +#ifdef ANDROID_RS_SERIALIZE +#define NO_RS_FUNCS +#endif #ifndef NO_RS_FUNCS #include "rsgApiFuncDecl.h" diff --git a/libs/rs/java/ModelViewer/src/com/android/modelviewer/scenegraph.rs b/libs/rs/java/ModelViewer/src/com/android/modelviewer/scenegraph.rs index 3bee8d6..3679068 100644 --- a/libs/rs/java/ModelViewer/src/com/android/modelviewer/scenegraph.rs +++ b/libs/rs/java/ModelViewer/src/com/android/modelviewer/scenegraph.rs @@ -81,7 +81,7 @@ int root(int launchID) { rsgProgramVertexLoadModelMatrix(&robot2Ptr->globalMat); rsgDrawMesh(gTestMesh); - color(0.3f, 0.3f, 0.3f, 1.0f); + //color(0.3f, 0.3f, 0.3f, 1.0f); rsgDrawText("Renderscript transform test", 30, 695); rsgBindFont(gItalic); diff --git a/libs/rs/java/Samples/src/com/android/samples/rslist.rs b/libs/rs/java/Samples/src/com/android/samples/rslist.rs index 0baccb8..b79f4fc 100644 --- a/libs/rs/java/Samples/src/com/android/samples/rslist.rs +++ b/libs/rs/java/Samples/src/com/android/samples/rslist.rs @@ -44,7 +44,6 @@ int root(int launchID) { rsgFontColor(0.9f, 0.9f, 0.9f, 1.0f); rsgBindFont(gItalic); - color(0.2, 0.2, 0.2, 0); rs_allocation listAlloc; rsSetObject(&listAlloc, rsGetAllocation(gList)); diff --git a/libs/rs/java/Samples/src/com/android/samples/rsrenderstates.rs b/libs/rs/java/Samples/src/com/android/samples/rsrenderstates.rs index a973167..42be4d8 100644 --- a/libs/rs/java/Samples/src/com/android/samples/rsrenderstates.rs +++ b/libs/rs/java/Samples/src/com/android/samples/rsrenderstates.rs @@ -407,7 +407,7 @@ static void setupCustomShaderLights() { gVSConstants->light1_Diffuse = 1.0f; gVSConstants->light1_Specular = 0.7f; gVSConstants->light1_CosinePower = 25.0f; - rsAllocationMarkDirty(rsGetAllocation(gVSConstants)); + rsgAllocationSyncAll(rsGetAllocation(gVSConstants)); gVSConstants2->light_Posision[0] = light0Pos; gVSConstants2->light_Diffuse[0] = 1.0f; @@ -417,7 +417,7 @@ static void setupCustomShaderLights() { gVSConstants2->light_Diffuse[1] = 1.0f; gVSConstants2->light_Specular[1] = 0.7f; gVSConstants2->light_CosinePower[1] = 25.0f; - rsAllocationMarkDirty(rsGetAllocation(gVSConstants2)); + rsgAllocationSyncAll(rsGetAllocation(gVSConstants2)); // Update fragmetn shader constants // Set light 0 colors @@ -426,14 +426,14 @@ static void setupCustomShaderLights() { // Set light 1 colors gFSConstants->light1_DiffuseColor = light1DiffCol; gFSConstants->light1_SpecularColor = light1SpecCol; - rsAllocationMarkDirty(rsGetAllocation(gFSConstants)); + rsgAllocationSyncAll(rsGetAllocation(gFSConstants)); gFSConstants2->light_DiffuseColor[0] = light0DiffCol; gFSConstants2->light_SpecularColor[0] = light0SpecCol; // Set light 1 colors gFSConstants2->light_DiffuseColor[1] = light1DiffCol; gFSConstants2->light_SpecularColor[1] = light1SpecCol; - rsAllocationMarkDirty(rsGetAllocation(gFSConstants2)); + rsgAllocationSyncAll(rsGetAllocation(gFSConstants2)); } static void displayCustomShaderSamples() { diff --git a/libs/rs/java/tests/src/com/android/rs/test/rslist.rs b/libs/rs/java/tests/src/com/android/rs/test/rslist.rs index f354a72..67c2b86 100644 --- a/libs/rs/java/tests/src/com/android/rs/test/rslist.rs +++ b/libs/rs/java/tests/src/com/android/rs/test/rslist.rs @@ -45,7 +45,6 @@ int root(int launchID) { rsgFontColor(0.9f, 0.9f, 0.9f, 1.0f); rsgBindFont(gFont); - color(0.2, 0.2, 0.2, 0); rs_allocation listAlloc; rsSetObject(&listAlloc, rsGetAllocation(gList)); diff --git a/libs/rs/rsAdapter.cpp b/libs/rs/rsAdapter.cpp index 8d363fd..6e8ca70 100644 --- a/libs/rs/rsAdapter.cpp +++ b/libs/rs/rsAdapter.cpp @@ -15,11 +15,7 @@ * limitations under the License. */ -#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" -#else -#include "rsContextHostStub.h" -#endif using namespace android; using namespace android::renderscript; diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp index 41c9fe2..54dcbcb 100644 --- a/libs/rs/rsAllocation.cpp +++ b/libs/rs/rsAllocation.cpp @@ -13,20 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef ANDROID_RS_BUILD_FOR_HOST -#include "rsContext.h" +#include "rsContext.h" +#ifndef ANDROID_RS_SERIALIZE #include <GLES/gl.h> #include <GLES2/gl2.h> #include <GLES/glext.h> -#else -#include "rsContextHostStub.h" - -#include <OpenGL/gl.h> -#include <OpenGl/glext.h> -#endif - -#include "utils/StopWatch.h" +#endif //ANDROID_RS_SERIALIZE static void rsaAllocationGenerateScriptMips(RsContext con, RsAllocation va); @@ -83,7 +76,7 @@ Allocation::~Allocation() { mPtr = NULL; } freeScriptMemory(); - +#ifndef ANDROID_RS_SERIALIZE if (mBufferID) { // Causes a SW crash.... //LOGV(" mBufferID %i", mBufferID); @@ -94,6 +87,7 @@ Allocation::~Allocation() { glDeleteTextures(1, &mTextureID); mTextureID = 0; } +#endif //ANDROID_RS_SERIALIZE } void Allocation::setCpuWritable(bool) { @@ -118,6 +112,7 @@ void Allocation::deferedUploadToTexture(const Context *rsc) { } uint32_t Allocation::getGLTarget() const { +#ifndef ANDROID_RS_SERIALIZE if (getIsTexture()) { if (mType->getDimFaces()) { return GL_TEXTURE_CUBE_MAP; @@ -128,6 +123,7 @@ uint32_t Allocation::getGLTarget() const { if (getIsBufferObject()) { return GL_ARRAY_BUFFER; } +#endif //ANDROID_RS_SERIALIZE return 0; } @@ -158,7 +154,7 @@ void Allocation::syncAll(Context *rsc, RsAllocationUsageType src) { } void Allocation::uploadToTexture(const Context *rsc) { - +#ifndef ANDROID_RS_SERIALIZE mUsageFlags |= RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE; GLenum type = mType->getElement()->getComponent().getGLType(); GLenum format = mType->getElement()->getComponent().getGLFormat(); @@ -195,8 +191,10 @@ void Allocation::uploadToTexture(const Context *rsc) { } rsc->checkError("Allocation::uploadToTexture"); +#endif //ANDROID_RS_SERIALIZE } +#ifndef ANDROID_RS_SERIALIZE const static GLenum gFaceOrder[] = { GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, @@ -205,10 +203,12 @@ const static GLenum gFaceOrder[] = { GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z }; +#endif //ANDROID_RS_SERIALIZE void Allocation::update2DTexture(const void *ptr, uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face, uint32_t w, uint32_t h) { +#ifndef ANDROID_RS_SERIALIZE GLenum type = mType->getElement()->getComponent().getGLType(); GLenum format = mType->getElement()->getComponent().getGLFormat(); GLenum target = (GLenum)getGLTarget(); @@ -220,9 +220,11 @@ void Allocation::update2DTexture(const void *ptr, uint32_t xoff, uint32_t yoff, t = gFaceOrder[face]; } glTexSubImage2D(t, lod, xoff, yoff, w, h, format, type, ptr); +#endif //ANDROID_RS_SERIALIZE } void Allocation::upload2DTexture(bool isFirstUpload) { +#ifndef ANDROID_RS_SERIALIZE GLenum type = mType->getElement()->getComponent().getGLType(); GLenum format = mType->getElement()->getComponent().getGLFormat(); @@ -258,10 +260,9 @@ void Allocation::upload2DTexture(bool isFirstUpload) { } if (mMipmapControl == RS_ALLOCATION_MIPMAP_ON_SYNC_TO_TEXTURE) { -#ifndef ANDROID_RS_BUILD_FOR_HOST glGenerateMipmap(target); -#endif //ANDROID_RS_BUILD_FOR_HOST } +#endif //ANDROID_RS_SERIALIZE } void Allocation::deferedUploadToBufferObject(const Context *rsc) { @@ -270,6 +271,7 @@ void Allocation::deferedUploadToBufferObject(const Context *rsc) { } void Allocation::uploadToBufferObject(const Context *rsc) { +#ifndef ANDROID_RS_SERIALIZE rsAssert(!mType->getDimY()); rsAssert(!mType->getDimZ()); @@ -288,6 +290,7 @@ void Allocation::uploadToBufferObject(const Context *rsc) { glBufferData(target, mType->getSizeBytes(), getPtr(), GL_DYNAMIC_DRAW); glBindBuffer(target, 0); rsc->checkError("Allocation::uploadToBufferObject"); +#endif //ANDROID_RS_SERIALIZE } void Allocation::uploadCheck(Context *rsc) { @@ -386,7 +389,7 @@ void Allocation::elementData(Context *rsc, uint32_t x, const void *data, ptr += mType->getElement()->getFieldOffsetBytes(cIdx); if (sizeBytes != e->getSizeBytes()) { - LOGE("Error Allocation::subElementData data size %i does not match field size %i.", sizeBytes, e->getSizeBytes()); + LOGE("Error Allocation::subElementData data size %i does not match field size %zu.", sizeBytes, e->getSizeBytes()); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData bad size."); return; } @@ -429,7 +432,7 @@ void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y, ptr += mType->getElement()->getFieldOffsetBytes(cIdx); if (sizeBytes != e->getSizeBytes()) { - LOGE("Error Allocation::subElementData data size %i does not match field size %i.", sizeBytes, e->getSizeBytes()); + LOGE("Error Allocation::subElementData data size %i does not match field size %zu.", sizeBytes, e->getSizeBytes()); rsc->setError(RS_ERROR_BAD_VALUE, "subElementData bad size."); return; } @@ -445,10 +448,13 @@ void Allocation::elementData(Context *rsc, uint32_t x, uint32_t y, } void Allocation::addProgramToDirty(const Program *p) { +#ifndef ANDROID_RS_SERIALIZE mToDirtyList.push(p); +#endif //ANDROID_RS_SERIALIZE } void Allocation::removeProgramToDirty(const Program *p) { +#ifndef ANDROID_RS_SERIALIZE for (size_t ct=0; ct < mToDirtyList.size(); ct++) { if (mToDirtyList[ct] == p) { mToDirtyList.removeAt(ct); @@ -456,6 +462,7 @@ void Allocation::removeProgramToDirty(const Program *p) { } } rsAssert(0); +#endif //ANDROID_RS_SERIALIZE } void Allocation::dumpLOGV(const char *prefix) const { @@ -530,9 +537,11 @@ Allocation *Allocation::createFromStream(Context *rsc, IStream *stream) { } void Allocation::sendDirty() const { +#ifndef ANDROID_RS_SERIALIZE for (size_t ct=0; ct < mToDirtyList.size(); ct++) { mToDirtyList[ct]->forceDirty(); } +#endif //ANDROID_RS_SERIALIZE } void Allocation::incRefs(const void *ptr, size_t ct, size_t startOff) const { @@ -591,7 +600,7 @@ void Allocation::resize2D(Context *rsc, uint32_t dimX, uint32_t dimY) { ///////////////// // - +#ifndef ANDROID_RS_SERIALIZE namespace android { namespace renderscript { @@ -674,11 +683,10 @@ static void mip(const Adapter2D &out, const Adapter2D &in) { } } -#ifndef ANDROID_RS_BUILD_FOR_HOST - void rsi_AllocationSyncAll(Context *rsc, RsAllocation va, RsAllocationUsageType src) { Allocation *a = static_cast<Allocation *>(va); a->syncAll(rsc, src); + a->sendDirty(); } void rsi_AllocationGenerateMipmaps(Context *rsc, RsAllocation va) { @@ -738,8 +746,6 @@ void rsi_AllocationResize2D(Context *rsc, RsAllocation va, uint32_t dimX, uint32 a->resize2D(rsc, dimX, dimY); } -#endif //ANDROID_RS_BUILD_FOR_HOST - } } @@ -839,3 +845,5 @@ RsAllocation rsaAllocationCubeCreateFromBitmap(RsContext con, RsType vtype, texAlloc->deferedUploadToTexture(rsc); return texAlloc; } + +#endif //ANDROID_RS_SERIALIZE diff --git a/libs/rs/rsAnimation.cpp b/libs/rs/rsAnimation.cpp index 6abda3c..48b4f02 100644 --- a/libs/rs/rsAnimation.cpp +++ b/libs/rs/rsAnimation.cpp @@ -14,12 +14,7 @@ * limitations under the License. */ -#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" -#else -#include "rsContextHostStub.h" -#endif //ANDROID_RS_BUILD_FOR_HOST - #include "rsAnimation.h" diff --git a/libs/rs/rsComponent.cpp b/libs/rs/rsComponent.cpp index 81ade5d..4c4987a 100644 --- a/libs/rs/rsComponent.cpp +++ b/libs/rs/rsComponent.cpp @@ -16,10 +16,8 @@ #include "rsComponent.h" -#ifndef ANDROID_RS_BUILD_FOR_HOST +#ifndef ANDROID_RS_SERIALIZE #include <GLES/gl.h> -#else -#include <OpenGL/gl.h> #endif using namespace android; @@ -183,6 +181,7 @@ bool Component::isReference() const { } uint32_t Component::getGLType() const { +#ifndef ANDROID_RS_SERIALIZE switch (mType) { case RS_TYPE_UNSIGNED_5_6_5: return GL_UNSIGNED_SHORT_5_6_5; case RS_TYPE_UNSIGNED_5_5_5_1: return GL_UNSIGNED_SHORT_5_5_5_1; @@ -196,11 +195,12 @@ uint32_t Component::getGLType() const { case RS_TYPE_SIGNED_16: return GL_SHORT; default: break; } - +#endif //ANDROID_RS_SERIALIZE return 0; } uint32_t Component::getGLFormat() const { +#ifndef ANDROID_RS_SERIALIZE switch (mKind) { case RS_KIND_PIXEL_L: return GL_LUMINANCE; case RS_KIND_PIXEL_A: return GL_ALPHA; @@ -209,6 +209,7 @@ uint32_t Component::getGLFormat() const { case RS_KIND_PIXEL_RGBA: return GL_RGBA; default: break; } +#endif //ANDROID_RS_SERIALIZE return 0; } diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index 40cb5c7..1dfedb3 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -528,6 +528,7 @@ void * Context::threadProc(void *vrsc) { void Context::destroyWorkerThreadResources() { //LOGV("destroyWorkerThreadResources 1"); + ObjectBase::zeroAllUserRef(this); if (mIsGraphicsContext) { mRaster.clear(); mFragment.clear(); @@ -542,7 +543,6 @@ void Context::destroyWorkerThreadResources() { mStateFont.deinit(this); mShaderCache.cleanupAll(); } - ObjectBase::zeroAllUserRef(this); //LOGV("destroyWorkerThreadResources 2"); mExit = true; } diff --git a/libs/rs/rsContext.h b/libs/rs/rsContext.h index 9f94f26..c5e32a6 100644 --- a/libs/rs/rsContext.h +++ b/libs/rs/rsContext.h @@ -18,16 +18,16 @@ #define ANDROID_RS_CONTEXT_H #include "rsUtils.h" -#include "rsMutex.h" - -#include "rsThreadIO.h" #include "rsType.h" -#include "rsMatrix.h" #include "rsAllocation.h" #include "rsMesh.h" + +#ifndef ANDROID_RS_SERIALIZE +#include "rsMutex.h" +#include "rsThreadIO.h" +#include "rsMatrix.h" #include "rsDevice.h" #include "rsScriptC.h" -#include "rsAllocation.h" #include "rsAdapter.h" #include "rsSampler.h" #include "rsFont.h" @@ -42,6 +42,7 @@ #include "rsLocklessFifo.h" #include <ui/egl/android_natives.h> +#endif // ANDROID_RS_SERIALIZE // --------------------------------------------------------------------------- namespace android { @@ -66,6 +67,8 @@ namespace renderscript { #define CHECK_OBJ_OR_NULL(o) #endif +#ifndef ANDROID_RS_SERIALIZE + class Context { public: static Context * createContext(Device *, const RsSurfaceConfig *sc); @@ -321,6 +324,39 @@ private: uint32_t mAverageFPS; }; -} -} +#else + +class Context { +public: + Context() { + mObjHead = NULL; + } + ~Context() { + ObjectBase::zeroAllUserRef(this); + } + + ElementState mStateElement; + TypeState mStateType; + + struct { + bool mLogTimes; + bool mLogScripts; + bool mLogObjects; + bool mLogShaders; + bool mLogShadersAttr; + bool mLogShadersUniforms; + bool mLogVisual; + } props; + + void setError(RsError e, const char *msg = NULL) { } + + mutable const ObjectBase * mObjHead; + +protected: + +}; +#endif //ANDROID_RS_SERIALIZE + +} // renderscript +} // android #endif diff --git a/libs/rs/rsContextHostStub.h b/libs/rs/rsContextHostStub.h deleted file mode 100644 index 8cfb38b..0000000 --- a/libs/rs/rsContextHostStub.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef ANDROID_RS_CONTEXT_HOST_STUB_H -#define ANDROID_RS_CONTEXT_HOST_STUB_H - -#include "rsUtils.h" -//#include "rsMutex.h" - -//#include "rsThreadIO.h" -#include "rsType.h" -#include "rsMatrix.h" -#include "rsAllocation.h" -#include "rsMesh.h" -//#include "rsDevice.h" -#include "rsScriptC.h" -#include "rsAllocation.h" -#include "rsAdapter.h" -#include "rsSampler.h" -#include "rsProgramFragment.h" -#include "rsProgramStore.h" -#include "rsProgramRaster.h" -#include "rsProgramVertex.h" -#include "rsShaderCache.h" -#include "rsVertexArray.h" - -//#include "rsgApiStructs.h" -//#include "rsLocklessFifo.h" - -//#include <ui/egl/android_natives.h> - -// --------------------------------------------------------------------------- -namespace android { -namespace renderscript { - -class Device; - -class Context { -public: - Context(Device *, bool isGraphics, bool useDepth) { - mObjHead = NULL; - } - ~Context() { - } - - - //StructuredAllocationContext mStateAllocation; - ElementState mStateElement; - TypeState mStateType; - SamplerState mStateSampler; - //ProgramFragmentState mStateFragment; - ProgramStoreState mStateFragmentStore; - //ProgramRasterState mStateRaster; - //ProgramVertexState mStateVertex; - VertexArrayState mStateVertexArray; - - //ScriptCState mScriptC; - ShaderCache mShaderCache; - - RsSurfaceConfig mUserSurfaceConfig; - - //bool setupCheck(); - - ProgramFragment * getDefaultProgramFragment() const { - return NULL; - } - ProgramVertex * getDefaultProgramVertex() const { - return NULL; - } - ProgramStore * getDefaultProgramStore() const { - return NULL; - } - ProgramRaster * getDefaultProgramRaster() const { - return NULL; - } - - uint32_t getWidth() const {return 0;} - uint32_t getHeight() const {return 0;} - - // Timers - enum Timers { - RS_TIMER_IDLE, - RS_TIMER_INTERNAL, - RS_TIMER_SCRIPT, - RS_TIMER_CLEAR_SWAP, - _RS_TIMER_TOTAL - }; - - bool checkVersion1_1() const {return false; } - bool checkVersion2_0() const {return false; } - - struct { - bool mLogTimes; - bool mLogScripts; - bool mLogObjects; - bool mLogShaders; - bool mLogShadersAttr; - bool mLogShadersUniforms; - bool mLogVisual; - } props; - - void dumpDebug() const { } - void checkError(const char *) const { }; - void setError(RsError e, const char *msg = NULL) { } - - 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 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: - - struct { - const uint8_t * mVendor; - const uint8_t * mRenderer; - const uint8_t * mVersion; - const uint8_t * mExtensions; - - uint32_t mMajorVersion; - uint32_t mMinorVersion; - - int32_t mMaxVaryingVectors; - int32_t mMaxTextureImageUnits; - - int32_t mMaxFragmentTextureImageUnits; - int32_t mMaxFragmentUniformVectors; - - int32_t mMaxVertexAttribs; - int32_t mMaxVertexUniformVectors; - int32_t mMaxVertexTextureUnits; - - bool OES_texture_npot; - bool GL_NV_texture_npot_2D_mipmap; - float EXT_texture_max_aniso; - } mGL; - -}; - -} -} -#endif diff --git a/libs/rs/rsDevice.cpp b/libs/rs/rsDevice.cpp index dd96445..d7d03f6 100644 --- a/libs/rs/rsDevice.cpp +++ b/libs/rs/rsDevice.cpp @@ -15,11 +15,7 @@ */ #include "rsDevice.h" -#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" -#else -#include "rsContextHostStub.h" -#endif using namespace android; using namespace android::renderscript; diff --git a/libs/rs/rsElement.cpp b/libs/rs/rsElement.cpp index 6ae8bb8..477cb61 100644 --- a/libs/rs/rsElement.cpp +++ b/libs/rs/rsElement.cpp @@ -15,13 +15,7 @@ */ -#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" -#include <GLES/gl.h> -#else -#include "rsContextHostStub.h" -#include <OpenGL/gl.h> -#endif using namespace android; using namespace android::renderscript; @@ -65,7 +59,7 @@ size_t Element::getSizeBits() const { void Element::dumpLOGV(const char *prefix) const { ObjectBase::dumpLOGV(prefix); - LOGV("%s Element: fieldCount: %i, size bytes: %i", prefix, mFieldCount, getSizeBytes()); + LOGV("%s Element: fieldCount: %zu, size bytes: %zu", prefix, mFieldCount, getSizeBytes()); for (uint32_t ct = 0; ct < mFieldCount; ct++) { LOGV("%s Element field index: %u ------------------", prefix, ct); LOGV("%s name: %s, offsetBits: %u, arraySize: %u", diff --git a/libs/rs/rsFileA3D.cpp b/libs/rs/rsFileA3D.cpp index d34ddd6..cd02c24 100644 --- a/libs/rs/rsFileA3D.cpp +++ b/libs/rs/rsFileA3D.cpp @@ -15,12 +15,7 @@ * limitations under the License. */ -#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" -#else -#include "rsContextHostStub.h" -#endif - #include "rsFileA3D.h" #include "rsMesh.h" @@ -249,31 +244,31 @@ ObjectBase *FileA3D::initializeFromEntry(size_t index) { entry->mRsObj = Allocation::createFromStream(mRSC, mReadStream); break; case RS_A3D_CLASS_ID_PROGRAM_VERTEX: - entry->mRsObj = ProgramVertex::createFromStream(mRSC, mReadStream); + //entry->mRsObj = ProgramVertex::createFromStream(mRSC, mReadStream); break; case RS_A3D_CLASS_ID_PROGRAM_RASTER: - entry->mRsObj = ProgramRaster::createFromStream(mRSC, mReadStream); + //entry->mRsObj = ProgramRaster::createFromStream(mRSC, mReadStream); break; case RS_A3D_CLASS_ID_PROGRAM_FRAGMENT: - entry->mRsObj = ProgramFragment::createFromStream(mRSC, mReadStream); + //entry->mRsObj = ProgramFragment::createFromStream(mRSC, mReadStream); break; case RS_A3D_CLASS_ID_PROGRAM_STORE: - entry->mRsObj = ProgramStore::createFromStream(mRSC, mReadStream); + //entry->mRsObj = ProgramStore::createFromStream(mRSC, mReadStream); break; case RS_A3D_CLASS_ID_SAMPLER: - entry->mRsObj = Sampler::createFromStream(mRSC, mReadStream); + //entry->mRsObj = Sampler::createFromStream(mRSC, mReadStream); break; case RS_A3D_CLASS_ID_ANIMATION: - entry->mRsObj = Animation::createFromStream(mRSC, mReadStream); + //entry->mRsObj = Animation::createFromStream(mRSC, mReadStream); break; case RS_A3D_CLASS_ID_ADAPTER_1D: - entry->mRsObj = Adapter1D::createFromStream(mRSC, mReadStream); + //entry->mRsObj = Adapter1D::createFromStream(mRSC, mReadStream); break; case RS_A3D_CLASS_ID_ADAPTER_2D: - entry->mRsObj = Adapter2D::createFromStream(mRSC, mReadStream); + //entry->mRsObj = Adapter2D::createFromStream(mRSC, mReadStream); break; case RS_A3D_CLASS_ID_SCRIPT_C: - return NULL; + break; } if (entry->mRsObj) { entry->mRsObj->incUserRef(); diff --git a/libs/rs/rsFont.cpp b/libs/rs/rsFont.cpp index 8571c32..8a5ab99 100644 --- a/libs/rs/rsFont.cpp +++ b/libs/rs/rsFont.cpp @@ -15,11 +15,7 @@ * limitations under the License. */ -#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" -#else -#include "rsContextHostStub.h" -#endif #include "rsFont.h" #include "rsProgramFragment.h" @@ -74,6 +70,15 @@ bool Font::init(const char *name, float fontSize, uint32_t dpi, const void *data return true; } +void Font::preDestroy() const { + for (uint32_t ct = 0; ct < mRSC->mStateFont.mActiveFonts.size(); ct++) { + if (mRSC->mStateFont.mActiveFonts[ct] == this) { + mRSC->mStateFont.mActiveFonts.removeAt(ct); + break; + } + } +} + void Font::invalidateTextureCache() { for (uint32_t i = 0; i < mCachedGlyphs.size(); i ++) { mCachedGlyphs.valueAt(i)->mIsValid = false; @@ -309,13 +314,6 @@ Font::~Font() { FT_Done_Face(mFace); } - for (uint32_t ct = 0; ct < mRSC->mStateFont.mActiveFonts.size(); ct++) { - if (mRSC->mStateFont.mActiveFonts[ct] == this) { - mRSC->mStateFont.mActiveFonts.removeAt(ct); - break; - } - } - for (uint32_t i = 0; i < mCachedGlyphs.size(); i ++) { CachedGlyphInfo *glyph = mCachedGlyphs.valueAt(i); delete glyph; @@ -799,11 +797,6 @@ void FontState::deinit(Context *rsc) { mDefault.clear(); - Vector<Font*> fontsToDereference = mActiveFonts; - for (uint32_t i = 0; i < fontsToDereference.size(); i ++) { - fontsToDereference[i]->zeroUserRef(); - } - if (mLibrary) { FT_Done_FreeType( mLibrary ); mLibrary = NULL; diff --git a/libs/rs/rsFont.h b/libs/rs/rsFont.h index 00d77c8..4820999 100644 --- a/libs/rs/rsFont.h +++ b/libs/rs/rsFont.h @@ -119,6 +119,7 @@ protected: Font(Context *rsc); bool init(const char *name, float fontSize, uint32_t dpi, const void *data = NULL, uint32_t dataLen = 0); + virtual void preDestroy() const; FT_Face mFace; bool mInitialized; bool mHasKerning; diff --git a/libs/rs/rsLocklessFifo.cpp b/libs/rs/rsLocklessFifo.cpp index 3f88543..70b7278 100644 --- a/libs/rs/rsLocklessFifo.cpp +++ b/libs/rs/rsLocklessFifo.cpp @@ -100,7 +100,9 @@ void LocklessCommandFifo::commit(uint32_t command, uint32_t sizeInBytes) { //dumpState("commit 1"); reinterpret_cast<uint16_t *>(mPut)[0] = command; reinterpret_cast<uint16_t *>(mPut)[1] = sizeInBytes; - mPut += ((sizeInBytes + 3) & ~3) + 4; + + int32_t s = ((sizeInBytes + 3) & ~3) + 4; + android_atomic_add(s, (int32_t *)&mPut); //dumpState("commit 2"); mSignalToWorker.set(); } diff --git a/libs/rs/rsMesh.cpp b/libs/rs/rsMesh.cpp index baf4c53..76fe62d 100644 --- a/libs/rs/rsMesh.cpp +++ b/libs/rs/rsMesh.cpp @@ -14,17 +14,11 @@ * limitations under the License. */ -#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" - +#ifndef ANDROID_RS_SERIALIZE #include <GLES/gl.h> #include <GLES2/gl2.h> #include <GLES/glext.h> -#else -#include "rsContextHostStub.h" - -#include <OpenGL/gl.h> -#include <OpenGl/glext.h> #endif using namespace android; @@ -35,10 +29,13 @@ Mesh::Mesh(Context *rsc) : ObjectBase(rsc) { mPrimitivesCount = 0; mVertexBuffers = NULL; mVertexBufferCount = 0; + +#ifndef ANDROID_RS_SERIALIZE mAttribs = NULL; mAttribAllocationIndex = NULL; mAttribCount = 0; +#endif } Mesh::~Mesh() { @@ -53,12 +50,97 @@ Mesh::~Mesh() { delete[] mPrimitives; } +#ifndef ANDROID_RS_SERIALIZE if (mAttribs) { delete[] mAttribs; delete[] mAttribAllocationIndex; } +#endif +} + +void Mesh::serialize(OStream *stream) const { + // Need to identify ourselves + stream->addU32((uint32_t)getClassId()); + + String8 name(getName()); + stream->addString(&name); + + // Store number of vertex streams + stream->addU32(mVertexBufferCount); + for (uint32_t vCount = 0; vCount < mVertexBufferCount; vCount ++) { + mVertexBuffers[vCount]->serialize(stream); + } + + stream->addU32(mPrimitivesCount); + // Store the primitives + for (uint32_t pCount = 0; pCount < mPrimitivesCount; pCount ++) { + Primitive_t * prim = mPrimitives[pCount]; + + stream->addU8((uint8_t)prim->mPrimitive); + + if (prim->mIndexBuffer.get()) { + stream->addU32(1); + prim->mIndexBuffer->serialize(stream); + } else { + stream->addU32(0); + } + } } +Mesh *Mesh::createFromStream(Context *rsc, IStream *stream) { + // First make sure we are reading the correct object + RsA3DClassID classID = (RsA3DClassID)stream->loadU32(); + if (classID != RS_A3D_CLASS_ID_MESH) { + LOGE("mesh loading skipped due to invalid class id"); + return NULL; + } + + Mesh * mesh = new Mesh(rsc); + + String8 name; + stream->loadString(&name); + mesh->setName(name.string(), name.size()); + + mesh->mVertexBufferCount = stream->loadU32(); + if (mesh->mVertexBufferCount) { + mesh->mVertexBuffers = new ObjectBaseRef<Allocation>[mesh->mVertexBufferCount]; + + for (uint32_t vCount = 0; vCount < mesh->mVertexBufferCount; vCount ++) { + Allocation *vertexAlloc = Allocation::createFromStream(rsc, stream); + mesh->mVertexBuffers[vCount].set(vertexAlloc); + } + } + + mesh->mPrimitivesCount = stream->loadU32(); + if (mesh->mPrimitivesCount) { + mesh->mPrimitives = new Primitive_t *[mesh->mPrimitivesCount]; + + // load all primitives + for (uint32_t pCount = 0; pCount < mesh->mPrimitivesCount; pCount ++) { + Primitive_t * prim = new Primitive_t; + mesh->mPrimitives[pCount] = prim; + + prim->mPrimitive = (RsPrimitive)stream->loadU8(); + + // Check to see if the index buffer was stored + uint32_t isIndexPresent = stream->loadU32(); + if (isIndexPresent) { + Allocation *indexAlloc = Allocation::createFromStream(rsc, stream); + prim->mIndexBuffer.set(indexAlloc); + } + } + } + +#ifndef ANDROID_RS_SERIALIZE + mesh->updateGLPrimitives(); + mesh->initVertexAttribs(); + mesh->uploadAll(rsc); +#endif + return mesh; +} + +#ifndef ANDROID_RS_SERIALIZE + bool Mesh::isValidGLComponent(const Element *elem, uint32_t fieldIdx) { // Do not create attribs for padding if (elem->getFieldName(fieldIdx)[0] == '#') { @@ -224,86 +306,6 @@ void Mesh::updateGLPrimitives() { } } -void Mesh::serialize(OStream *stream) const { - // Need to identify ourselves - stream->addU32((uint32_t)getClassId()); - - String8 name(getName()); - stream->addString(&name); - - // Store number of vertex streams - stream->addU32(mVertexBufferCount); - for (uint32_t vCount = 0; vCount < mVertexBufferCount; vCount ++) { - mVertexBuffers[vCount]->serialize(stream); - } - - stream->addU32(mPrimitivesCount); - // Store the primitives - for (uint32_t pCount = 0; pCount < mPrimitivesCount; pCount ++) { - Primitive_t * prim = mPrimitives[pCount]; - - stream->addU8((uint8_t)prim->mPrimitive); - - if (prim->mIndexBuffer.get()) { - stream->addU32(1); - prim->mIndexBuffer->serialize(stream); - } else { - stream->addU32(0); - } - } -} - -Mesh *Mesh::createFromStream(Context *rsc, IStream *stream) { - // First make sure we are reading the correct object - RsA3DClassID classID = (RsA3DClassID)stream->loadU32(); - if (classID != RS_A3D_CLASS_ID_MESH) { - LOGE("mesh loading skipped due to invalid class id"); - return NULL; - } - - Mesh * mesh = new Mesh(rsc); - - String8 name; - stream->loadString(&name); - mesh->setName(name.string(), name.size()); - - mesh->mVertexBufferCount = stream->loadU32(); - if (mesh->mVertexBufferCount) { - mesh->mVertexBuffers = new ObjectBaseRef<Allocation>[mesh->mVertexBufferCount]; - - for (uint32_t vCount = 0; vCount < mesh->mVertexBufferCount; vCount ++) { - Allocation *vertexAlloc = Allocation::createFromStream(rsc, stream); - mesh->mVertexBuffers[vCount].set(vertexAlloc); - } - } - - mesh->mPrimitivesCount = stream->loadU32(); - if (mesh->mPrimitivesCount) { - mesh->mPrimitives = new Primitive_t *[mesh->mPrimitivesCount]; - - // load all primitives - for (uint32_t pCount = 0; pCount < mesh->mPrimitivesCount; pCount ++) { - Primitive_t * prim = new Primitive_t; - mesh->mPrimitives[pCount] = prim; - - prim->mPrimitive = (RsPrimitive)stream->loadU8(); - - // Check to see if the index buffer was stored - uint32_t isIndexPresent = stream->loadU32(); - if (isIndexPresent) { - Allocation *indexAlloc = Allocation::createFromStream(rsc, stream); - prim->mIndexBuffer.set(indexAlloc); - } - } - } - - mesh->updateGLPrimitives(); - mesh->initVertexAttribs(); - mesh->uploadAll(rsc); - - return mesh; -} - void Mesh::computeBBox() { float *posPtr = NULL; uint32_t vectorSize = 0; @@ -347,13 +349,6 @@ void Mesh::computeBBox() { } } - -MeshContext::MeshContext() { -} - -MeshContext::~MeshContext() { -} - namespace android { namespace renderscript { @@ -428,3 +423,5 @@ void rsaMeshGetIndices(RsContext con, RsMesh mv, RsAllocation *va, uint32_t *pri } } } + +#endif diff --git a/libs/rs/rsMesh.h b/libs/rs/rsMesh.h index 410b70b..3e080e2 100644 --- a/libs/rs/rsMesh.h +++ b/libs/rs/rsMesh.h @@ -50,15 +50,18 @@ public: Primitive_t ** mPrimitives; uint32_t mPrimitivesCount; + virtual void serialize(OStream *stream) const; + virtual RsA3DClassID getClassId() const { return RS_A3D_CLASS_ID_MESH; } + static Mesh *createFromStream(Context *rsc, IStream *stream); + +#ifndef ANDROID_RS_SERIALIZE void render(Context *) const; void renderPrimitive(Context *, uint32_t primIndex) const; void renderPrimitiveRange(Context *, uint32_t primIndex, uint32_t start, uint32_t len) const; void uploadAll(Context *); void updateGLPrimitives(); - virtual void serialize(OStream *stream) const; - virtual RsA3DClassID getClassId() const { return RS_A3D_CLASS_ID_MESH; } - static Mesh *createFromStream(Context *rsc, IStream *stream); + // Bounding volumes float mBBoxMin[3]; @@ -76,12 +79,15 @@ protected: // buffer, it lets us properly map it uint32_t *mAttribAllocationIndex; uint32_t mAttribCount; +#endif }; class MeshContext { public: - MeshContext(); - ~MeshContext(); + MeshContext() { + } + ~MeshContext() { + } }; } diff --git a/libs/rs/rsObjectBase.cpp b/libs/rs/rsObjectBase.cpp index aec2f67..f428f94 100644 --- a/libs/rs/rsObjectBase.cpp +++ b/libs/rs/rsObjectBase.cpp @@ -15,13 +15,7 @@ */ #include "rsObjectBase.h" - -#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" -#else -#include "rsContextHostStub.h" -#endif - using namespace android; using namespace android::renderscript; diff --git a/libs/rs/rsProgram.cpp b/libs/rs/rsProgram.cpp index 39b85e3..4ef05bf 100644 --- a/libs/rs/rsProgram.cpp +++ b/libs/rs/rsProgram.cpp @@ -14,15 +14,11 @@ * limitations under the License. */ -#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" +#ifndef ANDROID_RS_SERIALIZE #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> -#else -#include "rsContextHostStub.h" -#include <OpenGL/gl.h> -#include <OpenGL/glext.h> -#endif //ANDROID_RS_BUILD_FOR_HOST +#endif //ANDROID_RS_SERIALIZE #include "rsProgram.h" diff --git a/libs/rs/rsProgramFragment.cpp b/libs/rs/rsProgramFragment.cpp index 22cd5d3..ff314b7 100644 --- a/libs/rs/rsProgramFragment.cpp +++ b/libs/rs/rsProgramFragment.cpp @@ -14,17 +14,13 @@ * limitations under the License. */ -#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" +#ifndef ANDROID_RS_SERIALIZE #include <GLES/gl.h> #include <GLES/glext.h> #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> -#else -#include "rsContextHostStub.h" -#include <OpenGL/gl.h> -#include <OpenGL/glext.h> -#endif //ANDROID_RS_BUILD_FOR_HOST +#endif //ANDROID_RS_SERIALIZE #include "rsProgramFragment.h" diff --git a/libs/rs/rsProgramRaster.cpp b/libs/rs/rsProgramRaster.cpp index f2b5b9a..ace1572 100644 --- a/libs/rs/rsProgramRaster.cpp +++ b/libs/rs/rsProgramRaster.cpp @@ -14,15 +14,11 @@ * limitations under the License. */ -#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" +#ifndef ANDROID_RS_SERIALIZE #include <GLES/gl.h> #include <GLES/glext.h> -#else -#include "rsContextHostStub.h" -#include <OpenGL/gl.h> -#include <OpenGl/glext.h> -#endif //ANDROID_RS_BUILD_FOR_HOST +#endif //ANDROID_RS_SERIALIZE #include "rsProgramRaster.h" diff --git a/libs/rs/rsProgramStore.cpp b/libs/rs/rsProgramStore.cpp index 72ac574..09b759d 100644 --- a/libs/rs/rsProgramStore.cpp +++ b/libs/rs/rsProgramStore.cpp @@ -14,15 +14,11 @@ * limitations under the License. */ -#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" +#ifndef ANDROID_RS_SERIALIZE #include <GLES/gl.h> #include <GLES/glext.h> -#else -#include "rsContextHostStub.h" -#include <OpenGL/gl.h> -#include <OpenGl/glext.h> -#endif //ANDROID_RS_BUILD_FOR_HOST +#endif //ANDROID_RS_SERIALIZE #include "rsProgramStore.h" diff --git a/libs/rs/rsProgramVertex.cpp b/libs/rs/rsProgramVertex.cpp index ad2beaf..403c2a6 100644 --- a/libs/rs/rsProgramVertex.cpp +++ b/libs/rs/rsProgramVertex.cpp @@ -14,17 +14,13 @@ * limitations under the License. */ -#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" +#ifndef ANDROID_RS_SERIALIZE #include <GLES/gl.h> #include <GLES/glext.h> #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> -#else -#include "rsContextHostStub.h" -#include <OpenGL/gl.h> -#include <OpenGL/glext.h> -#endif //ANDROID_RS_BUILD_FOR_HOST +#endif //ANDROID_RS_SERIALIZE #include "rsProgramVertex.h" diff --git a/libs/rs/rsSampler.cpp b/libs/rs/rsSampler.cpp index c80aecc..db2383a 100644 --- a/libs/rs/rsSampler.cpp +++ b/libs/rs/rsSampler.cpp @@ -14,15 +14,11 @@ * limitations under the License. */ -#ifndef ANDROID_RS_BUILD_FOR_HOST +#include "rsContext.h" +#ifndef ANDROID_RS_SERIALIZE #include <GLES/gl.h> #include <GLES/glext.h> -#include "rsContext.h" -#else -#include "rsContextHostStub.h" -#include <OpenGL/gl.h> -#include <OpenGL/glext.h> -#endif //ANDROID_RS_BUILD_FOR_HOST +#endif //ANDROID_RS_SERIALIZE #include "rsSampler.h" diff --git a/libs/rs/rsScript.cpp b/libs/rs/rsScript.cpp index efdc626..9ada9c2 100644 --- a/libs/rs/rsScript.cpp +++ b/libs/rs/rsScript.cpp @@ -78,8 +78,6 @@ void Script::setVarObj(uint32_t slot, ObjectBase *val) { (*destPtr)->decSysRef(); } *destPtr = val; - } else { - LOGV("Calling setVarObj on slot = %i which is null. This is dangerous because the script will not hold a ref count on the object.", slot); } } diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp index 3858e1c..445a4e4 100644 --- a/libs/rs/rsScriptC.cpp +++ b/libs/rs/rsScriptC.cpp @@ -94,16 +94,24 @@ char *genCacheFileName(const char *cacheDir, } ScriptC::ScriptC(Context *rsc) : Script(rsc) { - LOGD(">>>> ScriptC ctor called, obj=%p", this); mBccScript = NULL; memset(&mProgram, 0, sizeof(mProgram)); } ScriptC::~ScriptC() { - LOGD(">>>> ~ScriptC() mBccScript = %p", mBccScript); if (mBccScript) { + if (mProgram.mObjectSlotList) { + for (size_t ct=0; ct < mProgram.mObjectSlotCount; ct++) { + setVarObj(mProgram.mObjectSlotList[ct], NULL); + } + delete [] mProgram.mObjectSlotList; + mProgram.mObjectSlotList = NULL; + mProgram.mObjectSlotCount = 0; + } + + + LOGD(">>>> ~ScriptC bccDisposeScript(%p)", mBccScript); bccDisposeScript(mBccScript); - LOGD(">>>> ~ScriptC(mBCCScript)"); } free(mEnviroment.mScriptText); mEnviroment.mScriptText = NULL; @@ -477,12 +485,7 @@ bool ScriptCState::runCompiler(Context *rsc, } #if 1 - if (bccLinkBC(s->mBccScript, - resName, - NULL /*rs_runtime_lib_bc*/, - 1 /*rs_runtime_lib_bc_size*/ - /*"1" means skip buffer here, and let libbcc decide*/, - 0) != 0) { + if (bccLinkFile(s->mBccScript, "/system/lib/libclcore.bc", 0) != 0) { LOGE("bcc: FAILS to link bitcode"); return false; } @@ -589,6 +592,16 @@ bool ScriptCState::runCompiler(Context *rsc, return false; } } + + size_t objectSlotCount = bccGetObjectSlotCount(s->mBccScript); + uint32_t *objectSlots = NULL; + if (objectSlotCount) { + objectSlots = new uint32_t[objectSlotCount]; + bccGetObjectSlotList(s->mBccScript, objectSlotCount, objectSlots); + s->mProgram.mObjectSlotList = objectSlots; + s->mProgram.mObjectSlotCount = objectSlotCount; + } + return true; } diff --git a/libs/rs/rsScriptC.h b/libs/rs/rsScriptC.h index 7143c67..e794feb 100644 --- a/libs/rs/rsScriptC.h +++ b/libs/rs/rsScriptC.h @@ -42,8 +42,12 @@ public: RunScript_t mRoot; VoidFunc_t mInit; + + uint32_t * mObjectSlotList; + uint32_t mObjectSlotCount; }; + Program_t mProgram; BCCScriptRef mBccScript; diff --git a/libs/rs/rsShaderCache.cpp b/libs/rs/rsShaderCache.cpp index b958021..e8d89c2 100644 --- a/libs/rs/rsShaderCache.cpp +++ b/libs/rs/rsShaderCache.cpp @@ -14,14 +14,11 @@ * limitations under the License. */ -#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" +#ifndef ANDROID_RS_SERIALIZE #include <GLES/gl.h> #include <GLES2/gl2.h> -#else -#include "rsContextHostStub.h" -#include <OpenGL/gl.h> -#endif //ANDROID_RS_BUILD_FOR_HOST +#endif //ANDROID_RS_SERIALIZE using namespace android; using namespace android::renderscript; diff --git a/libs/rs/rsStream.cpp b/libs/rs/rsStream.cpp index 49ed567..b9df0cc 100644 --- a/libs/rs/rsStream.cpp +++ b/libs/rs/rsStream.cpp @@ -15,12 +15,7 @@ * limitations under the License. */ -#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" -#else -#include "rsContextHostStub.h" -#endif - #include "rsStream.h" using namespace android; diff --git a/libs/rs/rsType.cpp b/libs/rs/rsType.cpp index d7b5f12..cd2be94 100644 --- a/libs/rs/rsType.cpp +++ b/libs/rs/rsType.cpp @@ -14,13 +14,7 @@ * limitations under the License. */ -#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" -#include <GLES/gl.h> -#else -#include "rsContextHostStub.h" -#include <OpenGL/gl.h> -#endif using namespace android; using namespace android::renderscript; @@ -146,7 +140,7 @@ uint32_t Type::getLODFaceOffset(uint32_t lod, RsAllocationCubemapFace face, uint void Type::dumpLOGV(const char *prefix) const { char buf[1024]; ObjectBase::dumpLOGV(prefix); - LOGV("%s Type: x=%i y=%i z=%i mip=%i face=%i", prefix, mDimX, mDimY, mDimZ, mDimLOD, mFaces); + LOGV("%s Type: x=%zu y=%zu z=%zu mip=%i face=%i", prefix, mDimX, mDimY, mDimZ, mDimLOD, mFaces); snprintf(buf, sizeof(buf), "%s element: ", prefix); mElement->dumpLOGV(buf); } diff --git a/libs/rs/rsUtils.h b/libs/rs/rsUtils.h index 0699b57..3b60af5 100644 --- a/libs/rs/rsUtils.h +++ b/libs/rs/rsUtils.h @@ -32,7 +32,7 @@ #include <time.h> #include <cutils/atomic.h> -#ifndef ANDROID_RS_BUILD_FOR_HOST +#ifndef ANDROID_RS_SERIALIZE #include <EGL/egl.h> #endif diff --git a/libs/rs/rsVertexArray.cpp b/libs/rs/rsVertexArray.cpp index d9393fe..354ee89 100644 --- a/libs/rs/rsVertexArray.cpp +++ b/libs/rs/rsVertexArray.cpp @@ -14,13 +14,10 @@ * limitations under the License. */ -#ifndef ANDROID_RS_BUILD_FOR_HOST #include "rsContext.h" +#ifndef ANDROID_RS_SERIALIZE #include <GLES/gl.h> #include <GLES2/gl2.h> -#else -#include "rsContextHostStub.h" -#include <OpenGL/gl.h> #endif using namespace android; diff --git a/libs/rs/scriptc/rs_core.rsh b/libs/rs/scriptc/rs_core.rsh index 15c92a0..4768bbe 100644 --- a/libs/rs/scriptc/rs_core.rsh +++ b/libs/rs/scriptc/rs_core.rsh @@ -3,93 +3,227 @@ #define _RS_RUNTIME extern -// Debugging, print to the LOG a description string and a value. +/** + * Debug function. Prints a string and value to the log. + */ extern void __attribute__((overloadable)) rsDebug(const char *, float); +/** + * Debug function. Prints a string and value to the log. + */ extern void __attribute__((overloadable)) rsDebug(const char *, float, float); +/** + * Debug function. Prints a string and value to the log. + */ extern void __attribute__((overloadable)) rsDebug(const char *, float, float, float); +/** + * Debug function. Prints a string and value to the log. + */ extern void __attribute__((overloadable)) rsDebug(const char *, float, float, float, float); +/** + * Debug function. Prints a string and value to the log. + */ extern void __attribute__((overloadable)) rsDebug(const char *, double); +/** + * Debug function. Prints a string and value to the log. + */ extern void __attribute__((overloadable)) rsDebug(const char *, const rs_matrix4x4 *); +/** + * Debug function. Prints a string and value to the log. + */ extern void __attribute__((overloadable)) rsDebug(const char *, const rs_matrix3x3 *); +/** + * Debug function. Prints a string and value to the log. + */ extern void __attribute__((overloadable)) rsDebug(const char *, const rs_matrix2x2 *); +/** + * Debug function. Prints a string and value to the log. + */ extern void __attribute__((overloadable)) rsDebug(const char *, int); +/** + * Debug function. Prints a string and value to the log. + */ extern void __attribute__((overloadable)) rsDebug(const char *, uint); +/** + * Debug function. Prints a string and value to the log. + */ extern void __attribute__((overloadable)) rsDebug(const char *, long); +/** + * Debug function. Prints a string and value to the log. + */ extern void __attribute__((overloadable)) rsDebug(const char *, unsigned long); +/** + * Debug function. Prints a string and value to the log. + */ extern void __attribute__((overloadable)) rsDebug(const char *, long long); +/** + * Debug function. Prints a string and value to the log. + */ extern void __attribute__((overloadable)) rsDebug(const char *, unsigned long long); +/** + * Debug function. Prints a string and value to the log. + */ extern void __attribute__((overloadable)) rsDebug(const char *, const void *); #define RS_DEBUG(a) rsDebug(#a, a) #define RS_DEBUG_MARKER rsDebug(__FILE__, __LINE__) + +/** + * Debug function. Prints a string and value to the log. + */ _RS_RUNTIME void __attribute__((overloadable)) rsDebug(const char *s, float2 v); +/** + * Debug function. Prints a string and value to the log. + */ _RS_RUNTIME void __attribute__((overloadable)) rsDebug(const char *s, float3 v); +/** + * Debug function. Prints a string and value to the log. + */ _RS_RUNTIME void __attribute__((overloadable)) rsDebug(const char *s, float4 v); + +/** + * Pack floating point (0-1) RGB values into a uchar4. The alpha component is + * set to 255 (1.0). + * + * @param r + * @param g + * @param b + * + * @return uchar4 + */ _RS_RUNTIME uchar4 __attribute__((overloadable)) rsPackColorTo8888(float r, float g, float b); +/** + * Pack floating point (0-1) RGBA values into a uchar4. + * + * @param r + * @param g + * @param b + * @param a + * + * @return uchar4 + */ _RS_RUNTIME uchar4 __attribute__((overloadable)) rsPackColorTo8888(float r, float g, float b, float a); +/** + * Pack floating point (0-1) RGB values into a uchar4. The alpha component is + * set to 255 (1.0). + * + * @param color + * + * @return uchar4 + */ _RS_RUNTIME uchar4 __attribute__((overloadable)) rsPackColorTo8888(float3 color); +/** + * Pack floating point (0-1) RGBA values into a uchar4. + * + * @param color + * + * @return uchar4 + */ _RS_RUNTIME uchar4 __attribute__((overloadable)) rsPackColorTo8888(float4 color); +/** + * Unpack a uchar4 color to float4. The resulting float range will be (0-1). + * + * @param c + * + * @return float4 + */ _RS_RUNTIME float4 rsUnpackColor8888(uchar4 c); -//extern uchar4 __attribute__((overloadable)) rsPackColorTo565(float r, float g, float b); -//extern uchar4 __attribute__((overloadable)) rsPackColorTo565(float3); -//extern float4 rsUnpackColor565(uchar4); - ///////////////////////////////////////////////////// // Matrix ops ///////////////////////////////////////////////////// +/** + * Set one element of a matrix. + * + * @param m The matrix to be set + * @param row + * @param col + * @param v + * + * @return void + */ _RS_RUNTIME void __attribute__((overloadable)) rsMatrixSet(rs_matrix4x4 *m, uint32_t row, uint32_t col, float v); - -_RS_RUNTIME float __attribute__((overloadable)) -rsMatrixGet(const rs_matrix4x4 *m, uint32_t row, uint32_t col); - _RS_RUNTIME void __attribute__((overloadable)) rsMatrixSet(rs_matrix3x3 *m, uint32_t row, uint32_t col, float v); - -_RS_RUNTIME float __attribute__((overloadable)) -rsMatrixGet(const rs_matrix3x3 *m, uint32_t row, uint32_t col); - _RS_RUNTIME void __attribute__((overloadable)) rsMatrixSet(rs_matrix2x2 *m, uint32_t row, uint32_t col, float v); +/** + * Get one element of a matrix. + * + * @param m The matrix to read from + * @param row + * @param col + * + * @return float + */ +_RS_RUNTIME float __attribute__((overloadable)) +rsMatrixGet(const rs_matrix4x4 *m, uint32_t row, uint32_t col); +_RS_RUNTIME float __attribute__((overloadable)) +rsMatrixGet(const rs_matrix3x3 *m, uint32_t row, uint32_t col); _RS_RUNTIME float __attribute__((overloadable)) rsMatrixGet(const rs_matrix2x2 *m, uint32_t row, uint32_t col); +/** + * Set the elements of a matrix to the identity matrix. + * + * @param m + */ extern void __attribute__((overloadable)) rsMatrixLoadIdentity(rs_matrix4x4 *m); extern void __attribute__((overloadable)) rsMatrixLoadIdentity(rs_matrix3x3 *m); extern void __attribute__((overloadable)) rsMatrixLoadIdentity(rs_matrix2x2 *m); + +/** + * Set the elements of a matrix from an array of floats. + * + * @param m + */ extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const float *v); extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix3x3 *m, const float *v); extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix2x2 *m, const float *v); + +/** + * Set the elements of a matrix from another matrix. + * + * @param m + */ extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix4x4 *v); extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix3x3 *v); extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix4x4 *m, const rs_matrix2x2 *v); extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix3x3 *m, const rs_matrix3x3 *v); extern void __attribute__((overloadable)) rsMatrixLoad(rs_matrix2x2 *m, const rs_matrix2x2 *v); +/** + * Load a rotation matrix. + * + * @param m + * @param rot + * @param x + * @param y + * @param z + */ extern void __attribute__((overloadable)) rsMatrixLoadRotate(rs_matrix4x4 *m, float rot, float x, float y, float z); diff --git a/libs/rs/scriptc/rs_graphics.rsh b/libs/rs/scriptc/rs_graphics.rsh index 3868f24..142e21a 100644 --- a/libs/rs/scriptc/rs_graphics.rsh +++ b/libs/rs/scriptc/rs_graphics.rsh @@ -1,21 +1,60 @@ #ifndef __RS_GRAPHICS_RSH__ #define __RS_GRAPHICS_RSH__ -// Bind a ProgramFragment to the RS context. + +/** + * Bind a new ProgramFragment to the rendering context. + * + * @param pf + */ extern void __attribute__((overloadable)) - rsgBindProgramFragment(rs_program_fragment); + rsgBindProgramFragment(rs_program_fragment pf); + +/** + * Bind a new ProgramStore to the rendering context. + * + * @param ps + */ extern void __attribute__((overloadable)) - rsgBindProgramStore(rs_program_store); + rsgBindProgramStore(rs_program_store ps); + +/** + * Bind a new ProgramVertex to the rendering context. + * + * @param pv + */ extern void __attribute__((overloadable)) - rsgBindProgramVertex(rs_program_vertex); + rsgBindProgramVertex(rs_program_vertex pv); + +/** + * Bind a new ProgramRaster to the rendering context. + * + * @param pr + */ extern void __attribute__((overloadable)) - rsgBindProgramRaster(rs_program_raster); + rsgBindProgramRaster(rs_program_raster pr); +/** + * Bind a new Sampler object to a ProgramFragment. The sampler will + * operate on the texture bound at the matching slot. + * + * @param slot + */ extern void __attribute__((overloadable)) rsgBindSampler(rs_program_fragment, uint slot, rs_sampler); + +/** + * Bind a new Allocation object to a ProgramFragment. The + * Allocation must be a valid texture for the Program. The sampling + * of the texture will be controled by the Sampler bound at the + * matching slot. + * + * @param slot + */ extern void __attribute__((overloadable)) rsgBindTexture(rs_program_fragment, uint slot, rs_allocation); + extern void __attribute__((overloadable)) rsgProgramVertexLoadProjectionMatrix(const rs_matrix4x4 *); extern void __attribute__((overloadable)) @@ -26,32 +65,134 @@ extern void __attribute__((overloadable)) extern void __attribute__((overloadable)) rsgProgramVertexGetProjectionMatrix(rs_matrix4x4 *); +/** + * Set the constant color for a fixed function emulation program. + * + * @param pf + * @param r + * @param g + * @param b + * @param a + */ extern void __attribute__((overloadable)) - rsgProgramFragmentConstantColor(rs_program_fragment, float, float, float, float); + rsgProgramFragmentConstantColor(rs_program_fragment pf, float r, float g, float b, float a); +/** + * Get the width of the current rendering surface. + * + * @return uint + */ extern uint __attribute__((overloadable)) rsgGetWidth(void); + +/** + * Get the height of the current rendering surface. + * + * @return uint + */ extern uint __attribute__((overloadable)) rsgGetHeight(void); + +/** + * Sync the contents of an allocation from its SCRIPT memory space to its HW + * memory spaces. + * + * @param alloc + */ extern void __attribute__((overloadable)) - rsgAllocationSyncAll(rs_allocation); + rsgAllocationSyncAll(rs_allocation alloc); +/** + * Low performance utility function for drawing a simple rectangle. Not + * intended for drawing large quantities of geometry. + * + * @param x1 + * @param y1 + * @param x2 + * @param y2 + * @param z + */ extern void __attribute__((overloadable)) rsgDrawRect(float x1, float y1, float x2, float y2, float z); + +/** + * Low performance utility function for drawing a simple quad. Not intended for + * drawing large quantities of geometry. + * + * @param x1 + * @param y1 + * @param z1 + * @param x2 + * @param y2 + * @param z2 + * @param x3 + * @param y3 + * @param z3 + * @param x4 + * @param y4 + * @param z4 + */ extern void __attribute__((overloadable)) rsgDrawQuad(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4); + + +/** + * Low performance utility function for drawing a textured quad. Not intended + * for drawing large quantities of geometry. + * + * @param x1 + * @param y1 + * @param z1 + * @param u1 + * @param v1 + * @param x2 + * @param y2 + * @param z2 + * @param u2 + * @param v2 + * @param x3 + * @param y3 + * @param z3 + * @param u3 + * @param v3 + * @param x4 + * @param y4 + * @param z4 + * @param u4 + * @param v4 + */ extern void __attribute__((overloadable)) rsgDrawQuadTexCoords(float x1, float y1, float z1, float u1, float v1, float x2, float y2, float z2, float u2, float v2, float x3, float y3, float z3, float u3, float v3, float x4, float y4, float z4, float u4, float v4); + + +/** + * Low performance function for drawing rectangles in screenspace. This + * function uses the default passthough ProgramVertex. Any bound ProgramVertex + * is ignored. This function has considerable overhead and should not be used + * for drawing in shipping applications. + * + * @param x + * @param y + * @param z + * @param w + * @param h + */ extern void __attribute__((overloadable)) rsgDrawSpriteScreenspace(float x, float y, float z, float w, float h); +/** + * Draw a mesh of geometry using the current context state. The whole mesh is + * rendered. + * + * @param ism + */ extern void __attribute__((overloadable)) rsgDrawMesh(rs_mesh ism); extern void __attribute__((overloadable)) @@ -59,10 +200,23 @@ extern void __attribute__((overloadable)) extern void __attribute__((overloadable)) rsgDrawMesh(rs_mesh ism, uint primitiveIndex, uint start, uint len); +/** + * Clears the rendering surface to the specified color. + * + * @param r + * @param g + * @param b + * @param a + */ extern void __attribute__((overloadable)) - rsgClearColor(float, float, float, float); + rsgClearColor(float r, float g, float b, float a); + +/** + * Clears the depth suface to the specified value. + * + */ extern void __attribute__((overloadable)) - rsgClearDepth(float); + rsgClearDepth(float value); extern void __attribute__((overloadable)) rsgDrawText(const char *, int x, int y); @@ -94,12 +248,13 @@ rsgMeshComputeBoundingBox(rs_mesh mesh, float3 *bBoxMin, float3 *bBoxMax) { bBoxMax->z = z2; } -/////////////////////////////////////////////////////// -// misc -// Depricated -extern void __attribute__((overloadable)) - color(float, float, float, float); +/** + * @hide + * Deprecated, do not use. + * + */ +extern void __attribute__((overloadable)) color(float, float, float, float); #endif diff --git a/libs/rs/scriptc/rs_math.rsh b/libs/rs/scriptc/rs_math.rsh index a74c0e0..e2719e0 100644 --- a/libs/rs/scriptc/rs_math.rsh +++ b/libs/rs/scriptc/rs_math.rsh @@ -1,6 +1,12 @@ #ifndef __RS_MATH_RSH__ #define __RS_MATH_RSH__ +/** + * Copy reference to the specified object. + * + * @param dst + * @param src + */ extern void __attribute__((overloadable)) rsSetObject(rs_element *dst, rs_element src); extern void __attribute__((overloadable)) @@ -24,6 +30,11 @@ extern void __attribute__((overloadable)) extern void __attribute__((overloadable)) rsSetObject(rs_font *dst, rs_font src); +/** + * Sets the object to NULL. + * + * @return bool + */ extern void __attribute__((overloadable)) rsClearObject(rs_element *dst); extern void __attribute__((overloadable)) @@ -47,6 +58,12 @@ extern void __attribute__((overloadable)) extern void __attribute__((overloadable)) rsClearObject(rs_font *dst); +/** + * Tests if the object is valid. Returns true if the object is valid, false if + * it is NULL. + * + * @return bool + */ extern bool __attribute__((overloadable)) rsIsObject(rs_element); extern bool __attribute__((overloadable)) @@ -71,27 +88,58 @@ extern bool __attribute__((overloadable)) rsIsObject(rs_font); - -// Allocations - -// Return the rs_allocation associated with a bound data -// pointer. +/** + * Returns the Allocation for a given pointer. The pointer should point within + * a valid allocation. The results are undefined if the pointer is not from a + * valid allocation. + */ extern rs_allocation __attribute__((overloadable)) rsGetAllocation(const void *); -// Mark the allocation dirty and notify those using it +/** + * Mark the contents of an allocation as dirty. This forces any other scripts + * using the allocation to receive the updated + */ extern void __attribute__((overloadable)) rsAllocationMarkDirty(rs_allocation); -// Return the dimensions associated with an allocation. +/** + * Query the dimension of an allocation. + * + * @return uint32_t The X dimension of the allocation. + */ extern uint32_t __attribute__((overloadable)) rsAllocationGetDimX(rs_allocation); + +/** + * Query the dimension of an allocation. + * + * @return uint32_t The Y dimension of the allocation. + */ extern uint32_t __attribute__((overloadable)) rsAllocationGetDimY(rs_allocation); + +/** + * Query the dimension of an allocation. + * + * @return uint32_t The Z dimension of the allocation. + */ extern uint32_t __attribute__((overloadable)) rsAllocationGetDimZ(rs_allocation); + +/** + * Query an allocation for the presence of more than one LOD. + * + * @return uint32_t Returns 1 if more than one LOD is present, 0 otherwise. + */ extern uint32_t __attribute__((overloadable)) rsAllocationGetDimLOD(rs_allocation); + +/** + * Query an allocation for the presence of more than one face. + * + * @return uint32_t Returns 1 if more than one face is present, 0 otherwise. + */ extern uint32_t __attribute__((overloadable)) rsAllocationGetDimFaces(rs_allocation); diff --git a/libs/surfaceflinger_client/Surface.cpp b/libs/surfaceflinger_client/Surface.cpp index e21bab7..1e9bd74 100644 --- a/libs/surfaceflinger_client/Surface.cpp +++ b/libs/surfaceflinger_client/Surface.cpp @@ -827,13 +827,15 @@ int Surface::disconnect(int api) int Surface::crop(Rect const* rect) { - // empty/invalid rects are not allowed - if (rect->isEmpty()) - return BAD_VALUE; - Mutex::Autolock _l(mSurfaceLock); // TODO: validate rect size - mNextBufferCrop = *rect; + + if (rect == NULL || rect->isEmpty()) { + mNextBufferCrop = Rect(0,0); + } else { + mNextBufferCrop = *rect; + } + return NO_ERROR; } @@ -884,6 +886,9 @@ int Surface::setBuffersGeometry(int w, int h, int format) // EGLConfig validation. mFormat = format; } + + mNextBufferCrop = Rect(0,0); + return NO_ERROR; } diff --git a/libs/utils/ResourceTypes.cpp b/libs/utils/ResourceTypes.cpp index bbf5093..7197ad7 100644 --- a/libs/utils/ResourceTypes.cpp +++ b/libs/utils/ResourceTypes.cpp @@ -3703,9 +3703,9 @@ void ResTable::getConfigurations(Vector<ResTable_config>* configs) const void ResTable::getLocales(Vector<String8>* locales) const { Vector<ResTable_config> configs; - LOGD("calling getConfigurations"); + LOGV("calling getConfigurations"); getConfigurations(&configs); - LOGD("called getConfigurations size=%d", (int)configs.size()); + LOGV("called getConfigurations size=%d", (int)configs.size()); const size_t I = configs.size(); for (size_t i=0; i<I; i++) { char locale[6]; @@ -4141,6 +4141,38 @@ void print_complex(uint32_t complex, bool isFraction) } } +// Normalize a string for output +String8 ResTable::normalizeForOutput( const char *input ) +{ + String8 ret; + char buff[2]; + buff[1] = '\0'; + + while (*input != '\0') { + switch (*input) { + // All interesting characters are in the ASCII zone, so we are making our own lives + // easier by scanning the string one byte at a time. + case '\\': + ret += "\\\\"; + break; + case '\n': + ret += "\\n"; + break; + case '"': + ret += "\\\""; + break; + default: + buff[0] = *input; + ret += buff; + break; + } + + input++; + } + + return ret; +} + void ResTable::print_value(const Package* pkg, const Res_value& value) const { if (value.dataType == Res_value::TYPE_NULL) { @@ -4154,13 +4186,13 @@ void ResTable::print_value(const Package* pkg, const Res_value& value) const const char* str8 = pkg->header->values.string8At( value.data, &len); if (str8 != NULL) { - printf("(string8) \"%s\"\n", str8); + printf("(string8) \"%s\"\n", normalizeForOutput(str8).string()); } else { const char16_t* str16 = pkg->header->values.stringAt( value.data, &len); if (str16 != NULL) { printf("(string16) \"%s\"\n", - String8(str16, len).string()); + normalizeForOutput(String8(str16, len).string()).string()); } else { printf("(string) null\n"); } diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp index ad9a94f..b1bd828 100644 --- a/libs/utils/Threads.cpp +++ b/libs/utils/Threads.cpp @@ -778,6 +778,7 @@ int Thread::_threadLoop(void* user) // called by a new thread using the same thread ID as this one. self->mThread = thread_id_t(-1); self->mThreadExitedCondition.broadcast(); + self->mThread = thread_id_t(-1); // thread id could be reused self->mLock.unlock(); break; } diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index 7312d75..cbc7529 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -1450,7 +1450,7 @@ public class AudioService extends IAudioService.Stub { if (AudioSystem.getForceUse(AudioSystem.FOR_COMMUNICATION) == AudioSystem.FORCE_BT_SCO) { // Log.v(TAG, "getActiveStreamType: Forcing STREAM_BLUETOOTH_SCO..."); return AudioSystem.STREAM_BLUETOOTH_SCO; - } else if (isOffhook || AudioSystem.isStreamActive(AudioSystem.STREAM_VOICE_CALL)) { + } else if (isOffhook || getMode() == AudioManager.MODE_IN_COMMUNICATION) { // Log.v(TAG, "getActiveStreamType: Forcing STREAM_VOICE_CALL..."); return AudioSystem.STREAM_VOICE_CALL; } else if (AudioSystem.isStreamActive(AudioSystem.STREAM_MUSIC)) { diff --git a/media/java/android/media/videoeditor/AudioTrack.java b/media/java/android/media/videoeditor/AudioTrack.java index 9e68a5d..eeace13 100755 --- a/media/java/android/media/videoeditor/AudioTrack.java +++ b/media/java/android/media/videoeditor/AudioTrack.java @@ -267,14 +267,16 @@ public class AudioTrack { throw new IllegalArgumentException("Volume set exceeds maximum allowed value"); } - if (volumePercent < 0) { + if (volumePercent < 0) { throw new IllegalArgumentException("Invalid Volume "); } - mVolumePercent = volumePercent; + /** * Force update of preview settings */ mMANativeHelper.setGeneratePreview(true); + + mVolumePercent = volumePercent; } /** @@ -294,11 +296,11 @@ public class AudioTrack { * the volume of this Audio Track to 0. */ public void setMute(boolean muted) { - mMuted = muted; /** * Force update of preview settings */ mMANativeHelper.setGeneratePreview(true); + mMuted = muted; } /** @@ -363,14 +365,15 @@ public class AudioTrack { throw new IllegalArgumentException("Invalid end time; is < 0"); } - mBeginBoundaryTimeMs = beginMs; - mEndBoundaryTimeMs = endMs; - - mTimelineDurationMs = mEndBoundaryTimeMs - mBeginBoundaryTimeMs; /** * Force update of preview settings */ mMANativeHelper.setGeneratePreview(true); + + mBeginBoundaryTimeMs = beginMs; + mEndBoundaryTimeMs = endMs; + + mTimelineDurationMs = mEndBoundaryTimeMs - mBeginBoundaryTimeMs; } /** @@ -412,11 +415,11 @@ public class AudioTrack { */ public void disableLoop() { if (mLoop) { - mLoop = false; /** * Force update of preview settings */ mMANativeHelper.setGeneratePreview(true); + mLoop = false; } } @@ -434,11 +437,11 @@ public class AudioTrack { */ public void disableDucking() { if (mIsDuckingEnabled) { - mIsDuckingEnabled = false; /** * Force update of preview settings */ mMANativeHelper.setGeneratePreview(true); + mIsDuckingEnabled = false; } } @@ -462,13 +465,14 @@ public class AudioTrack { + duckedTrackVolume); } - mDuckingThreshold = threshold; - mDuckedTrackVolume = duckedTrackVolume; - mIsDuckingEnabled = true; /** * Force update of preview settings */ mMANativeHelper.setGeneratePreview(true); + + mDuckingThreshold = threshold; + mDuckedTrackVolume = duckedTrackVolume; + mIsDuckingEnabled = true; } /** diff --git a/media/java/android/media/videoeditor/Effect.java b/media/java/android/media/videoeditor/Effect.java index 3362d47..c6b0839 100755 --- a/media/java/android/media/videoeditor/Effect.java +++ b/media/java/android/media/videoeditor/Effect.java @@ -105,8 +105,7 @@ public abstract class Effect { final long oldDurationMs = mDurationMs; mDurationMs = durationMs; - mMediaItem.invalidateTransitions(mStartTimeMs, oldDurationMs, - mStartTimeMs, mDurationMs); + mMediaItem.invalidateTransitions(mStartTimeMs, oldDurationMs, mStartTimeMs, mDurationMs); } /** @@ -130,11 +129,11 @@ public abstract class Effect { throw new IllegalArgumentException("Start time is too large"); } + getMediaItem().getNativeContext().setGeneratePreview(true); final long oldStartTimeMs = mStartTimeMs; mStartTimeMs = startTimeMs; - mMediaItem.invalidateTransitions(oldStartTimeMs, mDurationMs, - mStartTimeMs, mDurationMs); + mMediaItem.invalidateTransitions(oldStartTimeMs, mDurationMs, mStartTimeMs, mDurationMs); } /** @@ -163,8 +162,7 @@ public abstract class Effect { mStartTimeMs = startTimeMs; mDurationMs = durationMs; - mMediaItem.invalidateTransitions(oldStartTimeMs, oldDurationMs, - mStartTimeMs, mDurationMs); + mMediaItem.invalidateTransitions(oldStartTimeMs, oldDurationMs, mStartTimeMs, mDurationMs); } /** diff --git a/media/java/android/media/videoeditor/MediaArtistNativeHelper.java b/media/java/android/media/videoeditor/MediaArtistNativeHelper.java index f438be8..ba9403d 100644 --- a/media/java/android/media/videoeditor/MediaArtistNativeHelper.java +++ b/media/java/android/media/videoeditor/MediaArtistNativeHelper.java @@ -20,9 +20,10 @@ import java.io.File; import java.io.IOException; import java.math.BigDecimal; import java.nio.IntBuffer; -import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import java.util.concurrent.Semaphore; + import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; @@ -39,22 +40,29 @@ import android.view.Surface; *This class provide Native methods to be used by MediaArtist {@hide} */ class MediaArtistNativeHelper { + private static final String TAG = "MediaArtistNativeHelper"; static { System.loadLibrary("videoeditor_jni"); } - private final int MAX_THUMBNAIL_PERMITTED = 8; + private static final int MAX_THUMBNAIL_PERMITTED = 8; + + public static final int TASK_LOADING_SETTINGS = 1; + public static final int TASK_ENCODING = 2; + + /** + * The resize paint + */ + private static final Paint sResizePaint = new Paint(Paint.FILTER_BITMAP_FLAG); private final VideoEditor mVideoEditor; - public EditSettings mStoryBoardSettings; + private EditSettings mStoryBoardSettings; private String mOutputFilename; - EditSettings mEditSettings = null; - - PreviewClipProperties mClipProperties = null; + private PreviewClipProperties mClipProperties = null; private EditSettings mPreviewEditSettings; @@ -62,30 +70,24 @@ class MediaArtistNativeHelper { private AudioTrack mAudioTrack = null; - public boolean mInvalidatePreviewArray = true; + private boolean mInvalidatePreviewArray = true; private boolean mRegenerateAudio = true; private String mExportFilename = null; - private boolean mExportDone = false; - private int mProgressToApp; - /** - * The resize paint + /* + * Semaphore to control preview calls */ - private static final Paint sResizePaint = new Paint(Paint.FILTER_BITMAP_FLAG); + private final Semaphore mLock = new Semaphore(1, true); private String mRenderPreviewOverlayFile; - private int mRenderPreviewRenderingMode; + private int mRenderPreviewRenderingMode; private boolean mIsFirstProgress; - public static final int TASK_LOADING_SETTINGS = 1; - - public static final int TASK_ENCODING = 2; - private static final String AUDIO_TRACK_PCM_FILE = "AudioPcm.pcm"; // Processing indication @@ -98,33 +100,25 @@ class MediaArtistNativeHelper { public static final int PROCESSING_INTERMEDIATE3 = 13; public static final int PROCESSING_EXPORT = 20; - private int mProcessingState; + private int mProcessingState; private Object mProcessingObject; - private PreviewProgressListener mPreviewProgressListener; private ExportProgressListener mExportProgressListener; private ExtractAudioWaveformProgressListener mExtractAudioWaveformProgressListener; - private MediaProcessingProgressListener mMediaProcessingProgressListener; + private MediaProcessingProgressListener mMediaProcessingProgressListener; private final String mProjectPath; private long mPreviewProgress; private String mAudioTrackPCMFilePath; - int mTotalClips = 0; - - int mPreviewEffectsSize = 0; + private int mTotalClips = 0; private boolean mErrorFlagSet = false; @SuppressWarnings("unused") private int mManualEditContext; - - List<Effect> mMediaEffectList; - - List<Overlay> mMediaOverLayList; - /* Listeners */ /** @@ -339,10 +333,13 @@ class MediaArtistNativeHelper { public static final int JPG = 5; /** GIF image file type. */ - public static final int GIF = 6; + public static final int GIF = 7; /** PNG image file type. */ - public static final int PNG = 7; + public static final int PNG = 8; + + /** M4V file type. */ + public static final int M4V = 10; /** Unsupported file type. */ public static final int UNSUPPORTED = 255; @@ -760,7 +757,6 @@ class MediaArtistNativeHelper { /** Internal error. */ public static final int ERR_INTERNAL = 255; - } /** @@ -1200,9 +1196,8 @@ class MediaArtistNativeHelper { } /** - * Defines transition behaviours. - **/ - + * Defines transition behaviors. + */ public static final class TransitionBehaviour { /** The transition uses an increasing speed. */ @@ -1227,7 +1222,9 @@ class MediaArtistNativeHelper { public static final int FAST_MIDDLE = 4; } - /** Defines settings for the background music. */ + /** + * Defines settings for the background music. + */ public static class BackgroundMusicSettings { /** Background music file. */ @@ -1270,7 +1267,6 @@ class MediaArtistNativeHelper { public int lowVolume; public boolean isLooping; - } /** Defines settings for an effect. */ @@ -1565,7 +1561,6 @@ class MediaArtistNativeHelper { boolean bInDucking_enable; String pcmFilePath; - } /** Encapsulates preview clips and effect settings */ @@ -1772,7 +1767,6 @@ class MediaArtistNativeHelper { public int audioVolumeValue; public String Id; - } /** @@ -1793,8 +1787,6 @@ class MediaArtistNativeHelper { if (mStoryBoardSettings == null) mStoryBoardSettings = new EditSettings(); - mMediaEffectList = new ArrayList<Effect>(); - mMediaOverLayList = new ArrayList<Overlay>(); _init(mProjectPath, "null"); mAudioTrackPCMFilePath = null; } @@ -1876,7 +1868,7 @@ class MediaArtistNativeHelper { case PROCESSING_NONE: default: - Log.e("MediaArtistNativeHelper", "ERROR unexpected State=" + mProcessingState); + Log.e(TAG, "ERROR unexpected State=" + mProcessingState); return; } if ((mProgressToApp != actualProgress) && (actualProgress != 0)) { @@ -1885,8 +1877,7 @@ class MediaArtistNativeHelper { if (mMediaProcessingProgressListener != null) { // Send the progress indication - mMediaProcessingProgressListener.onProgress(mProcessingObject, - action, + mMediaProcessingProgressListener.onProgress(mProcessingObject, action, actualProgress); } } @@ -1896,8 +1887,7 @@ class MediaArtistNativeHelper { /* * Send the progress indication */ - mMediaProcessingProgressListener.onProgress(mProcessingObject, - action, + mMediaProcessingProgressListener.onProgress(mProcessingObject, action, actualProgress); } mProgressToApp = 1; @@ -1941,15 +1931,14 @@ class MediaArtistNativeHelper { /** * Release the native helper object */ - public void releaseNativeHelper() { + void releaseNativeHelper() { try { release(); } catch (IllegalStateException ex) { - Log.e("MediaArtistNativeHelper", - "Illegal State exeption caught in releaseNativeHelper"); + Log.e(TAG, "Illegal State exeption caught in releaseNativeHelper"); throw ex; } catch (RuntimeException ex) { - Log.e("MediaArtistNativeHelper", "Runtime exeption caught in releaseNativeHelper"); + Log.e(TAG, "Runtime exeption caught in releaseNativeHelper"); throw ex; } } @@ -1959,9 +1948,7 @@ class MediaArtistNativeHelper { */ @SuppressWarnings("unused") private void onAudioGraphExtractProgressUpdate(int progress, boolean isVideo) { - - if ((mExtractAudioWaveformProgressListener != null) && (progress > 0)) - { + if ((mExtractAudioWaveformProgressListener != null) && (progress > 0)) { mExtractAudioWaveformProgressListener.onProgress(progress); } } @@ -1971,8 +1958,7 @@ class MediaArtistNativeHelper { * * @param effects The reference of EffectColor * - * @return The populated effect settings in EffectSettings - * reference + * @return The populated effect settings in EffectSettings reference */ EffectSettings getEffectSettings(EffectColor effects) { EffectSettings effectSettings = new EffectSettings(); @@ -2014,8 +2000,7 @@ class MediaArtistNativeHelper { * * @param overlay The reference of OverlayFrame * - * @return The populated overlay settings in EffectSettings - * reference + * @return The populated overlay settings in EffectSettings reference */ EffectSettings getOverlaySettings(OverlayFrame overlay) { EffectSettings effectSettings = new EffectSettings(); @@ -2036,7 +2021,7 @@ class MediaArtistNativeHelper { try { (overlay).save(mProjectPath); } catch (IOException e) { - Log.e("MediaArtistNativeHelper","getOverlaySettings : File not found"); + Log.e(TAG, "getOverlaySettings : File not found"); } effectSettings.framingFile = overlay.getFilename(); } @@ -2095,13 +2080,12 @@ class MediaArtistNativeHelper { int aspectRatio; if (overlay.getMediaItem() instanceof MediaImageItem) { if (((MediaImageItem)overlay.getMediaItem()).getGeneratedImageClip() != null) { - //Kenburns was applied + // Ken Burns was applied mediaItemHeight = ((MediaImageItem)overlay.getMediaItem()).getGeneratedClipHeight(); aspectRatio = getAspectRatio( ((MediaImageItem)overlay.getMediaItem()).getGeneratedClipWidth() , mediaItemHeight); - } - else { + } else { //For image get the scaled height. Aspect ratio would remain the same mediaItemHeight = ((MediaImageItem)overlay.getMediaItem()).getScaledHeight(); aspectRatio = overlay.getMediaItem().getAspectRatio(); @@ -2145,7 +2129,7 @@ class MediaArtistNativeHelper { * * @return The frame rate from one of the defined enum values */ - public int GetClosestVideoFrameRate(int averageFrameRate) { + int GetClosestVideoFrameRate(int averageFrameRate) { if (averageFrameRate >= 25) { return VideoFrameRate.FR_30_FPS; } else if (averageFrameRate >= 20) { @@ -2169,8 +2153,7 @@ class MediaArtistNativeHelper { * Helper function to adjust the effect or overlay start time * depending on the begin and end boundary time of meddia item */ - public void adjustEffectsStartTimeAndDuration(EffectSettings lEffect, - int beginCutTime, + public void adjustEffectsStartTimeAndDuration(EffectSettings lEffect, int beginCutTime, int endCutTime) { int effectStartTime = 0; @@ -2268,20 +2251,20 @@ class MediaArtistNativeHelper { try { err = nativeGenerateClip(editSettings); } catch (IllegalArgumentException ex) { - Log.e("MediaArtistNativeHelper","Illegal Argument exception in load settings"); + Log.e(TAG, "Illegal Argument exception in load settings"); return -1; } catch (IllegalStateException ex) { - Log.e("MediaArtistNativeHelper","Illegal state exception in load settings"); + Log.e(TAG, "Illegal state exception in load settings"); return -1; } catch (RuntimeException ex) { - Log.e("MediaArtistNativeHelper", "Runtime exception in load settings"); + Log.e(TAG, "Runtime exception in load settings"); return -1; } return err; } /** - * Init function to initialise the ClipSettings reference to + * Init function to initialiZe the ClipSettings reference to * default values * * @param lclipSettings The ClipSettings reference @@ -2354,9 +2337,8 @@ class MediaArtistNativeHelper { //editSettings.videoFormat = VideoFormat.MPEG4; editSettings.videoFormat = VideoFormat.H264; editSettings.videoFrameRate = VideoFrameRate.FR_30_FPS; - editSettings.videoFrameSize = findVideoResolution(mVideoEditor.getAspectRatio(), m - .getHeight()); - + editSettings.videoFrameSize = findVideoResolution(mVideoEditor.getAspectRatio(), + m.getHeight()); } else { MediaImageItem m = (MediaImageItem)lMediaItem; editSettings.audioBitrate = Bitrate.BR_64_KBPS; @@ -2367,8 +2349,8 @@ class MediaArtistNativeHelper { editSettings.videoBitrate = Bitrate.BR_5_MBPS; editSettings.videoFormat = VideoFormat.H264; editSettings.videoFrameRate = VideoFrameRate.FR_30_FPS; - editSettings.videoFrameSize = findVideoResolution(mVideoEditor.getAspectRatio(), m - .getScaledHeight()); + editSettings.videoFrameSize = findVideoResolution(mVideoEditor.getAspectRatio(), + m.getScaledHeight()); } editSettings.outputFile = EffectClipPath; @@ -2463,11 +2445,9 @@ class MediaArtistNativeHelper { clip2Height = ((MediaImageItem)m2).getScaledHeight(); } if (clip1Height > clip2Height) { - videoSize = findVideoResolution(mVideoEditor.getAspectRatio(), - clip1Height); + videoSize = findVideoResolution(mVideoEditor.getAspectRatio(), clip1Height); } else { - videoSize = findVideoResolution(mVideoEditor.getAspectRatio(), - clip2Height); + videoSize = findVideoResolution(mVideoEditor.getAspectRatio(), clip2Height); } } else if (m1 == null && m2 != null) { if (m2 instanceof MediaVideoItem) { @@ -2475,16 +2455,14 @@ class MediaArtistNativeHelper { } else if (m2 instanceof MediaImageItem) { clip2Height = ((MediaImageItem)m2).getScaledHeight(); } - videoSize = findVideoResolution(mVideoEditor.getAspectRatio(), - clip2Height); + videoSize = findVideoResolution(mVideoEditor.getAspectRatio(), clip2Height); } else if (m1 != null && m2 == null) { if (m1 instanceof MediaVideoItem) { clip1Height = m1.getHeight(); } else if (m1 instanceof MediaImageItem) { clip1Height = ((MediaImageItem)m1).getScaledHeight(); } - videoSize = findVideoResolution(mVideoEditor.getAspectRatio(), - clip1Height); + videoSize = findVideoResolution(mVideoEditor.getAspectRatio(), clip1Height); } return videoSize; } @@ -2539,7 +2517,7 @@ class MediaArtistNativeHelper { * * @param m1 Media item associated with effect * @param effectSettings The EffectSettings reference containing - * effect specific data + * effect specific data * @param beginCutTime The begin cut time of the clip associated with effect * @param endCutTime The end cut time of the clip associated with effect * @param storyBoardTime The current story board time @@ -2548,8 +2526,6 @@ class MediaArtistNativeHelper { */ private int populateEffects(MediaItem m, EffectSettings[] effectSettings, int i, int beginCutTime, int endCutTime, int storyBoardTime) { - List<Effect> effects = m.getAllEffects(); - List<Overlay> overlays = m.getAllOverlays(); if (m.getBeginTransition() != null && m.getBeginTransition().getDuration() > 0 && m.getEndTransition() != null && m.getEndTransition().getDuration() > 0) { @@ -2563,19 +2539,20 @@ class MediaArtistNativeHelper { beginCutTime += m.getBeginTransition().getDuration(); } + final List<Effect> effects = m.getAllEffects(); + final List<Overlay> overlays = m.getAllOverlays(); for (Effect effect : effects) { if (effect instanceof EffectColor) { effectSettings[i] = getEffectSettings((EffectColor)effect); - adjustEffectsStartTimeAndDuration(effectSettings[i], - beginCutTime, endCutTime); + adjustEffectsStartTimeAndDuration(effectSettings[i], beginCutTime, endCutTime); effectSettings[i].startTime += storyBoardTime; i++; } } + for (Overlay overlay : overlays) { effectSettings[i] = getOverlaySettings((OverlayFrame)overlay); - adjustEffectsStartTimeAndDuration(effectSettings[i], - beginCutTime, endCutTime); + adjustEffectsStartTimeAndDuration(effectSettings[i], beginCutTime, endCutTime); effectSettings[i].startTime += storyBoardTime; i++; } @@ -2593,31 +2570,24 @@ class MediaArtistNativeHelper { Properties clipProperties, MediaItem m) { if (m.getBeginTransition() != null && m.getBeginTransition().getDuration() > 0 && m.getEndTransition() != null && m.getEndTransition().getDuration() > 0) { - clipSettings.beginCutTime += m.getBeginTransition().getDuration(); clipSettings.endCutTime -= m.getEndTransition().getDuration(); - } else if (m.getBeginTransition() == null && m.getEndTransition() != null && m.getEndTransition().getDuration() > 0) { - clipSettings.endCutTime -= m.getEndTransition().getDuration(); - } else if (m.getEndTransition() == null && m.getBeginTransition() != null && m.getBeginTransition().getDuration() > 0) { - clipSettings.beginCutTime += m.getBeginTransition().getDuration(); } - clipProperties.duration = clipSettings.endCutTime - - clipSettings.beginCutTime; + + clipProperties.duration = clipSettings.endCutTime - clipSettings.beginCutTime; if (clipProperties.videoDuration != 0) { - clipProperties.videoDuration = clipSettings.endCutTime - - clipSettings.beginCutTime; + clipProperties.videoDuration = clipSettings.endCutTime - clipSettings.beginCutTime; } if (clipProperties.audioDuration != 0) { - clipProperties.audioDuration = clipSettings.endCutTime - - clipSettings.beginCutTime; + clipProperties.audioDuration = clipSettings.endCutTime - clipSettings.beginCutTime; } } @@ -2639,27 +2609,25 @@ class MediaArtistNativeHelper { editSettings.clipSettingsArray[index].clipPath = transition.getFilename(); editSettings.clipSettingsArray[index].fileType = FileType.THREE_GPP; editSettings.clipSettingsArray[index].beginCutTime = 0; - editSettings.clipSettingsArray[index].endCutTime = - (int)transition.getDuration(); - editSettings.clipSettingsArray[index].mediaRendering = - MediaRendering.BLACK_BORDERS; + editSettings.clipSettingsArray[index].endCutTime = (int)transition.getDuration(); + editSettings.clipSettingsArray[index].mediaRendering = MediaRendering.BLACK_BORDERS; + try { clipPropertiesArray.clipProperties[index] = - getMediaProperties(transition.getFilename()); + getMediaProperties(transition.getFilename()); } catch (Exception e) { throw new IllegalArgumentException("Unsupported file or file not found"); } + clipPropertiesArray.clipProperties[index].Id = null; clipPropertiesArray.clipProperties[index].audioVolumeValue = 100; - clipPropertiesArray.clipProperties[index].duration = - (int)transition.getDuration(); + clipPropertiesArray.clipProperties[index].duration = (int)transition.getDuration(); if (clipPropertiesArray.clipProperties[index].videoDuration != 0) { - clipPropertiesArray.clipProperties[index].videoDuration = - (int)transition.getDuration(); + clipPropertiesArray.clipProperties[index].videoDuration = (int)transition.getDuration(); } + if (clipPropertiesArray.clipProperties[index].audioDuration != 0) { - clipPropertiesArray.clipProperties[index].audioDuration = - (int)transition.getDuration(); + clipPropertiesArray.clipProperties[index].audioDuration = (int)transition.getDuration(); } } @@ -2673,10 +2641,10 @@ class MediaArtistNativeHelper { private void adjustVolume(MediaItem m, PreviewClipProperties clipProperties, int index) { if (m instanceof MediaVideoItem) { - boolean videoMuted = ((MediaVideoItem)m).isMuted(); + final boolean videoMuted = ((MediaVideoItem)m).isMuted(); if (videoMuted == false) { - mClipProperties.clipProperties[index].audioVolumeValue = ((MediaVideoItem)m) - .getVolume(); + mClipProperties.clipProperties[index].audioVolumeValue = + ((MediaVideoItem)m).getVolume(); } else { mClipProperties.clipProperties[index].audioVolumeValue = 0; } @@ -2722,22 +2690,22 @@ class MediaArtistNativeHelper { private int populateMediaItemProperties(MediaItem m, int index, int maxHeight) { mPreviewEditSettings.clipSettingsArray[index] = new ClipSettings(); if (m instanceof MediaVideoItem) { - mPreviewEditSettings.clipSettingsArray[index] = ((MediaVideoItem)m) - .getVideoClipProperties(); + mPreviewEditSettings.clipSettingsArray[index] = + ((MediaVideoItem)m).getVideoClipProperties(); if (((MediaVideoItem)m).getHeight() > maxHeight) { maxHeight = ((MediaVideoItem)m).getHeight(); } } else if (m instanceof MediaImageItem) { - mPreviewEditSettings.clipSettingsArray[index] = ((MediaImageItem)m) - .getImageClipProperties(); + mPreviewEditSettings.clipSettingsArray[index] = + ((MediaImageItem)m).getImageClipProperties(); if (((MediaImageItem)m).getScaledHeight() > maxHeight) { maxHeight = ((MediaImageItem)m).getScaledHeight(); } } /** + Handle the image files here */ if (mPreviewEditSettings.clipSettingsArray[index].fileType == FileType.JPG) { - mPreviewEditSettings.clipSettingsArray[index].clipDecodedPath = ((MediaImageItem)m) - .getDecodedImageFileName(); + mPreviewEditSettings.clipSettingsArray[index].clipDecodedPath = + ((MediaImageItem)m).getDecodedImageFileName(); mPreviewEditSettings.clipSettingsArray[index].clipOriginalPath = mPreviewEditSettings.clipSettingsArray[index].clipPath; @@ -2755,8 +2723,7 @@ class MediaArtistNativeHelper { if (mediaBGMList.size() == 1) { mAudioTrack = mediaBGMList.get(0); - } else - { + } else { mAudioTrack = null; } @@ -2789,41 +2756,31 @@ class MediaArtistNativeHelper { mAudioSettings.ducking_threshold = mAudioTrack.getDuckingThreshhold(); mAudioSettings.bInDucking_enable = mAudioTrack.isDuckingEnabled(); mAudioTrackPCMFilePath = String.format(mProjectPath + "/" + AUDIO_TRACK_PCM_FILE); - //String.format(mProjectPath + "/" + "AudioPcm" + ".pcm"); mAudioSettings.pcmFilePath = mAudioTrackPCMFilePath; - mPreviewEditSettings.backgroundMusicSettings = - new BackgroundMusicSettings(); - mPreviewEditSettings.backgroundMusicSettings.file = - mAudioTrackPCMFilePath; - mPreviewEditSettings.backgroundMusicSettings.fileType = - mAudioProperties.fileType; + mPreviewEditSettings.backgroundMusicSettings = new BackgroundMusicSettings(); + mPreviewEditSettings.backgroundMusicSettings.file = mAudioTrackPCMFilePath; + mPreviewEditSettings.backgroundMusicSettings.fileType = mAudioProperties.fileType; mPreviewEditSettings.backgroundMusicSettings.insertionTime = - mAudioTrack.getStartTime(); - mPreviewEditSettings.backgroundMusicSettings.volumePercent = - mAudioTrack.getVolume(); - mPreviewEditSettings.backgroundMusicSettings.beginLoop = mAudioTrack - .getBoundaryBeginTime(); + mAudioTrack.getStartTime(); + mPreviewEditSettings.backgroundMusicSettings.volumePercent = mAudioTrack.getVolume(); + mPreviewEditSettings.backgroundMusicSettings.beginLoop = + mAudioTrack.getBoundaryBeginTime(); mPreviewEditSettings.backgroundMusicSettings.endLoop = mAudioTrack.getBoundaryEndTime(); - mPreviewEditSettings.backgroundMusicSettings.enableDucking = mAudioTrack - .isDuckingEnabled(); - mPreviewEditSettings.backgroundMusicSettings.duckingThreshold = mAudioTrack - .getDuckingThreshhold(); - mPreviewEditSettings.backgroundMusicSettings.lowVolume = mAudioTrack - .getDuckedTrackVolume(); - mPreviewEditSettings.backgroundMusicSettings.isLooping = - mAudioTrack.isLooping(); + mPreviewEditSettings.backgroundMusicSettings.enableDucking = + mAudioTrack.isDuckingEnabled(); + mPreviewEditSettings.backgroundMusicSettings.duckingThreshold = + mAudioTrack.getDuckingThreshhold(); + mPreviewEditSettings.backgroundMusicSettings.lowVolume = + mAudioTrack.getDuckedTrackVolume(); + mPreviewEditSettings.backgroundMusicSettings.isLooping = mAudioTrack.isLooping(); mPreviewEditSettings.primaryTrackVolume = 100; mProcessingState = PROCESSING_AUDIO_PCM; mProcessingObject = mAudioTrack; } else { - if (mAudioSettings != null) { - mAudioSettings = null; - } - if (mPreviewEditSettings.backgroundMusicSettings != null) { - mPreviewEditSettings.backgroundMusicSettings = null; - } + mAudioSettings = null; + mPreviewEditSettings.backgroundMusicSettings = null; mAudioTrackPCMFilePath = null; } } @@ -2847,8 +2804,9 @@ class MediaArtistNativeHelper { final Iterator<Effect> ef = t.getAllEffects().iterator(); while (ef.hasNext()) { final Effect e = ef.next(); - if (e instanceof EffectKenBurns) + if (e instanceof EffectKenBurns) { totalEffects--; + } } } return totalEffects; @@ -2866,7 +2824,7 @@ class MediaArtistNativeHelper { * @param listener The MediaProcessingProgressListener * */ - public void previewStoryBoard(List<MediaItem> mediaItemsList, + void previewStoryBoard(List<MediaItem> mediaItemsList, List<Transition> mediaTransitionList, List<AudioTrack> mediaBGMList, MediaProcessingProgressListener listener) { if (mInvalidatePreviewArray) { @@ -2885,8 +2843,9 @@ class MediaArtistNativeHelper { mTotalClips = mediaItemsList.size(); for (Transition transition : mediaTransitionList) { - if (transition.getDuration() > 0) + if (transition.getDuration() > 0) { mTotalClips++; + } } totalEffects = getTotalEffects(mediaItemsList); @@ -2895,7 +2854,7 @@ class MediaArtistNativeHelper { mPreviewEditSettings.effectSettingsArray = new EffectSettings[totalEffects]; mClipProperties.clipProperties = new Properties[mTotalClips]; - /** record the call back progress listner */ + /** record the call back progress listener */ mMediaProcessingProgressListener = listener; mProgressToApp = 0; @@ -2920,19 +2879,16 @@ class MediaArtistNativeHelper { previewIndex++; } /* Populate media item properties */ - maxHeight = populateMediaItemProperties(lMediaItem, - previewIndex, - maxHeight); + maxHeight = populateMediaItemProperties(lMediaItem, previewIndex, maxHeight); /* Get the clip properties of the media item. */ - if (lMediaItem instanceof MediaImageItem) - { + if (lMediaItem instanceof MediaImageItem) { int tmpCnt = 0; boolean bEffectKbPresent = false; - List<Effect> effectList = lMediaItem.getAllEffects(); + final List<Effect> effectList = lMediaItem.getAllEffects(); /** - * check if Kenburns effect is present + * Check if Ken Burns effect is present */ - while ( tmpCnt < effectList.size()) { + while (tmpCnt < effectList.size()) { if (effectList.get(tmpCnt) instanceof EffectKenBurns) { bEffectKbPresent = true; break; @@ -2957,9 +2913,7 @@ class MediaArtistNativeHelper { mClipProperties.clipProperties[previewIndex].width = ((MediaImageItem)lMediaItem).getScaledWidth(); mClipProperties.clipProperties[previewIndex].height = ((MediaImageItem)lMediaItem).getScaledHeight(); } - - }else - { + } else { try { mClipProperties.clipProperties[previewIndex] = getMediaProperties(lMediaItem.getFilename()); @@ -3005,22 +2959,19 @@ class MediaArtistNativeHelper { if (!mErrorFlagSet) { mPreviewEditSettings.videoFrameSize = findVideoResolution(mVideoEditor .getAspectRatio(), maxHeight); - /*if (mediaBGMList.size() == 1) //for remove Audio check */ { - populateBackgroundMusicProperties(mediaBGMList); - } + populateBackgroundMusicProperties(mediaBGMList); + /** call to native populate settings */ try { nativePopulateSettings(mPreviewEditSettings, mClipProperties, mAudioSettings); } catch (IllegalArgumentException ex) { - Log.e("MediaArtistNativeHelper", - "Illegal argument exception in nativePopulateSettings"); + Log.e(TAG, "Illegal argument exception in nativePopulateSettings"); throw ex; } catch (IllegalStateException ex) { - Log.e("MediaArtistNativeHelper", - "Illegal state exception in nativePopulateSettings"); + Log.e(TAG, "Illegal state exception in nativePopulateSettings"); throw ex; } catch (RuntimeException ex) { - Log.e("MediaArtistNativeHelper", "Runtime exception in nativePopulateSettings"); + Log.e(TAG, "Runtime exception in nativePopulateSettings"); throw ex; } mInvalidatePreviewArray = false; @@ -3045,7 +2996,7 @@ class MediaArtistNativeHelper { * the callback is needed * @param listener The PreviewProgressListener */ - public void doPreview(Surface surface, long fromMs, long toMs, boolean loop, + void doPreview(Surface surface, long fromMs, long toMs, boolean loop, int callbackAfterFrameCount, PreviewProgressListener listener) { mPreviewProgress = fromMs; mIsFirstProgress = true; @@ -3054,22 +3005,23 @@ class MediaArtistNativeHelper { if (!mInvalidatePreviewArray) { try { /** Modify the image files names to rgb image files. */ - for (int clipCnt = 0; clipCnt < mPreviewEditSettings.clipSettingsArray.length; clipCnt++) { + for (int clipCnt = 0; clipCnt < mPreviewEditSettings.clipSettingsArray.length; + clipCnt++) { if (mPreviewEditSettings.clipSettingsArray[clipCnt].fileType == FileType.JPG) { - mPreviewEditSettings.clipSettingsArray[clipCnt].clipPath = mPreviewEditSettings.clipSettingsArray[clipCnt].clipDecodedPath; + mPreviewEditSettings.clipSettingsArray[clipCnt].clipPath = + mPreviewEditSettings.clipSettingsArray[clipCnt].clipDecodedPath; } } nativePopulateSettings(mPreviewEditSettings, mClipProperties, mAudioSettings); nativeStartPreview(surface, fromMs, toMs, callbackAfterFrameCount, loop); } catch (IllegalArgumentException ex) { - Log.e("MediaArtistNativeHelper", - "Illegal argument exception in nativeStartPreview"); + Log.e(TAG, "Illegal argument exception in nativeStartPreview"); throw ex; } catch (IllegalStateException ex) { - Log.e("MediaArtistNativeHelper", "Illegal state exception in nativeStartPreview"); + Log.e(TAG, "Illegal state exception in nativeStartPreview"); throw ex; } catch (RuntimeException ex) { - Log.e("MediaArtistNativeHelper", "Runtime exception in nativeStartPreview"); + Log.e(TAG, "Runtime exception in nativeStartPreview"); throw ex; } } @@ -3078,7 +3030,7 @@ class MediaArtistNativeHelper { /** * This function is responsible for stopping the preview */ - public long stopPreview() { + long stopPreview() { nativeStopPreview(); return mPreviewProgress; } @@ -3096,48 +3048,48 @@ class MediaArtistNativeHelper { * @return The actual time from the story board at which the frame was extracted * and rendered */ - public long renderPreviewFrame(Surface surface, long time, int surfaceWidth, + long renderPreviewFrame(Surface surface, long time, int surfaceWidth, int surfaceHeight, VideoEditor.OverlayData overlayData) { - long timeMs = 0; - if (!mInvalidatePreviewArray) { - try { - for (int clipCnt = 0; - clipCnt < mPreviewEditSettings.clipSettingsArray.length; - clipCnt++) { + if (mInvalidatePreviewArray) { + throw new RuntimeException("Call generate preview first"); + } - if (mPreviewEditSettings.clipSettingsArray[clipCnt].fileType == FileType.JPG) { - mPreviewEditSettings.clipSettingsArray[clipCnt].clipPath = - mPreviewEditSettings.clipSettingsArray[clipCnt].clipDecodedPath; - } + long timeMs = 0; + try { + for (int clipCnt = 0; clipCnt < mPreviewEditSettings.clipSettingsArray.length; + clipCnt++) { + if (mPreviewEditSettings.clipSettingsArray[clipCnt].fileType == FileType.JPG) { + mPreviewEditSettings.clipSettingsArray[clipCnt].clipPath = + mPreviewEditSettings.clipSettingsArray[clipCnt].clipDecodedPath; } + } - // Reset the render preview frame params that shall be set by native. - mRenderPreviewOverlayFile = null; - mRenderPreviewRenderingMode = MediaRendering.RESIZING; - nativePopulateSettings(mPreviewEditSettings, mClipProperties, mAudioSettings); - timeMs = (long)nativeRenderPreviewFrame(surface, time, surfaceWidth, surfaceHeight); + // Reset the render preview frame params that shall be set by native. + mRenderPreviewOverlayFile = null; + mRenderPreviewRenderingMode = MediaRendering.RESIZING; - if (mRenderPreviewOverlayFile != null) { - overlayData.set(BitmapFactory.decodeFile(mRenderPreviewOverlayFile), mRenderPreviewRenderingMode); - } else { - overlayData.setClear(); - } - } catch (IllegalArgumentException ex) { - Log.e("MediaArtistNativeHelper", - "Illegal Argument exception in nativeRenderPreviewFrame"); - throw ex; - } catch (IllegalStateException ex) { - Log.e("MediaArtistNativeHelper", - "Illegal state exception in nativeRenderPreviewFrame"); - throw ex; - } catch (RuntimeException ex) { - Log.e("MediaArtistNativeHelper", "Runtime exception in nativeRenderPreviewFrame"); - throw ex; + nativePopulateSettings(mPreviewEditSettings, mClipProperties, mAudioSettings); + + timeMs = (long)nativeRenderPreviewFrame(surface, time, surfaceWidth, surfaceHeight); + + if (mRenderPreviewOverlayFile != null) { + overlayData.set(BitmapFactory.decodeFile(mRenderPreviewOverlayFile), + mRenderPreviewRenderingMode); + } else { + overlayData.setClear(); } - return timeMs; - } else { - throw new RuntimeException("Call generate preview first"); + } catch (IllegalArgumentException ex) { + Log.e(TAG, "Illegal Argument exception in nativeRenderPreviewFrame"); + throw ex; + } catch (IllegalStateException ex) { + Log.e(TAG, "Illegal state exception in nativeRenderPreviewFrame"); + throw ex; + } catch (RuntimeException ex) { + Log.e(TAG, "Runtime exception in nativeRenderPreviewFrame"); + throw ex; } + + return timeMs; } private void previewFrameEditInfo(String filename, int renderingMode) { @@ -3159,24 +3111,20 @@ class MediaArtistNativeHelper { * @return The actual time from media item at which the frame was extracted * and rendered */ - public long renderMediaItemPreviewFrame(Surface surface, String filepath, - long time, int framewidth, - int frameheight) { + long renderMediaItemPreviewFrame(Surface surface, String filepath, + long time, int framewidth, int frameheight) { long timeMs = 0; try { - timeMs = (long)nativeRenderMediaItemPreviewFrame(surface, filepath, framewidth, frameheight, 0, 0, time); } catch (IllegalArgumentException ex) { - Log.e("MediaArtistNativeHelper", - "Illegal Argument exception in renderMediaItemPreviewFrame"); + Log.e(TAG, "Illegal Argument exception in renderMediaItemPreviewFrame"); throw ex; } catch (IllegalStateException ex) { - Log.e("MediaArtistNativeHelper", - "Illegal state exception in renderMediaItemPreviewFrame"); + Log.e(TAG, "Illegal state exception in renderMediaItemPreviewFrame"); throw ex; } catch (RuntimeException ex) { - Log.e("MediaArtistNativeHelper", "Runtime exception in renderMediaItemPreviewFrame"); + Log.e(TAG, "Runtime exception in renderMediaItemPreviewFrame"); throw ex; } @@ -3188,7 +3136,18 @@ class MediaArtistNativeHelper { * and for generating the preview again */ void setGeneratePreview(boolean isRequired) { - mInvalidatePreviewArray = isRequired; + boolean semAcquiredDone = false; + try { + lock(); + semAcquiredDone = true; + mInvalidatePreviewArray = isRequired; + } catch (InterruptedException ex) { + Log.e(TAG, "Runtime exception in renderMediaItemPreviewFrame"); + } finally { + if (semAcquiredDone) { + unlock(); + } + } } /** @@ -3207,7 +3166,7 @@ class MediaArtistNativeHelper { * * @return The calculated aspect ratio */ - public int getAspectRatio(int w, int h) { + int getAspectRatio(int w, int h) { double apRatio = (double)(w) / (double)(h); BigDecimal bd = new BigDecimal(apRatio); bd = bd.setScale(3, BigDecimal.ROUND_HALF_UP); @@ -3235,7 +3194,7 @@ class MediaArtistNativeHelper { * * @return The File type in JAVA layer */ - public int getFileType(int fileType) { + int getFileType(int fileType) { int retValue = -1; switch (fileType) { case FileType.UNSUPPORTED: @@ -3256,6 +3215,9 @@ class MediaArtistNativeHelper { case FileType.MP3: retValue = MediaProperties.FILE_MP3; break; + case FileType.M4V: + retValue = MediaProperties.FILE_M4V; + break; default: retValue = -1; @@ -3271,7 +3233,7 @@ class MediaArtistNativeHelper { * * @return The video codec type in JAVA layer */ - public int getVideoCodecType(int codecType) { + int getVideoCodecType(int codecType) { int retValue = -1; switch (codecType) { case VideoFormat.H263: @@ -3299,7 +3261,7 @@ class MediaArtistNativeHelper { * * @return The audio codec type in JAVA layer */ - public int getAudioCodecType(int codecType) { + int getAudioCodecType(int codecType) { int retValue = -1; switch (codecType) { case AudioFormat.AMR_NB: @@ -3325,7 +3287,7 @@ class MediaArtistNativeHelper { * * @return The frame rate as integer */ - public int getFrameRate(int fps) { + int getFrameRate(int fps) { int retValue = -1; switch (fps) { case VideoFrameRate.FR_5_FPS: @@ -3386,6 +3348,9 @@ class MediaArtistNativeHelper { case MediaProperties.FILE_PNG: retValue = FileType.PNG; break; + case MediaProperties.FILE_M4V: + retValue = FileType.M4V; + break; default: retValue = -1; @@ -3527,7 +3492,7 @@ class MediaArtistNativeHelper { } /** - * Calculates videdo resolution for output clip + * Calculates video resolution for output clip * based on clip's height and aspect ratio of storyboard * * @param aspectRatio The aspect ratio of story board @@ -3571,8 +3536,7 @@ class MediaArtistNativeHelper { resolutions = MediaProperties.getSupportedResolutions(mVideoEditor.getAspectRatio()); // Get the highest resolution maxResolution = resolutions[resolutions.length - 1]; - retValue = findVideoResolution(mVideoEditor.getAspectRatio(), - maxResolution.second); + retValue = findVideoResolution(mVideoEditor.getAspectRatio(), maxResolution.second); } return retValue; @@ -3586,12 +3550,12 @@ class MediaArtistNativeHelper { * @param height The height of clip * @param bitrate The bitrate at which the movie should be exported * @param mediaItemsList The media items list - * @param mediaTransitionList The transitons list + * @param mediaTransitionList The transitions list * @param mediaBGMList The background track list * @param listener The ExportProgressListener * */ - public void export(String filePath, String projectDir, int height, int bitrate, + void export(String filePath, String projectDir, int height, int bitrate, List<MediaItem> mediaItemsList, List<Transition> mediaTransitionList, List<AudioTrack> mediaBGMList, ExportProgressListener listener) { @@ -3663,8 +3627,10 @@ class MediaArtistNativeHelper { mPreviewEditSettings.transitionSettingsArray = new TransitionSettings[mTotalClips - 1]; for (int index = 0; index < mTotalClips - 1; index++) { mPreviewEditSettings.transitionSettingsArray[index] = new TransitionSettings(); - mPreviewEditSettings.transitionSettingsArray[index].videoTransitionType = VideoTransition.NONE; - mPreviewEditSettings.transitionSettingsArray[index].audioTransitionType = AudioTransition.NONE; + mPreviewEditSettings.transitionSettingsArray[index].videoTransitionType = + VideoTransition.NONE; + mPreviewEditSettings.transitionSettingsArray[index].audioTransitionType = + AudioTransition.NONE; } for (int clipCnt = 0; clipCnt < mPreviewEditSettings.clipSettingsArray.length; clipCnt++) { if (mPreviewEditSettings.clipSettingsArray[clipCnt].fileType == FileType.JPG) { @@ -3681,194 +3647,40 @@ class MediaArtistNativeHelper { err = generateClip(mPreviewEditSettings); mProcessingState = PROCESSING_NONE; } catch (IllegalArgumentException ex) { - Log.e("MediaArtistNativeHelper", "IllegalArgument for generateClip"); + Log.e(TAG, "IllegalArgument for generateClip"); throw ex; } catch (IllegalStateException ex) { - Log.e("MediaArtistNativeHelper", "IllegalStateExceptiont for generateClip"); + Log.e(TAG, "IllegalStateExceptiont for generateClip"); throw ex; } catch (RuntimeException ex) { - Log.e("MediaArtistNativeHelper", "RuntimeException for generateClip"); + Log.e(TAG, "RuntimeException for generateClip"); throw ex; } if (err != 0) { - Log.e("MediaArtistNativeHelper", "RuntimeException for generateClip"); - throw new RuntimeException("generateClip failed with error="+err ); + Log.e(TAG, "RuntimeException for generateClip"); + throw new RuntimeException("generateClip failed with error=" + err); } - mExportDone = true; - setGeneratePreview(true); mExportProgressListener = null; } /** - * This method is responsible for exporting a movie - * - * @param filePath The output file path - * @param projectDir The output project directory - * @param height The height of clip - * @param bitrate The bitrate at which the movie should be exported - * @param audioCodec The audio codec to use - * @param videoCodec The video codec to use - * @param mediaItemsList The media items list - * @param mediaTransitionList The transitons list - * @param mediaBGMList The background track list - * @param listener The ExportProgressListener + * This methods takes care of stopping the Export process * + * @param The input file name for which export has to be stopped */ - public void export(String filePath, String projectDir,int height,int bitrate, - int audioCodec,int videoCodec,List<MediaItem> mediaItemsList, - List<Transition> mediaTransitionList,List<AudioTrack> mediaBGMList, - ExportProgressListener listener) { - - int outBitrate = 0; - mExportFilename = filePath; - previewStoryBoard(mediaItemsList, mediaTransitionList, mediaBGMList,null); - mExportProgressListener = listener; - - mProgressToApp = 0; - - switch (bitrate) { - case MediaProperties.BITRATE_28K: - outBitrate = Bitrate.BR_32_KBPS; - break; - case MediaProperties.BITRATE_40K: - outBitrate = Bitrate.BR_48_KBPS; - break; - case MediaProperties.BITRATE_64K: - outBitrate = Bitrate.BR_64_KBPS; - break; - case MediaProperties.BITRATE_96K: - outBitrate = Bitrate.BR_96_KBPS; - break; - case MediaProperties.BITRATE_128K: - outBitrate = Bitrate.BR_128_KBPS; - break; - case MediaProperties.BITRATE_192K: - outBitrate = Bitrate.BR_192_KBPS; - break; - case MediaProperties.BITRATE_256K: - outBitrate = Bitrate.BR_256_KBPS; - break; - case MediaProperties.BITRATE_384K: - outBitrate = Bitrate.BR_384_KBPS; - break; - case MediaProperties.BITRATE_512K: - outBitrate = Bitrate.BR_512_KBPS; - break; - case MediaProperties.BITRATE_800K: - outBitrate = Bitrate.BR_800_KBPS; - break; - case MediaProperties.BITRATE_2M: - outBitrate = Bitrate.BR_2_MBPS; - break; - case MediaProperties.BITRATE_5M: - outBitrate = Bitrate.BR_5_MBPS; - break; - case MediaProperties.BITRATE_8M: - outBitrate = Bitrate.BR_8_MBPS; - break; - - default: - throw new IllegalArgumentException("Argument Bitrate incorrect"); - } - mPreviewEditSettings.videoFrameRate = VideoFrameRate.FR_30_FPS; - mPreviewEditSettings.outputFile = mOutputFilename = filePath; - - int aspectRatio = mVideoEditor.getAspectRatio(); - mPreviewEditSettings.videoFrameSize = findVideoResolution(aspectRatio, height); - switch (audioCodec) { - case MediaProperties.ACODEC_AAC_LC: - mPreviewEditSettings.audioFormat = AudioFormat.AAC; - break; - case MediaProperties.ACODEC_AMRNB: - mPreviewEditSettings.audioFormat = AudioFormat.AMR_NB; - break; - } - - switch (videoCodec) { - case MediaProperties.VCODEC_H263: - mPreviewEditSettings.videoFormat = VideoFormat.H263; - break; - case MediaProperties.VCODEC_H264BP: - mPreviewEditSettings.videoFormat = VideoFormat.H264; - break; - case MediaProperties.VCODEC_MPEG4: - mPreviewEditSettings.videoFormat = VideoFormat.MPEG4; - break; - } - - mPreviewEditSettings.audioSamplingFreq = AudioSamplingFrequency.FREQ_32000; - mPreviewEditSettings.maxFileSize = 0; - mPreviewEditSettings.audioChannels = 2; - mPreviewEditSettings.videoBitrate = outBitrate; - mPreviewEditSettings.audioBitrate = Bitrate.BR_96_KBPS; - - mPreviewEditSettings.transitionSettingsArray = - new TransitionSettings[mTotalClips - 1]; - for (int index = 0; index < mTotalClips - 1; index++) { - mPreviewEditSettings.transitionSettingsArray[index] = - new TransitionSettings(); - mPreviewEditSettings.transitionSettingsArray[index].videoTransitionType = - VideoTransition.NONE; - mPreviewEditSettings.transitionSettingsArray[index].audioTransitionType = - AudioTransition.NONE; - } - for (int clipCnt = 0; clipCnt < mPreviewEditSettings.clipSettingsArray.length; clipCnt++) { - if (mPreviewEditSettings.clipSettingsArray[clipCnt].fileType == FileType.JPG) { - mPreviewEditSettings.clipSettingsArray[clipCnt].clipPath = - mPreviewEditSettings.clipSettingsArray[clipCnt].clipOriginalPath; - } - } - nativePopulateSettings(mPreviewEditSettings, mClipProperties, mAudioSettings); - - int err = 0; + void stop(String filename) { try { - mProcessingState = PROCESSING_EXPORT; - mProcessingObject = null; - err = generateClip(mPreviewEditSettings); - mProcessingState = PROCESSING_NONE; - } catch (IllegalArgumentException ex) { - Log.e("MediaArtistNativeHelper", "IllegalArgument for generateClip"); - throw ex; + stopEncoding(); + new File(mExportFilename).delete(); } catch (IllegalStateException ex) { - Log.e("MediaArtistNativeHelper", "IllegalStateExceptiont for generateClip"); + Log.e(TAG, "Illegal state exception in unload settings"); throw ex; } catch (RuntimeException ex) { - Log.e("MediaArtistNativeHelper", "RuntimeException for generateClip"); + Log.e(TAG, "Runtime exception in unload settings"); throw ex; } - - if (err != 0) { - Log.e("MediaArtistNativeHelper", "RuntimeException for generateClip"); - throw new RuntimeException("generateClip failed with error="+err ); - } - - mExportDone = true; - setGeneratePreview(true); - mExportProgressListener = null; - } - - - /** - * This methods takes care of stopping the Export process - * - * @param The input file name for which export has to be stopped - */ - public void stop(String filename) { - if (!mExportDone) { - try { - stopEncoding(); - } catch (IllegalStateException ex) { - Log.e("MediaArtistNativeHelper", "Illegal state exception in unload settings"); - throw ex; - } catch (RuntimeException ex) { - Log.e("MediaArtistNativeHelper", "Runtime exception in unload settings"); - throw ex; - } - - new File(mExportFilename).delete(); - } } /** @@ -3878,9 +3690,9 @@ class MediaArtistNativeHelper { * @param inputFile The inputFile * @param width The width of the output frame * @param height The height of the output frame - * @param timeMS The time in ms at which the frame hass to be extracted + * @param timeMS The time in ms at which the frame has to be extracted */ - public Bitmap getPixels(String inputFile, int width, int height, long timeMS) { + Bitmap getPixels(String inputFile, int width, int height, long timeMS) { if (inputFile == null) { throw new IllegalArgumentException(); } @@ -3911,8 +3723,7 @@ class MediaArtistNativeHelper { /* Create a canvas to resize */ final Canvas canvas = new Canvas(bitmap); canvas.drawBitmap(tempBitmap, new Rect(0, 0, newWidth, newHeight), - new Rect(0, 0, width, height), - sResizePaint); + new Rect(0, 0, width, height), sResizePaint); } if (tempBitmap != null) { @@ -3954,50 +3765,49 @@ class MediaArtistNativeHelper { } int i = 0; int deltaTime = (int)(endMs - startMs) / thumbnailCount; - Bitmap[] bitmap = null; + Bitmap[] bitmaps = null; try { // This may result in out of Memory Error rgb888 = new int[thumbnailSize * thumbnailCount]; - bitmap = new Bitmap[thumbnailCount]; + bitmaps = new Bitmap[thumbnailCount]; } catch (Throwable e) { // Allocating to new size with Fixed count try { System.gc(); rgb888 = new int[thumbnailSize * MAX_THUMBNAIL_PERMITTED]; - bitmap = new Bitmap[MAX_THUMBNAIL_PERMITTED]; + bitmaps = new Bitmap[MAX_THUMBNAIL_PERMITTED]; thumbnailCount = MAX_THUMBNAIL_PERMITTED; } catch (Throwable ex) { throw new RuntimeException("Memory allocation fails, thumbnail count too large: "+thumbnailCount); } } IntBuffer tmpBuffer = IntBuffer.allocate(thumbnailSize); - nativeGetPixelsList(filename, rgb888, newWidth, newHeight, deltaTime, thumbnailCount, startMs, - endMs); + nativeGetPixelsList(filename, rgb888, newWidth, newHeight, deltaTime, thumbnailCount, + startMs, endMs); for (; i < thumbnailCount; i++) { - bitmap[i] = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); + bitmaps[i] = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); tmpBuffer.put(rgb888, (i * thumbnailSize), thumbnailSize); tmpBuffer.rewind(); if ((newWidth == width) && (newHeight == height)) { - bitmap[i].copyPixelsFromBuffer(tmpBuffer); + bitmaps[i].copyPixelsFromBuffer(tmpBuffer); } else { /* Copy the out rgb buffer to temp bitmap */ tempBitmap.copyPixelsFromBuffer(tmpBuffer); /* Create a canvas to resize */ - final Canvas canvas = new Canvas(bitmap[i]); + final Canvas canvas = new Canvas(bitmaps[i]); canvas.drawBitmap(tempBitmap, new Rect(0, 0, newWidth, newHeight), - new Rect(0, 0, width, height), - sResizePaint); + new Rect(0, 0, width, height), sResizePaint); } } if (tempBitmap != null) { tempBitmap.recycle(); } - return bitmap; + return bitmaps; } /** @@ -4013,7 +3823,7 @@ class MediaArtistNativeHelper { * @param isVideo The flag to indicate if the file is video file or not * **/ - public void generateAudioGraph(String uniqueId, String inFileName, String OutAudiGraphFileName, + void generateAudioGraph(String uniqueId, String inFileName, String OutAudiGraphFileName, int frameDuration, int audioChannels, int samplesCount, ExtractAudioWaveformProgressListener listener, boolean isVideo) { String tempPCMFileName; @@ -4021,7 +3831,7 @@ class MediaArtistNativeHelper { mExtractAudioWaveformProgressListener = listener; /** - * in case of Video , first call will generate the PCM file to make the + * In case of Video, first call will generate the PCM file to make the * audio graph */ if (isVideo) { @@ -4029,6 +3839,7 @@ class MediaArtistNativeHelper { } else { tempPCMFileName = mAudioTrackPCMFilePath; } + /** * For Video item, generate the PCM */ @@ -4039,19 +3850,46 @@ class MediaArtistNativeHelper { nativeGenerateAudioGraph(tempPCMFileName, OutAudiGraphFileName, frameDuration, audioChannels, samplesCount); - /* once the audio graph file is generated, delete the pcm file */ + /** + * Once the audio graph file is generated, delete the pcm file + */ if (isVideo) { new File(tempPCMFileName).delete(); } } - public void clearPreviewSurface(Surface surface) { - nativeClearSurface(surface); + void clearPreviewSurface(Surface surface) { + nativeClearSurface(surface); + } + + /** + * Grab the semaphore which arbitrates access to the editor + * + * @throws InterruptedException + */ + void lock() throws InterruptedException { + if (Log.isLoggable(TAG, Log.DEBUG)) { + Log.d(TAG, "lock: grabbing semaphore", new Throwable()); + } + mLock.acquire(); + if (Log.isLoggable(TAG, Log.DEBUG)) { + Log.d(TAG, "lock: grabbed semaphore"); + } + } + + /** + * Release the semaphore which arbitrates access to the editor + */ + void unlock() { + if (Log.isLoggable(TAG, Log.DEBUG)) { + Log.d(TAG, "unlock: releasing semaphore"); + } + mLock.release(); } /** Native Methods */ native Properties getMediaProperties(String file) throws IllegalArgumentException, - IllegalStateException, RuntimeException, Exception; + IllegalStateException, RuntimeException, Exception; /** * Get the version of ManualEdit. @@ -4066,7 +3904,7 @@ class MediaArtistNativeHelper { * Returns the video thumbnail in an array of integers. Output format is * ARGB8888. * - * @param pixelArray the array that receives the pixelvalues + * @param pixelArray the array that receives the pixel values * @param width width of the video thumbnail * @param height height of the video thumbnail * @param timeMS desired time of the thumbnail in ms @@ -4096,7 +3934,6 @@ class MediaArtistNativeHelper { */ private native void nativeClearSurface(Surface surface); - /** * Stops the encoding. This method should only be called after encoding has * started using method <code> startEncoding</code> @@ -4106,7 +3943,6 @@ class MediaArtistNativeHelper { private native void stopEncoding() throws IllegalStateException, RuntimeException; - private native void _init(String tempPath, String libraryPath) throws IllegalArgumentException, IllegalStateException, RuntimeException; @@ -4114,7 +3950,7 @@ class MediaArtistNativeHelper { int callbackAfterFrameCount, boolean loop) throws IllegalArgumentException, IllegalStateException, RuntimeException; - private native void nativePopulateSettings(EditSettings mEditSettings, + private native void nativePopulateSettings(EditSettings editSettings, PreviewClipProperties mProperties, AudioSettings mAudioSettings) throws IllegalArgumentException, IllegalStateException, RuntimeException; diff --git a/media/java/android/media/videoeditor/MediaImageItem.java b/media/java/android/media/videoeditor/MediaImageItem.java index f1315c0..69088ed 100755 --- a/media/java/android/media/videoeditor/MediaImageItem.java +++ b/media/java/android/media/videoeditor/MediaImageItem.java @@ -294,6 +294,8 @@ public class MediaImageItem extends MediaItem { return; } + mMANativeHelper.setGeneratePreview(true); + /** * Invalidate the end transitions if necessary. * This invalidation is necessary for the case in which an effect or @@ -794,8 +796,8 @@ public class MediaImageItem extends MediaItem { return clipSettings; } - PanZoomXa = (100 * start.width()) / width; - PanZoomXb = (100 * end.width()) / width; + PanZoomXa = (1000 * start.width()) / width; + PanZoomXb = (1000 * end.width()) / width; clipSettings.clipPath = getDecodedImageFileName(); clipSettings.fileType = mMANativeHelper.getMediaItemFileType(getFileType()); @@ -805,11 +807,11 @@ public class MediaImageItem extends MediaItem { clipSettings.endCutPercent = 0; clipSettings.panZoomEnabled = true; clipSettings.panZoomPercentStart = PanZoomXa; - clipSettings.panZoomTopLeftXStart = (start.left * 100) / width; - clipSettings.panZoomTopLeftYStart = (start.top * 100) / height; + clipSettings.panZoomTopLeftXStart = (start.left * 1000) / width; + clipSettings.panZoomTopLeftYStart = (start.top * 1000) / height; clipSettings.panZoomPercentEnd = PanZoomXb; - clipSettings.panZoomTopLeftXEnd = (end.left * 100) / width; - clipSettings.panZoomTopLeftYEnd = (end.top * 100) / height; + clipSettings.panZoomTopLeftXEnd = (end.left * 1000) / width; + clipSettings.panZoomTopLeftYEnd = (end.top * 1000) / height; clipSettings.mediaRendering = mMANativeHelper.getMediaItemRenderingMode(getRenderingMode()); diff --git a/media/java/android/media/videoeditor/MediaItem.java b/media/java/android/media/videoeditor/MediaItem.java index a24b46e..d3ab051 100755 --- a/media/java/android/media/videoeditor/MediaItem.java +++ b/media/java/android/media/videoeditor/MediaItem.java @@ -176,6 +176,9 @@ public abstract class MediaItem { default: throw new IllegalArgumentException("Invalid Rendering Mode"); } + + mMANativeHelper.setGeneratePreview(true); + mRenderingMode = renderingMode; if (mBeginTransition != null) { mBeginTransition.invalidate(); @@ -184,7 +187,6 @@ public abstract class MediaItem { if (mEndTransition != null) { mEndTransition.invalidate(); } - mMANativeHelper.setGeneratePreview(true); } /** @@ -296,12 +298,11 @@ public abstract class MediaItem { mEffects.add(effect); invalidateTransitions(effect.getStartTime(), effect.getDuration()); - if (mMANativeHelper != null) { - if (effect instanceof EffectKenBurns) { - mRegenerateClip = true; - } - mMANativeHelper.setGeneratePreview(true); + + if (effect instanceof EffectKenBurns) { + mRegenerateClip = true; } + mMANativeHelper.setGeneratePreview(true); } /** @@ -318,23 +319,23 @@ public abstract class MediaItem { public Effect removeEffect(String effectId) { for (Effect effect : mEffects) { if (effect.getId().equals(effectId)) { + mMANativeHelper.setGeneratePreview(true); + mEffects.remove(effect); + invalidateTransitions(effect.getStartTime(), effect.getDuration()); - if (mMANativeHelper != null) { - if (effect instanceof EffectKenBurns) { - if (mGeneratedImageClip != null) { - /** - * Delete the file - */ - new File(mGeneratedImageClip).delete(); - /** - * Invalidate the filename - */ - mGeneratedImageClip = null; - } - mRegenerateClip = false; + if (effect instanceof EffectKenBurns) { + if (mGeneratedImageClip != null) { + /** + * Delete the file + */ + new File(mGeneratedImageClip).delete(); + /** + * Invalidate the filename + */ + mGeneratedImageClip = null; } - mMANativeHelper.setGeneratePreview(true); + mRegenerateClip = false; } return effect; } @@ -448,9 +449,7 @@ public abstract class MediaItem { mOverlays.add(overlay); invalidateTransitions(overlay.getStartTime(), overlay.getDuration()); - if (mMANativeHelper != null) { - mMANativeHelper.setGeneratePreview(true); - } + mMANativeHelper.setGeneratePreview(true); } /** @@ -483,10 +482,9 @@ public abstract class MediaItem { public Overlay removeOverlay(String overlayId) { for (Overlay overlay : mOverlays) { if (overlay.getId().equals(overlayId)) { + mMANativeHelper.setGeneratePreview(true); + mOverlays.remove(overlay); - if (mMANativeHelper != null) { - mMANativeHelper.setGeneratePreview(true); - } if (overlay instanceof OverlayFrame) { ((OverlayFrame)overlay).invalidate(); } diff --git a/media/java/android/media/videoeditor/MediaProperties.java b/media/java/android/media/videoeditor/MediaProperties.java index 9654a6a..a2e01f6 100755 --- a/media/java/android/media/videoeditor/MediaProperties.java +++ b/media/java/android/media/videoeditor/MediaProperties.java @@ -190,15 +190,20 @@ public class MediaProperties { public static final int FILE_MP3 = 3; // 4 is for PCM public static final int FILE_JPEG = 5; - // 6 is for GIF - public static final int FILE_PNG = 7; + // 6 is for BMP + // 7 is for GIF + public static final int FILE_PNG = 8; + // 9 is for ARGB8888 + public static final int FILE_M4V = 10; public static final int FILE_UNSUPPORTED = 255; + /** * The array of the supported file formats */ private static final int[] SUPPORTED_VIDEO_FILE_FORMATS = new int[] { FILE_3GP, - FILE_MP4 + FILE_MP4, + FILE_M4V }; /** diff --git a/media/java/android/media/videoeditor/MediaVideoItem.java b/media/java/android/media/videoeditor/MediaVideoItem.java index 2981b41..bbadd62 100755 --- a/media/java/android/media/videoeditor/MediaVideoItem.java +++ b/media/java/android/media/videoeditor/MediaVideoItem.java @@ -120,8 +120,8 @@ public class MediaVideoItem extends MediaItem { switch (mMANativeHelper.getFileType(properties.fileType)) { case MediaProperties.FILE_3GP: - break; case MediaProperties.FILE_MP4: + case MediaProperties.FILE_M4V: break; default: @@ -130,11 +130,8 @@ public class MediaVideoItem extends MediaItem { switch (mMANativeHelper.getVideoCodecType(properties.videoFormat)) { case MediaProperties.VCODEC_H263: - break; case MediaProperties.VCODEC_H264BP: - break; case MediaProperties.VCODEC_H264MP: - break; case MediaProperties.VCODEC_MPEG4: break; @@ -201,6 +198,8 @@ public class MediaVideoItem extends MediaItem { throw new IllegalArgumentException("setExtractBoundaries: Start time or end time is negative"); } + mMANativeHelper.setGeneratePreview(true); + if (beginMs != mBeginBoundaryTimeMs) { if (mBeginTransition != null) { mBeginTransition.invalidate(); @@ -215,7 +214,6 @@ public class MediaVideoItem extends MediaItem { mBeginBoundaryTimeMs = beginMs; mEndBoundaryTimeMs = endMs; - mMANativeHelper.setGeneratePreview(true); adjustTransitions(); mVideoEditor.updateTimelineDuration(); /** @@ -263,12 +261,11 @@ public class MediaVideoItem extends MediaItem { throw new IllegalArgumentException("Invalid Time duration"); } - if ((width <=0) || (height <= 0)) { + if ((width <= 0) || (height <= 0)) { throw new IllegalArgumentException("Invalid Dimensions"); } - return mMANativeHelper.getPixels(super.getFilename(), - width, height,timeMs); + return mMANativeHelper.getPixels(super.getFilename(), width, height,timeMs); } /* @@ -613,6 +610,7 @@ public class MediaVideoItem extends MediaItem { * @param muted true to mute the media item */ public void setMute(boolean muted) { + mMANativeHelper.setGeneratePreview(true); mMuted = muted; if (mBeginTransition != null) { mBeginTransition.invalidate(); @@ -620,7 +618,6 @@ public class MediaVideoItem extends MediaItem { if (mEndTransition != null) { mEndTransition.invalidate(); } - mMANativeHelper.setGeneratePreview(true); } /** diff --git a/media/java/android/media/videoeditor/Overlay.java b/media/java/android/media/videoeditor/Overlay.java index ec03966..a070eb4 100755 --- a/media/java/android/media/videoeditor/Overlay.java +++ b/media/java/android/media/videoeditor/Overlay.java @@ -106,7 +106,6 @@ public abstract class Overlay { * @param durationMs The duration in milliseconds */ public void setDuration(long durationMs) { - if (durationMs < 0) { throw new IllegalArgumentException("Invalid duration"); } @@ -115,11 +114,12 @@ public abstract class Overlay { throw new IllegalArgumentException("Duration is too large"); } + getMediaItem().getNativeContext().setGeneratePreview(true); + final long oldDurationMs = mDurationMs; mDurationMs = durationMs; - mMediaItem.invalidateTransitions(mStartTimeMs, oldDurationMs, - mStartTimeMs, mDurationMs); + mMediaItem.invalidateTransitions(mStartTimeMs, oldDurationMs, mStartTimeMs, mDurationMs); } /** @@ -143,11 +143,12 @@ public abstract class Overlay { throw new IllegalArgumentException("Start time is too large"); } + getMediaItem().getNativeContext().setGeneratePreview(true); + final long oldStartTimeMs = mStartTimeMs; mStartTimeMs = startTimeMs; - mMediaItem.invalidateTransitions(oldStartTimeMs, mDurationMs, - mStartTimeMs, mDurationMs); + mMediaItem.invalidateTransitions(oldStartTimeMs, mDurationMs, mStartTimeMs, mDurationMs); } /** @@ -161,14 +162,15 @@ public abstract class Overlay { throw new IllegalArgumentException("Invalid start time or duration"); } + getMediaItem().getNativeContext().setGeneratePreview(true); + final long oldStartTimeMs = mStartTimeMs; final long oldDurationMs = mDurationMs; mStartTimeMs = startTimeMs; mDurationMs = durationMs; - mMediaItem.invalidateTransitions(oldStartTimeMs, oldDurationMs, - mStartTimeMs, mDurationMs); + mMediaItem.invalidateTransitions(oldStartTimeMs, oldDurationMs, mStartTimeMs, mDurationMs); } /** diff --git a/media/java/android/media/videoeditor/OverlayFrame.java b/media/java/android/media/videoeditor/OverlayFrame.java index 0a928fe..2bb9a1c 100755 --- a/media/java/android/media/videoeditor/OverlayFrame.java +++ b/media/java/android/media/videoeditor/OverlayFrame.java @@ -120,6 +120,10 @@ public class OverlayFrame extends Overlay { * @param bitmap The overlay bitmap. */ public void setBitmap(Bitmap bitmap) { + getMediaItem().getNativeContext().setGeneratePreview(true); + + invalidate(); + mBitmap = bitmap; if (mFilename != null) { /** @@ -238,12 +242,16 @@ public class OverlayFrame extends Overlay { * Delete the overlay files */ void invalidate() { + if (mBitmap != null) { + mBitmap.recycle(); + mBitmap = null; + } + if (mFilename != null) { new File(mFilename).delete(); mFilename = null; - mBitmap.recycle(); - mBitmap = null; } + if (mBitmapFileName != null) { new File(mBitmapFileName).delete(); mBitmapFileName = null; diff --git a/media/java/android/media/videoeditor/VideoEditorImpl.java b/media/java/android/media/videoeditor/VideoEditorImpl.java index 54b3837..cc847ef 100755 --- a/media/java/android/media/videoeditor/VideoEditorImpl.java +++ b/media/java/android/media/videoeditor/VideoEditorImpl.java @@ -27,20 +27,17 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; -import java.util.concurrent.Semaphore; - import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlSerializer; +import android.graphics.Bitmap; import android.graphics.Rect; import android.util.Log; import android.util.Xml; import android.view.Surface; import android.view.SurfaceHolder; -import android.graphics.Bitmap; - /** * The VideoEditor implementation {@hide} */ @@ -54,15 +51,6 @@ public class VideoEditorImpl implements VideoEditor { * The project filename */ private static final String PROJECT_FILENAME = "videoeditor.xml"; - /* - * Semaphore to control preview calls - */ - final Semaphore mPreviewSemaphore = new Semaphore(1, true); - - /* - * Semaphore to control export calls - */ - final Semaphore mExportSemaphore = new Semaphore(1, true); /* * XML tags @@ -74,8 +62,7 @@ public class VideoEditorImpl implements VideoEditor { private static final String TAG_TRANSITION = "transition"; private static final String TAG_OVERLAYS = "overlays"; private static final String TAG_OVERLAY = "overlay"; - private static final String TAG_OVERLAY_USER_ATTRIBUTES = - "overlay_user_attributes"; + private static final String TAG_OVERLAY_USER_ATTRIBUTES = "overlay_user_attributes"; private static final String TAG_EFFECTS = "effects"; private static final String TAG_EFFECT = "effect"; private static final String TAG_AUDIO_TRACKS = "audio_tracks"; @@ -86,7 +73,6 @@ public class VideoEditorImpl implements VideoEditor { private static final String ATTR_AUDIO_WAVEFORM_FILENAME = "waveform"; private static final String ATTR_RENDERING_MODE = "rendering_mode"; private static final String ATTR_ASPECT_RATIO = "aspect_ratio"; - private static final String ATTR_PREVIEW_PREPARE = "preview_prepare_invalid"; private static final String ATTR_REGENERATE_PCM = "regeneratePCMFlag"; private static final String ATTR_TYPE = "type"; private static final String ATTR_DURATION = "duration"; @@ -116,18 +102,12 @@ public class VideoEditorImpl implements VideoEditor { private static final String ATTR_DUCK_ENABLED = "ducking_enabled"; private static final String ATTR_DUCK_THRESHOLD = "ducking_threshold"; private static final String ATTR_DUCKED_TRACK_VOLUME = "ducking_volume"; - private static final String ATTR_GENERATED_IMAGE_CLIP = - "generated_image_clip"; - private static final String ATTR_GENERATED_TRANSITION_CLIP = - "generated_transition_clip"; - private static final String ATTR_IS_TRANSITION_GENERATED = - "is_transition_generated"; - private static final String ATTR_OVERLAY_RGB_FILENAME = - "overlay_rgb_filename"; - private static final String ATTR_OVERLAY_FRAME_WIDTH = - "overlay_frame_width"; - private static final String ATTR_OVERLAY_FRAME_HEIGHT = - "overlay_frame_height"; + private static final String ATTR_GENERATED_IMAGE_CLIP = "generated_image_clip"; + private static final String ATTR_GENERATED_TRANSITION_CLIP = "generated_transition_clip"; + private static final String ATTR_IS_TRANSITION_GENERATED = "is_transition_generated"; + private static final String ATTR_OVERLAY_RGB_FILENAME = "overlay_rgb_filename"; + private static final String ATTR_OVERLAY_FRAME_WIDTH = "overlay_frame_width"; + private static final String ATTR_OVERLAY_FRAME_HEIGHT = "overlay_frame_height"; /* * Instance variables @@ -143,7 +123,6 @@ public class VideoEditorImpl implements VideoEditor { * Private Object for calling native Methods via MediaArtistNativeHelper */ private MediaArtistNativeHelper mMANativeHelper; - private VideoEditor veObject = null; private boolean mPreviewInProgress = false; /** @@ -153,7 +132,6 @@ public class VideoEditorImpl implements VideoEditor { * related to the project */ public VideoEditorImpl(String projectPath) throws IOException { - mMANativeHelper = new MediaArtistNativeHelper(projectPath, this); mProjectPath = projectPath; final File projectXml = new File(projectPath, PROJECT_FILENAME); @@ -184,6 +162,7 @@ public class VideoEditorImpl implements VideoEditor { if (audioTrack == null) { throw new IllegalArgumentException("Audio Track is null"); } + if (mAudioTracks.size() == 1) { throw new IllegalArgumentException("No more tracks can be added"); } @@ -196,16 +175,16 @@ public class VideoEditorImpl implements VideoEditor { /* * Form the audio PCM file path */ - String audioTrackPCMFilePath = String.format(mProjectPath + "/" + final String audioTrackPCMFilePath = String.format(mProjectPath + "/" + "AudioPcm" + audioTrack.getId() + ".pcm"); /* * Create PCM only if not generated in previous session */ - if (new File(audioTrackPCMFilePath).exists()) - { + if (new File(audioTrackPCMFilePath).exists()) { mMANativeHelper.setAudioflag(false); } + mMANativeHelper.setGeneratePreview(true); } @@ -223,15 +202,14 @@ public class VideoEditorImpl implements VideoEditor { * Add the Media item to MediaItem list */ if (mMediaItems.contains(mediaItem)) { - throw new IllegalArgumentException("Media item already exists: " + - mediaItem.getId()); + throw new IllegalArgumentException("Media item already exists: " + mediaItem.getId()); } /* * Invalidate the end transition if necessary */ final int mediaItemsCount = mMediaItems.size(); - if ( mediaItemsCount > 0) { + if (mediaItemsCount > 0) { removeTransitionAfter(mediaItemsCount - 1); } @@ -258,6 +236,7 @@ public class VideoEditorImpl implements VideoEditor { if (transition == null) { throw new IllegalArgumentException("Null Transition"); } + final MediaItem beforeMediaItem = transition.getBeforeMediaItem(); final MediaItem afterMediaItem = transition.getAfterMediaItem(); /* @@ -266,15 +245,16 @@ public class VideoEditorImpl implements VideoEditor { if (mMediaItems == null) { throw new IllegalArgumentException("No media items are added"); } - if ((afterMediaItem != null) && (beforeMediaItem != null)) { - int afterMediaItemIndex = mMediaItems.indexOf(afterMediaItem); - int beforeMediaItemIndex = mMediaItems.indexOf(beforeMediaItem); + if ((afterMediaItem != null) && (beforeMediaItem != null)) { + final int afterMediaItemIndex = mMediaItems.indexOf(afterMediaItem); + final int beforeMediaItemIndex = mMediaItems.indexOf(beforeMediaItem); if ((afterMediaItemIndex == -1) || (beforeMediaItemIndex == -1)) { throw new IllegalArgumentException ("Either of the mediaItem is not found in the list"); } + if (afterMediaItemIndex != (beforeMediaItemIndex - 1) ) { throw new IllegalArgumentException("MediaItems are not in sequence"); } @@ -334,9 +314,10 @@ public class VideoEditorImpl implements VideoEditor { case MediaProperties.ACODEC_AMRNB: break; - default : + default: { String message = "Unsupported audio codec type " + audioCodec; throw new IllegalArgumentException(message); + } } switch (videoCodec) { @@ -347,9 +328,10 @@ public class VideoEditorImpl implements VideoEditor { case MediaProperties.VCODEC_MPEG4: break; - default : + default: { String message = "Unsupported video codec type " + videoCodec; throw new IllegalArgumentException(message); + } } export(filename, height, bitrate, listener); @@ -360,13 +342,15 @@ public class VideoEditorImpl implements VideoEditor { */ public void export(String filename, int height, int bitrate, ExportProgressListener listener) throws IOException { - if ( filename == null) { + if (filename == null) { throw new IllegalArgumentException("export: filename is null"); } - File tempPathFile = new File(filename); + + final File tempPathFile = new File(filename); if (tempPathFile == null) { throw new IOException(filename + "can not be created"); } + if (mMediaItems.size() == 0) { throw new IllegalStateException("No MediaItems added"); } @@ -381,10 +365,12 @@ public class VideoEditorImpl implements VideoEditor { case MediaProperties.HEIGHT_720: break; - default: + default: { String message = "Unsupported height value " + height; throw new IllegalArgumentException(message); + } } + switch (bitrate) { case MediaProperties.BITRATE_28K: break; @@ -413,20 +399,24 @@ public class VideoEditorImpl implements VideoEditor { case MediaProperties.BITRATE_8M: break; - default: + default: { final String message = "Unsupported bitrate value " + bitrate; throw new IllegalArgumentException(message); + } } + boolean semAcquireDone = false; try { - mExportSemaphore.acquire(); + mMANativeHelper.lock(); + semAcquireDone = true; mMANativeHelper.export(filename, mProjectPath, height,bitrate, - mMediaItems, mTransitions, mAudioTracks, - listener); + mMediaItems, mTransitions, mAudioTracks, listener); } catch (InterruptedException ex) { Log.e(TAG, "Sem acquire NOT successful in export"); } finally { - mExportSemaphore.release(); + if (semAcquireDone) { + mMANativeHelper.unlock(); + } } } @@ -436,18 +426,18 @@ public class VideoEditorImpl implements VideoEditor { public void generatePreview(MediaProcessingProgressListener listener) { boolean semAcquireDone = false; try { - mPreviewSemaphore.acquire(); + mMANativeHelper.lock(); semAcquireDone = true; - mMANativeHelper.setGeneratePreview(true); + if ((mMediaItems.size() > 0) || (mAudioTracks.size() > 0)) { - mMANativeHelper.previewStoryBoard(mMediaItems, mTransitions, - mAudioTracks, listener); + mMANativeHelper.previewStoryBoard(mMediaItems, mTransitions, mAudioTracks, + listener); } } catch (InterruptedException ex) { Log.e(TAG, "Sem acquire NOT successful in previewStoryBoard"); } finally { if (semAcquireDone) { - mPreviewSemaphore.release(); + mMANativeHelper.unlock(); } } } @@ -553,29 +543,28 @@ public class VideoEditorImpl implements VideoEditor { if (afterAudioTrackId == null) { mAudioTracks.add(0, audioTrack); + mMANativeHelper.setGeneratePreview(true); } else { final int audioTrackCount = mAudioTracks.size(); for (int i = 0; i < audioTrackCount; i++) { AudioTrack at = mAudioTracks.get(i); if (at.getId().equals(afterAudioTrackId)) { mAudioTracks.add(i + 1, audioTrack); + mMANativeHelper.setGeneratePreview(true); return; } } - throw new IllegalArgumentException("AudioTrack not found: " - + afterAudioTrackId); + + throw new IllegalArgumentException("AudioTrack not found: " + afterAudioTrackId); } - mMANativeHelper.setGeneratePreview(true); } /* * {@inheritDoc} */ - public synchronized void insertMediaItem(MediaItem mediaItem, - String afterMediaItemId) { + public synchronized void insertMediaItem(MediaItem mediaItem, String afterMediaItemId) { if (mMediaItems.contains(mediaItem)) { - throw new IllegalArgumentException("Media item already exists: " - + mediaItem.getId()); + throw new IllegalArgumentException("Media item already exists: " + mediaItem.getId()); } if (afterMediaItemId == null) { @@ -585,9 +574,11 @@ public class VideoEditorImpl implements VideoEditor { */ removeTransitionBefore(0); } + mMediaItems.add(0, mediaItem); computeTimelineDuration(); generateProjectThumbnail(); + mMANativeHelper.setGeneratePreview(true); } else { final int mediaItemCount = mMediaItems.size(); for (int i = 0; i < mediaItemCount; i++) { @@ -606,29 +597,25 @@ public class VideoEditorImpl implements VideoEditor { return; } } - throw new IllegalArgumentException("MediaItem not found: " - + afterMediaItemId); + + throw new IllegalArgumentException("MediaItem not found: " + afterMediaItemId); } - mMANativeHelper.setGeneratePreview(true); } /* * {@inheritDoc} */ - public synchronized void moveAudioTrack(String audioTrackId, - String afterAudioTrackId) { + public synchronized void moveAudioTrack(String audioTrackId, String afterAudioTrackId) { throw new IllegalStateException("Not supported"); } /* * {@inheritDoc} */ - public synchronized void moveMediaItem(String mediaItemId, - String afterMediaItemId) { + public synchronized void moveMediaItem(String mediaItemId, String afterMediaItemId) { final MediaItem moveMediaItem = removeMediaItem(mediaItemId,true); if (moveMediaItem == null) { - throw new IllegalArgumentException("Target MediaItem not found: " - + mediaItemId); + throw new IllegalArgumentException("Target MediaItem not found: " + mediaItemId); } if (afterMediaItemId == null) { @@ -643,6 +630,8 @@ public class VideoEditorImpl implements VideoEditor { */ mMediaItems.add(0, moveMediaItem); computeTimelineDuration(); + mMANativeHelper.setGeneratePreview(true); + generateProjectThumbnail(); } else { throw new IllegalStateException("Cannot move media item (it is the only item)"); @@ -666,10 +655,8 @@ public class VideoEditorImpl implements VideoEditor { } } - throw new IllegalArgumentException("MediaItem not found: " - + afterMediaItemId); + throw new IllegalArgumentException("MediaItem not found: " + afterMediaItemId); } - mMANativeHelper.setGeneratePreview(true); } /* @@ -681,16 +668,15 @@ public class VideoEditorImpl implements VideoEditor { mAudioTracks.clear(); mTransitions.clear(); mMANativeHelper.releaseNativeHelper(); - if (mMANativeHelper!= null) - mMANativeHelper = null; - if (veObject != null) - veObject= null; + mMANativeHelper = null; } /* * {@inheritDoc} */ public synchronized void removeAllMediaItems() { + mMANativeHelper.setGeneratePreview(true); + mMediaItems.clear(); /** @@ -702,7 +688,6 @@ public class VideoEditorImpl implements VideoEditor { mTransitions.clear(); mDurationMs = 0; - mMANativeHelper.setGeneratePreview(true); /** * If a thumbnail already exists, then delete it */ @@ -722,11 +707,10 @@ public class VideoEditorImpl implements VideoEditor { audioTrack.invalidate(); mMANativeHelper.invalidatePcmFile(); mMANativeHelper.setAudioflag(true); - } - else { + mMANativeHelper.setGeneratePreview(true); + } else { throw new IllegalArgumentException(" No more audio tracks"); } - mMANativeHelper.setGeneratePreview(true); return audioTrack; } @@ -737,6 +721,7 @@ public class VideoEditorImpl implements VideoEditor { final String firstItemString = mMediaItems.get(0).getId(); final MediaItem mediaItem = getMediaItem(mediaItemId); if (mediaItem != null) { + mMANativeHelper.setGeneratePreview(true); /** * Remove the media item */ @@ -760,10 +745,10 @@ public class VideoEditorImpl implements VideoEditor { removeAdjacentTransitions(mediaItem); computeTimelineDuration(); } - mMANativeHelper.setGeneratePreview(true); + /** * If string equals first mediaItem, then - * generate Project thumbail + * generate Project thumbnail */ if (firstItemString.equals(mediaItemId)) { generateProjectThumbnail(); @@ -784,6 +769,7 @@ public class VideoEditorImpl implements VideoEditor { final MediaItem mediaItem = getMediaItem(mediaItemId); if (mediaItem != null) { + mMANativeHelper.setGeneratePreview(true); /** * Remove the media item */ @@ -794,7 +780,6 @@ public class VideoEditorImpl implements VideoEditor { removeAdjacentTransitions(mediaItem); computeTimelineDuration(); } - mMANativeHelper.setGeneratePreview(true); /** * If string equals first mediaItem, then @@ -812,10 +797,11 @@ public class VideoEditorImpl implements VideoEditor { public synchronized Transition removeTransition(String transitionId) { final Transition transition = getTransition(transitionId); if (transition == null) { - throw new IllegalStateException("Transition not found: " - + transitionId); + throw new IllegalStateException("Transition not found: " + transitionId); } + mMANativeHelper.setGeneratePreview(true); + /** * Remove the transition references */ @@ -832,7 +818,6 @@ public class VideoEditorImpl implements VideoEditor { mTransitions.remove(transition); transition.invalidate(); computeTimelineDuration(); - mMANativeHelper.setGeneratePreview(true); return transition; } @@ -841,63 +826,43 @@ public class VideoEditorImpl implements VideoEditor { */ public long renderPreviewFrame(SurfaceHolder surfaceHolder, long timeMs, OverlayData overlayData) { - long result = 0; - int surfaceWidth = 0; - int surfaceHeight = 0; - Rect frame; - if (surfaceHolder == null) { throw new IllegalArgumentException("Surface Holder is null"); } + final Surface surface = surfaceHolder.getSurface(); + if (surface == null) { + throw new IllegalArgumentException("Surface could not be retrieved from Surface holder"); + } + if (timeMs < 0) { throw new IllegalArgumentException("requested time not correct"); } else if (timeMs > mDurationMs) { throw new IllegalArgumentException("requested time more than duration"); } - if (mMANativeHelper != null) { - if (mMANativeHelper.mInvalidatePreviewArray) { - return -1; - } - } - else { - return -1; - } - boolean semAcquireDone = false; - try{ - mPreviewSemaphore.acquire(); - semAcquireDone = true; - Surface surface = surfaceHolder.getSurface(); - frame = surfaceHolder.getSurfaceFrame(); - surfaceWidth = frame.width(); - surfaceHeight = frame.height(); + long result = 0; - if (surface == null) { - throw new RuntimeException("Surface could not be retrieved from Surface holder"); - } + boolean semAcquireDone = false; + try { + mMANativeHelper.lock(); + semAcquireDone = true; - if (!mMANativeHelper.mInvalidatePreviewArray) { - if (mMediaItems.size() > 0) { - result = mMANativeHelper.renderPreviewFrame(surface, - timeMs,surfaceWidth,surfaceHeight, overlayData); - } - else { - result = 0; - } - } - else { - result = -1; + if (mMediaItems.size() > 0) { + final Rect frame = surfaceHolder.getSurfaceFrame(); + result = mMANativeHelper.renderPreviewFrame(surface, + timeMs, frame.width(), frame.height(), overlayData); + } else { + result = 0; } - } catch (InterruptedException ex) { Log.e(TAG, "Sem acquire NOT successful in renderPreviewFrame"); - } - finally { + } finally { if (semAcquireDone) { - mPreviewSemaphore.release(); + mMANativeHelper.unlock(); } } + return result; } @@ -926,10 +891,6 @@ public class VideoEditorImpl implements VideoEditor { mAspectRatio = Integer.parseInt(parser.getAttributeValue("", ATTR_ASPECT_RATIO)); - final boolean mInvalidatePreviewArray = - Boolean.parseBoolean(parser.getAttributeValue("", - ATTR_PREVIEW_PREPARE)); - mMANativeHelper.setGeneratePreview(mInvalidatePreviewArray); final boolean mRegenPCM = Boolean.parseBoolean(parser.getAttributeValue("", @@ -1126,7 +1087,7 @@ public class VideoEditorImpl implements VideoEditor { final String transitionFile = parser.getAttributeValue("", ATTR_GENERATED_TRANSITION_CLIP); - if (new File(transitionFile).exists() == true) { + if (new File(transitionFile).exists()) { transition.setFilename(transitionFile); } else { transition.setFilename(null); @@ -1300,8 +1261,6 @@ public class VideoEditorImpl implements VideoEditor { serializer.startTag("", TAG_PROJECT); serializer.attribute("", ATTR_ASPECT_RATIO, Integer.toString(mAspectRatio)); - serializer.attribute("", ATTR_PREVIEW_PREPARE, - Boolean.toString(mMANativeHelper.getGeneratePreview())); serializer.attribute("", ATTR_REGENERATE_PCM, Boolean.toString(mMANativeHelper.getAudioflag())); @@ -1551,56 +1510,54 @@ public class VideoEditorImpl implements VideoEditor { if (surfaceHolder == null) { throw new IllegalArgumentException(); } + + final Surface surface = surfaceHolder.getSurface(); + if (surface == null) { + throw new IllegalArgumentException("Surface could not be retrieved from surface holder"); + } + if (listener == null) { throw new IllegalArgumentException(); } + if (fromMs >= mDurationMs) { - throw new IllegalArgumentException("requested time not correct"); + throw new IllegalArgumentException("Requested time not correct"); } if (fromMs < 0) { - throw new IllegalArgumentException("requested time not correct"); + throw new IllegalArgumentException("Requested time not correct"); } boolean semAcquireDone = false; try{ - mPreviewSemaphore.acquire(); + mMANativeHelper.lock(); semAcquireDone = true; - } catch (InterruptedException ex) { - Log.e(TAG, "Sem acquire NOT successful in startPreview"); - } - - if (semAcquireDone) { - Surface mSurface = surfaceHolder.getSurface(); - - if (mSurface == null) { - throw new RuntimeException("Surface could not be retrieved from surface holder"); - } if (mMediaItems.size() > 0) { - try { - mMANativeHelper.previewStoryBoard(mMediaItems, mTransitions, - mAudioTracks, null); - mMANativeHelper.doPreview(mSurface, fromMs, toMs, loop, - callbackAfterFrameCount, listener); - mPreviewInProgress = true; - } catch (IllegalArgumentException ex) { - mPreviewSemaphore.release(); - Log.e(TAG, "Illegal Argument exception in do preview"); - throw ex; - } catch (IllegalStateException ex) { - mPreviewSemaphore.release(); - Log.e(TAG, "Illegal State exception in do preview"); - throw ex; - } catch (RuntimeException ex) { - mPreviewSemaphore.release(); - Log.e(TAG, "Runtime exception in do preview"); - throw ex; - } + mMANativeHelper.previewStoryBoard(mMediaItems, mTransitions, + mAudioTracks, null); + mMANativeHelper.doPreview(surface, fromMs, toMs, loop, + callbackAfterFrameCount, listener); + mPreviewInProgress = true; } /** * release on complete by calling stopPreview */ + } catch (InterruptedException ex) { + Log.e(TAG, "Sem acquire NOT successful in startPreview"); + } catch (IllegalArgumentException ex) { + Log.e(TAG, "Illegal Argument exception in do preview"); + throw ex; + } catch (IllegalStateException ex) { + Log.e(TAG, "Illegal State exception in do preview"); + throw ex; + } catch (RuntimeException ex) { + Log.e(TAG, "Runtime exception in do preview"); + throw ex; + } finally { + if (semAcquireDone) { + mMANativeHelper.unlock(); + } } } @@ -1614,10 +1571,9 @@ public class VideoEditorImpl implements VideoEditor { /** * release the sem acquired in startPreview */ - mPreviewSemaphore.release(); + mMANativeHelper.unlock(); return result; - } - else { + } else { return 0; } } @@ -1662,6 +1618,7 @@ public class VideoEditorImpl implements VideoEditor { Transition t = it.next(); if (t.getBeforeMediaItem() == mediaItem) { it.remove(); + mMANativeHelper.setGeneratePreview(true); t.invalidate(); mediaItem.setBeginTransition(null); if (index > 0) { @@ -1684,6 +1641,7 @@ public class VideoEditorImpl implements VideoEditor { Transition t = it.next(); if (t.getAfterMediaItem() == mediaItem) { it.remove(); + mMANativeHelper.setGeneratePreview(true); t.invalidate(); mediaItem.setEndTransition(null); /** @@ -1730,22 +1688,22 @@ public class VideoEditorImpl implements VideoEditor { if (mMediaItems.size() > 0) { MediaItem mI = mMediaItems.get(0); /* - * Lets initialiZe the width for default aspect ratio i.e 16:9 + * Lets initialize the width for default aspect ratio i.e 16:9 */ int height = 480; int width = 854; switch (mI.getAspectRatio()) { case MediaProperties.ASPECT_RATIO_3_2: - width = 720; + width = 720; break; case MediaProperties.ASPECT_RATIO_4_3: - width = 640; + width = 640; break; case MediaProperties.ASPECT_RATIO_5_3: - width = 800; + width = 800; break; case MediaProperties.ASPECT_RATIO_11_9: - width = 586; + width = 586; break; case MediaProperties.ASPECT_RATIO_16_9: case MediaProperties.ASPECT_RATIO_UNDEFINED: @@ -1756,10 +1714,11 @@ public class VideoEditorImpl implements VideoEditor { try { projectBitmap = mI.getThumbnail(width, height, 500); } catch (IllegalArgumentException e) { - throw new IllegalArgumentException ("Illegal Argument Error creating project thumbnail"); + throw new IllegalArgumentException ("Illegal argument error creating project thumbnail"); } catch (IOException e) { throw new IllegalArgumentException ("IO Error creating project thumbnail"); } + try { FileOutputStream stream = new FileOutputStream(mProjectPath + "/" + THUMBNAIL_FILENAME); @@ -1767,7 +1726,6 @@ public class VideoEditorImpl implements VideoEditor { stream.flush(); stream.close(); } catch (IOException e) { - throw new IllegalArgumentException ("Error creating project thumbnail"); } finally { projectBitmap.recycle(); @@ -1788,7 +1746,7 @@ public class VideoEditorImpl implements VideoEditor { final Surface surface = surfaceHolder.getSurface(); if (surface == null) { - throw new RuntimeException("Surface could not be retrieved from surface holder"); + throw new IllegalArgumentException("Surface could not be retrieved from surface holder"); } if (mMANativeHelper != null) { diff --git a/media/jni/mediaeditor/VideoEditorClasses.cpp b/media/jni/mediaeditor/VideoEditorClasses.cpp index 369faa9..8a35041 100755 --- a/media/jni/mediaeditor/VideoEditorClasses.cpp +++ b/media/jni/mediaeditor/VideoEditorClasses.cpp @@ -145,6 +145,7 @@ VIDEOEDIT_JAVA_DEFINE_CONSTANTS(ClipType) VIDEOEDIT_JAVA_CONSTANT_INIT("MP3", M4VIDEOEDITING_kFileType_MP3), VIDEOEDIT_JAVA_CONSTANT_INIT("PCM", M4VIDEOEDITING_kFileType_PCM), VIDEOEDIT_JAVA_CONSTANT_INIT("JPG", M4VIDEOEDITING_kFileType_JPG), + VIDEOEDIT_JAVA_CONSTANT_INIT("M4V", M4VIDEOEDITING_kFileType_M4V), VIDEOEDIT_JAVA_CONSTANT_INIT("UNSUPPORTED", M4VIDEOEDITING_kFileType_Unsupported) }; @@ -330,6 +331,7 @@ VIDEOEDIT_JAVA_DEFINE_CONSTANTS(FileType) VIDEOEDIT_JAVA_CONSTANT_INIT("JPG", VideoEditClasses_kFileType_JPG), VIDEOEDIT_JAVA_CONSTANT_INIT("GIF", VideoEditClasses_kFileType_GIF), VIDEOEDIT_JAVA_CONSTANT_INIT("PNG", VideoEditClasses_kFileType_PNG), + VIDEOEDIT_JAVA_CONSTANT_INIT("M4V", VideoEditClasses_kFileType_M4V), VIDEOEDIT_JAVA_CONSTANT_INIT("UNSUPPORTED", VideoEditClasses_kFileType_Unsupported) }; @@ -1548,7 +1550,7 @@ videoEditClasses_createClipSettings( // Set the panZoomPercentStart field. pEnv->SetIntField(object, fieldIds.panZoomPercentStart, - (100 - pSettings->xVSS.PanZoomXa)); + (1000 - pSettings->xVSS.PanZoomXa)); // Set the panZoomTopLeftXStart field. pEnv->SetIntField(object, fieldIds.panZoomTopLeftXStart, @@ -1560,7 +1562,7 @@ videoEditClasses_createClipSettings( // Set the panZoomPercentEnd field. pEnv->SetIntField(object, fieldIds.panZoomPercentEnd, - (100 - pSettings->xVSS.PanZoomXb)); + (1000 - pSettings->xVSS.PanZoomXb)); // Set the panZoomTopLeftXEnd field. pEnv->SetIntField(object, fieldIds.panZoomTopLeftXEnd, diff --git a/media/jni/mediaeditor/VideoEditorClasses.h b/media/jni/mediaeditor/VideoEditorClasses.h index 3c8f055..045f229 100755 --- a/media/jni/mediaeditor/VideoEditorClasses.h +++ b/media/jni/mediaeditor/VideoEditorClasses.h @@ -91,8 +91,11 @@ typedef enum VideoEditClasses_kFileType_MP3, VideoEditClasses_kFileType_PCM, VideoEditClasses_kFileType_JPG, + VideoEditClasses_kFileType_BMP, VideoEditClasses_kFileType_GIF, VideoEditClasses_kFileType_PNG, + VideoEditClasses_kFileType_ARGB8888, + VideoEditClasses_kFileType_M4V, VideoEditClasses_kFileType_Unsupported } VideoEditClasses_FileType; diff --git a/media/jni/mediaeditor/VideoEditorJava.cpp b/media/jni/mediaeditor/VideoEditorJava.cpp index 1d610f6..884256a 100755 --- a/media/jni/mediaeditor/VideoEditorJava.cpp +++ b/media/jni/mediaeditor/VideoEditorJava.cpp @@ -410,7 +410,7 @@ videoEditJava_getStaticIntField( (*pValue) = pEnv->GetStaticIntField(clazz, fieldId); // Log the value. - VIDEOEDIT_LOG_EXCEPTION(ANDROID_LOG_INFO, "VIDEO_EDITOR_JAVA", + VIDEOEDIT_LOG_FUNCTION(ANDROID_LOG_INFO, "VIDEO_EDITOR_JAVA", "videoEditJava_getStaticIntField, %s = %d", pName, (*pValue)); } else diff --git a/media/jni/mediaeditor/VideoEditorMain.cpp b/media/jni/mediaeditor/VideoEditorMain.cpp index 4149bc9..221bfa1 100755 --- a/media/jni/mediaeditor/VideoEditorMain.cpp +++ b/media/jni/mediaeditor/VideoEditorMain.cpp @@ -307,7 +307,7 @@ static JNINativeMethod gManualEditMethods[] = { }; // temp file name of VSS out file -#define TEMP_MCS_OUT_FILE_PATH "/tmpOut.3gp" +#define TEMP_MCS_OUT_FILE_PATH "tmpOut.3gp" void getClipSetting( @@ -1144,13 +1144,13 @@ M4OSA_ERR videoEditor_generateAudio(JNIEnv* pEnv,ManualEditContext* pContext, // generate the path for temp 3gp output file pTemp3gpFilePath = (M4OSA_Char*) M4OSA_malloc ( (M4OSA_chrLength((M4OSA_Char*)pContext->initParams.pTempPath) - + M4OSA_chrLength ((M4OSA_Char*)TEMP_MCS_OUT_FILE_PATH)) , 0x0, + + M4OSA_chrLength ((M4OSA_Char*)TEMP_MCS_OUT_FILE_PATH)) + 1 /* for null termination */ , 0x0, (M4OSA_Char*) "Malloc for temp 3gp file"); if ( pTemp3gpFilePath != M4OSA_NULL ) { M4OSA_memset(pTemp3gpFilePath , M4OSA_chrLength((M4OSA_Char*)pContext->initParams.pTempPath) - + M4OSA_chrLength((M4OSA_Char*)TEMP_MCS_OUT_FILE_PATH), 0); + + M4OSA_chrLength((M4OSA_Char*)TEMP_MCS_OUT_FILE_PATH) + 1, 0); M4OSA_chrNCat ( (M4OSA_Char*)pTemp3gpFilePath, (M4OSA_Char*)pContext->initParams.pTempPath , M4OSA_chrLength ((M4OSA_Char*)pContext->initParams.pTempPath)); @@ -2385,7 +2385,7 @@ M4OSA_ERR videoEditor_processClip( "not initialized"); // We start in Analyzing state - pContext->state = ManualEditState_ANALYZING; + pContext->state = ManualEditState_INITIALIZED; M4OSA_ERR completionResult = M4VSS3GPP_WAR_ANALYZING_DONE; ManualEditState completionState = ManualEditState_OPENED; ManualEditState errorState = ManualEditState_ANALYZING_ERROR; @@ -2560,9 +2560,10 @@ videoEditor_generateClip( result = videoEditor_processClip(pEnv, thiz, 0 /*item id is unused*/); LOGV("videoEditor_generateClip videoEditor_processClip returned 0x%x", result); - // Free up memory (whatever the result) - videoEditor_unloadSettings(pEnv, thiz); - //LVME_release(pEnv, thiz); + if (pContext->state != ManualEditState_INITIALIZED) { + // Free up memory (whatever the result) + videoEditor_unloadSettings(pEnv, thiz); + } LOGV("videoEditor_generateClip END 0x%x", (unsigned int) result); return result; diff --git a/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp b/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp index 7bf76da..35c14b6 100755 --- a/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp +++ b/media/jni/mediaeditor/VideoEditorPropertiesMain.cpp @@ -165,7 +165,8 @@ jobject videoEditProp_getProperties( (VideoEditClasses_kFileType_MP4 == fileType) || (VideoEditClasses_kFileType_3GPP == fileType) || (VideoEditClasses_kFileType_AMR == fileType) || - (VideoEditClasses_kFileType_PCM == fileType)) + (VideoEditClasses_kFileType_PCM == fileType) || + (VideoEditClasses_kFileType_M4V == fileType)) { // Allocate a new clip properties structure. pClipProperties = @@ -316,12 +317,13 @@ static void getFileAndMediaTypeFromExtension ( extension[index] = M4OSA_chrToLower(pExtension[index]); } - // Check if the extension is ".mp3". + // Check if the extension is ".mp3". if (!(VideoEdit_chrCompare(extension, (M4OSA_Char*)"mp3", &cmpResult))) { *pFileType = VideoEditClasses_kFileType_MP3; *pClipType = M4VIDEOEDITING_kFileType_MP3; - } // Check if the extension is ".mp4". + } + // Check if the extension is ".mp4". else if (!(VideoEdit_chrCompare(extension, (M4OSA_Char*)"mp4", &cmpResult))) { *pFileType = VideoEditClasses_kFileType_MP4; @@ -333,7 +335,7 @@ static void getFileAndMediaTypeFromExtension ( *pFileType = VideoEditClasses_kFileType_3GPP; *pClipType = M4VIDEOEDITING_kFileType_3GPP; } - // Check if the extension is ".3gp". + // Check if the extension is ".m4a". else if (!(VideoEdit_chrCompare(extension, (M4OSA_Char*)"m4a", &cmpResult))) { *pFileType = VideoEditClasses_kFileType_3GPP; @@ -348,7 +350,6 @@ static void getFileAndMediaTypeFromExtension ( // Check if the extension is ".amr". else if (!(VideoEdit_chrCompare(extension, (M4OSA_Char*)"amr", &cmpResult))) { - *pFileType = VideoEditClasses_kFileType_AMR; *pClipType = M4VIDEOEDITING_kFileType_AMR; } @@ -378,9 +379,13 @@ static void getFileAndMediaTypeFromExtension ( { *pFileType = VideoEditClasses_kFileType_PNG; } - + // Check if the extension is ".m4v". + else if (!(VideoEdit_chrCompare(extension, (M4OSA_Char*)"m4v", &cmpResult))) + { + *pFileType = VideoEditClasses_kFileType_M4V; + *pClipType = M4VIDEOEDITING_kFileType_M4V; + } } - } static M4OSA_ERR getClipProperties( diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index 11ac56c..89b3dab 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -378,14 +378,11 @@ status_t AwesomePlayer::setDataSource_l(const sp<MediaExtractor> &extractor) { } void AwesomePlayer::reset() { - LOGI("reset"); - Mutex::Autolock autoLock(mLock); reset_l(); } void AwesomePlayer::reset_l() { - LOGI("reset_l"); mDisplayWidth = 0; mDisplayHeight = 0; @@ -411,10 +408,6 @@ void AwesomePlayer::reset_l() { } } - if (mFlags & PREPARING) { - LOGI("waiting until preparation is completes."); - } - while (mFlags & PREPARING) { mPreparedCondition.wait(mLock); } @@ -438,8 +431,6 @@ void AwesomePlayer::reset_l() { } mAudioSource.clear(); - LOGI("audio source cleared"); - mTimeSource = NULL; delete mAudioPlayer; @@ -480,8 +471,6 @@ void AwesomePlayer::reset_l() { IPCThreadState::self()->flushCommands(); } - LOGI("video source cleared"); - mDurationUs = -1; mFlags = 0; mExtractorFlags = 0; @@ -498,8 +487,6 @@ void AwesomePlayer::reset_l() { mFileSource.clear(); mBitrate = -1; - - LOGI("reset_l completed"); } void AwesomePlayer::notifyListener_l(int msg, int ext1, int ext2) { diff --git a/media/libstagefright/httplive/LiveSession.cpp b/media/libstagefright/httplive/LiveSession.cpp index c6c36e3..0bed3ca 100644 --- a/media/libstagefright/httplive/LiveSession.cpp +++ b/media/libstagefright/httplive/LiveSession.cpp @@ -51,6 +51,7 @@ LiveSession::LiveSession() mNumRetries(0), mDurationUs(-1), mSeekDone(false), + mDisconnectPending(false), mMonitorQueueGeneration(0) { } @@ -68,6 +69,11 @@ void LiveSession::connect(const char *url) { } void LiveSession::disconnect() { + Mutex::Autolock autoLock(mLock); + mDisconnectPending = true; + + mHTTPDataSource->disconnect(); + (new AMessage(kWhatDisconnect, id()))->post(); } @@ -138,7 +144,13 @@ void LiveSession::onConnect(const sp<AMessage> &msg) { mMasterURL = url; sp<M3UParser> playlist = fetchPlaylist(url.c_str()); - CHECK(playlist != NULL); + + if (playlist == NULL) { + LOGE("unable to fetch master playlist '%s'.", url.c_str()); + + mDataSource->queueEOS(ERROR_IO); + return; + } if (playlist->isVariantPlaylist()) { for (size_t i = 0; i < playlist->size(); ++i) { @@ -177,6 +189,9 @@ void LiveSession::onDisconnect() { LOGI("onDisconnect"); mDataSource->queueEOS(ERROR_END_OF_STREAM); + + Mutex::Autolock autoLock(mLock); + mDisconnectPending = false; } status_t LiveSession::fetchFile(const char *url, sp<ABuffer> *out) { @@ -189,6 +204,14 @@ status_t LiveSession::fetchFile(const char *url, sp<ABuffer> *out) { } else if (strncasecmp(url, "http://", 7)) { return ERROR_UNSUPPORTED; } else { + { + Mutex::Autolock autoLock(mLock); + + if (mDisconnectPending) { + return ERROR_IO; + } + } + status_t err = mHTTPDataSource->connect(url); if (err != OK) { diff --git a/media/libstagefright/include/LiveSession.h b/media/libstagefright/include/LiveSession.h index 41f5ad0..f1188c4 100644 --- a/media/libstagefright/include/LiveSession.h +++ b/media/libstagefright/include/LiveSession.h @@ -87,6 +87,7 @@ private: Condition mCondition; int64_t mDurationUs; bool mSeekDone; + bool mDisconnectPending; int32_t mMonitorQueueGeneration; diff --git a/media/libstagefright/rtsp/ASessionDescription.cpp b/media/libstagefright/rtsp/ASessionDescription.cpp index 77917b3..3e710dc 100644 --- a/media/libstagefright/rtsp/ASessionDescription.cpp +++ b/media/libstagefright/rtsp/ASessionDescription.cpp @@ -254,26 +254,12 @@ bool ASessionDescription::getDurationUs(int64_t *durationUs) const { return false; } - if (value == "npt=now-" || value == "npt=0-") { - return false; - } - if (strncmp(value.c_str(), "npt=", 4)) { return false; } - const char *s = value.c_str() + 4; - char *end; - double from = strtod(s, &end); - - if (end == s || *end != '-') { - return false; - } - - s = end + 1; - double to = strtod(s, &end); - - if (end == s || *end != '\0' || to < from) { + float from, to; + if (!parseNTPRange(value.c_str() + 4, &from, &to)) { return false; } @@ -307,5 +293,39 @@ void ASessionDescription::ParseFormatDesc( } } +// static +bool ASessionDescription::parseNTPRange( + const char *s, float *npt1, float *npt2) { + if (s[0] == '-') { + return false; // no start time available. + } + + if (!strncmp("now", s, 3)) { + return false; // no absolute start time available + } + + char *end; + *npt1 = strtof(s, &end); + + if (end == s || *end != '-') { + // Failed to parse float or trailing "dash". + return false; + } + + s = end + 1; // skip the dash. + + if (!strncmp("now", s, 3)) { + return false; // no absolute end time available + } + + *npt2 = strtof(s, &end); + + if (end == s || *end != '\0') { + return false; + } + + return *npt2 > *npt1; +} + } // namespace android diff --git a/media/libstagefright/rtsp/ASessionDescription.h b/media/libstagefright/rtsp/ASessionDescription.h index a3fa79e..b462983 100644 --- a/media/libstagefright/rtsp/ASessionDescription.h +++ b/media/libstagefright/rtsp/ASessionDescription.h @@ -55,6 +55,14 @@ struct ASessionDescription : public RefBase { bool findAttribute(size_t index, const char *key, AString *value) const; + // parses strings of the form + // npt := npt-time "-" npt-time? | "-" npt-time + // npt-time := "now" | [0-9]+("." [0-9]*)? + // + // Returns true iff both "npt1" and "npt2" times were available, + // i.e. we have a fixed duration, otherwise this is live streaming. + static bool parseNTPRange(const char *s, float *npt1, float *npt2); + protected: virtual ~ASessionDescription(); diff --git a/media/libstagefright/rtsp/MyHandler.h b/media/libstagefright/rtsp/MyHandler.h index 9bb8c46..306a9c1 100644 --- a/media/libstagefright/rtsp/MyHandler.h +++ b/media/libstagefright/rtsp/MyHandler.h @@ -938,13 +938,11 @@ struct MyHandler : public AHandler { AString val; CHECK(GetAttribute(range.c_str(), "npt", &val)); - float npt1, npt2; - if (val == "now-" || val == "0-") { + float npt1, npt2; + if (!ASessionDescription::parseNTPRange(val.c_str(), &npt1, &npt2)) { // This is a live stream and therefore not seekable. return; - } else { - CHECK_EQ(sscanf(val.c_str(), "%f-%f", &npt1, &npt2), 2); } i = response->mHeaders.indexOfKey("rtp-info"); diff --git a/media/mtp/MtpServer.cpp b/media/mtp/MtpServer.cpp index be004d2..853a5af 100644 --- a/media/mtp/MtpServer.cpp +++ b/media/mtp/MtpServer.cpp @@ -343,8 +343,9 @@ MtpResponseCode MtpServer::doGetDeviceInfo() { mData.putAUInt16(deviceProperties); // Device Properties Supported mData.putAUInt16(captureFormats); // Capture Formats mData.putAUInt16(playbackFormats); // Playback Formats - // FIXME - string.set("Google, Inc."); + + property_get("ro.product.manufacturer", prop_value, "unknown manufacturer"); + string.set(prop_value); mData.putString(string); // Manufacturer property_get("ro.product.model", prop_value, "MTP Device"); diff --git a/opengl/libagl/egl.cpp b/opengl/libagl/egl.cpp index 7ac6f92..a1cb23a 100644 --- a/opengl/libagl/egl.cpp +++ b/opengl/libagl/egl.cpp @@ -82,6 +82,11 @@ static GLint getError() { if (ggl_unlikely(gEGLErrorKey == -1)) return EGL_SUCCESS; GLint error = (GLint)pthread_getspecific(gEGLErrorKey); + if (error == 0) { + // The TLS key has been created by another thread, but the value for + // this thread has not been initialized. + return EGL_SUCCESS; + } pthread_setspecific(gEGLErrorKey, (void*)EGL_SUCCESS); return error; } diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp index 8977fbf..3dc8c03 100644 --- a/opengl/libs/EGL/egl.cpp +++ b/opengl/libs/EGL/egl.cpp @@ -389,10 +389,9 @@ static tls_t* getTLS() } static inline void clearError() { - if (gEGLThreadLocalStorageKey != -1) { - tls_t* tls = getTLS(); - tls->error = EGL_SUCCESS; - } + // This must clear the error from all the underlying EGL implementations as + // well as the EGL wrapper layer. + eglGetError(); } template<typename T> diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_gps_acquiring.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_gps_acquiring.png Binary files differindex 150c9fc..61f65bf 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_gps_acquiring.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_gps_acquiring.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0.png Binary files differindex ecb3951..ff74c35 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_0.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1.png Binary files differindex e375a8a..6375b1b 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully.png Binary files differindex 13dde32..ef886b8 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_1_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2.png Binary files differindex 24ade2c..92882bd 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully.png Binary files differindex efa6f79..cf5c4c3 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_2_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3.png Binary files differindex 5b5baed..24b6d25 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully.png Binary files differindex 2eaff98..b147583 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_3_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4.png Binary files differindex b515cf0..594ad6a 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully.png Binary files differindex d8599b5..2879550 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_signal_4_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_0.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_0.png Binary files differindex 1b404b3..7cd2893 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_0.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_0.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1.png Binary files differindex ba9cc9c..23eb1d6 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1_fully.png Binary files differindex 3e29d5e..ad28667 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1_fully.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_1_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2.png Binary files differindex e1900ea..048dfd1 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2_fully.png Binary files differindex 2b00f3b..224ae1f 100755 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2_fully.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_2_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3.png Binary files differindex 6158e66..b85859b 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3_fully.png Binary files differindex b183160..d7f3960 100755 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3_fully.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_3_fully.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4.png Binary files differindex 1b96f39..54915b9 100644 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4.png diff --git a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4_fully.png b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4_fully.png Binary files differindex cf504f5..bd44b52 100755 --- a/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4_fully.png +++ b/packages/SystemUI/res/drawable-hdpi/stat_sys_wifi_signal_4_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_gps_acquiring.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_gps_acquiring.png Binary files differindex e5e98f9..3a0fce0 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_gps_acquiring.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_gps_acquiring.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0.png Binary files differindex cf11f0d..8654aa0 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_0.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png Binary files differindex 3b69d1e..c10629f 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully.png Binary files differindex b012b18..753c9f9 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_1_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png Binary files differindex 8736234..65a886a 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully.png Binary files differindex cc68512..6e90ce4 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_2_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png Binary files differindex 5a2d3c0..cce7d9b 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully.png Binary files differindex a93d49c..c4e33bd 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_3_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png Binary files differindex 3fbf7fc..433a2c5 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully.png Binary files differindex e3ff8b9..81401b2 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_signal_4_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_0.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_0.png Binary files differindex b11ad16..75906a2 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_0.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_0.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1.png Binary files differindex 94d40e0..528e4ce 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1_fully.png Binary files differindex 4a896f3..1eb5aad 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_1_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2.png Binary files differindex b09b40d..5f2c230 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2_fully.png Binary files differindex 0f9c187..2c27620 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_2_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3.png Binary files differindex b852dba..4cb06be 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3_fully.png Binary files differindex 0468d06..fd9c350 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_3_fully.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4.png Binary files differindex 06bbb4a..e8aed95 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4.png diff --git a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4_fully.png b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4_fully.png Binary files differindex 1858af3..c629387 100644 --- a/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4_fully.png +++ b/packages/SystemUI/res/drawable-mdpi/stat_sys_wifi_signal_4_fully.png diff --git a/packages/SystemUI/res/layout-xlarge/status_bar.xml b/packages/SystemUI/res/layout-xlarge/status_bar.xml index f355e17..6c173c9 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar.xml @@ -44,20 +44,20 @@ /> <!-- navigation controls --> + <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back" + android:layout_width="80dip" + android:layout_height="match_parent" + android:src="@drawable/ic_sysbar_back" + android:layout_alignParentLeft="true" + systemui:keyCode="4" + /> <LinearLayout android:id="@+id/navigationArea" android:layout_width="wrap_content" android:layout_height="match_parent" - android:layout_alignParentLeft="true" + android:layout_toRightOf="@+id/back" android:orientation="horizontal" > - - <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/back" - android:layout_width="80dip" - android:layout_height="match_parent" - android:src="@drawable/ic_sysbar_back" - systemui:keyCode="4" - /> <com.android.systemui.statusbar.policy.KeyButtonView android:id="@+id/home" android:layout_width="80dip" android:layout_height="match_parent" 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 index c4bca61..efbf359 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_input_methods_panel.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_input_methods_panel.xml @@ -22,7 +22,8 @@ android:layout_height="match_parent" android:layout_width="match_parent" android:paddingBottom="28dip" - android:orientation="vertical"> + android:orientation="vertical" + android:visibility="gone"> <View android:layout_width="match_parent" android:layout_height="0dip" @@ -38,6 +39,47 @@ android:layout_marginLeft="20dip" android:orientation="vertical" android:background="@*android:drawable/dialog_full_holo_dark"> + <!-- Hard keyboard switch --> + <LinearLayout + android:id="@+id/hard_keyboard_section" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:orientation="vertical"> + <LinearLayout + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:orientation="horizontal"> + <TextView + android:id="@+id/use_physical_keyboard_label" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + 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_use_physical_keyboard" + android:textAppearance="?android:attr/textAppearanceMedium" + android:ellipsize="marquee" /> + <Switch + android:id="@+id/hard_keyboard_switch" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:layout_marginRight="16dip" /> + </LinearLayout> + <View + android:layout_width="match_parent" + android:layout_height="1dip" + android:background="@android:drawable/divider_horizontal_dark" /> + </LinearLayout> + + <!-- Input method list --> <ScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -50,6 +92,8 @@ android:layout_height="wrap_content" android:orientation="vertical" /> </ScrollView> + + <!-- Configure input methods --> <TextView android:id="@+id/ime_settings_shortcut" android:layout_width="match_parent" diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml index 2ee2ac4..4e41e53 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_area.xml @@ -45,7 +45,6 @@ android:id="@+id/notificationIcons" android:layout_width="wrap_content" android:layout_height="match_parent" - android:orientation="horizontal" > <view class="com.android.systemui.statusbar.tablet.NotificationIconArea$IconLayout" @@ -55,6 +54,14 @@ android:layout_gravity="center_vertical" android:layout_marginLeft="8dp" /> + <View + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_alignLeft="@id/icons" + android:layout_alignRight="@id/icons" + android:background="@drawable/notification_icon_area_smoke" + android:clickable="false" + /> </com.android.systemui.statusbar.tablet.NotificationIconArea> </LinearLayout> @@ -77,7 +84,7 @@ android:layout_height="wrap_content" android:singleLine="true" android:textSize="40sp" - android:textColor="#8cffffff" /> + android:textColor="#8cccdaff" /> </com.android.systemui.statusbar.tablet.HoloClock> <TextView diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel_title.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel_title.xml index 40f2247..15b2b70 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel_title.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_panel_title.xml @@ -86,7 +86,7 @@ android:layout_alignBaseline="@id/battery" android:layout_alignParentRight="true" android:paddingRight="16dp" - android:src="@drawable/ic_notification_open" + android:src="@drawable/ic_sysbar_quicksettings" android:baseline="21dp" /> @@ -98,7 +98,7 @@ android:layout_alignBaseline="@id/battery" android:paddingRight="16dp" android:visibility="invisible" - android:src="@drawable/status_bar_veto" + android:src="@drawable/ic_notification_open" android:baseline="21dp" /> @@ -119,7 +119,7 @@ android:layout_width="match_parent" android:layout_alignParentRight="true" android:layout_above="@id/title_divider" - android:layout_marginRight="32dip" + android:layout_marginRight="6dip" android:layout_marginBottom="8dip" > <TextView android:id="@+id/time_bg" @@ -127,14 +127,14 @@ android:layout_height="wrap_content" android:gravity="right" android:singleLine="true" - android:textSize="72sp" + android:textSize="78sp" android:textColor="#999999" /> <TextView android:id="@+id/time_fg" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="right" android:singleLine="true" - android:textSize="72sp" + android:textSize="78sp" android:textColor="#666666" /> </com.android.systemui.statusbar.tablet.HoloClock> diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml b/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml index 0f3f5f0..8e456b2 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_notification_row.xml @@ -27,7 +27,7 @@ <com.android.systemui.statusbar.LatestItemView android:id="@+id/content" android:layout_width="match_parent" - android:layout_height="64sp" + android:layout_height="64dp" android:layout_alignParentTop="true" android:layout_toRightOf="@id/large_icon" android:layout_toLeftOf="@id/veto" diff --git a/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml b/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml index d0afbb2..75bbb3a 100644 --- a/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml +++ b/packages/SystemUI/res/layout-xlarge/status_bar_settings_view.xml @@ -118,7 +118,7 @@ <ImageView android:id="@+id/do_not_disturb_icon" style="@style/StatusBarPanelSettingsIcon" - android:src="@drawable/ic_sysbar_gps_on" + android:src="@drawable/ic_notification_open" /> <TextView style="@style/StatusBarPanelSettingsContents" diff --git a/packages/SystemUI/res/values-es-rUS/strings.xml b/packages/SystemUI/res/values-es-rUS/strings.xml index 8013a19..c38abdd 100644 --- a/packages/SystemUI/res/values-es-rUS/strings.xml +++ b/packages/SystemUI/res/values-es-rUS/strings.xml @@ -40,8 +40,8 @@ <string name="status_bar_settings_notifications" msgid="397146176280905137">"Notificaciones"</string> <string name="recent_tasks_title" msgid="3691764623638127888">"Reciente"</string> <string name="recent_tasks_empty" msgid="1905484479067697884">"No hay aplicaciones recientes."</string> - <!-- no translation found for recent_tasks_app_label (3796483981246752469) --> - <skip /> - <!-- no translation found for bluetooth_tethered (7094101612161133267) --> - <skip /> + <!-- outdated translation 5550538721034982973 --> <string name="recent_tasks_app_label" msgid="3796483981246752469">"Google Apps"</string> + <!-- outdated translation 8017158699581472359 --> <string name="bluetooth_tethered" msgid="7094101612161133267">"Bluetooth anclado"</string> + <!-- outdated translation 3875357213648023768 --> <string name="status_bar_input_method_settings_configure_input_methods" msgid="737483394044014246">"Configurar métodos de entrada"</string> + <string name="status_bar_use_physical_keyboard">"Usar un teclado externo"</string> </resources> diff --git a/packages/SystemUI/res/values-xlarge/colors.xml b/packages/SystemUI/res/values-xlarge/colors.xml index 14161c3..7f1e358 100644 --- a/packages/SystemUI/res/values-xlarge/colors.xml +++ b/packages/SystemUI/res/values-xlarge/colors.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <resources> <drawable name="status_bar_background">#000000</drawable> + <drawable name="notification_icon_area_smoke">#D0000000</drawable> </resources> diff --git a/packages/SystemUI/res/values-xlarge/styles.xml b/packages/SystemUI/res/values-xlarge/styles.xml index fb10a24..c1cd533 100644 --- a/packages/SystemUI/res/values-xlarge/styles.xml +++ b/packages/SystemUI/res/values-xlarge/styles.xml @@ -39,6 +39,7 @@ <item name="android:layout_weight">1</item> <item name="android:layout_gravity">left|center_vertical</item> <item name="android:textColor">?android:attr/textColorPrimary</item> + <item name="android:textSize">18sp</item> </style> <style name="StatusBarPanelSettingsPanelSeparator"> diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 53d06c0..0923570 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -112,4 +112,7 @@ <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> + + <!-- Label of a toggle switch to disable use of the physical keyboard in favor of the IME. [CHAR LIMIT=25] --> + <string name="status_bar_use_physical_keyboard">Use physical keyboard</string> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java index 37939df..d55a7c2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/CommandQueue.java @@ -56,6 +56,7 @@ public class CommandQueue extends IStatusBar.Stub { private static final int MSG_SHOW_MENU = 0x00080000; private static final int MSG_SHOW_IME_BUTTON = 0x00090000; + private static final int MSG_SET_HARD_KEYBOARD_STATUS = 0x000a0000; private StatusBarIconList mList; private Callbacks mCallbacks; @@ -82,7 +83,8 @@ public class CommandQueue extends IStatusBar.Stub { public void animateCollapse(); public void setLightsOn(boolean on); public void setMenuKeyVisible(boolean visible); - public void setIMEButtonVisible(IBinder token, boolean visible); + public void setImeWindowStatus(IBinder token, int vis, int backDisposition); + public void setHardKeyboardStatus(boolean available, boolean enabled); } public CommandQueue(Callbacks callbacks, StatusBarIconList list) { @@ -165,10 +167,19 @@ public class CommandQueue extends IStatusBar.Stub { } } - public void setIMEButtonVisible(IBinder token, boolean visible) { + public void setImeWindowStatus(IBinder token, int vis, int backDisposition) { synchronized (mList) { mHandler.removeMessages(MSG_SHOW_IME_BUTTON); - mHandler.obtainMessage(MSG_SHOW_IME_BUTTON, visible ? 1 : 0, 0, token).sendToTarget(); + mHandler.obtainMessage(MSG_SHOW_IME_BUTTON, vis, backDisposition, token) + .sendToTarget(); + } + } + + public void setHardKeyboardStatus(boolean available, boolean enabled) { + synchronized (mList) { + mHandler.removeMessages(MSG_SET_HARD_KEYBOARD_STATUS); + mHandler.obtainMessage(MSG_SET_HARD_KEYBOARD_STATUS, + available ? 1 : 0, enabled ? 1 : 0).sendToTarget(); } } @@ -233,7 +244,10 @@ public class CommandQueue extends IStatusBar.Stub { mCallbacks.setMenuKeyVisible(msg.arg1 != 0); break; case MSG_SHOW_IME_BUTTON: - mCallbacks.setIMEButtonVisible((IBinder)msg.obj, msg.arg1 != 0); + mCallbacks.setImeWindowStatus((IBinder)msg.obj, msg.arg1, msg.arg2); + break; + case MSG_SET_HARD_KEYBOARD_STATUS: + mCallbacks.setHardKeyboardStatus(msg.arg1 != 0, msg.arg2 != 0); break; } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java index 8fca759..23ae823 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/StatusBar.java @@ -67,7 +67,7 @@ public abstract class StatusBar extends SystemUI implements CommandQueue.Callbac mCommandQueue = new CommandQueue(this, iconList); mBarService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); - int[] switches = new int[4]; + int[] switches = new int[7]; ArrayList<IBinder> binders = new ArrayList<IBinder>(); try { mBarService.registerStatusBar(mCommandQueue, iconList, notificationKeys, notifications, @@ -80,7 +80,8 @@ public abstract class StatusBar extends SystemUI implements CommandQueue.Callbac setLightsOn(switches[1] != 0); setMenuKeyVisible(switches[2] != 0); // StatusBarManagerService has a back up of IME token and it's restored here. - setIMEButtonVisible(binders.get(0), switches[3] != 0); + setImeWindowStatus(binders.get(0), switches[3], switches[4]); + setHardKeyboardStatus(switches[5] != 0, switches[6] != 0); // Set up the initial icon state int N = iconList.size(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 132433b..1e46246 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1020,7 +1020,9 @@ public class PhoneStatusBar extends StatusBar { // Not supported public void setMenuKeyVisible(boolean visible) { } - public void setIMEButtonVisible(IBinder token, boolean visible) { } + public void setImeWindowStatus(IBinder token, int vis, int backDisposition) { } + @Override + public void setHardKeyboardStatus(boolean available, boolean enabled) { } private class Launcher implements View.OnClickListener { private PendingIntent mIntent; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java index 136f4a94..6ab03e1 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/DateView.java @@ -20,6 +20,7 @@ import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; +import android.text.format.DateFormat; import android.util.AttributeSet; import android.util.Slog; import android.widget.TextView; @@ -27,7 +28,6 @@ import android.view.MotionEvent; import android.view.View; import android.view.ViewParent; -import java.text.DateFormat; import java.util.Date; public final class DateView extends TextView { @@ -86,8 +86,11 @@ public final class DateView extends TextView { } private final void updateClock() { + final Context context = getContext(); Date now = new Date(); - setText(DateFormat.getDateInstance(DateFormat.FULL).format(now)); + CharSequence dow = DateFormat.format("EEEE", now); + CharSequence date = DateFormat.getMediumDateFormat(getContext()).format(now); + setText(dow + "\n" + date); } private boolean isVisible() { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java index cb5e361..a4c153f 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java @@ -146,6 +146,7 @@ public class NetworkController extends BroadcastReceiver { filter.addAction(Telephony.Intents.SPN_STRINGS_UPDATED_ACTION); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); filter.addAction(ConnectivityManager.INET_CONDITION_ACTION); + filter.addAction(Intent.ACTION_CONFIGURATION_CHANGED); context.registerReceiver(this, filter); // yuck @@ -197,6 +198,8 @@ public class NetworkController extends BroadcastReceiver { action.equals(ConnectivityManager.INET_CONDITION_ACTION)) { updateConnectivity(intent); refreshViews(); + } else if (action.equals(Intent.ACTION_CONFIGURATION_CHANGED)) { + refreshViews(); } } @@ -697,7 +700,7 @@ public class NetworkController extends BroadcastReceiver { } else { label = context.getString(R.string.status_bar_settings_signal_meter_disconnected); combinedSignalIconId = mDataSignalIconId; - dataTypeIconId = mDataTypeIconId; + dataTypeIconId = 0; } if (false) { 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 28f485c..100ed55 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodButton.java @@ -17,32 +17,23 @@ package com.android.systemui.statusbar.tablet; import android.content.Context; -import android.content.pm.PackageManager; -import android.graphics.drawable.Drawable; import android.os.IBinder; import android.provider.Settings; -import android.util.Log; import android.util.AttributeSet; import android.view.inputmethod.InputMethodInfo; import android.view.inputmethod.InputMethodManager; -import android.view.inputmethod.InputMethodSubtype; import android.view.View; import android.widget.ImageView; import com.android.systemui.R; import java.util.List; -import java.util.Map; public class InputMethodButton extends ImageView { private static final String TAG = "StatusBar/InputMethodButton"; private static final boolean DEBUG = false; - private static final int ID_IME_SWITCH_BUTTON = R.id.imeSwitchButton; - // IME shortcut button is disabled. - private static final int ID_IME_SHORTCUT_BUTTON = 0; - // These values are defined in Settings application. private static final int ID_IME_BUTTON_VISIBILITY_AUTO = 0; private static final int ID_IME_BUTTON_VISIBILITY_ALWAYS_SHOW = 1; @@ -53,10 +44,9 @@ public class InputMethodButton extends ImageView { private final int mId; private ImageView mIcon; private IBinder mToken; - private boolean mKeyboardVisible = false; + private boolean mShowButton = false; private boolean mScreenLocked = false; - private InputMethodInfo mShortcutInfo; - private InputMethodSubtype mShortcutSubtype; + private boolean mHardKeyboardAvailable; public InputMethodButton(Context context, AttributeSet attrs) { super(context, attrs); @@ -65,26 +55,6 @@ public class InputMethodButton extends ImageView { mId = getId(); // IME hookup mImm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); - // TODO: read the current icon & visibility state directly from the service - - // TODO: register for notifications about changes to visibility & subtype from service - - setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - switch (mId) { - case ID_IME_SWITCH_BUTTON: - mImm.showInputMethodPicker(); - break; - case ID_IME_SHORTCUT_BUTTON: - if (mToken != null && mShortcutInfo != null) { - mImm.setInputMethodAndSubtype( - mToken, mShortcutInfo.getId(), mShortcutSubtype); - } - break; - } - } - }); } @Override @@ -94,57 +64,17 @@ public class InputMethodButton extends ImageView { refreshStatusIcon(); } - // 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. - private Drawable getShortcutInputMethodAndSubtypeDrawable() { - Map<InputMethodInfo, List<InputMethodSubtype>> shortcuts = - mImm.getShortcutInputMethodsAndSubtypes(); - if (shortcuts.size() > 0) { - for (InputMethodInfo imi: shortcuts.keySet()) { - List<InputMethodSubtype> subtypes = shortcuts.get(imi); - // TODO: Returns the first found IMI for now. Should handle all shortcuts as - // appropriate. - mShortcutInfo = imi; - // TODO: Pick up the first found subtype for now. Should handle all subtypes - // as appropriate. - mShortcutSubtype = subtypes.size() > 0 ? subtypes.get(0) : null; - return getSubtypeIcon(mShortcutInfo, mShortcutSubtype); - } - } - return null; - } - - private Drawable getSubtypeIcon(InputMethodInfo imi, InputMethodSubtype subtype) { - final PackageManager pm = getContext().getPackageManager(); - if (imi != null) { - if (DEBUG) { - Log.d(TAG, "Update icons of IME: " + imi.getPackageName()); - } - if (subtype != null) { - return pm.getDrawable(imi.getPackageName(), subtype.getIconResId(), - imi.getServiceInfo().applicationInfo); - } else if (imi.getSubtypeCount() > 0) { - return pm.getDrawable(imi.getPackageName(), - imi.getSubtypeAt(0).getIconResId(), - imi.getServiceInfo().applicationInfo); - } else { - try { - return pm.getApplicationInfo(imi.getPackageName(), 0).loadIcon(pm); - } catch (PackageManager.NameNotFoundException e) { - Log.w(TAG, "IME can't be found: " + imi.getPackageName()); - } - } - } - return null; - } - // Display IME switcher icon only when all of the followings are true: // * There is only one enabled IME on the device. (Note that the IME should be the system IME) // * There are no explicitly enabled (by the user) subtypes of the IME, or the IME doesn't have // its subtypes at all private boolean needsToShowIMEButton() { - if (!mKeyboardVisible || mScreenLocked) return false; + if (!mShowButton || mScreenLocked) return false; + + if (mHardKeyboardAvailable) { + return true; + } + List<InputMethodInfo> imis = mImm.getEnabledInputMethodList(); final int size = imis.size(); final int visibility = loadInputMethodSelectorVisibility(); @@ -170,17 +100,7 @@ public class InputMethodButton extends ImageView { } else { setVisibility(View.VISIBLE); } - Drawable icon = null; - switch (mId) { - case ID_IME_SHORTCUT_BUTTON: - icon = getShortcutInputMethodAndSubtypeDrawable(); - break; - } - if (icon == null) { - mIcon.setImageResource(R.drawable.ic_sysbar_ime); - } else { - mIcon.setImageDrawable(icon); - } + mIcon.setImageResource(R.drawable.ic_sysbar_ime); } private int loadInputMethodSelectorVisibility() { @@ -194,12 +114,19 @@ public class InputMethodButton extends ImageView { } } - public void setIMEButtonVisible(IBinder token, boolean keyboardVisible) { + public void setImeWindowStatus(IBinder token, boolean showButton) { mToken = token; - mKeyboardVisible = keyboardVisible; + mShowButton = showButton; refreshStatusIcon(); } + public void setHardKeyboardStatus(boolean available) { + if (mHardKeyboardAvailable != available) { + mHardKeyboardAvailable = available; + refreshStatusIcon(); + } + } + public void setScreenLocked(boolean locked) { mScreenLocked = locked; refreshStatusIcon(); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java index a1cc274..b1e74ad 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/InputMethodsPanel.java @@ -16,6 +16,8 @@ package com.android.systemui.statusbar.tablet; +import com.android.systemui.R; + import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -29,13 +31,13 @@ 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.Switch; import android.widget.TextView; import java.util.Comparator; @@ -45,9 +47,8 @@ import java.util.Map; import java.util.Set; import java.util.TreeMap; -import com.android.systemui.R; - -public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, OnClickListener { +public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, + View.OnClickListener { private static final boolean DEBUG = TabletStatusBar.DEBUG; private static final String TAG = "InputMethodsPanel"; @@ -73,11 +74,18 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O private IBinder mToken; private InputMethodButton mInputMethodSwitchButton; private LinearLayout mInputMethodMenuList; + private boolean mHardKeyboardAvailable; + private boolean mHardKeyboardEnabled; + private OnHardKeyboardEnabledChangeListener mHardKeyboardEnabledChangeListener; + private LinearLayout mHardKeyboardSection; + private Switch mHardKeyboardSwitch; private PackageManager mPackageManager; private String mEnabledInputMethodAndSubtypesCacheStr; + private String mLastSystemLocaleString; private View mConfigureImeShortcut; private class InputMethodComparator implements Comparator<InputMethodInfo> { + @Override public int compare(InputMethodInfo imi1, InputMethodInfo imi2) { if (imi2 == null) return 0; if (imi1 == null) return 1; @@ -106,6 +114,11 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O mIntentFilter.addDataScheme("package"); } + public void setHardKeyboardEnabledChangeListener( + OnHardKeyboardEnabledChangeListener listener) { + mHardKeyboardEnabledChangeListener = listener; + } + @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); @@ -127,7 +140,9 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O @Override public void onFinishInflate() { mInputMethodMenuList = (LinearLayout) findViewById(R.id.input_method_menu_list); - mConfigureImeShortcut = ((View) findViewById(R.id.ime_settings_shortcut)); + mHardKeyboardSection = (LinearLayout) findViewById(R.id.hard_keyboard_section); + mHardKeyboardSwitch = (Switch) findViewById(R.id.hard_keyboard_switch); + mConfigureImeShortcut = findViewById(R.id.ime_settings_shortcut); mConfigureImeShortcut.setOnClickListener(this); // TODO: If configurations for IME are not changed, do not update // by checking onConfigurationChanged. @@ -140,36 +155,41 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O } @Override - protected void onVisibilityChanged(View changedView, int visibility) { - super.onVisibilityChanged(changedView, visibility); - if (changedView == this) { - if (visibility == View.VISIBLE) { - updateUiElements(); - if (mInputMethodSwitchButton != null) { - mInputMethodSwitchButton.setIconImage(R.drawable.ic_sysbar_ime_pressed); - } - } else { - if (mInputMethodSwitchButton != null) { - mInputMethodSwitchButton.setIconImage(R.drawable.ic_sysbar_ime); - } + public void onClick(View view) { + if (view == mConfigureImeShortcut) { + showConfigureInputMethods(); + closePanel(true); + } + } + + private void updateHardKeyboardEnabled() { + if (mHardKeyboardAvailable) { + final boolean checked = mHardKeyboardSwitch.isChecked(); + if (mHardKeyboardEnabled != checked) { + mHardKeyboardEnabled = checked; + if (mHardKeyboardEnabledChangeListener != null) + mHardKeyboardEnabledChangeListener.onHardKeyboardEnabledChange(checked); } } } - @Override - public void onClick(View view) { - if (view == mConfigureImeShortcut) { - showConfigureInputMethods(); - onFinishPanel(true); - return; + public void openPanel() { + setVisibility(View.VISIBLE); + updateUiElements(); + if (mInputMethodSwitchButton != null) { + mInputMethodSwitchButton.setIconImage(R.drawable.ic_sysbar_ime_pressed); } } - private void onFinishPanel(boolean closeKeyboard) { + public void closePanel(boolean closeKeyboard) { setVisibility(View.GONE); + if (mInputMethodSwitchButton != null) { + mInputMethodSwitchButton.setIconImage(R.drawable.ic_sysbar_ime); + } if (closeKeyboard) { mImm.hideSoftInputFromWindow(getWindowToken(), 0); } + updateHardKeyboardEnabled(); } private void startActivity(Intent intent) { @@ -215,7 +235,7 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED | Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); - onFinishPanel(true); + closePanel(true); } }); } else { @@ -227,10 +247,10 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O subtypeView, new Pair<InputMethodInfo, InputMethodSubtype> (imi, subtype)); subtypeView.setOnClickListener(new View.OnClickListener() { @Override - public void onClick(View view) { + public void onClick(View v) { Pair<InputMethodInfo, InputMethodSubtype> imiAndSubtype = - updateRadioButtonsByView(view); - onFinishPanel(false); + updateRadioButtonsByView(v); + closePanel(false); setInputMethodAndSubtype(imiAndSubtype.first, imiAndSubtype.second); } }); @@ -238,6 +258,8 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O } private void updateUiElements() { + updateHardKeyboardSection(); + // TODO: Reuse subtype views. mInputMethodMenuList.removeAllViews(); mRadioViewAndImiMap.clear(); @@ -277,6 +299,25 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O } } + public void setHardKeyboardStatus(boolean available, boolean enabled) { + if (mHardKeyboardAvailable != available || mHardKeyboardEnabled != enabled) { + mHardKeyboardAvailable = available; + mHardKeyboardEnabled = enabled; + updateHardKeyboardSection(); + } + } + + private void updateHardKeyboardSection() { + if (mHardKeyboardAvailable) { + mHardKeyboardSection.setVisibility(View.VISIBLE); + if (mHardKeyboardSwitch.isChecked() != mHardKeyboardEnabled) { + mHardKeyboardSwitch.setChecked(mHardKeyboardEnabled); + } + } else { + mHardKeyboardSection.setVisibility(View.GONE); + } + } + // Turn on the selected radio button when the user chooses the item private Pair<InputMethodInfo, InputMethodSubtype> updateRadioButtonsByView(View selectedView) { Pair<InputMethodInfo, InputMethodSubtype> selectedImiAndSubtype = null; @@ -335,8 +376,10 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O getEnabledInputMethodAndSubtypeList() { String newEnabledIMIs = Settings.Secure.getString( mContext.getContentResolver(), Settings.Secure.ENABLED_INPUT_METHODS); - if (mEnabledInputMethodAndSubtypesCacheStr == null - || !mEnabledInputMethodAndSubtypesCacheStr.equals(newEnabledIMIs) + String currentSystemLocaleString = + mContext.getResources().getConfiguration().locale.toString(); + if (!TextUtils.equals(mEnabledInputMethodAndSubtypesCacheStr, newEnabledIMIs) + || !TextUtils.equals(mLastSystemLocaleString, currentSystemLocaleString) || mPackageChanged) { mEnabledInputMethodAndSubtypesCache.clear(); final List<InputMethodInfo> imis = mImm.getEnabledInputMethodList(); @@ -346,6 +389,7 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O } mEnabledInputMethodAndSubtypesCacheStr = newEnabledIMIs; mPackageChanged = false; + mLastSystemLocaleString = currentSystemLocaleString; } return mEnabledInputMethodAndSubtypesCache; } @@ -419,4 +463,8 @@ public class InputMethodsPanel extends LinearLayout implements StatusBarPanel, O } mPackageChanged = true; } + + public interface OnHardKeyboardEnabledChangeListener { + public void onHardKeyboardEnabledChange(boolean enabled); + } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationIconArea.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationIconArea.java index df29f95..3d6c1a2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationIconArea.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationIconArea.java @@ -23,13 +23,14 @@ import android.util.AttributeSet; import android.util.Slog; import android.view.View; import android.widget.LinearLayout; +import android.widget.RelativeLayout; import android.widget.ImageView; import android.view.MotionEvent; import com.android.systemui.R; -public class NotificationIconArea extends LinearLayout { +public class NotificationIconArea extends RelativeLayout { private static final String TAG = "NotificationIconArea"; IconLayout mIconLayout; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java index 372aa90..2ec2af0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/NotificationPanel.java @@ -170,7 +170,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, setContentFrameVisible(n > 0, false); } else if (mSettingsView == null) { // we're looking at the notifications; time to maybe make some changes - if (mNotificationCount != n) { + if ((mNotificationCount > 0) != (n > 0)) { setContentFrameVisible(n > 0, true); } } @@ -320,7 +320,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, if (mNotificationCount == 0) { end += mContentFrameMissingTranslation; } - start = (y < (HYPERSPACE_OFFRAMP+end)) ? y : (HYPERSPACE_OFFRAMP+end); + start = HYPERSPACE_OFFRAMP+end; } else { start = y; end = y + HYPERSPACE_OFFRAMP; @@ -336,10 +336,15 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel, mContentAnim.cancel(); } + Animator fadeAnim = ObjectAnimator.ofFloat(mContentParent, "alpha", + mContentParent.getAlpha(), appearing ? 1.0f : 0.0f); + fadeAnim.setInterpolator(appearing + ? new android.view.animation.AccelerateInterpolator(2.0f) + : new android.view.animation.DecelerateInterpolator(2.0f)); + mContentAnim = new AnimatorSet(); mContentAnim - .play(ObjectAnimator.ofFloat(mContentParent, "alpha", - mContentParent.getAlpha(), appearing ? 1.0f : 0.0f)) + .play(fadeAnim) .with(bgAnim) .with(posAnim) ; 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 14a2f90..4373dba 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBar.java @@ -19,12 +19,9 @@ package com.android.systemui.statusbar.tablet; import java.io.FileDescriptor; import java.io.PrintWriter; import java.util.ArrayList; -import java.util.Map; -import java.util.IdentityHashMap; import android.animation.LayoutTransition; import android.animation.ObjectAnimator; -import android.animation.AnimatorSet; import android.app.ActivityManagerNative; import android.app.PendingIntent; import android.app.Notification; @@ -33,9 +30,9 @@ import android.content.Context; import android.content.Intent; import android.content.res.Configuration; import android.content.res.Resources; +import android.inputmethodservice.InputMethodService; import android.graphics.PixelFormat; import android.graphics.Rect; -import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; import android.os.Handler; import android.os.IBinder; @@ -44,8 +41,6 @@ import android.os.RemoteException; import android.os.ServiceManager; import android.text.TextUtils; import android.util.Slog; -import android.view.animation.Animation; -import android.view.animation.AnimationUtils; import android.view.Gravity; import android.view.IWindowManager; import android.view.KeyEvent; @@ -57,12 +52,10 @@ import android.view.ViewConfiguration; import android.view.ViewGroup; import android.view.WindowManager; import android.view.WindowManagerImpl; -import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.RemoteViews; import android.widget.ScrollView; -import android.widget.TextSwitcher; import android.widget.TextView; import com.android.internal.statusbar.StatusBarIcon; @@ -75,7 +68,8 @@ import com.android.systemui.statusbar.policy.NetworkController; import com.android.systemui.recent.RecentApplicationsActivity; public class TabletStatusBar extends StatusBar implements - HeightReceiver.OnBarHeightChangedListener { + HeightReceiver.OnBarHeightChangedListener, + InputMethodsPanel.OnHardKeyboardEnabledChangeListener { public static final boolean DEBUG = false; public static final String TAG = "TabletStatusBar"; @@ -93,12 +87,11 @@ public class TabletStatusBar extends StatusBar implements 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; + public static final int MSG_STOP_TICKER = 2000; // Fitts' Law assistance for LatinIME; TODO: replace with a more general approach private static final boolean FAKE_SPACE_BAR = true; - public static final int LIGHTS_ON_DELAY = 5000; - // The height of the bar, as definied by the build. It may be taller if we're plugged // into hdmi. int mNaturalBarHeight = -1; @@ -269,7 +262,7 @@ public class TabletStatusBar extends StatusBar implements // Input methods Panel mInputMethodsPanel = (InputMethodsPanel) View.inflate(context, R.layout.status_bar_input_methods_panel, null); - mInputMethodsPanel.setVisibility(View.GONE); + mInputMethodsPanel.setHardKeyboardEnabledChangeListener(this); mInputMethodsPanel.setOnTouchListener(new TouchOutsideListener( MSG_CLOSE_INPUT_METHODS_PANEL, mInputMethodsPanel)); mInputMethodsPanel.setImeSwitchButton(mInputMethodSwitchButton); @@ -369,8 +362,8 @@ public class TabletStatusBar extends StatusBar implements (ImageView)sb.findViewById(R.id.network_type)); // The navigation buttons + mBackButton = (ImageView)sb.findViewById(R.id.back); mNavigationArea = sb.findViewById(R.id.navigationArea); - mBackButton = (ImageView)mNavigationArea.findViewById(R.id.back); mHomeButton = mNavigationArea.findViewById(R.id.home); mMenuButton = mNavigationArea.findViewById(R.id.menu); mRecentButton = mNavigationArea.findViewById(R.id.recent_apps); @@ -391,6 +384,12 @@ public class TabletStatusBar extends StatusBar implements new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent ev) { if (ev.getAction() == MotionEvent.ACTION_DOWN) { + // even though setting the systemUI visibility below will turn these views + // on, we need them to come up faster so that they can catch this motion + // event + mShadow.setVisibility(View.GONE); + mBarContents.setVisibility(View.VISIBLE); + try { mBarService.setSystemUiVisibility(View.STATUS_BAR_VISIBLE); } catch (RemoteException ex) { @@ -557,11 +556,11 @@ public class TabletStatusBar extends StatusBar implements break; case MSG_OPEN_INPUT_METHODS_PANEL: if (DEBUG) Slog.d(TAG, "opening input methods panel"); - if (mInputMethodsPanel != null) mInputMethodsPanel.setVisibility(View.VISIBLE); + if (mInputMethodsPanel != null) mInputMethodsPanel.openPanel(); break; case MSG_CLOSE_INPUT_METHODS_PANEL: if (DEBUG) Slog.d(TAG, "closing input methods panel"); - if (mInputMethodsPanel != null) mInputMethodsPanel.setVisibility(View.GONE); + if (mInputMethodsPanel != null) mInputMethodsPanel.closePanel(false); break; case MSG_SHOW_CHROME: if (DEBUG) Slog.d(TAG, "hiding shadows (lights on)"); @@ -576,6 +575,9 @@ public class TabletStatusBar extends StatusBar implements mShadow.setVisibility(View.VISIBLE); notifyLightsChanged(false); break; + case MSG_STOP_TICKER: + mTicker.halt(); + break; } } } @@ -788,6 +790,18 @@ public class TabletStatusBar extends StatusBar implements mInputMethodSwitchButton.setScreenLocked(false); } } + if ((diff & StatusBarManager.DISABLE_BACK) != 0) { + if ((state & StatusBarManager.DISABLE_BACK) != 0) { + Slog.i(TAG, "DISABLE_BACK: yes"); + mBackButton.setVisibility(View.INVISIBLE); + mInputMethodSwitchButton.setScreenLocked(true); + } else { + Slog.i(TAG, "DISABLE_BACK: no"); + mBackButton.setVisibility(View.VISIBLE); + mInputMethodSwitchButton.setScreenLocked(false); + } + } + } private boolean hasTicker(Notification n) { @@ -859,17 +873,51 @@ public class TabletStatusBar extends StatusBar implements if (visible) setLightsOn(true); } - public void setIMEButtonVisible(IBinder token, boolean visible) { - if (DEBUG) { - Slog.d(TAG, (visible?"showing":"hiding") + " the IME button"); - } - mInputMethodSwitchButton.setIMEButtonVisible(token, visible); + public void setImeWindowStatus(IBinder token, int vis, int backDisposition) { + mInputMethodSwitchButton.setImeWindowStatus(token, + (vis & InputMethodService.IME_ACTIVE) != 0); updateNotificationIcons(); mInputMethodsPanel.setImeToken(token); - mBackButton.setImageResource( - visible ? R.drawable.ic_sysbar_back_ime : R.drawable.ic_sysbar_back); + int res; + switch (backDisposition) { + case InputMethodService.BACK_DISPOSITION_WILL_NOT_DISMISS: + res = R.drawable.ic_sysbar_back; + break; + case InputMethodService.BACK_DISPOSITION_WILL_DISMISS: + res = R.drawable.ic_sysbar_back_ime; + break; + case InputMethodService.BACK_DISPOSITION_DEFAULT: + default: + if ((vis & InputMethodService.IME_VISIBLE) != 0) { + res = R.drawable.ic_sysbar_back_ime; + } else { + res = R.drawable.ic_sysbar_back; + } + break; + } + mBackButton.setImageResource(res); if (FAKE_SPACE_BAR) { - mFakeSpaceBar.setVisibility(visible ? View.VISIBLE : View.GONE); + mFakeSpaceBar.setVisibility(((vis & InputMethodService.IME_VISIBLE) != 0) + ? View.VISIBLE : View.GONE); + } + } + + @Override + public void setHardKeyboardStatus(boolean available, boolean enabled) { + if (DEBUG) { + Slog.d(TAG, "Set hard keyboard status: available=" + available + + ", enabled=" + enabled); + } + mInputMethodSwitchButton.setHardKeyboardStatus(available); + updateNotificationIcons(); + mInputMethodsPanel.setHardKeyboardStatus(available, enabled); + } + + @Override + public void onHardKeyboardEnabledChange(boolean enabled) { + try { + mBarService.setHardKeyboardEnabled(enabled); + } catch (RemoteException ex) { } } 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 98f718b..4e2faf7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletStatusBarView.java @@ -51,6 +51,8 @@ public class TabletStatusBarView extends FrameLayout { mHandler.sendEmptyMessage(TabletStatusBar.MSG_CLOSE_RECENTS_PANEL); mHandler.removeMessages(TabletStatusBar.MSG_CLOSE_INPUT_METHODS_PANEL); mHandler.sendEmptyMessage(TabletStatusBar.MSG_CLOSE_INPUT_METHODS_PANEL); + mHandler.removeMessages(TabletStatusBar.MSG_STOP_TICKER); + mHandler.sendEmptyMessage(TabletStatusBar.MSG_STOP_TICKER); for (int i=0; i < mPanels.length; i++) { if (mPanels[i] != null && mPanels[i].getVisibility() == View.VISIBLE) { diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java index 5184462..a072aed 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/TabletTicker.java @@ -53,7 +53,7 @@ public class TabletTicker private static final String TAG = "StatusBar.TabletTicker"; - private static final boolean CLICKABLE_TICKER = false; + private static final boolean CLICKABLE_TICKER = true; // 3 is enough to let us see most cases, but not get so far behind that it's too annoying. private static final int QUEUE_LENGTH = 3; @@ -300,8 +300,16 @@ public class TabletTicker if (CLICKABLE_TICKER) { PendingIntent contentIntent = notification.notification.contentIntent; if (contentIntent != null) { - group.setOnClickListener(mBar.makeClicker(contentIntent, - notification.pkg, notification.tag, notification.id)); + // create the usual notification clicker, but chain it together with a halt() call + // to abort the ticker too + final View.OnClickListener clicker = mBar.makeClicker(contentIntent, + notification.pkg, notification.tag, notification.id); + group.setOnClickListener(new View.OnClickListener() { + public void onClick(View v) { + halt(); + clicker.onClick(v); + } + }); } else { group.setOnClickListener(null); } diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java b/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java index 6b52454..36afd75 100644 --- a/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java +++ b/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java @@ -50,6 +50,8 @@ public abstract class KeyguardViewBase extends FrameLayout { public KeyguardViewBase(Context context) { super(context); + setSystemUiVisibility(STATUS_BAR_DISABLE_BACK); + // This is a faster way to draw the background on devices without hardware acceleration setBackgroundDrawable(new Drawable() { @Override @@ -235,4 +237,9 @@ public abstract class KeyguardViewBase extends FrameLayout { return false; } + @Override + public void dispatchSystemUiVisibilityChanged(int visibility) { + super.dispatchSystemUiVisibilityChanged(visibility); + setSystemUiVisibility(STATUS_BAR_DISABLE_BACK); + } } diff --git a/policy/src/com/android/internal/policy/impl/StatusView.java b/policy/src/com/android/internal/policy/impl/StatusView.java index 1732adb..da7bbb8 100644 --- a/policy/src/com/android/internal/policy/impl/StatusView.java +++ b/policy/src/com/android/internal/policy/impl/StatusView.java @@ -19,10 +19,10 @@ import android.view.View; import android.widget.TextView; class StatusView { - public static final int LOCK_ICON = R.drawable.ic_lock_idle_lock; - public static final int ALARM_ICON = R.drawable.ic_lock_idle_alarm; - public static final int CHARGING_ICON = R.drawable.ic_lock_idle_charging; - public static final int BATTERY_LOW_ICON = R.drawable.ic_lock_idle_low_battery; + public static final int LOCK_ICON = 0; // R.drawable.ic_lock_idle_lock; + public static final int ALARM_ICON = 0; // R.drawable.ic_lock_idle_alarm; + public static final int CHARGING_ICON = 0; //R.drawable.ic_lock_idle_charging; + public static final int BATTERY_LOW_ICON = 0; //R.drawable.ic_lock_idle_low_battery; private String mDateFormatString; diff --git a/services/audioflinger/AudioPolicyManagerBase.cpp b/services/audioflinger/AudioPolicyManagerBase.cpp index 18abc0b..e84d136 100644 --- a/services/audioflinger/AudioPolicyManagerBase.cpp +++ b/services/audioflinger/AudioPolicyManagerBase.cpp @@ -1893,7 +1893,8 @@ float AudioPolicyManagerBase::computeVolume(int stream, int index, audio_io_hand AudioSystem::DEVICE_OUT_WIRED_HEADPHONE | AudioSystem::DEVICE_OUT_ANLG_DOCK_HEADSET | AudioSystem::DEVICE_OUT_DGTL_DOCK_HEADSET)) && - (getStrategy((AudioSystem::stream_type)stream) == STRATEGY_SONIFICATION) && + ((getStrategy((AudioSystem::stream_type)stream) == STRATEGY_SONIFICATION) || + (stream == AudioSystem::SYSTEM)) && streamDesc.mCanBeMuted) { volume *= SONIFICATION_HEADSET_VOLUME_FACTOR; // when the phone is ringing we must consider that music could have been paused just before diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java index 0147b1a..6636fb7 100644 --- a/services/java/com/android/server/InputMethodManagerService.java +++ b/services/java/com/android/server/InputMethodManagerService.java @@ -49,6 +49,7 @@ import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.TypedArray; import android.database.ContentObserver; +import android.inputmethodservice.InputMethodService; import android.os.Binder; import android.os.Handler; import android.os.IBinder; @@ -59,6 +60,7 @@ import android.os.RemoteException; import android.os.ResultReceiver; import android.os.ServiceManager; import android.os.SystemClock; +import android.os.SystemProperties; import android.provider.Settings; import android.provider.Settings.Secure; import android.provider.Settings.SettingNotFoundException; @@ -311,6 +313,10 @@ public class InputMethodManagerService extends IInputMethodManager.Stub */ boolean mScreenOn = true; + int mBackDisposition = InputMethodService.BACK_DISPOSITION_DEFAULT; + int mImeWindowVis; + long mOldSystemSettingsVersion; + AlertDialog.Builder mDialogBuilder; AlertDialog mSwitchingDialog; InputMethodInfo[] mIms; @@ -430,7 +436,9 @@ 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); + mImeWindowVis = 0; + mStatusBar.setImeWindowStatus(mCurToken, mImeWindowVis, + mBackDisposition); if (!chooseNewDefaultIMELocked()) { changed = true; curIm = null; @@ -480,6 +488,8 @@ public class InputMethodManagerService extends IInputMethodManager.Stub handleMessage(msg); } }); + // Initialize the system settings version to undefined. + mOldSystemSettingsVersion = -1; (new MyPackageMonitor()).register(mContext, true); @@ -982,24 +992,34 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } } - public void setIMEButtonVisible(IBinder token, boolean visible) { + public void setImeWindowStatus(IBinder token, int vis, int backDisposition) { int uid = Binder.getCallingUid(); long ident = Binder.clearCallingIdentity(); try { if (token == null || mCurToken != token) { - Slog.w(TAG, "Ignoring setIMEButtonVisible of uid " + uid + " token: " + token); + Slog.w(TAG, "Ignoring setImeWindowStatus of uid " + uid + " token: " + token); return; } synchronized (mMethodMap) { - mStatusBar.setIMEButtonVisible(token, visible); + mImeWindowVis = vis; + mBackDisposition = backDisposition; + mStatusBar.setImeWindowStatus(token, vis, backDisposition); } } finally { Binder.restoreCallingIdentity(ident); } } + // TODO: Investigate and fix why are settings changes getting processed before the settings seq + // number is updated? + // TODO: Change this stuff to not rely on modifying settings for normal user interactions. void updateFromSettingsLocked() { + long newSystemSettingsVersion = getSystemSettingsVersion(); + // This is a workaround to avoid a situation that old cached value in Settings.Secure + // will be handled. + if (newSystemSettingsVersion == mOldSystemSettingsVersion) return; + // We are assuming that whoever is changing DEFAULT_INPUT_METHOD and // ENABLED_INPUT_METHODS is taking care of keeping them correctly in // sync, so we will never have a DEFAULT_INPUT_METHOD that is not @@ -1045,12 +1065,17 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } if (mCurMethod != null) { try { - if (mInputShown) { - // If mInputShown is false, there is no IME button on the - // system bar. - // Thus there is no need to make it invisible explicitly. - mStatusBar.setIMEButtonVisible(mCurToken, true); - } + final Configuration conf = mRes.getConfiguration(); + final boolean haveHardKeyboard = conf.keyboard + != Configuration.KEYBOARD_NOKEYS; + final boolean hardKeyShown = haveHardKeyboard + && conf.hardKeyboardHidden + != Configuration.HARDKEYBOARDHIDDEN_YES; + mImeWindowVis = (mInputShown || hardKeyShown) ? ( + InputMethodService.IME_ACTIVE | InputMethodService.IME_VISIBLE) + : 0; + mStatusBar.setImeWindowStatus(mCurToken, mImeWindowVis, + mBackDisposition); // If subtype is null, try to find the most applicable one from // getCurrentInputMethodSubtype. if (subtype == null) { @@ -1168,11 +1193,14 @@ public class InputMethodManagerService extends IInputMethodManager.Stub if (!mIWindowManager.inputMethodClientHasFocus(client)) { if (DEBUG) Slog.w(TAG, "Ignoring hideSoftInput of uid " + uid + ": " + client); - mStatusBar.setIMEButtonVisible(mCurToken, false); + mImeWindowVis = 0; + mStatusBar.setImeWindowStatus(mCurToken, mImeWindowVis, + mBackDisposition); return false; } } catch (RemoteException e) { - mStatusBar.setIMEButtonVisible(mCurToken, false); + mImeWindowVis = 0; + mStatusBar.setImeWindowStatus(mCurToken, mImeWindowVis, mBackDisposition); return false; } } @@ -1942,6 +1970,7 @@ public class InputMethodManagerService extends IInputMethodManager.Stub private void setSelectedInputMethodAndSubtypeLocked(InputMethodInfo imi, int subtypeId, boolean setSubtypeOnly) { + mOldSystemSettingsVersion = getSystemSettingsVersion(); // Update the history of InputMethod and Subtype saveCurrentInputMethodAndSubtypeToHistory(); @@ -2191,6 +2220,10 @@ public class InputMethodManagerService extends IInputMethodManager.Stub } } + private static long getSystemSettingsVersion() { + return SystemProperties.getLong(Settings.Secure.SYS_PROP_SETTING_VERSION, 0); + } + /** * @return Return the current subtype of this input method. */ diff --git a/services/java/com/android/server/IntentResolver.java b/services/java/com/android/server/IntentResolver.java index a8b2840..e9ee12c 100644 --- a/services/java/com/android/server/IntentResolver.java +++ b/services/java/com/android/server/IntentResolver.java @@ -27,6 +27,8 @@ import java.util.List; import java.util.Map; import java.util.Set; +import android.net.Uri; +import android.util.FastImmutableArraySet; import android.util.Log; import android.util.PrintWriterPrinter; import android.util.Slog; @@ -207,10 +209,11 @@ public class IntentResolver<F extends IntentFilter, R extends Object> { final boolean debug = localLOGV || ((intent.getFlags() & Intent.FLAG_DEBUG_LOG_RESOLUTION) != 0); + FastImmutableArraySet<String> categories = getFastIntentCategories(intent); final String scheme = intent.getScheme(); int N = listCut.size(); for (int i = 0; i < N; ++i) { - buildResolveList(intent, debug, defaultOnly, + buildResolveList(intent, categories, debug, defaultOnly, resolvedType, scheme, listCut.get(i), resultList); } sortResults(resultList); @@ -286,20 +289,21 @@ public class IntentResolver<F extends IntentFilter, R extends Object> { if (debug) Slog.v(TAG, "Action list: " + firstTypeCut); } + FastImmutableArraySet<String> categories = getFastIntentCategories(intent); if (firstTypeCut != null) { - buildResolveList(intent, debug, defaultOnly, + buildResolveList(intent, categories, debug, defaultOnly, resolvedType, scheme, firstTypeCut, finalList); } if (secondTypeCut != null) { - buildResolveList(intent, debug, defaultOnly, + buildResolveList(intent, categories, debug, defaultOnly, resolvedType, scheme, secondTypeCut, finalList); } if (thirdTypeCut != null) { - buildResolveList(intent, debug, defaultOnly, + buildResolveList(intent, categories, debug, defaultOnly, resolvedType, scheme, thirdTypeCut, finalList); } if (schemeCut != null) { - buildResolveList(intent, debug, defaultOnly, + buildResolveList(intent, categories, debug, defaultOnly, resolvedType, scheme, schemeCut, finalList); } sortResults(finalList); @@ -478,9 +482,19 @@ public class IntentResolver<F extends IntentFilter, R extends Object> { return false; } - private void buildResolveList(Intent intent, boolean debug, boolean defaultOnly, + private static FastImmutableArraySet<String> getFastIntentCategories(Intent intent) { + final Set<String> categories = intent.getCategories(); + if (categories == null) { + return null; + } + return new FastImmutableArraySet<String>(categories.toArray(new String[categories.size()])); + } + + private void buildResolveList(Intent intent, FastImmutableArraySet<String> categories, + boolean debug, boolean defaultOnly, String resolvedType, String scheme, List<F> src, List<R> dest) { - Set<String> categories = intent.getCategories(); + final String action = intent.getAction(); + final Uri data = intent.getData(); final int N = src != null ? src.size() : 0; boolean hasNonDefaults = false; @@ -498,8 +512,7 @@ public class IntentResolver<F extends IntentFilter, R extends Object> { continue; } - match = filter.match( - intent.getAction(), resolvedType, scheme, intent.getData(), categories, TAG); + match = filter.match(action, resolvedType, scheme, data, categories, TAG); if (match >= 0) { if (debug) Slog.v(TAG, " Filter matched! match=0x" + Integer.toHexString(match)); diff --git a/services/java/com/android/server/MountService.java b/services/java/com/android/server/MountService.java index 3101222..436eff0 100644 --- a/services/java/com/android/server/MountService.java +++ b/services/java/com/android/server/MountService.java @@ -46,6 +46,7 @@ import android.os.storage.IMountShutdownObserver; import android.os.storage.IObbActionListener; import android.os.storage.OnObbStateChangeListener; import android.os.storage.StorageResultCode; +import android.text.TextUtils; import android.util.Slog; import java.io.FileDescriptor; @@ -1632,8 +1633,8 @@ class MountService extends IMountService.Stub implements INativeDaemonConnectorC } public int decryptStorage(String password) { - if (password == null) { - throw new IllegalArgumentException("password cannot be null"); + if (TextUtils.isEmpty(password)) { + throw new IllegalArgumentException("password cannot be empty"); } mContext.enforceCallingOrSelfPermission(Manifest.permission.CRYPT_KEEPER, @@ -1647,13 +1648,13 @@ class MountService extends IMountService.Stub implements INativeDaemonConnectorC try { ArrayList<String> rsp = mConnector.doCommand("cryptfs checkpw " + password); - String []tok = rsp.get(0).split(" "); + String[] tokens = rsp.get(0).split(" "); - if (tok == null || tok.length != 2) { + if (tokens == null || tokens.length != 2) { return -1; } - int code = Integer.parseInt(tok[1]); + int code = Integer.parseInt(tokens[1]); if (code == 0) { // Decrypt was successful. Post a delayed message before restarting in order @@ -1662,7 +1663,7 @@ class MountService extends IMountService.Stub implements INativeDaemonConnectorC public void run() { mConnector.doCommand(String.format("cryptfs restart")); } - }, 2000); // 2 seconds + }, 1000); // 1 second } return code; @@ -1673,8 +1674,8 @@ class MountService extends IMountService.Stub implements INativeDaemonConnectorC } public int encryptStorage(String password) { - if (password == null) { - throw new IllegalArgumentException("password cannot be null"); + if (TextUtils.isEmpty(password)) { + throw new IllegalArgumentException("password cannot be empty"); } mContext.enforceCallingOrSelfPermission(Manifest.permission.CRYPT_KEEPER, @@ -1696,6 +1697,36 @@ class MountService extends IMountService.Stub implements INativeDaemonConnectorC return 0; } + public int changeEncryptionPassword(String password) { + if (TextUtils.isEmpty(password)) { + throw new IllegalArgumentException("password cannot be empty"); + } + + mContext.enforceCallingOrSelfPermission(Manifest.permission.CRYPT_KEEPER, + "no permission to access the crypt keeper"); + + waitForReady(); + + if (DEBUG_EVENTS) { + Slog.i(TAG, "changing encryption password..."); + } + + try { + ArrayList<String> response = mConnector.doCommand("cryptfs changepw " + password); + + String[] tokens = response.get(0).split(" "); + + if (tokens == null || tokens.length != 2) { + return -1; + } + + return Integer.parseInt(tokens[1]); + } catch (NativeDaemonConnectorException e) { + // Encryption failed + return e.getCode(); + } + } + private void addObbStateLocked(ObbState obbState) throws RemoteException { final IBinder binder = obbState.getBinder(); List<ObbState> obbStates = mObbMounts.get(binder); diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java index 5806de2..9ee71e8 100644 --- a/services/java/com/android/server/PackageManagerService.java +++ b/services/java/com/android/server/PackageManagerService.java @@ -2924,26 +2924,6 @@ class PackageManagerService extends IPackageManager.Stub { } } - if (pkg.reqFeatures != null) { - int N = pkg.reqFeatures.size(); - for (int i = 0; i < N; i++) { - FeatureInfo fi = pkg.reqFeatures.get(i); - if ((fi.flags & FeatureInfo.FLAG_REQUIRED) == 0) { - // Don't care. - continue; - } - - if (fi.name != null) { - if (mAvailableFeatures.get(fi.name) == null) { - Slog.e(TAG, "Package " + pkg.packageName - + " requires unavailable feature " + fi.name + "; failing!"); - mLastScanError = PackageManager.INSTALL_FAILED_MISSING_FEATURE; - return null; - } - } - } - } - if (pkg.mSharedUserId != null) { suid = mSettings.getSharedUserLP(pkg.mSharedUserId, pkg.applicationInfo.flags, true); diff --git a/services/java/com/android/server/StatusBarManagerService.java b/services/java/com/android/server/StatusBarManagerService.java index bdaa3b0..5ada77b 100644 --- a/services/java/com/android/server/StatusBarManagerService.java +++ b/services/java/com/android/server/StatusBarManagerService.java @@ -53,11 +53,13 @@ import java.util.Map; * if they are local, that they just enqueue messages to not deadlock. */ public class StatusBarManagerService extends IStatusBarService.Stub + implements WindowManagerService.OnHardKeyboardStatusChangeListener { static final String TAG = "StatusBarManagerService"; static final boolean SPEW = false; final Context mContext; + final WindowManagerService mWindowManager; Handler mHandler = new Handler(); NotificationCallbacks mNotificationCallbacks; volatile IStatusBar mBar; @@ -67,14 +69,16 @@ public class StatusBarManagerService extends IStatusBarService.Stub // for disabling the status bar ArrayList<DisableRecord> mDisableRecords = new ArrayList<DisableRecord>(); + IBinder mSysUiVisToken = new Binder(); int mDisabled = 0; Object mLock = new Object(); // We usually call it lights out mode, but double negatives are annoying boolean mLightsOn = true; boolean mMenuVisible = false; - boolean mIMEButtonVisible = false; - IBinder mIMEToken = null; + int mImeWindowVis = 0; + int mImeBackDisposition; + IBinder mImeToken = null; private class DisableRecord implements IBinder.DeathRecipient { String pkg; @@ -101,8 +105,10 @@ public class StatusBarManagerService extends IStatusBarService.Stub /** * Construct the service, add the status bar view to the window manager */ - public StatusBarManagerService(Context context) { + public StatusBarManagerService(Context context, WindowManagerService windowManager) { mContext = context; + mWindowManager = windowManager; + mWindowManager.setOnHardKeyboardStatusChangeListener(this); final Resources res = context.getResources(); mIcons.defineSlots(res.getStringArray(com.android.internal.R.array.config_statusBarIcons)); @@ -140,25 +146,29 @@ public class StatusBarManagerService extends IStatusBarService.Stub public void disable(int what, IBinder token, String pkg) { enforceStatusBar(); + synchronized (mLock) { + disableLocked(what, token, pkg); + } + } + + private void disableLocked(int what, IBinder token, String pkg) { // It's important that the the callback and the call to mBar get done // in the same order when multiple threads are calling this function // so they are paired correctly. The messages on the handler will be // handled in the order they were enqueued, but will be outside the lock. - synchronized (mDisableRecords) { - manageDisableListLocked(what, token, pkg); - final int net = gatherDisableActionsLocked(); - if (net != mDisabled) { - mDisabled = net; - mHandler.post(new Runnable() { - public void run() { - mNotificationCallbacks.onSetDisabled(net); - } - }); - if (mBar != null) { - try { - mBar.disable(net); - } catch (RemoteException ex) { + manageDisableListLocked(what, token, pkg); + final int net = gatherDisableActionsLocked(); + if (net != mDisabled) { + mDisabled = net; + mHandler.post(new Runnable() { + public void run() { + mNotificationCallbacks.onSetDisabled(net); } + }); + if (mBar != null) { + try { + mBar.disable(net); + } catch (RemoteException ex) { } } } @@ -259,22 +269,25 @@ public class StatusBarManagerService extends IStatusBarService.Stub } } - public void setIMEButtonVisible(final IBinder token, final boolean visible) { + public void setImeWindowStatus(final IBinder token, final int vis, final int backDisposition) { enforceStatusBar(); - if (SPEW) Slog.d(TAG, (visible?"showing":"hiding") + " IME Button"); + if (SPEW) { + Slog.d(TAG, "swetImeWindowStatus vis=" + vis + " backDisposition=" + backDisposition); + } synchronized(mLock) { - // In case of IME change, we need to call up setIMEButtonVisible() regardless of - // mIMEButtonVisible because mIMEButtonVisible may not have been set to false when the + // In case of IME change, we need to call up setImeWindowStatus() regardless of + // mImeWindowVis because mImeWindowVis may not have been set to false when the // previous IME was destroyed. - mIMEButtonVisible = visible; - mIMEToken = token; + mImeWindowVis = vis; + mImeBackDisposition = backDisposition; + mImeToken = token; mHandler.post(new Runnable() { public void run() { if (mBar != null) { try { - mBar.setIMEButtonVisible(token, visible); + mBar.setImeWindowStatus(token, vis, backDisposition); } catch (RemoteException ex) { } } @@ -290,6 +303,8 @@ public class StatusBarManagerService extends IStatusBarService.Stub synchronized (mLock) { final boolean lightsOn = (vis & View.STATUS_BAR_HIDDEN) == 0; updateLightsOnLocked(lightsOn); + disableLocked(vis & StatusBarManager.DISABLE_MASK, mSysUiVisToken, + "WindowManager.LayoutParams"); } } @@ -309,6 +324,28 @@ public class StatusBarManagerService extends IStatusBarService.Stub } } + public void setHardKeyboardEnabled(final boolean enabled) { + mHandler.post(new Runnable() { + public void run() { + mWindowManager.setHardKeyboardEnabled(enabled); + } + }); + } + + @Override + public void onHardKeyboardStatusChange(final boolean available, final boolean enabled) { + mHandler.post(new Runnable() { + public void run() { + if (mBar != null) { + try { + mBar.setHardKeyboardStatus(available, enabled); + } catch (RemoteException ex) { + } + } + } + }); + } + private void enforceStatusBar() { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR, "StatusBarManagerService"); @@ -324,7 +361,6 @@ public class StatusBarManagerService extends IStatusBarService.Stub "StatusBarManagerService"); } - // ================================================================================ // Callbacks from the status bar service. // ================================================================================ @@ -348,9 +384,12 @@ public class StatusBarManagerService extends IStatusBarService.Stub switches[0] = gatherDisableActionsLocked(); switches[1] = mLightsOn ? 1 : 0; switches[2] = mMenuVisible ? 1 : 0; - switches[3] = mIMEButtonVisible ? 1 : 0; - binders.add(mIMEToken); + switches[3] = mImeWindowVis; + switches[4] = mImeBackDisposition; + binders.add(mImeToken); } + switches[5] = mWindowManager.isHardKeyboardAvailable() ? 1 : 0; + switches[6] = mWindowManager.isHardKeyboardEnabled() ? 1 : 0; } /** @@ -447,37 +486,35 @@ public class StatusBarManagerService extends IStatusBarService.Stub Slog.d(TAG, "manageDisableList what=0x" + Integer.toHexString(what) + " pkg=" + pkg); } // update the list - synchronized (mDisableRecords) { - final int N = mDisableRecords.size(); - DisableRecord tok = null; - int i; - for (i=0; i<N; i++) { - DisableRecord t = mDisableRecords.get(i); - if (t.token == token) { - tok = t; - break; - } + final int N = mDisableRecords.size(); + DisableRecord tok = null; + int i; + for (i=0; i<N; i++) { + DisableRecord t = mDisableRecords.get(i); + if (t.token == token) { + tok = t; + break; + } + } + if (what == 0 || !token.isBinderAlive()) { + if (tok != null) { + mDisableRecords.remove(i); + tok.token.unlinkToDeath(tok, 0); } - if (what == 0 || !token.isBinderAlive()) { - if (tok != null) { - mDisableRecords.remove(i); - tok.token.unlinkToDeath(tok, 0); + } else { + if (tok == null) { + tok = new DisableRecord(); + try { + token.linkToDeath(tok, 0); } - } else { - if (tok == null) { - tok = new DisableRecord(); - try { - token.linkToDeath(tok, 0); - } - catch (RemoteException ex) { - return; // give up - } - mDisableRecords.add(tok); + catch (RemoteException ex) { + return; // give up } - tok.what = what; - tok.token = token; - tok.pkg = pkg; + mDisableRecords.add(tok); } + tok.what = what; + tok.token = token; + tok.pkg = pkg; } } @@ -518,7 +555,7 @@ public class StatusBarManagerService extends IStatusBarService.Stub } } - synchronized (mDisableRecords) { + synchronized (mLock) { final int N = mDisableRecords.size(); pw.println(" mDisableRecords.size=" + N + " mDisabled=0x" + Integer.toHexString(mDisabled)); diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 62ff064..683c2c0 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -248,7 +248,7 @@ class ServerThread extends Thread { try { Slog.i(TAG, "Status Bar"); - statusBar = new StatusBarManagerService(context); + statusBar = new StatusBarManagerService(context, wm); ServiceManager.addService(Context.STATUS_BAR_SERVICE, statusBar); } catch (Throwable e) { Slog.e(TAG, "Failure starting StatusBarManagerService", e); diff --git a/services/java/com/android/server/WifiService.java b/services/java/com/android/server/WifiService.java index 04f4e4e..5e78353 100644 --- a/services/java/com/android/server/WifiService.java +++ b/services/java/com/android/server/WifiService.java @@ -890,10 +890,10 @@ public class WifiService extends IWifiManager.Stub { * @see #shouldDeviceStayAwake(int, int) */ private boolean shouldWifiStayAwake(int stayAwakeConditions, int pluggedType) { - //Never sleep when plugged in as long as the user has not changed the settings + //Never sleep as long as the user has not changed the settings int wifiSleepPolicy = Settings.System.getInt(mContext.getContentResolver(), Settings.System.WIFI_SLEEP_POLICY, - Settings.System.WIFI_SLEEP_POLICY_NEVER_WHILE_PLUGGED); + Settings.System.WIFI_SLEEP_POLICY_NEVER); if (wifiSleepPolicy == Settings.System.WIFI_SLEEP_POLICY_NEVER) { // Never sleep diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java index 30a9432..17c3154 100644 --- a/services/java/com/android/server/WindowManagerService.java +++ b/services/java/com/android/server/WindowManagerService.java @@ -47,6 +47,7 @@ import com.android.server.am.BatteryStatsService; import android.Manifest; import android.app.ActivityManagerNative; import android.app.IActivityManager; +import android.app.StatusBarManager; import android.app.admin.DevicePolicyManager; import android.content.BroadcastReceiver; import android.content.ClipData; @@ -454,6 +455,10 @@ public class WindowManagerService extends IWindowManager.Stub WindowState mInputMethodWindow = null; final ArrayList<WindowState> mInputMethodDialogs = new ArrayList<WindowState>(); + boolean mHardKeyboardAvailable; + boolean mHardKeyboardEnabled; + OnHardKeyboardStatusChangeListener mHardKeyboardStatusChangeListener; + final ArrayList<WindowToken> mWallpaperTokens = new ArrayList<WindowToken>(); // If non-null, this is the currently visible window that is associated @@ -1315,7 +1320,20 @@ public class WindowManagerService extends IWindowManager.Stub static boolean canBeImeTarget(WindowState w) { final int fl = w.mAttrs.flags & (FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM); - if (fl == 0 || fl == (FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM)) { + if (fl == 0 || fl == (FLAG_NOT_FOCUSABLE|FLAG_ALT_FOCUSABLE_IM) + || w.mAttrs.type == WindowManager.LayoutParams.TYPE_APPLICATION_STARTING) { + if (DEBUG_INPUT_METHOD) { + Slog.i(TAG, "isVisibleOrAdding " + w + ": " + w.isVisibleOrAdding()); + if (!w.isVisibleOrAdding()) { + Slog.i(TAG, " mSurface=" + w.mSurface + " reportDestroy=" + w.mReportDestroySurface + + " relayoutCalled=" + w.mRelayoutCalled + " viewVis=" + w.mViewVisibility + + " policyVis=" + w.mPolicyVisibility + " attachHid=" + w.mAttachedHidden + + " exiting=" + w.mExiting + " destroying=" + w.mDestroying); + if (w.mAppToken != null) { + Slog.i(TAG, " mAppToken.hiddenRequested=" + w.mAppToken.hiddenRequested); + } + } + } return w.isVisibleOrAdding(); } return false; @@ -1330,8 +1348,8 @@ public class WindowManagerService extends IWindowManager.Stub i--; w = localmWindows.get(i); - //Slog.i(TAG, "Checking window @" + i + " " + w + " fl=0x" - // + Integer.toHexString(w.mAttrs.flags)); + if (DEBUG_INPUT_METHOD && willMove) Slog.i(TAG, "Checking window @" + i + + " " + w + " fl=0x" + Integer.toHexString(w.mAttrs.flags)); if (canBeImeTarget(w)) { //Slog.i(TAG, "Putting input method here!"); @@ -1353,6 +1371,8 @@ public class WindowManagerService extends IWindowManager.Stub } } + if (DEBUG_INPUT_METHOD && willMove) Slog.v(TAG, "Proposed new IME target: " + w); + // Now, a special case -- if the last target's window is in the // process of exiting, and is above the new target, keep on the // last target to avoid flicker. Consider for example a Dialog with @@ -1365,6 +1385,7 @@ public class WindowManagerService extends IWindowManager.Stub if (mInputMethodTarget.mAnimLayer > w.mAnimLayer) { w = mInputMethodTarget; i = localmWindows.indexOf(w); + if (DEBUG_INPUT_METHOD) Slog.v(TAG, "Current target higher, switching to: " + w); } } @@ -1420,6 +1441,7 @@ public class WindowManagerService extends IWindowManager.Stub // with an animation, and it is on top of the next target // we will be over, then hold off on moving until // that is done. + mInputMethodTargetWaitingAnim = true; mInputMethodTarget = highestTarget; return highestPos + 1; } @@ -1440,6 +1462,7 @@ public class WindowManagerService extends IWindowManager.Stub + mInputMethodTarget + " to " + w, e); } mInputMethodTarget = w; + mInputMethodTargetWaitingAnim = false; if (w.mAppToken != null) { setInputMethodAnimLayerAdjustment(w.mAppToken.animLayerAdjustment); } else { @@ -2736,6 +2759,15 @@ public class WindowManagerService extends IWindowManager.Stub boolean displayed = false; boolean inTouchMode; boolean configChanged; + + // if they don't have this permission, mask out the status bar bits + if (attrs != null) { + if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR) + != PackageManager.PERMISSION_GRANTED) { + attrs.systemUiVisibility &= ~StatusBarManager.DISABLE_MASK; + attrs.subtreeSystemUiVisibility &= ~StatusBarManager.DISABLE_MASK; + } + } long origId = Binder.clearCallingIdentity(); synchronized(mWindowMap) { @@ -5735,13 +5767,13 @@ public class WindowManagerService extends IWindowManager.Stub mScreenLayout = Configuration.SCREENLAYOUT_SIZE_LARGE; } else { mScreenLayout = Configuration.SCREENLAYOUT_SIZE_NORMAL; - - // If this screen is wider than normal HVGA, or taller - // than FWVGA, then for old apps we want to run in size - // compatibility mode. - if (shortSize > 321 || longSize > 570) { - mScreenLayout |= Configuration.SCREENLAYOUT_COMPAT_NEEDED; - } + } + + // If this screen is wider than normal HVGA, or taller + // than FWVGA, then for old apps we want to run in size + // compatibility mode. + if (shortSize > 321 || longSize > 570) { + mScreenLayout |= Configuration.SCREENLAYOUT_COMPAT_NEEDED; } // Is this a long screen? @@ -5755,12 +5787,70 @@ public class WindowManagerService extends IWindowManager.Stub } config.screenLayout = mScreenLayout; + // Determine whether a hard keyboard is available and enabled. + boolean hardKeyboardAvailable = config.keyboard != Configuration.KEYBOARD_NOKEYS; + if (hardKeyboardAvailable != mHardKeyboardAvailable) { + mHardKeyboardAvailable = hardKeyboardAvailable; + mHardKeyboardEnabled = hardKeyboardAvailable; + + mH.removeMessages(H.REPORT_HARD_KEYBOARD_STATUS_CHANGE); + mH.sendEmptyMessage(H.REPORT_HARD_KEYBOARD_STATUS_CHANGE); + } + if (!mHardKeyboardEnabled) { + config.keyboard = Configuration.KEYBOARD_NOKEYS; + } + + // Update value of keyboardHidden, hardKeyboardHidden and navigationHidden + // based on whether a hard or soft keyboard is present, whether navigation keys + // are present and the lid switch state. config.keyboardHidden = Configuration.KEYBOARDHIDDEN_NO; config.hardKeyboardHidden = Configuration.HARDKEYBOARDHIDDEN_NO; + config.navigationHidden = Configuration.NAVIGATIONHIDDEN_NO; mPolicy.adjustConfigurationLw(config); return true; } + public boolean isHardKeyboardAvailable() { + synchronized (mWindowMap) { + return mHardKeyboardAvailable; + } + } + + public boolean isHardKeyboardEnabled() { + synchronized (mWindowMap) { + return mHardKeyboardEnabled; + } + } + + public void setHardKeyboardEnabled(boolean enabled) { + synchronized (mWindowMap) { + if (mHardKeyboardEnabled != enabled) { + mHardKeyboardEnabled = enabled; + mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION); + } + } + } + + public void setOnHardKeyboardStatusChangeListener( + OnHardKeyboardStatusChangeListener listener) { + synchronized (mWindowMap) { + mHardKeyboardStatusChangeListener = listener; + } + } + + void notifyHardKeyboardStatusChange() { + final boolean available, enabled; + final OnHardKeyboardStatusChangeListener listener; + synchronized (mWindowMap) { + listener = mHardKeyboardStatusChangeListener; + available = mHardKeyboardAvailable; + enabled = mHardKeyboardEnabled; + } + if (listener != null) { + listener.onHardKeyboardStatusChange(available, enabled); + } + } + // ------------------------------------------------------------- // Drag and drop // ------------------------------------------------------------- @@ -5786,8 +5876,7 @@ public class WindowManagerService extends IWindowManager.Stub outSurface.copyFrom(surface); final IBinder winBinder = window.asBinder(); token = new Binder(); - // TODO: preserve flags param in DragState - mDragState = new DragState(token, surface, 0, winBinder); + mDragState = new DragState(token, surface, flags, winBinder); mDragState.mSurface = surface; token = mDragState.mToken = new Binder(); @@ -8539,7 +8628,7 @@ public class WindowManagerService extends IWindowManager.Stub w.mAnimLayer = w.mLayer + adj; if (DEBUG_LAYERS) Slog.v(TAG, "Updating layer " + w + ": " + w.mAnimLayer); - if (w == mInputMethodTarget) { + if (w == mInputMethodTarget && !mInputMethodTargetWaitingAnim) { setInputMethodAnimLayerAdjustment(adj); } if (w == mWallpaperTarget && mLowerWallpaperTarget == null) { @@ -8630,6 +8719,10 @@ public class WindowManagerService extends IWindowManager.Stub clearAnimation(); animating = false; + if (animLayerAdjustment != 0) { + animLayerAdjustment = 0; + updateLayers(); + } if (mInputMethodTarget != null && mInputMethodTarget.mAppToken == this) { moveInputMethodWindowsIfNeededLocked(true); } @@ -8639,10 +8732,6 @@ public class WindowManagerService extends IWindowManager.Stub + ": reportedVisible=" + reportedVisible); transformation.clear(); - if (animLayerAdjustment != 0) { - animLayerAdjustment = 0; - updateLayers(); - } final int N = windows.size(); for (int i=0; i<N; i++) { @@ -8851,6 +8940,7 @@ public class WindowManagerService extends IWindowManager.Stub public static final int REPORT_WINDOWS_CHANGE = 19; public static final int DRAG_START_TIMEOUT = 20; public static final int DRAG_END_TIMEOUT = 21; + public static final int REPORT_HARD_KEYBOARD_STATUS_CHANGE = 22; private Session mLastReportedHold; @@ -9224,6 +9314,11 @@ public class WindowManagerService extends IWindowManager.Stub } break; } + + case REPORT_HARD_KEYBOARD_STATUS_CHANGE: { + notifyHardKeyboardStatusChange(); + break; + } } } } @@ -9248,11 +9343,47 @@ public class WindowManagerService extends IWindowManager.Stub WindowState imFocus; if (idx > 0) { imFocus = mWindows.get(idx-1); + //Log.i(TAG, "Desired input method target: " + imFocus); + //Log.i(TAG, "Current focus: " + this.mCurrentFocus); + //Log.i(TAG, "Last focus: " + this.mLastFocus); if (imFocus != null) { + // This may be a starting window, in which case we still want + // to count it as okay. + if (imFocus.mAttrs.type == LayoutParams.TYPE_APPLICATION_STARTING + && imFocus.mAppToken != null) { + // The client has definitely started, so it really should + // have a window in this app token. Let's look for it. + for (int i=0; i<imFocus.mAppToken.windows.size(); i++) { + WindowState w = imFocus.mAppToken.windows.get(i); + if (w != imFocus) { + //Log.i(TAG, "Switching to real app window: " + w); + imFocus = w; + break; + } + } + } + //Log.i(TAG, "IM target client: " + imFocus.mSession.mClient); + //if (imFocus.mSession.mClient != null) { + // Log.i(TAG, "IM target client binder: " + imFocus.mSession.mClient.asBinder()); + // Log.i(TAG, "Requesting client binder: " + client.asBinder()); + //} if (imFocus.mSession.mClient != null && imFocus.mSession.mClient.asBinder() == client.asBinder()) { return true; } + + // Okay, how about this... what is the current focus? + // It seems in some cases we may not have moved the IM + // target window, such as when it was in a pop-up window, + // so let's also look at the current focus. (An example: + // go to Gmail, start searching so the keyboard goes up, + // press home. Sometimes the IME won't go down.) + // Would be nice to fix this more correctly, but it's + // way at the end of a release, and this should be good enough. + if (mCurrentFocus != null && mCurrentFocus.mSession.mClient != null && + mCurrentFocus.mSession.mClient.asBinder() == client.asBinder()) { + return true; + } } } } @@ -11261,13 +11392,13 @@ public class WindowManagerService extends IWindowManager.Stub mInputMonitor.thawInputDispatchingLw(); + boolean configChanged; + // While the display is frozen we don't re-compute the orientation // to avoid inconsistent states. However, something interesting // could have actually changed during that time so re-evaluate it // now to catch that. - if (updateOrientationFromAppTokensLocked(false)) { - mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION); - } + configChanged = updateOrientationFromAppTokensLocked(false); // A little kludge: a lot could have happened while the // display was frozen, so now that we are coming back we @@ -11282,11 +11413,12 @@ public class WindowManagerService extends IWindowManager.Stub if (updateRotation) { if (DEBUG_ORIENTATION) Slog.d(TAG, "Performing post-rotate rotation"); - boolean changed = setRotationUncheckedLocked( + configChanged |= setRotationUncheckedLocked( WindowManagerPolicy.USE_LAST_ROTATION, 0, false); - if (changed) { - sendNewConfiguration(); - } + } + + if (configChanged) { + mH.sendEmptyMessage(H.SEND_NEW_CONFIGURATION); } } @@ -11933,4 +12065,8 @@ public class WindowManagerService extends IWindowManager.Stub return Animation.ZORDER_TOP; } } + + public interface OnHardKeyboardStatusChangeListener { + public void onHardKeyboardStatusChange(boolean available, boolean enabled); + } } diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index da70f61..9e3b9c6 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -11947,28 +11947,6 @@ public final class ActivityManagerService extends ActivityManagerNative adj = FOREGROUND_APP_ADJ; schedGroup = Process.THREAD_GROUP_DEFAULT; app.adjType = "exec-service"; - } else if (app.foregroundServices) { - // The user is aware of this app, so make it visible. - adj = PERCEPTIBLE_APP_ADJ; - schedGroup = Process.THREAD_GROUP_DEFAULT; - app.adjType = "foreground-service"; - } else if (app.forcingToForeground != null) { - // The user is aware of this app, so make it visible. - adj = PERCEPTIBLE_APP_ADJ; - schedGroup = Process.THREAD_GROUP_DEFAULT; - app.adjType = "force-foreground"; - app.adjSource = app.forcingToForeground; - } else if (app == mHeavyWeightProcess) { - // We don't want to kill the current heavy-weight process. - adj = HEAVY_WEIGHT_APP_ADJ; - schedGroup = Process.THREAD_GROUP_BG_NONINTERACTIVE; - app.adjType = "heavy"; - } else if (app == mHomeProcess) { - // This process is hosting what we currently consider to be the - // home app, so we don't want to let it go into the background. - adj = HOME_APP_ADJ; - schedGroup = Process.THREAD_GROUP_BG_NONINTERACTIVE; - app.adjType = "home"; } else if ((N=app.activities.size()) != 0) { // This app is in the background with paused activities. app.hidden = true; @@ -12001,7 +11979,37 @@ public final class ActivityManagerService extends ActivityManagerNative adj = hiddenAdj; app.adjType = "bg-empty"; } + + if (adj > PERCEPTIBLE_APP_ADJ) { + if (app.foregroundServices) { + // The user is aware of this app, so make it visible. + adj = PERCEPTIBLE_APP_ADJ; + schedGroup = Process.THREAD_GROUP_DEFAULT; + app.adjType = "foreground-service"; + } else if (app.forcingToForeground != null) { + // The user is aware of this app, so make it visible. + adj = PERCEPTIBLE_APP_ADJ; + schedGroup = Process.THREAD_GROUP_DEFAULT; + app.adjType = "force-foreground"; + app.adjSource = app.forcingToForeground; + } + } + + if (adj > HEAVY_WEIGHT_APP_ADJ && app == mHeavyWeightProcess) { + // We don't want to kill the current heavy-weight process. + adj = HEAVY_WEIGHT_APP_ADJ; + schedGroup = Process.THREAD_GROUP_BG_NONINTERACTIVE; + app.adjType = "heavy"; + } + if (adj > HOME_APP_ADJ && app == mHomeProcess) { + // This process is hosting what we currently consider to be the + // home app, so we don't want to let it go into the background. + adj = HOME_APP_ADJ; + schedGroup = Process.THREAD_GROUP_BG_NONINTERACTIVE; + app.adjType = "home"; + } + //Slog.i(TAG, "OOM " + app + ": initial adj=" + adj); // By default, we use the computed adjustment. It may be changed if diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 3730739..fde8e67 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -56,6 +56,8 @@ Layer::Layer(SurfaceFlinger* flinger, mNeedsBlending(true), mNeedsDithering(false), mSecure(false), + mProtectedByApp(false), + mProtectedByDRM(false), mTextureManager(), mBufferManager(mTextureManager), mWidth(0), mHeight(0), mNeedsScaling(false), mFixedSize(false) @@ -150,8 +152,7 @@ status_t Layer::ditch() // the layer is not on screen anymore. free as much resources as possible mFreezeLock.clear(); - EGLDisplay dpy(mFlinger->graphicPlane(0).getEGLDisplay()); - mBufferManager.destroy(dpy); + // Free our own reference to ISurface mSurface.clear(); Mutex::Autolock _l(mLock); @@ -191,6 +192,8 @@ status_t Layer::setBuffers( uint32_t w, uint32_t h, mReqHeight = h; mSecure = (flags & ISurfaceComposer::eSecure) ? true : false; + mProtectedByApp = (flags & ISurfaceComposer::eProtectedByApp) ? true : false; + mProtectedByDRM = (flags & ISurfaceComposer::eProtectedByDRM) ? true : false; mNeedsBlending = (info.h_alpha - info.l_alpha) > 0 && (flags & ISurfaceComposer::eOpaque) == 0; @@ -476,6 +479,10 @@ uint32_t Layer::getEffectiveUsage(uint32_t usage) const // request EGLImage for all buffers usage |= GraphicBuffer::USAGE_HW_TEXTURE; } + if (mProtectedByApp || mProtectedByDRM) { + // need a hardware-protected path to external video sink + usage |= GraphicBuffer::USAGE_PROTECTED; + } return usage; } diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h index 2908119..d9a8be3 100644 --- a/services/surfaceflinger/Layer.h +++ b/services/surfaceflinger/Layer.h @@ -79,6 +79,8 @@ public: virtual bool needsDithering() const { return mNeedsDithering; } virtual bool needsFiltering() const; virtual bool isSecure() const { return mSecure; } + virtual bool isProtectedByApp() const { return mProtectedByApp; } + virtual bool isProtectedByDRM() const { return mProtectedByDRM; } virtual sp<Surface> createSurface() const; virtual status_t ditch(); virtual void onRemoved(); @@ -218,7 +220,9 @@ private: bool mNeedsDithering; // page-flip thread (currently main thread) - bool mSecure; + bool mSecure; // no screenshots + bool mProtectedByApp; // application requires protected path to external sink + bool mProtectedByDRM; // DRM agent requires protected path to external sink Region mPostedDirtyRegion; // page-flip thread and transaction thread (currently main thread) diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp index 8d83f0b..86057f8 100644 --- a/services/surfaceflinger/LayerBase.cpp +++ b/services/surfaceflinger/LayerBase.cpp @@ -498,11 +498,9 @@ void LayerBase::drawWithOpenGL(const Region& clip, const Texture& texture) const } void LayerBase::setBufferCrop(const Rect& crop) { - if (!crop.isEmpty()) { - if (mBufferCrop != crop) { - mBufferCrop = crop; - mFlinger->invalidateHwcGeometry(); - } + if (mBufferCrop != crop) { + mBufferCrop = crop; + mFlinger->invalidateHwcGeometry(); } } diff --git a/services/surfaceflinger/LayerBase.h b/services/surfaceflinger/LayerBase.h index 8ed4749..184edd7 100644 --- a/services/surfaceflinger/LayerBase.h +++ b/services/surfaceflinger/LayerBase.h @@ -196,6 +196,18 @@ public: */ virtual bool isSecure() const { return false; } + /** + * isProtectedByApp - true if application says this surface is protected, that + * is if it requires a hardware-protected data path to an external sink. + */ + virtual bool isProtectedByApp() const { return false; } + + /** + * isProtectedByDRM - true if DRM agent says this surface is protected, that + * is if it requires a hardware-protected data path to an external sink. + */ + virtual bool isProtectedByDRM() const { return false; } + /** Called from the main thread, when the surface is removed from the * draw list */ virtual status_t ditch() { return NO_ERROR; } diff --git a/services/surfaceflinger/LayerDim.h b/services/surfaceflinger/LayerDim.h index f032314..a04a0c0 100644 --- a/services/surfaceflinger/LayerDim.h +++ b/services/surfaceflinger/LayerDim.h @@ -42,8 +42,10 @@ public: virtual ~LayerDim(); virtual void onDraw(const Region& clip) const; - virtual bool needsBlending() const { return true; } - virtual bool isSecure() const { return false; } + virtual bool needsBlending() const { return true; } + virtual bool isSecure() const { return false; } + virtual bool isProtectedByApp() const { return false; } + virtual bool isProtectedByDRM() const { return false; } virtual const char* getTypeId() const { return "LayerDim"; } static void initDimmer(SurfaceFlinger* flinger, uint32_t w, uint32_t h); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 4424e5b..88d9436 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -402,7 +402,6 @@ public class TelephonyManager { /** Current network is eHRPD */ public static final int NETWORK_TYPE_EHRPD = 14; - /** * Returns a constant indicating the radio technology (network type) * currently in use on the device for data transmission. diff --git a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java index 2343dd8..7f8485b 100644 --- a/telephony/java/com/android/internal/telephony/DataConnectionTracker.java +++ b/telephony/java/com/android/internal/telephony/DataConnectionTracker.java @@ -531,7 +531,9 @@ public abstract class DataConnectionTracker extends Handler { * {@code true} otherwise. */ public synchronized boolean getAnyDataEnabled() { - return (mInternalDataEnabled && mDataEnabled && (enabledCount != 0)); + boolean result = (mInternalDataEnabled && mDataEnabled && (enabledCount != 0)); + if (!result && DBG) log("getAnyDataEnabled " + result); + return result; } protected abstract void startNetStatPoll(); @@ -657,7 +659,13 @@ public abstract class DataConnectionTracker extends Handler { // disabled apn's still need avail/unavail notificiations - send them out protected void notifyOffApnsOfAvailability(String reason, boolean availability) { - if (mAvailability == availability) return; + if (mAvailability == availability) { + if (DBG) { + log("notifyOffApnsOfAvailability: no change in availability, " + + "not nofitying about reason='" + reason + "' availability=" + availability); + } + return; + } mAvailability = availability; for (int id = 0; id < APN_NUM_TYPES; id++) { if (!isApnIdEnabled(id)) { @@ -685,10 +693,13 @@ public abstract class DataConnectionTracker extends Handler { * @return {@code true} if data connectivity is possible, {@code false} otherwise. */ protected boolean isDataPossible() { - boolean possible = (isDataAllowed() - && !(getAnyDataEnabled() && (mState == State.FAILED || mState == State.IDLE))); - if (!possible && DBG && isDataAllowed()) { - log("Data not possible. No coverage: dataState = " + mState); + boolean dataAllowed = isDataAllowed(); + boolean anyDataEnabled = getAnyDataEnabled(); + boolean possible = (dataAllowed + && !(anyDataEnabled && (mState == State.FAILED || mState == State.IDLE))); + if (!possible && DBG) { + log("isDataPossible() " + possible + ", dataAllowed=" + dataAllowed + + " anyDataEnabled=" + anyDataEnabled + " dataState=" + mState); } return possible; } diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java index 19e7fae..a7f7866 100755 --- a/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java +++ b/telephony/java/com/android/internal/telephony/cdma/CdmaServiceStateTracker.java @@ -1069,6 +1069,8 @@ final class CdmaServiceStateTracker extends ServiceStateTracker { cdmaDataConnectionState = newCdmaDataConnectionState; networkType = newNetworkType; + // this new state has been applied - forget it until we get a new new state + newNetworkType = 0; newSS.setStateOutOfService(); // clean slate for next time diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java index c107d17..bb99e45 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmServiceStateTracker.java @@ -957,6 +957,9 @@ final class GsmServiceStateTracker extends ServiceStateTracker { gprsState = newGPRSState; networkType = newNetworkType; + // this new state has been applied - forget it until we get a new new state + newNetworkType = 0; + newSS.setStateOutOfService(); // clean slate for next time diff --git a/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java b/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java index 5fd946e..13665e1 100644 --- a/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java +++ b/tests/StatusBar/src/com/android/statusbartest/StatusBarTest.java @@ -70,6 +70,12 @@ public class StatusBarTest extends TestActivity } private Test[] mTests = new Test[] { + new Test("DISABLE_NAVIGATION") { + public void run() { + View v = findViewById(android.R.id.list); + v.setSystemUiVisibility(View.STATUS_BAR_DISABLE_NAVIGATION); + } + }, new Test("STATUS_BAR_HIDDEN") { public void run() { View v = findViewById(android.R.id.list); @@ -77,7 +83,7 @@ public class StatusBarTest extends TestActivity v.setOnSystemUiVisibilityChangeListener(mOnSystemUiVisibilityChangeListener); } }, - new Test("not STATUS_BAR_HIDDEN") { + new Test("no setSystemUiVisibility") { public void run() { View v = findViewById(android.R.id.list); v.setSystemUiVisibility(View.STATUS_BAR_VISIBLE); diff --git a/tools/aapt/AaptAssets.cpp b/tools/aapt/AaptAssets.cpp index e4f447e..2b2ec7b 100644 --- a/tools/aapt/AaptAssets.cpp +++ b/tools/aapt/AaptAssets.cpp @@ -685,13 +685,11 @@ bool AaptGroupEntry::getMncName(const char* name, if (*c != 0) return false; if (c-val == 0 || c-val > 3) return false; - int d = atoi(val); - if (d != 0) { - if (out) out->mnc = d; - return true; + if (out) { + out->mnc = atoi(val); } - return false; + return true; } /* diff --git a/tools/aapt/XMLNode.cpp b/tools/aapt/XMLNode.cpp index 8551b0f..c0d7427 100644 --- a/tools/aapt/XMLNode.cpp +++ b/tools/aapt/XMLNode.cpp @@ -451,13 +451,15 @@ void printXMLBlock(ResXMLTree* block) printf("=?0x%x", (int)value.data); } else if (value.dataType == Res_value::TYPE_STRING) { printf("=\"%s\"", - String8(block->getAttributeStringValue(i, &len)).string()); + ResTable::normalizeForOutput(String8(block->getAttributeStringValue(i, + &len)).string()).string()); } else { printf("=(type 0x%x)0x%x", (int)value.dataType, (int)value.data); } const char16_t* val = block->getAttributeStringValue(i, &len); if (val != NULL) { - printf(" (Raw: \"%s\")", String8(val).string()); + printf(" (Raw: \"%s\")", ResTable::normalizeForOutput(String8(val).string()). + string()); } printf("\n"); } diff --git a/tools/layoutlib/bridge/.classpath b/tools/layoutlib/bridge/.classpath index 64c1fb5..2eaf8e3 100644 --- a/tools/layoutlib/bridge/.classpath +++ b/tools/layoutlib/bridge/.classpath @@ -8,6 +8,6 @@ <classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/kxml2/kxml2-2.3.0.jar" sourcepath="/ANDROID_PLAT_SRC/dalvik/libcore/xml/src/main/java"/> <classpathentry kind="var" path="ANDROID_PLAT_SRC/out/host/common/obj/JAVA_LIBRARIES/temp_layoutlib_intermediates/javalib.jar" sourcepath="/ANDROID_PLAT_SRC/frameworks/base"/> <classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/ninepatch/ninepatch-prebuilt.jar"/> - <classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/resources/resources-prebuilt.jar"/> + <classpathentry kind="var" path="ANDROID_PLAT_SRC/prebuilt/common/common/common-prebuilt.jar"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/tools/layoutlib/bridge/Android.mk b/tools/layoutlib/bridge/Android.mk index 57dd7ae..3d4c76a 100644 --- a/tools/layoutlib/bridge/Android.mk +++ b/tools/layoutlib/bridge/Android.mk @@ -21,7 +21,7 @@ LOCAL_SRC_FILES := $(call all-java-files-under,src) LOCAL_JAVA_LIBRARIES := \ kxml2-2.3.0 \ layoutlib_api-prebuilt \ - resources-prebuilt + common-prebuilt LOCAL_STATIC_JAVA_LIBRARIES := \ temp_layoutlib \ diff --git a/tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java b/tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java index 7a0c2f7..38c092d 100644 --- a/tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java +++ b/tools/layoutlib/bridge/src/android/graphics/Gradient_Delegate.java @@ -95,7 +95,7 @@ public abstract class Gradient_Delegate extends Shader_Delegate { * Pre-computes the colors for the gradient. This must be called once before any call * to {@link #getGradientColor(float)} */ - protected synchronized void precomputeGradientColors() { + protected void precomputeGradientColors() { if (mGradient == null) { // actually create an array with an extra size, so that we can really go // from 0 to SIZE (100%), or currentPos in the loop below will never equal 1.0 diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java index bd52dc2..93c81d1 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/Bridge.java @@ -28,8 +28,10 @@ import com.android.layoutlib.bridge.android.BridgeAssetManager; import com.android.layoutlib.bridge.impl.FontLoader; import com.android.layoutlib.bridge.impl.RenderSessionImpl; import com.android.ninepatch.NinePatchChunk; +import com.android.resources.ResourceType; import com.android.tools.layoutlib.create.MethodAdapter; import com.android.tools.layoutlib.create.OverrideMethod; +import com.android.util.Pair; import android.graphics.Bitmap; import android.graphics.Typeface; @@ -41,6 +43,7 @@ import java.lang.ref.SoftReference; import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.Arrays; +import java.util.EnumMap; import java.util.EnumSet; import java.util.HashMap; import java.util.Map; @@ -68,9 +71,11 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge { private final static ReentrantLock sLock = new ReentrantLock(); /** - * Maps from id to resource name/type. This is for android.R only. + * Maps from id to resource type/name. This is for android.R only. */ - private final static Map<Integer, String[]> sRMap = new HashMap<Integer, String[]>(); + private final static Map<Integer, Pair<ResourceType, String>> sRMap = + new HashMap<Integer, Pair<ResourceType, String>>(); + /** * Same as sRMap except for int[] instead of int resources. This is for android.R only. */ @@ -79,8 +84,8 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge { * Reverse map compared to sRMap, resource type -> (resource name -> id). * This is for android.R only. */ - private final static Map<String, Map<String, Integer>> sRFullMap = - new HashMap<String, Map<String,Integer>>(); + private final static Map<ResourceType, Map<String, Integer>> sRFullMap = + new EnumMap<ResourceType, Map<String,Integer>>(ResourceType.class); private final static Map<Object, Map<String, SoftReference<Bitmap>>> sProjectBitmapCache = new HashMap<Object, Map<String, SoftReference<Bitmap>>>(); @@ -130,7 +135,7 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge { } } - /** Instance of IntArrayWrapper to be reused in {@link #resolveResourceValue(int[])}. */ + /** Instance of IntArrayWrapper to be reused in {@link #resolveResourceId(int[])}. */ private final static IntArray sIntArrayWrapper = new IntArray(); /** @@ -236,28 +241,30 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge { Class<?> r = com.android.internal.R.class; for (Class<?> inner : r.getDeclaredClasses()) { - String resType = inner.getSimpleName(); - - Map<String, Integer> fullMap = new HashMap<String, Integer>(); - sRFullMap.put(resType, fullMap); - - for (Field f : inner.getDeclaredFields()) { - // only process static final fields. Since the final attribute may have - // been altered by layoutlib_create, we only check static - int modifiers = f.getModifiers(); - if (Modifier.isStatic(modifiers)) { - Class<?> type = f.getType(); - if (type.isArray() && type.getComponentType() == int.class) { - // if the object is an int[] we put it in sRArrayMap using an IntArray - // wrapper that properly implements equals and hashcode for the array - // objects, as required by the map contract. - sRArrayMap.put(new IntArray((int[]) f.get(null)), f.getName()); - } else if (type == int.class) { - Integer value = (Integer) f.get(null); - sRMap.put(value, new String[] { f.getName(), resType }); - fullMap.put(f.getName(), value); - } else { - assert false; + String resTypeName = inner.getSimpleName(); + ResourceType resType = ResourceType.getEnum(resTypeName); + if (resType != null) { + Map<String, Integer> fullMap = new HashMap<String, Integer>(); + sRFullMap.put(resType, fullMap); + + for (Field f : inner.getDeclaredFields()) { + // only process static final fields. Since the final attribute may have + // been altered by layoutlib_create, we only check static + int modifiers = f.getModifiers(); + if (Modifier.isStatic(modifiers)) { + Class<?> type = f.getType(); + if (type.isArray() && type.getComponentType() == int.class) { + // if the object is an int[] we put it in sRArrayMap using an IntArray + // wrapper that properly implements equals and hashcode for the array + // objects, as required by the map contract. + sRArrayMap.put(new IntArray((int[]) f.get(null)), f.getName()); + } else if (type == int.class) { + Integer value = (Integer) f.get(null); + sRMap.put(value, Pair.of(resType, f.getName())); + fullMap.put(f.getName(), value); + } else { + assert false; + } } } } @@ -388,10 +395,10 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge { /** * Returns details of a framework resource from its integer value. * @param value the integer value - * @return an array of 2 strings containing the resource name and type, or null if the id - * does not match any resource. + * @return a Pair containing the resource type and name, or null if the id + * does not match any resource. */ - public static String[] resolveResourceValue(int value) { + public static Pair<ResourceType, String> resolveResourceId(int value) { return sRMap.get(value); } @@ -399,7 +406,7 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge { * Returns the name of a framework resource whose value is an int array. * @param array */ - public static String resolveResourceValue(int[] array) { + public static String resolveResourceId(int[] array) { sIntArrayWrapper.set(array); return sRArrayMap.get(sIntArrayWrapper); } @@ -410,7 +417,7 @@ public final class Bridge extends com.android.ide.common.rendering.api.Bridge { * @param name the name of the resource. * @return an {@link Integer} containing the resource id, or null if no resource were found. */ - public static Integer getResourceValue(String type, String name) { + public static Integer getResourceId(ResourceType type, String name) { Map<String, Integer> map = sRFullMap.get(type); if (map != null) { return map.get(name); diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java index 79264d0..037ad23 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java @@ -24,6 +24,8 @@ import com.android.ide.common.rendering.api.StyleResourceValue; import com.android.layoutlib.bridge.Bridge; import com.android.layoutlib.bridge.BridgeConstants; import com.android.layoutlib.bridge.impl.Stack; +import com.android.resources.ResourceType; +import com.android.util.Pair; import android.app.Activity; import android.app.Fragment; @@ -517,14 +519,14 @@ public final class BridgeContext extends Activity { */ private TreeMap<Integer,String> searchAttrs(int[] attrs, boolean[] outFrameworkFlag) { // get the name of the array from the framework resources - String arrayName = Bridge.resolveResourceValue(attrs); + String arrayName = Bridge.resolveResourceId(attrs); if (arrayName != null) { // if we found it, get the name of each of the int in the array. TreeMap<Integer,String> attributes = new TreeMap<Integer, String>(); for (int i = 0 ; i < attrs.length ; i++) { - String[] info = Bridge.resolveResourceValue(attrs[i]); + Pair<ResourceType, String> info = Bridge.resolveResourceId(attrs[i]); if (info != null) { - attributes.put(i, info[0]); + attributes.put(i, info.getSecond()); } else { // FIXME Not sure what we should be doing here... attributes.put(i, null); @@ -540,13 +542,13 @@ public final class BridgeContext extends Activity { // if the name was not found in the framework resources, look in the project // resources - arrayName = mProjectCallback.resolveResourceValue(attrs); + arrayName = mProjectCallback.resolveResourceId(attrs); if (arrayName != null) { TreeMap<Integer,String> attributes = new TreeMap<Integer, String>(); for (int i = 0 ; i < attrs.length ; i++) { - String[] info = mProjectCallback.resolveResourceValue(attrs[i]); + Pair<ResourceType, String> info = mProjectCallback.resolveResourceId(attrs[i]); if (info != null) { - attributes.put(i, info[0]); + attributes.put(i, info.getSecond()); } else { // FIXME Not sure what we should be doing here... attributes.put(i, null); @@ -571,14 +573,14 @@ public final class BridgeContext extends Activity { * if nothing is found. */ public String searchAttr(int attr) { - String[] info = Bridge.resolveResourceValue(attr); + Pair<ResourceType, String> info = Bridge.resolveResourceId(attr); if (info != null) { - return info[0]; + return info.getSecond(); } - info = mProjectCallback.resolveResourceValue(attr); + info = mProjectCallback.resolveResourceId(attr); if (info != null) { - return info[0]; + return info.getSecond(); } return null; @@ -614,8 +616,8 @@ public final class BridgeContext extends Activity { return null; } - int getFrameworkResourceValue(String resType, String resName, int defValue) { - Integer value = Bridge.getResourceValue(resType, resName); + int getFrameworkResourceValue(ResourceType resType, String resName, int defValue) { + Integer value = Bridge.getResourceId(resType, resName); if (value != null) { return value.intValue(); } @@ -623,9 +625,9 @@ public final class BridgeContext extends Activity { return defValue; } - int getProjectResourceValue(String resType, String resName, int defValue) { + int getProjectResourceValue(ResourceType resType, String resName, int defValue) { if (mProjectCallback != null) { - Integer value = mProjectCallback.getResourceValue(resType, resName); + Integer value = mProjectCallback.getResourceId(resType, resName); if (value != null) { return value.intValue(); } diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeInflater.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeInflater.java index 465bf1d..5740e8b 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeInflater.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeInflater.java @@ -19,9 +19,10 @@ package com.android.layoutlib.bridge.android; import com.android.ide.common.rendering.api.IProjectCallback; import com.android.ide.common.rendering.api.LayoutLog; import com.android.ide.common.rendering.api.MergeCookie; -import com.android.ide.common.rendering.api.RenderResources; import com.android.ide.common.rendering.api.ResourceValue; import com.android.layoutlib.bridge.Bridge; +import com.android.resources.ResourceType; +import com.android.util.Pair; import org.kxml2.io.KXmlParser; import org.xmlpull.v1.XmlPullParser; @@ -155,16 +156,16 @@ public final class BridgeInflater extends LayoutInflater { ResourceValue value = null; - String[] layoutInfo = Bridge.resolveResourceValue(resource); + Pair<ResourceType, String> layoutInfo = Bridge.resolveResourceId(resource); if (layoutInfo != null) { value = bridgeContext.getRenderResources().getFrameworkResource( - RenderResources.RES_LAYOUT, layoutInfo[0]); + ResourceType.LAYOUT, layoutInfo.getSecond()); } else { - layoutInfo = mProjectCallback.resolveResourceValue(resource); + layoutInfo = mProjectCallback.resolveResourceId(resource); if (layoutInfo != null) { value = bridgeContext.getRenderResources().getProjectResource( - RenderResources.RES_LAYOUT, layoutInfo[0]); + ResourceType.LAYOUT, layoutInfo.getSecond()); } } diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java index 7b66809..5ea0a8d 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java @@ -22,6 +22,8 @@ import com.android.ide.common.rendering.api.ResourceValue; import com.android.layoutlib.bridge.Bridge; import com.android.layoutlib.bridge.BridgeConstants; import com.android.layoutlib.bridge.impl.ResourceHelper; +import com.android.resources.ResourceType; +import com.android.util.Pair; import org.kxml2.io.KXmlParser; import org.xmlpull.v1.XmlPullParser; @@ -100,22 +102,22 @@ public final class BridgeResources extends Resources { private ResourceValue getResourceValue(int id, boolean[] platformResFlag_out) { // first get the String related to this id in the framework - String[] resourceInfo = Bridge.resolveResourceValue(id); + Pair<ResourceType, String> resourceInfo = Bridge.resolveResourceId(id); if (resourceInfo != null) { platformResFlag_out[0] = true; return mContext.getRenderResources().getFrameworkResource( - resourceInfo[1], resourceInfo[0]); + resourceInfo.getFirst(), resourceInfo.getSecond()); } // didn't find a match in the framework? look in the project. if (mProjectCallback != null) { - resourceInfo = mProjectCallback.resolveResourceValue(id); + resourceInfo = mProjectCallback.resolveResourceId(id); if (resourceInfo != null) { platformResFlag_out[0] = false; return mContext.getRenderResources().getProjectResource( - resourceInfo[1], resourceInfo[0]); + resourceInfo.getFirst(), resourceInfo.getSecond()); } } @@ -614,18 +616,18 @@ public final class BridgeResources extends Resources { */ private void throwException(int id) throws NotFoundException { // first get the String related to this id in the framework - String[] resourceInfo = Bridge.resolveResourceValue(id); + Pair<ResourceType, String> resourceInfo = Bridge.resolveResourceId(id); // if the name is unknown in the framework, get it from the custom view loader. if (resourceInfo == null && mProjectCallback != null) { - resourceInfo = mProjectCallback.resolveResourceValue(id); + resourceInfo = mProjectCallback.resolveResourceId(id); } String message = null; if (resourceInfo != null) { message = String.format( "Could not find %1$s resource matching value 0x%2$X (resolved name: %3$s) in current configuration.", - resourceInfo[1], id, resourceInfo[0]); + resourceInfo.getFirst(), id, resourceInfo.getSecond()); } else { message = String.format( "Could not resolve resource value: 0x%1$X.", id); diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java index 8d3c929..cf2c0ff 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java @@ -24,6 +24,7 @@ import com.android.internal.util.XmlUtils; import com.android.layoutlib.bridge.Bridge; import com.android.layoutlib.bridge.BridgeConstants; import com.android.layoutlib.bridge.impl.ResourceHelper; +import com.android.resources.ResourceType; import org.kxml2.io.KXmlParser; import org.xmlpull.v1.XmlPullParser; @@ -39,6 +40,7 @@ import android.view.ViewGroup.LayoutParams; import java.io.File; import java.io.FileReader; +import java.util.Arrays; import java.util.Map; /** @@ -587,17 +589,17 @@ public final class BridgeTypedArray extends TypedArray { // then the xml attribute value was "resolved" which leads us to a ResourceValue with a // valid getType() and getName() returning a resource name. // (and getValue() returning null!). We need to handle this! - if (resValue.getType() != null && resValue.getType().startsWith("@+") == false) { + if (resValue.getResourceType() != null) { // if this is a framework id if (mPlatformFile || resValue.isFramework()) { // look for idName in the android R classes return mContext.getFrameworkResourceValue( - resValue.getType(), resValue.getName(), defValue); + resValue.getResourceType(), resValue.getName(), defValue); } // look for idName in the project R class. return mContext.getProjectResourceValue( - resValue.getType(), resValue.getName(), defValue); + resValue.getResourceType(), resValue.getName(), defValue); } // else, try to get the value, and resolve it somehow. @@ -634,21 +636,22 @@ public final class BridgeTypedArray extends TypedArray { // if this is a framework id if (mPlatformFile || value.startsWith("@android") || value.startsWith("@+android")) { // look for idName in the android R classes - return mContext.getFrameworkResourceValue(RenderResources.RES_ID, idName, defValue); + return mContext.getFrameworkResourceValue(ResourceType.ID, idName, defValue); } // look for idName in the project R class. - return mContext.getProjectResourceValue(RenderResources.RES_ID, idName, defValue); + return mContext.getProjectResourceValue(ResourceType.ID, idName, defValue); } // not a direct id valid reference? resolve it Integer idValue = null; if (resValue.isFramework()) { - idValue = Bridge.getResourceValue(resValue.getType(), resValue.getName()); + idValue = Bridge.getResourceId(resValue.getResourceType(), + resValue.getName()); } else { - idValue = mContext.getProjectCallback().getResourceValue( - resValue.getType(), resValue.getName()); + idValue = mContext.getProjectCallback().getResourceId( + resValue.getResourceType(), resValue.getName()); } if (idValue != null) { @@ -796,6 +799,6 @@ public final class BridgeTypedArray extends TypedArray { @Override public String toString() { - return mResourceData.toString(); + return Arrays.toString(mResourceData); } } diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeXmlPullAttributes.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeXmlPullAttributes.java index 4a6880b..ba856e0 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeXmlPullAttributes.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeXmlPullAttributes.java @@ -20,6 +20,7 @@ import com.android.ide.common.rendering.api.RenderResources; import com.android.ide.common.rendering.api.ResourceValue; import com.android.layoutlib.bridge.Bridge; import com.android.layoutlib.bridge.BridgeConstants; +import com.android.resources.ResourceType; import org.xmlpull.v1.XmlPullParser; @@ -58,7 +59,7 @@ public class BridgeXmlPullAttributes extends XmlPullAttributes { String ns = mParser.getAttributeNamespace(index); if (BridgeConstants.NS_RESOURCES.equals(ns)) { - Integer v = Bridge.getResourceValue(RenderResources.RES_ATTR, name); + Integer v = Bridge.getResourceId(ResourceType.ATTR, name); if (v != null) { return v.intValue(); } @@ -69,8 +70,7 @@ public class BridgeXmlPullAttributes extends XmlPullAttributes { // this is not an attribute in the android namespace, we query the customviewloader, if // the namespaces match. if (mContext.getProjectCallback().getNamespace().equals(ns)) { - Integer v = mContext.getProjectCallback().getResourceValue(RenderResources.RES_ATTR, - name); + Integer v = mContext.getProjectCallback().getResourceId(ResourceType.ATTR, name); if (v != null) { return v.intValue(); } @@ -110,10 +110,10 @@ public class BridgeXmlPullAttributes extends XmlPullAttributes { if (resource != null) { Integer id = null; if (mPlatformFile || resource.isFramework()) { - id = Bridge.getResourceValue(resource.getType(), resource.getName()); + id = Bridge.getResourceId(resource.getResourceType(), resource.getName()); } else { - id = mContext.getProjectCallback().getResourceValue( - resource.getType(), resource.getName()); + id = mContext.getProjectCallback().getResourceId( + resource.getResourceType(), resource.getName()); } if (id != null) { diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/FontLoader.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/FontLoader.java index 5d56370..f62fad2 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/FontLoader.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/FontLoader.java @@ -163,7 +163,7 @@ public final class FontLoader { mTtfToFontMap.put(ttf, styleMap); } - Font f = styleMap.get(style); + Font f = styleMap.get(style[0]); if (f != null) { return f; diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java index 978832f..d816d18 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java @@ -48,7 +48,9 @@ import com.android.layoutlib.bridge.android.BridgeWindow; import com.android.layoutlib.bridge.android.BridgeWindowSession; import com.android.layoutlib.bridge.android.BridgeXmlBlockParser; import com.android.resources.Density; +import com.android.resources.ResourceType; import com.android.resources.ScreenSize; +import com.android.util.Pair; import android.animation.Animator; import android.animation.AnimatorInflater; @@ -566,17 +568,16 @@ public class RenderSessionImpl extends FrameworkResourceIdProvider { int animationId = 0; if (isFrameworkAnimation) { animationResource = mContext.getRenderResources().getFrameworkResource( - RenderResources.RES_ANIMATOR, animationName); + ResourceType.ANIMATOR, animationName); if (animationResource != null) { - animationId = Bridge.getResourceValue(RenderResources.RES_ANIMATOR, - animationName); + animationId = Bridge.getResourceId(ResourceType.ANIMATOR, animationName); } } else { animationResource = mContext.getRenderResources().getProjectResource( - RenderResources.RES_ANIMATOR, animationName); + ResourceType.ANIMATOR, animationName); if (animationResource != null) { - animationId = mContext.getProjectCallback().getResourceValue( - RenderResources.RES_ANIMATOR, animationName); + animationId = mContext.getProjectCallback().getResourceId( + ResourceType.ANIMATOR, animationName); } } @@ -1022,7 +1023,7 @@ public class RenderSessionImpl extends FrameworkResourceIdProvider { mStatusBarSize = DEFAULT_STATUS_BAR_HEIGHT; // get the real value - ResourceValue value = resources.getFrameworkResource(RenderResources.RES_DIMEN, + ResourceValue value = resources.getFrameworkResource(ResourceType.DIMEN, "status_bar_height"); if (value != null) { @@ -1110,7 +1111,7 @@ public class RenderSessionImpl extends FrameworkResourceIdProvider { mSystemBarSize = 56; // ?? // get the real value - ResourceValue value = resources.getFrameworkResource(RenderResources.RES_DIMEN, + ResourceValue value = resources.getFrameworkResource(ResourceType.DIMEN, "status_bar_height"); if (value != null) { @@ -1227,10 +1228,10 @@ public class RenderSessionImpl extends FrameworkResourceIdProvider { View child = content.getChildAt(i); String tabSpec = String.format("tab_spec%d", i+1); int id = child.getId(); - String[] resource = projectCallback.resolveResourceValue(id); + Pair<ResourceType, String> resource = projectCallback.resolveResourceId(id); String name; if (resource != null) { - name = resource[0]; // 0 is resource name, 1 is resource type. + name = resource.getSecond(); } else { name = String.format("Tab %d", i+1); // default name if id is unresolved. } @@ -1309,7 +1310,7 @@ public class RenderSessionImpl extends FrameworkResourceIdProvider { // --- FrameworkResourceIdProvider methods @Override - public Integer getId(String resType, String resName) { - return Bridge.getResourceValue(resType, resName); + public Integer getId(ResourceType resType, String resName) { + return Bridge.getResourceId(resType, resName); } } diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java index 119dfb1..25bb81c 100644 --- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java +++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/ResourceHelper.java @@ -197,7 +197,8 @@ public final class ResourceHelper { } catch (Exception e) { // this is an error and not warning since the file existence is checked before // attempting to parse it. - Bridge.getLog().error(null, "Failed to parse file " + value, e, null /*data*/); + Bridge.getLog().error(null, "Failed to parse file " + stringValue, + e, null /*data*/); } } else { Bridge.getLog().error(LayoutLog.TAG_BROKEN, @@ -298,7 +299,7 @@ public final class ResourceHelper { */ public static boolean stringToFloat(String s, TypedValue outValue) { // remove the space before and after - s.trim(); + s = s.trim(); int len = s.length(); if (len <= 0) { diff --git a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/DelegateMethodAdapter.java b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/DelegateMethodAdapter.java index c7968a4..8d7f016 100644 --- a/tools/layoutlib/create/src/com/android/tools/layoutlib/create/DelegateMethodAdapter.java +++ b/tools/layoutlib/create/src/com/android/tools/layoutlib/create/DelegateMethodAdapter.java @@ -27,6 +27,8 @@ import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; +import java.util.ArrayList; + /** * This method adapter rewrites a method by discarding the original code and generating * a call to a delegate. Original annotations are passed along unchanged. @@ -124,7 +126,7 @@ class DelegateMethodAdapter implements MethodVisitor { public void generateCode() { /* * The goal is to generate a call to a static delegate method. - * If this method is not-static, the first parameter will be this. + * If this method is non-static, the first parameter will be 'this'. * All the parameters must be passed and then the eventual return type returned. * * Example, let's say we have a method such as @@ -133,9 +135,19 @@ class DelegateMethodAdapter implements MethodVisitor { * We'll want to create a body that calls a delegate method like this: * TheClass_Delegate.method_1(this, a, b, c); * + * If the method is non-static and the class name is an inner class (e.g. has $ in its + * last segment), we want to push the 'this' of the outer class first: + * OuterClass_InnerClass_Delegate.method_1( + * OuterClass.this, + * OuterClass$InnerClass.this, + * a, b, c); + * + * Only one level of inner class is supported right now, for simplicity and because + * we don't need more. + * * The generated class name is the current class name with "_Delegate" appended to it. * One thing to realize is that we don't care about generics -- since generic types - * are erased at runtime, they have no influence on the method being called. + * are erased at runtime, they have no influence on the method name being called. */ // Add our annotation @@ -151,34 +163,61 @@ class DelegateMethodAdapter implements MethodVisitor { mVisitCodeCalled = true; } - int numVars = 0; + ArrayList<Type> paramTypes = new ArrayList<Type>(); + String delegateClassName = mClassName + DELEGATE_SUFFIX; + boolean pushedArg0 = false; + int maxStack = 0; - // Push "this" for an instance method, which is always ALOAD 0 + // For an instance method (e.g. non-static), push the 'this' preceded + // by the 'this' of any outer class, if any. if (!mIsStatic) { - mParentVisitor.visitVarInsn(Opcodes.ALOAD, numVars++); + // Check if the last segment of the class name has inner an class. + // Right now we only support one level of inner classes. + int slash = mClassName.lastIndexOf('/'); + int dol = mClassName.lastIndexOf('$'); + if (dol != -1 && dol > slash && dol == mClassName.indexOf('$')) { + String outerClass = mClassName.substring(0, dol); + Type outerType = Type.getObjectType(outerClass); + + // Change a delegate class name to "com/foo/Outer_Inner_Delegate" + delegateClassName = delegateClassName.replace('$', '_'); + + // The first-level inner class has a package-protected member called 'this$0' + // that points to the outer class. + + // Push this.getField("this$0") on the call stack. + mParentVisitor.visitVarInsn(Opcodes.ALOAD, 0); // var 0 = this + mParentVisitor.visitFieldInsn(Opcodes.GETFIELD, + mClassName, // class where the field is defined + "this$0", // field name + outerType.getDescriptor()); // type of the field + maxStack++; + paramTypes.add(outerType); + } + + // Push "this" for the instance method, which is always ALOAD 0 + mParentVisitor.visitVarInsn(Opcodes.ALOAD, 0); + maxStack++; + pushedArg0 = true; + paramTypes.add(Type.getObjectType(mClassName)); } - // Push all other arguments + // Push all other arguments. Start at arg 1 if we already pushed 'this' above. Type[] argTypes = Type.getArgumentTypes(mDesc); + int maxLocals = pushedArg0 ? 1 : 0; for (Type t : argTypes) { int size = t.getSize(); - mParentVisitor.visitVarInsn(t.getOpcode(Opcodes.ILOAD), numVars); - numVars += size; - } - - // Construct the descriptor of the delegate. For a static method, it's the same - // however for an instance method we need to pass the 'this' reference first - String desc = mDesc; - if (!mIsStatic) { - Type[] argTypes2 = new Type[argTypes.length + 1]; - - argTypes2[0] = Type.getObjectType(mClassName); - System.arraycopy(argTypes, 0, argTypes2, 1, argTypes.length); - - desc = Type.getMethodDescriptor(Type.getReturnType(mDesc), argTypes2); + mParentVisitor.visitVarInsn(t.getOpcode(Opcodes.ILOAD), maxLocals); + maxLocals += size; + maxStack += size; + paramTypes.add(t); } - String delegateClassName = mClassName + DELEGATE_SUFFIX; + // Construct the descriptor of the delegate based on the parameters + // we pushed on the call stack. The return type remains unchanged. + String desc = Type.getMethodDescriptor( + Type.getReturnType(mDesc), + paramTypes.toArray(new Type[paramTypes.size()])); // Invoke the static delegate mParentVisitor.visitMethodInsn(Opcodes.INVOKESTATIC, @@ -189,7 +228,7 @@ class DelegateMethodAdapter implements MethodVisitor { Type returnType = Type.getReturnType(mDesc); mParentVisitor.visitInsn(returnType.getOpcode(Opcodes.IRETURN)); - mParentVisitor.visitMaxs(numVars, numVars); + mParentVisitor.visitMaxs(maxStack, maxLocals); mParentVisitor.visitEnd(); // For debugging now. Maybe we should collect these and store them in diff --git a/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/DelegateClassAdapterTest.java b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/DelegateClassAdapterTest.java index 7d80796..e8b3ea8 100644 --- a/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/DelegateClassAdapterTest.java +++ b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/DelegateClassAdapterTest.java @@ -24,25 +24,38 @@ import static org.junit.Assert.assertSame; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; +import com.android.tools.layoutlib.create.dataclass.ClassWithNative; +import com.android.tools.layoutlib.create.dataclass.OuterClass; +import com.android.tools.layoutlib.create.dataclass.OuterClass.InnerClass; + import org.junit.Before; import org.junit.Test; import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.ClassWriter; import java.io.IOException; +import java.io.PrintWriter; +import java.io.StringWriter; import java.lang.annotation.Annotation; +import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; +import java.util.HashMap; import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; public class DelegateClassAdapterTest { private MockLog mLog; - private static final String CLASS_NAME = - DelegateClassAdapterTest.class.getCanonicalName() + "$" + - ClassWithNative.class.getSimpleName(); + private static final String NATIVE_CLASS_NAME = ClassWithNative.class.getCanonicalName(); + private static final String OUTER_CLASS_NAME = OuterClass.class.getCanonicalName(); + private static final String INNER_CLASS_NAME = OuterClass.class.getCanonicalName() + "$" + + InnerClass.class.getSimpleName(); @Before public void setUp() throws Exception { @@ -55,11 +68,11 @@ public class DelegateClassAdapterTest { */ @SuppressWarnings("unchecked") @Test - public void testNoOp() throws Exception { + public void testNoOp() throws Throwable { // create an instance of the class that will be modified // (load the class in a distinct class loader so that we can trash its definition later) ClassLoader cl1 = new ClassLoader(this.getClass().getClassLoader()) { }; - Class<ClassWithNative> clazz1 = (Class<ClassWithNative>) cl1.loadClass(CLASS_NAME); + Class<ClassWithNative> clazz1 = (Class<ClassWithNative>) cl1.loadClass(NATIVE_CLASS_NAME); ClassWithNative instance1 = clazz1.newInstance(); assertEquals(42, instance1.add(20, 22)); try { @@ -73,42 +86,47 @@ public class DelegateClassAdapterTest { ClassWriter cw = new ClassWriter(0 /*flags*/); HashSet<String> delegateMethods = new HashSet<String>(); - String internalClassName = CLASS_NAME.replace('.', '/'); + String internalClassName = NATIVE_CLASS_NAME.replace('.', '/'); DelegateClassAdapter cv = new DelegateClassAdapter( mLog, cw, internalClassName, delegateMethods); - ClassReader cr = new ClassReader(CLASS_NAME); + ClassReader cr = new ClassReader(NATIVE_CLASS_NAME); cr.accept(cv, 0 /* flags */); // Load the generated class in a different class loader and try it again - final byte[] bytes = cw.toByteArray(); - ClassLoader2 cl2 = new ClassLoader2(bytes) { - @Override - public void testModifiedInstance() throws Exception { - Class<?> clazz2 = loadClass(CLASS_NAME); - Object i2 = clazz2.newInstance(); - assertNotNull(i2); - assertEquals(42, callAdd(i2, 20, 22)); + ClassLoader2 cl2 = null; + try { + cl2 = new ClassLoader2() { + @Override + public void testModifiedInstance() throws Exception { + Class<?> clazz2 = loadClass(NATIVE_CLASS_NAME); + Object i2 = clazz2.newInstance(); + assertNotNull(i2); + assertEquals(42, callAdd(i2, 20, 22)); - try { - callCallNativeInstance(i2, 10, 3.1415, new Object[0]); - fail("Test should have failed to invoke callTheNativeMethod [2]"); - } catch (InvocationTargetException e) { - // This is expected to fail since the native method has NOT been - // overridden here. - assertEquals(UnsatisfiedLinkError.class, e.getCause().getClass()); + try { + callCallNativeInstance(i2, 10, 3.1415, new Object[0]); + fail("Test should have failed to invoke callTheNativeMethod [2]"); + } catch (InvocationTargetException e) { + // This is expected to fail since the native method has NOT been + // overridden here. + assertEquals(UnsatisfiedLinkError.class, e.getCause().getClass()); + } + + // Check that the native method does NOT have the new annotation + Method[] m = clazz2.getDeclaredMethods(); + assertEquals("native_instance", m[2].getName()); + assertTrue(Modifier.isNative(m[2].getModifiers())); + Annotation[] a = m[2].getAnnotations(); + assertEquals(0, a.length); } - - // Check that the native method does NOT have the new annotation - Method[] m = clazz2.getDeclaredMethods(); - assertEquals("native_instance", m[2].getName()); - assertTrue(Modifier.isNative(m[2].getModifiers())); - Annotation[] a = m[2].getAnnotations(); - assertEquals(0, a.length); - } - }; - cl2.testModifiedInstance(); + }; + cl2.add(NATIVE_CLASS_NAME, cw); + cl2.testModifiedInstance(); + } catch (Throwable t) { + throw dumpGeneratedClass(t, cl2); + } } /** @@ -122,38 +140,37 @@ public class DelegateClassAdapterTest { public void testConstructorsNotSupported() throws IOException { ClassWriter cw = new ClassWriter(0 /*flags*/); - String internalClassName = CLASS_NAME.replace('.', '/'); + String internalClassName = NATIVE_CLASS_NAME.replace('.', '/'); HashSet<String> delegateMethods = new HashSet<String>(); delegateMethods.add("<init>"); DelegateClassAdapter cv = new DelegateClassAdapter( mLog, cw, internalClassName, delegateMethods); - ClassReader cr = new ClassReader(CLASS_NAME); + ClassReader cr = new ClassReader(NATIVE_CLASS_NAME); cr.accept(cv, 0 /* flags */); } @Test - public void testDelegateNative() throws Exception { + public void testDelegateNative() throws Throwable { ClassWriter cw = new ClassWriter(0 /*flags*/); - String internalClassName = CLASS_NAME.replace('.', '/'); + String internalClassName = NATIVE_CLASS_NAME.replace('.', '/'); HashSet<String> delegateMethods = new HashSet<String>(); delegateMethods.add(DelegateClassAdapter.ALL_NATIVES); DelegateClassAdapter cv = new DelegateClassAdapter( mLog, cw, internalClassName, delegateMethods); - ClassReader cr = new ClassReader(CLASS_NAME); + ClassReader cr = new ClassReader(NATIVE_CLASS_NAME); cr.accept(cv, 0 /* flags */); // Load the generated class in a different class loader and try it - final byte[] bytes = cw.toByteArray(); - + ClassLoader2 cl2 = null; try { - ClassLoader2 cl2 = new ClassLoader2(bytes) { + cl2 = new ClassLoader2() { @Override public void testModifiedInstance() throws Exception { - Class<?> clazz2 = loadClass(CLASS_NAME); + Class<?> clazz2 = loadClass(NATIVE_CLASS_NAME); Object i2 = clazz2.newInstance(); assertNotNull(i2); @@ -173,48 +190,105 @@ public class DelegateClassAdapterTest { assertEquals("LayoutlibDelegate", a[0].annotationType().getSimpleName()); } }; + cl2.add(NATIVE_CLASS_NAME, cw); cl2.testModifiedInstance(); + } catch (Throwable t) { + throw dumpGeneratedClass(t, cl2); + } + } + + @Test + public void testDelegateInner() throws Throwable { + // We'll delegate the "get" method of both the inner and outer class. + HashSet<String> delegateMethods = new HashSet<String>(); + delegateMethods.add("get"); + + // Generate the delegate for the outer class. + ClassWriter cwOuter = new ClassWriter(0 /*flags*/); + String outerClassName = OUTER_CLASS_NAME.replace('.', '/'); + DelegateClassAdapter cvOuter = new DelegateClassAdapter( + mLog, cwOuter, outerClassName, delegateMethods); + ClassReader cr = new ClassReader(OUTER_CLASS_NAME); + cr.accept(cvOuter, 0 /* flags */); + + // Generate the delegate for the inner class. + ClassWriter cwInner = new ClassWriter(0 /*flags*/); + String innerClassName = INNER_CLASS_NAME.replace('.', '/'); + DelegateClassAdapter cvInner = new DelegateClassAdapter( + mLog, cwInner, innerClassName, delegateMethods); + cr = new ClassReader(INNER_CLASS_NAME); + cr.accept(cvInner, 0 /* flags */); + + // Load the generated classes in a different class loader and try them + ClassLoader2 cl2 = null; + try { + cl2 = new ClassLoader2() { + @Override + public void testModifiedInstance() throws Exception { + + // Check the outer class + Class<?> outerClazz2 = loadClass(OUTER_CLASS_NAME); + Object o2 = outerClazz2.newInstance(); + assertNotNull(o2); + + // The original Outer.get returns 1+10+20, + // but the delegate makes it return 4+10+20 + assertEquals(4+10+20, callGet(o2, 10, 20)); + + // Check the inner class. Since it's not a static inner class, we need + // to use the hidden constructor that takes the outer class as first parameter. + Class<?> innerClazz2 = loadClass(INNER_CLASS_NAME); + Constructor<?> innerCons = innerClazz2.getConstructor( + new Class<?>[] { outerClazz2 }); + Object i2 = innerCons.newInstance(new Object[] { o2 }); + assertNotNull(i2); - // This code block is useful for debugging. However to make it work you need to - // pull in the org.objectweb.asm.util.TraceClassVisitor class and associated - // utilities which are found in the ASM source jar. - // - // } catch (Throwable t) { - // For debugging, dump the bytecode of the class in case of unexpected error. - // StringWriter sw = new StringWriter(); - // PrintWriter pw = new PrintWriter(sw); - // TraceClassVisitor tcv = new TraceClassVisitor(pw); - // ClassReader cr2 = new ClassReader(bytes); - // cr2.accept(tcv, 0 /* flags */); - // String msg = "\n" + t.getClass().getCanonicalName(); - // if (t.getMessage() != null) { - // msg += ": " + t.getMessage(); - // } - // msg = msg + "\nBytecode dump:\n" + sw.toString(); - // // Re-throw exception with new message - // RuntimeException ex = new RuntimeException(msg, t); - // throw ex; - } finally { + // The original Inner.get returns 3+10+20, + // but the delegate makes it return 6+10+20 + assertEquals(6+10+20, callGet(i2, 10, 20)); + } + }; + cl2.add(OUTER_CLASS_NAME, cwOuter.toByteArray()); + cl2.add(INNER_CLASS_NAME, cwInner.toByteArray()); + cl2.testModifiedInstance(); + } catch (Throwable t) { + throw dumpGeneratedClass(t, cl2); } } //------- /** - * A class loader than can define and instantiate our dummy {@link ClassWithNative}. + * A class loader than can define and instantiate our modified classes. + * <p/> + * The trick here is that this class loader will test our <em>modified</em> version + * of the classes, the one with the delegate calls. * <p/> - * The trick here is that this class loader will test our modified version of ClassWithNative. * Trying to do so in the original class loader generates all sort of link issues because * there are 2 different definitions of the same class name. This class loader will * define and load the class when requested by name and provide helpers to access the * instance methods via reflection. */ private abstract class ClassLoader2 extends ClassLoader { - private final byte[] mClassWithNative; - public ClassLoader2(byte[] classWithNative) { + private final Map<String, byte[]> mClassDefs = new HashMap<String, byte[]>(); + + public ClassLoader2() { super(null); - mClassWithNative = classWithNative; + } + + public ClassLoader2 add(String className, byte[] definition) { + mClassDefs.put(className, definition); + return this; + } + + public ClassLoader2 add(String className, ClassWriter rewrittenClass) { + mClassDefs.put(className, rewrittenClass.toByteArray()); + return this; + } + + private Set<Entry<String, byte[]>> getByteCode() { + return mClassDefs.entrySet(); } @SuppressWarnings("unused") @@ -224,9 +298,10 @@ public class DelegateClassAdapterTest { return super.findClass(name); } catch (ClassNotFoundException e) { - if (CLASS_NAME.equals(name)) { + byte[] def = mClassDefs.get(name); + if (def != null) { // Load the modified ClassWithNative from its bytes representation. - return defineClass(CLASS_NAME, mClassWithNative, 0, mClassWithNative.length); + return defineClass(name, def, 0, def.length); } try { @@ -244,6 +319,17 @@ public class DelegateClassAdapterTest { } /** + * Accesses {@link OuterClass#get()} or {@link InnerClass#get() }via reflection. + */ + public int callGet(Object instance, int a, long b) throws Exception { + Method m = instance.getClass().getMethod("get", + new Class<?>[] { int.class, long.class } ); + + Object result = m.invoke(instance, new Object[] { a, b }); + return ((Integer) result).intValue(); + } + + /** * Accesses {@link ClassWithNative#add(int, int)} via reflection. */ public int callAdd(Object instance, int a, int b) throws Exception { @@ -271,34 +357,53 @@ public class DelegateClassAdapterTest { } /** - * Dummy test class with a native method. - * The native method is not defined and any attempt to invoke it will - * throw an {@link UnsatisfiedLinkError}. + * For debugging, it's useful to dump the content of the generated classes + * along with the exception that was generated. + * + * However to make it work you need to pull in the org.objectweb.asm.util.TraceClassVisitor + * class and associated utilities which are found in the ASM source jar. Since we don't + * want that dependency in the source code, we only put it manually for development and + * access the TraceClassVisitor via reflection if present. + * + * @param t The exception thrown by {@link ClassLoader2#testModifiedInstance()} + * @param cl2 The {@link ClassLoader2} instance with the generated bytecode. + * @return Either original {@code t} or a new wrapper {@link Throwable} */ - public static class ClassWithNative { - public ClassWithNative() { - } - - public int add(int a, int b) { - return a + b; - } + private Throwable dumpGeneratedClass(Throwable t, ClassLoader2 cl2) { + try { + // For debugging, dump the bytecode of the class in case of unexpected error + // if we can find the TraceClassVisitor class. + Class<?> tcvClass = Class.forName("org.objectweb.asm.util.TraceClassVisitor"); + + StringBuilder sb = new StringBuilder(); + sb.append('\n').append(t.getClass().getCanonicalName()); + if (t.getMessage() != null) { + sb.append(": ").append(t.getMessage()); + } + + for (Entry<String, byte[]> entry : cl2.getByteCode()) { + String className = entry.getKey(); + byte[] bytes = entry.getValue(); + + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + // next 2 lines do: TraceClassVisitor tcv = new TraceClassVisitor(pw); + Constructor<?> cons = tcvClass.getConstructor(new Class<?>[] { pw.getClass() }); + Object tcv = cons.newInstance(new Object[] { pw }); + ClassReader cr2 = new ClassReader(bytes); + cr2.accept((ClassVisitor) tcv, 0 /* flags */); + + sb.append("\nBytecode dump: <").append(className).append(">:\n") + .append(sw.toString()); + } - public int callNativeInstance(int a, double d, Object[] o) { - return native_instance(a, d, o); + // Re-throw exception with new message + RuntimeException ex = new RuntimeException(sb.toString(), t); + return ex; + } catch (Throwable ignore) { + // In case of problem, just throw the original exception as-is. + return t; } - - private native int native_instance(int a, double d, Object[] o); } - /** - * The delegate that receives the call to {@link ClassWithNative}'s overridden methods. - */ - public static class ClassWithNative_Delegate { - public static int native_instance(ClassWithNative instance, int a, double d, Object[] o) { - if (o != null && o.length > 0) { - o[0] = instance; - } - return (int)(a + d); - } - } } diff --git a/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/dataclass/ClassWithNative.java b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/dataclass/ClassWithNative.java new file mode 100644 index 0000000..c314853 --- /dev/null +++ b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/dataclass/ClassWithNative.java @@ -0,0 +1,45 @@ +/* + * 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 com.android.tools.layoutlib.create.dataclass; + +import com.android.tools.layoutlib.create.DelegateClassAdapterTest; + +/** + * Dummy test class with a native method. + * The native method is not defined and any attempt to invoke it will + * throw an {@link UnsatisfiedLinkError}. + * + * Used by {@link DelegateClassAdapterTest}. + */ +public class ClassWithNative { + public ClassWithNative() { + } + + public int add(int a, int b) { + return a + b; + } + + // Note: it's good to have a long or double for testing parameters since they take + // 2 slots in the stack/locals maps. + + public int callNativeInstance(int a, double d, Object[] o) { + return native_instance(a, d, o); + } + + private native int native_instance(int a, double d, Object[] o); +} + diff --git a/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/dataclass/ClassWithNative_Delegate.java b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/dataclass/ClassWithNative_Delegate.java new file mode 100644 index 0000000..a3d4dc6 --- /dev/null +++ b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/dataclass/ClassWithNative_Delegate.java @@ -0,0 +1,34 @@ +/* + * 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 com.android.tools.layoutlib.create.dataclass; + +import com.android.tools.layoutlib.create.DelegateClassAdapterTest; + +/** + * The delegate that receives the call to {@link ClassWithNative_Delegate}'s overridden methods. + * + * Used by {@link DelegateClassAdapterTest}. + */ +public class ClassWithNative_Delegate { + public static int native_instance(ClassWithNative instance, int a, double d, Object[] o) { + if (o != null && o.length > 0) { + o[0] = instance; + } + return (int)(a + d); + } +} + diff --git a/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/dataclass/OuterClass.java b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/dataclass/OuterClass.java new file mode 100644 index 0000000..9dc2f69 --- /dev/null +++ b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/dataclass/OuterClass.java @@ -0,0 +1,48 @@ +/* + * 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.tools.layoutlib.create.dataclass; + +import com.android.tools.layoutlib.create.DelegateClassAdapterTest; + +/** + * Test class with an inner class. + * + * Used by {@link DelegateClassAdapterTest}. + */ +public class OuterClass { + private int mOuterValue = 1; + public OuterClass() { + } + + // Outer.get returns 1 + a + b + // Note: it's good to have a long or double for testing parameters since they take + // 2 slots in the stack/locals maps. + public int get(int a, long b) { + return mOuterValue + a + (int) b; + } + + public class InnerClass { + public InnerClass() { + } + + // Inner.get returns 1+2=3 + a + b + public int get(int a, long b) { + return 2 + mOuterValue + a + (int) b; + } + } +} + diff --git a/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/dataclass/OuterClass_Delegate.java b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/dataclass/OuterClass_Delegate.java new file mode 100644 index 0000000..3252d87 --- /dev/null +++ b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/dataclass/OuterClass_Delegate.java @@ -0,0 +1,30 @@ +/* + * 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.tools.layoutlib.create.dataclass; + +import com.android.tools.layoutlib.create.DelegateClassAdapterTest; + +/** + * Used by {@link DelegateClassAdapterTest}. + */ +public class OuterClass_Delegate { + // The delegate override of Outer.get returns 4 + a + b + public static int get(OuterClass instance, int a, long b) { + return 4 + a + (int) b; + } +} + diff --git a/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/dataclass/OuterClass_InnerClass_Delegate.java b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/dataclass/OuterClass_InnerClass_Delegate.java new file mode 100644 index 0000000..b472220 --- /dev/null +++ b/tools/layoutlib/create/tests/com/android/tools/layoutlib/create/dataclass/OuterClass_InnerClass_Delegate.java @@ -0,0 +1,30 @@ +/* + * 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.tools.layoutlib.create.dataclass; + +import com.android.tools.layoutlib.create.DelegateClassAdapterTest; +import com.android.tools.layoutlib.create.dataclass.OuterClass.InnerClass; + +/** + * Used by {@link DelegateClassAdapterTest}. + */ +public class OuterClass_InnerClass_Delegate { + // The delegate override of Inner.get return 6 + a + b + public static int get(OuterClass outer, InnerClass inner, int a, long b) { + return 6 + a + (int) b; + } +} |
