summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/current.xml1948
-rw-r--r--cmds/stagefright/stagefright.cpp4
-rw-r--r--core/java/android/app/ProgressDialog.java61
-rw-r--r--core/java/android/content/ContentProvider.java22
-rw-r--r--core/java/android/content/ContentResolver.java61
-rw-r--r--core/java/android/content/IContentProvider.java13
-rw-r--r--core/java/android/widget/QuickContactBadge.java40
-rw-r--r--core/res/AndroidManifest.xml8
-rw-r--r--core/res/res/drawable-hdpi/quickcontact_badge_overlay_normal_dark.9.pngbin0 -> 303 bytes
-rw-r--r--core/res/res/drawable-hdpi/quickcontact_badge_overlay_normal_light.9.pngbin0 -> 305 bytes
-rw-r--r--core/res/res/drawable-hdpi/quickcontact_badge_overlay_pressed_dark.9.pngbin0 -> 593 bytes
-rw-r--r--core/res/res/drawable-hdpi/quickcontact_badge_overlay_pressed_light.9.pngbin0 -> 600 bytes
-rw-r--r--core/res/res/drawable-hdpi/quickcontact_badge_pressed.9.pngbin3093 -> 0 bytes
-rw-r--r--core/res/res/drawable-hdpi/quickcontact_badge_small_pressed.9.pngbin3150 -> 0 bytes
-rw-r--r--core/res/res/drawable-hdpi/quickcontact_badge_small_unpressed.9.pngbin3184 -> 0 bytes
-rw-r--r--core/res/res/drawable-hdpi/quickcontact_badge_unpressed.9.pngbin3127 -> 0 bytes
-rw-r--r--core/res/res/drawable-hdpi/quickcontact_nobadge.9.pngbin1019 -> 0 bytes
-rw-r--r--core/res/res/drawable-ldpi/quickcontact_badge_pressed.9.pngbin291 -> 0 bytes
-rw-r--r--core/res/res/drawable-ldpi/quickcontact_badge_small_pressed.9.pngbin312 -> 0 bytes
-rw-r--r--core/res/res/drawable-ldpi/quickcontact_badge_small_unpressed.9.pngbin317 -> 0 bytes
-rw-r--r--core/res/res/drawable-ldpi/quickcontact_badge_unpressed.9.pngbin309 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/quickcontact_badge_overlay_normal_dark.9.pngbin0 -> 254 bytes
-rw-r--r--core/res/res/drawable-mdpi/quickcontact_badge_overlay_normal_light.9.pngbin0 -> 254 bytes
-rw-r--r--core/res/res/drawable-mdpi/quickcontact_badge_overlay_pressed_dark.9.pngbin0 -> 463 bytes
-rw-r--r--core/res/res/drawable-mdpi/quickcontact_badge_overlay_pressed_light.9.pngbin0 -> 466 bytes
-rw-r--r--core/res/res/drawable-mdpi/quickcontact_badge_pressed.9.pngbin650 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/quickcontact_badge_small_pressed.9.pngbin605 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/quickcontact_badge_small_unpressed.9.pngbin609 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/quickcontact_badge_unpressed.9.pngbin651 -> 0 bytes
-rw-r--r--core/res/res/drawable-mdpi/quickcontact_nobadge.9.pngbin1016 -> 0 bytes
-rw-r--r--core/res/res/drawable/quickcontact_badge_overlay_dark.xml (renamed from core/res/res/drawable/quickcontact_badge.xml)4
-rw-r--r--core/res/res/drawable/quickcontact_badge_overlay_light.xml (renamed from core/res/res/drawable/quickcontact_badge_small.xml)4
-rw-r--r--core/res/res/layout-xlarge/keyguard_screen_lock.xml6
-rw-r--r--core/res/res/layout-xlarge/keyguard_screen_tab_unlock.xml3
-rw-r--r--core/res/res/layout-xlarge/keyguard_screen_tab_unlock_land.xml1
-rw-r--r--core/res/res/layout-xlarge/keyguard_screen_unlock_landscape.xml3
-rw-r--r--core/res/res/layout-xlarge/keyguard_screen_unlock_portrait.xml4
-rw-r--r--core/res/res/layout/alert_dialog_progress.xml6
-rw-r--r--core/res/res/layout/keyguard_screen_password_landscape.xml1
-rw-r--r--core/res/res/layout/keyguard_screen_password_portrait.xml1
-rw-r--r--core/res/res/layout/keyguard_screen_tab_unlock.xml1
-rw-r--r--core/res/res/layout/keyguard_screen_tab_unlock_land.xml1
-rw-r--r--core/res/res/layout/keyguard_screen_unlock_landscape.xml4
-rw-r--r--core/res/res/layout/keyguard_screen_unlock_portrait.xml4
-rwxr-xr-xcore/res/res/values/attrs.xml4
-rw-r--r--core/res/res/values/styles.xml20
-rw-r--r--core/res/res/values/themes.xml4
-rw-r--r--core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/ConnectivityManagerMobileTest.java15
-rwxr-xr-xcore/tests/coretests/src/android/content/pm/AppCacheTest.java53
-rw-r--r--data/etc/platform.xml4
-rw-r--r--graphics/java/android/renderscript/Allocation.java113
-rw-r--r--graphics/java/android/renderscript/AllocationAdapter.java1
-rw-r--r--graphics/java/android/renderscript/FileA3D.java1
-rw-r--r--graphics/java/android/renderscript/Font.java1
-rw-r--r--graphics/java/android/renderscript/Long2.java1
-rw-r--r--graphics/java/android/renderscript/Long3.java1
-rw-r--r--graphics/java/android/renderscript/Long4.java1
-rw-r--r--graphics/java/android/renderscript/Mesh.java3
-rw-r--r--graphics/java/android/renderscript/RSDriverException.java1
-rw-r--r--graphics/java/android/renderscript/RSIllegalArgumentException.java1
-rw-r--r--graphics/java/android/renderscript/RSInvalidStateException.java1
-rw-r--r--graphics/java/android/renderscript/RSRuntimeException.java1
-rw-r--r--graphics/java/android/renderscript/RSSurfaceView.java9
-rw-r--r--graphics/java/android/renderscript/RenderScript.java4
-rw-r--r--graphics/jni/android_renderscript_RenderScript.cpp14
-rw-r--r--include/gui/SurfaceTexture.h46
-rw-r--r--include/media/IMediaMetadataRetriever.h1
-rw-r--r--include/media/MediaMetadataRetrieverInterface.h26
-rw-r--r--include/media/mediametadataretriever.h34
-rw-r--r--libs/gui/SurfaceTexture.cpp119
-rw-r--r--libs/rs/rs.spec10
-rw-r--r--libs/rs/rsAllocation.cpp57
-rw-r--r--media/java/android/media/MediaMetadataRetriever.java164
-rw-r--r--media/java/android/media/MediaScanner.java59
-rw-r--r--media/java/android/media/ThumbnailUtils.java1
-rw-r--r--media/java/android/mtp/MtpDatabase.java16
-rw-r--r--media/jni/android_media_MediaMetadataRetriever.cpp12
-rw-r--r--media/libmedia/IMediaMetadataRetriever.cpp16
-rw-r--r--media/libmedia/mediametadataretriever.cpp11
-rw-r--r--media/libmediaplayerservice/MetadataRetrieverClient.cpp27
-rw-r--r--media/libmediaplayerservice/MetadataRetrieverClient.h2
-rw-r--r--media/libstagefright/StagefrightMediaScanner.cpp8
-rw-r--r--media/libstagefright/StagefrightMetadataRetriever.cpp17
-rw-r--r--media/libstagefright/rtsp/ASessionDescription.cpp12
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaMetadataTest.java1
-rw-r--r--media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java8
-rw-r--r--policy/src/com/android/internal/policy/impl/KeyguardViewBase.java27
-rw-r--r--services/java/com/android/server/WindowManagerService.java39
-rw-r--r--tests/CoreTests/android/core/HeapTest.java67
89 files changed, 2677 insertions, 556 deletions
diff --git a/api/current.xml b/api/current.xml
index 53ab70c..6053e1b 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -34814,6 +34814,32 @@
<parameter name="d" type="android.graphics.drawable.Drawable">
</parameter>
</method>
+<method name="setProgressNumberFormat"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="format" type="java.lang.String">
+</parameter>
+</method>
+<method name="setProgressPercentFormat"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="format" type="java.text.NumberFormat">
+</parameter>
+</method>
<method name="setProgressStyle"
return="void"
abstract="false"
@@ -44972,6 +44998,23 @@
<parameter name="values" type="android.content.ContentValues[]">
</parameter>
</method>
+<method name="call"
+ return="android.os.Bundle"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="method" type="java.lang.String">
+</parameter>
+<parameter name="arg" type="java.lang.String">
+</parameter>
+<parameter name="extras" type="android.os.Bundle">
+</parameter>
+</method>
<method name="delete"
return="int"
abstract="true"
@@ -46188,6 +46231,25 @@
<parameter name="values" type="android.content.ContentValues[]">
</parameter>
</method>
+<method name="call"
+ return="android.os.Bundle"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="uri" type="android.net.Uri">
+</parameter>
+<parameter name="method" type="java.lang.String">
+</parameter>
+<parameter name="arg" type="java.lang.String">
+</parameter>
+<parameter name="extras" type="android.os.Bundle">
+</parameter>
+</method>
<method name="cancelSync"
return="void"
abstract="false"
@@ -103521,6 +103583,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"
@@ -166131,7 +166572,7 @@
</parameter>
<parameter name="h" type="int">
</parameter>
-<parameter name="d" type="byte[]">
+<parameter name="data" type="byte[]">
</parameter>
</method>
<method name="copy2DRangeFrom"
@@ -166152,7 +166593,7 @@
</parameter>
<parameter name="h" type="int">
</parameter>
-<parameter name="d" type="short[]">
+<parameter name="data" type="short[]">
</parameter>
</method>
<method name="copy2DRangeFrom"
@@ -166173,7 +166614,7 @@
</parameter>
<parameter name="h" type="int">
</parameter>
-<parameter name="d" type="int[]">
+<parameter name="data" type="int[]">
</parameter>
</method>
<method name="copy2DRangeFrom"
@@ -166194,7 +166635,7 @@
</parameter>
<parameter name="h" type="int">
</parameter>
-<parameter name="d" type="float[]">
+<parameter name="data" type="float[]">
</parameter>
</method>
<method name="copy2DRangeFrom"
@@ -166211,7 +166652,7 @@
</parameter>
<parameter name="yoff" type="int">
</parameter>
-<parameter name="b" type="android.graphics.Bitmap">
+<parameter name="data" type="android.graphics.Bitmap">
</parameter>
</method>
<method name="copyFrom"
@@ -166621,6 +167062,17 @@
<parameter name="type" type="android.renderscript.Type">
</parameter>
</method>
+<method name="generateMipmaps"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
<method name="getType"
return="android.renderscript.Type"
abstract="false"
@@ -166736,6 +167188,250 @@
>
</method>
</class>
+<class name="AllocationAdapter"
+ extends="android.renderscript.Allocation"
+ abstract="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<method name="create2D"
+ return="android.renderscript.AllocationAdapter"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="rs" type="android.renderscript.RenderScript">
+</parameter>
+<parameter name="a" type="android.renderscript.Allocation">
+</parameter>
+</method>
+<method name="readData"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="d" type="int[]">
+</parameter>
+</method>
+<method name="readData"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="d" type="float[]">
+</parameter>
+</method>
+<method name="setFace"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="cf" type="android.renderscript.Type.CubemapFace">
+</parameter>
+</method>
+<method name="setLOD"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="lod" type="int">
+</parameter>
+</method>
+<method name="setY"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="y" type="int">
+</parameter>
+</method>
+<method name="setZ"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="z" type="int">
+</parameter>
+</method>
+<method name="subData"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="xoff" type="int">
+</parameter>
+<parameter name="fp" type="android.renderscript.FieldPacker">
+</parameter>
+</method>
+<method name="subData1D"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="off" type="int">
+</parameter>
+<parameter name="count" type="int">
+</parameter>
+<parameter name="d" type="int[]">
+</parameter>
+</method>
+<method name="subData1D"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="off" type="int">
+</parameter>
+<parameter name="count" type="int">
+</parameter>
+<parameter name="d" type="short[]">
+</parameter>
+</method>
+<method name="subData1D"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="off" type="int">
+</parameter>
+<parameter name="count" type="int">
+</parameter>
+<parameter name="d" type="byte[]">
+</parameter>
+</method>
+<method name="subData1D"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="off" type="int">
+</parameter>
+<parameter name="count" type="int">
+</parameter>
+<parameter name="d" type="float[]">
+</parameter>
+</method>
+<method name="subData2D"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="xoff" type="int">
+</parameter>
+<parameter name="yoff" type="int">
+</parameter>
+<parameter name="w" type="int">
+</parameter>
+<parameter name="h" type="int">
+</parameter>
+<parameter name="d" type="int[]">
+</parameter>
+</method>
+<method name="subData2D"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="xoff" type="int">
+</parameter>
+<parameter name="yoff" type="int">
+</parameter>
+<parameter name="w" type="int">
+</parameter>
+<parameter name="h" type="int">
+</parameter>
+<parameter name="d" type="float[]">
+</parameter>
+</method>
+<method name="subElementData"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="xoff" type="int">
+</parameter>
+<parameter name="component_number" type="int">
+</parameter>
+<parameter name="fp" type="android.renderscript.FieldPacker">
+</parameter>
+</method>
+</class>
<class name="BaseObj"
extends="java.lang.Object"
abstract="false"
@@ -168095,6 +168791,246 @@
</parameter>
</method>
</class>
+<class name="FileA3D"
+ extends="android.renderscript.BaseObj"
+ abstract="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<method name="createFromAsset"
+ return="android.renderscript.FileA3D"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="rs" type="android.renderscript.RenderScript">
+</parameter>
+<parameter name="mgr" type="android.content.res.AssetManager">
+</parameter>
+<parameter name="path" type="java.lang.String">
+</parameter>
+</method>
+<method name="createFromFile"
+ return="android.renderscript.FileA3D"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="rs" type="android.renderscript.RenderScript">
+</parameter>
+<parameter name="path" type="java.lang.String">
+</parameter>
+</method>
+<method name="createFromFile"
+ return="android.renderscript.FileA3D"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="rs" type="android.renderscript.RenderScript">
+</parameter>
+<parameter name="path" type="java.io.File">
+</parameter>
+</method>
+<method name="createFromResource"
+ return="android.renderscript.FileA3D"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="rs" type="android.renderscript.RenderScript">
+</parameter>
+<parameter name="res" type="android.content.res.Resources">
+</parameter>
+<parameter name="id" type="int">
+</parameter>
+</method>
+<method name="getIndexEntry"
+ return="android.renderscript.FileA3D.IndexEntry"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="index" type="int">
+</parameter>
+</method>
+<method name="getIndexEntryCount"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+</class>
+<class name="FileA3D.ClassID"
+ extends="java.lang.Enum"
+ abstract="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<method name="toClassID"
+ return="android.renderscript.FileA3D.ClassID"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="intID" type="int">
+</parameter>
+</method>
+<method name="valueOf"
+ return="android.renderscript.FileA3D.ClassID"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="name" type="java.lang.String">
+</parameter>
+</method>
+<method name="values"
+ return="android.renderscript.FileA3D.ClassID[]"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+</class>
+<class name="FileA3D.EntryType"
+ extends="java.lang.Enum"
+ abstract="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<method name="valueOf"
+ return="android.renderscript.FileA3D.EntryType"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="name" type="java.lang.String">
+</parameter>
+</method>
+<method name="values"
+ return="android.renderscript.FileA3D.EntryType[]"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+</class>
+<class name="FileA3D.IndexEntry"
+ extends="java.lang.Object"
+ abstract="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<method name="getClassID"
+ return="android.renderscript.FileA3D.ClassID"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getEntryType"
+ return="android.renderscript.FileA3D.EntryType"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getMesh"
+ return="android.renderscript.Mesh"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getName"
+ return="java.lang.String"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getObject"
+ return="android.renderscript.BaseObj"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+</class>
<class name="Float2"
extends="java.lang.Object"
abstract="false"
@@ -168278,6 +169214,145 @@
>
</field>
</class>
+<class name="Font"
+ extends="android.renderscript.BaseObj"
+ abstract="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<method name="create"
+ return="android.renderscript.Font"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="rs" type="android.renderscript.RenderScript">
+</parameter>
+<parameter name="res" type="android.content.res.Resources">
+</parameter>
+<parameter name="familyName" type="java.lang.String">
+</parameter>
+<parameter name="fontStyle" type="android.renderscript.Font.Style">
+</parameter>
+<parameter name="pointSize" type="float">
+</parameter>
+</method>
+<method name="createFromAsset"
+ return="android.renderscript.Font"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="rs" type="android.renderscript.RenderScript">
+</parameter>
+<parameter name="res" type="android.content.res.Resources">
+</parameter>
+<parameter name="path" type="java.lang.String">
+</parameter>
+<parameter name="pointSize" type="float">
+</parameter>
+</method>
+<method name="createFromFile"
+ return="android.renderscript.Font"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="rs" type="android.renderscript.RenderScript">
+</parameter>
+<parameter name="res" type="android.content.res.Resources">
+</parameter>
+<parameter name="path" type="java.lang.String">
+</parameter>
+<parameter name="pointSize" type="float">
+</parameter>
+</method>
+<method name="createFromFile"
+ return="android.renderscript.Font"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="rs" type="android.renderscript.RenderScript">
+</parameter>
+<parameter name="res" type="android.content.res.Resources">
+</parameter>
+<parameter name="path" type="java.io.File">
+</parameter>
+<parameter name="pointSize" type="float">
+</parameter>
+</method>
+<method name="createFromResource"
+ return="android.renderscript.Font"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="rs" type="android.renderscript.RenderScript">
+</parameter>
+<parameter name="res" type="android.content.res.Resources">
+</parameter>
+<parameter name="id" type="int">
+</parameter>
+<parameter name="pointSize" type="float">
+</parameter>
+</method>
+</class>
+<class name="Font.Style"
+ extends="java.lang.Enum"
+ abstract="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<method name="valueOf"
+ return="android.renderscript.Font.Style"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="name" type="java.lang.String">
+</parameter>
+</method>
+<method name="values"
+ return="android.renderscript.Font.Style[]"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+</class>
<class name="Int2"
extends="java.lang.Object"
abstract="false"
@@ -168419,6 +169494,147 @@
>
</field>
</class>
+<class name="Long2"
+ extends="java.lang.Object"
+ abstract="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<constructor name="Long2"
+ type="android.renderscript.Long2"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</constructor>
+<field name="x"
+ type="long"
+ transient="false"
+ volatile="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="y"
+ type="long"
+ transient="false"
+ volatile="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</class>
+<class name="Long3"
+ extends="java.lang.Object"
+ abstract="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<constructor name="Long3"
+ type="android.renderscript.Long3"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</constructor>
+<field name="x"
+ type="long"
+ transient="false"
+ volatile="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="y"
+ type="long"
+ transient="false"
+ volatile="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="z"
+ type="long"
+ transient="false"
+ volatile="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</class>
+<class name="Long4"
+ extends="java.lang.Object"
+ abstract="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<constructor name="Long4"
+ type="android.renderscript.Long4"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</constructor>
+<field name="w"
+ type="long"
+ transient="false"
+ volatile="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="x"
+ type="long"
+ transient="false"
+ volatile="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="y"
+ type="long"
+ transient="false"
+ volatile="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="z"
+ type="long"
+ transient="false"
+ volatile="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</class>
<class name="Matrix2f"
extends="java.lang.Object"
abstract="false"
@@ -169255,6 +170471,504 @@
>
</method>
</class>
+<class name="Mesh"
+ extends="android.renderscript.BaseObj"
+ abstract="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<method name="getIndexSetAllocation"
+ return="android.renderscript.Allocation"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="slot" type="int">
+</parameter>
+</method>
+<method name="getPrimitive"
+ return="android.renderscript.Mesh.Primitive"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="slot" type="int">
+</parameter>
+</method>
+<method name="getPrimitiveCount"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getVertexAllocation"
+ return="android.renderscript.Allocation"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="slot" type="int">
+</parameter>
+</method>
+<method name="getVertexAllocationCount"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+</class>
+<class name="Mesh.AllocationBuilder"
+ extends="java.lang.Object"
+ abstract="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<constructor name="Mesh.AllocationBuilder"
+ type="android.renderscript.Mesh.AllocationBuilder"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="rs" type="android.renderscript.RenderScript">
+</parameter>
+</constructor>
+<method name="addIndexSetAllocation"
+ return="android.renderscript.Mesh.AllocationBuilder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="a" type="android.renderscript.Allocation">
+</parameter>
+<parameter name="p" type="android.renderscript.Mesh.Primitive">
+</parameter>
+</method>
+<method name="addIndexSetType"
+ return="android.renderscript.Mesh.AllocationBuilder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="p" type="android.renderscript.Mesh.Primitive">
+</parameter>
+</method>
+<method name="addVertexAllocation"
+ return="android.renderscript.Mesh.AllocationBuilder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="a" type="android.renderscript.Allocation">
+</parameter>
+<exception name="IllegalStateException" type="java.lang.IllegalStateException">
+</exception>
+</method>
+<method name="create"
+ return="android.renderscript.Mesh"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getCurrentIndexSetIndex"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getCurrentVertexTypeIndex"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+</class>
+<class name="Mesh.Builder"
+ extends="java.lang.Object"
+ abstract="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<constructor name="Mesh.Builder"
+ type="android.renderscript.Mesh.Builder"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="rs" type="android.renderscript.RenderScript">
+</parameter>
+<parameter name="usage" type="int">
+</parameter>
+</constructor>
+<method name="addIndexSetType"
+ return="android.renderscript.Mesh.Builder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="t" type="android.renderscript.Type">
+</parameter>
+<parameter name="p" type="android.renderscript.Mesh.Primitive">
+</parameter>
+</method>
+<method name="addIndexSetType"
+ return="android.renderscript.Mesh.Builder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="p" type="android.renderscript.Mesh.Primitive">
+</parameter>
+</method>
+<method name="addIndexSetType"
+ return="android.renderscript.Mesh.Builder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="e" type="android.renderscript.Element">
+</parameter>
+<parameter name="size" type="int">
+</parameter>
+<parameter name="p" type="android.renderscript.Mesh.Primitive">
+</parameter>
+</method>
+<method name="addVertexType"
+ return="android.renderscript.Mesh.Builder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="t" type="android.renderscript.Type">
+</parameter>
+<exception name="IllegalStateException" type="java.lang.IllegalStateException">
+</exception>
+</method>
+<method name="addVertexType"
+ return="android.renderscript.Mesh.Builder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="e" type="android.renderscript.Element">
+</parameter>
+<parameter name="size" type="int">
+</parameter>
+<exception name="IllegalStateException" type="java.lang.IllegalStateException">
+</exception>
+</method>
+<method name="create"
+ return="android.renderscript.Mesh"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getCurrentIndexSetIndex"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getCurrentVertexTypeIndex"
+ return="int"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+</class>
+<class name="Mesh.Primitive"
+ extends="java.lang.Enum"
+ abstract="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<method name="valueOf"
+ return="android.renderscript.Mesh.Primitive"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="name" type="java.lang.String">
+</parameter>
+</method>
+<method name="values"
+ return="android.renderscript.Mesh.Primitive[]"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+</class>
+<class name="Mesh.TriangleMeshBuilder"
+ extends="java.lang.Object"
+ abstract="false"
+ static="true"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<constructor name="Mesh.TriangleMeshBuilder"
+ type="android.renderscript.Mesh.TriangleMeshBuilder"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="rs" type="android.renderscript.RenderScript">
+</parameter>
+<parameter name="vtxSize" type="int">
+</parameter>
+<parameter name="flags" type="int">
+</parameter>
+</constructor>
+<method name="addTriangle"
+ return="android.renderscript.Mesh.TriangleMeshBuilder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="idx1" type="int">
+</parameter>
+<parameter name="idx2" type="int">
+</parameter>
+<parameter name="idx3" type="int">
+</parameter>
+</method>
+<method name="addVertex"
+ return="android.renderscript.Mesh.TriangleMeshBuilder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="x" type="float">
+</parameter>
+<parameter name="y" type="float">
+</parameter>
+</method>
+<method name="addVertex"
+ return="android.renderscript.Mesh.TriangleMeshBuilder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="x" type="float">
+</parameter>
+<parameter name="y" type="float">
+</parameter>
+<parameter name="z" type="float">
+</parameter>
+</method>
+<method name="create"
+ return="android.renderscript.Mesh"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="uploadToBufferObject" type="boolean">
+</parameter>
+</method>
+<method name="setColor"
+ return="android.renderscript.Mesh.TriangleMeshBuilder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="r" type="float">
+</parameter>
+<parameter name="g" type="float">
+</parameter>
+<parameter name="b" type="float">
+</parameter>
+<parameter name="a" type="float">
+</parameter>
+</method>
+<method name="setNormal"
+ return="android.renderscript.Mesh.TriangleMeshBuilder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="x" type="float">
+</parameter>
+<parameter name="y" type="float">
+</parameter>
+<parameter name="z" type="float">
+</parameter>
+</method>
+<method name="setTexture"
+ return="android.renderscript.Mesh.TriangleMeshBuilder"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="s" type="float">
+</parameter>
+<parameter name="t" type="float">
+</parameter>
+</method>
+<field name="COLOR"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="1"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="NORMAL"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="2"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="TEXTURE_0"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="256"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+</class>
<class name="Program"
extends="android.renderscript.BaseObj"
abstract="false"
@@ -170290,6 +172004,230 @@
</parameter>
</method>
</class>
+<class name="RSDriverException"
+ extends="android.renderscript.RSRuntimeException"
+ abstract="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<constructor name="RSDriverException"
+ type="android.renderscript.RSDriverException"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="string" type="java.lang.String">
+</parameter>
+</constructor>
+</class>
+<class name="RSIllegalArgumentException"
+ extends="android.renderscript.RSRuntimeException"
+ abstract="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<constructor name="RSIllegalArgumentException"
+ type="android.renderscript.RSIllegalArgumentException"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="string" type="java.lang.String">
+</parameter>
+</constructor>
+</class>
+<class name="RSInvalidStateException"
+ extends="android.renderscript.RSRuntimeException"
+ abstract="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<constructor name="RSInvalidStateException"
+ type="android.renderscript.RSInvalidStateException"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="string" type="java.lang.String">
+</parameter>
+</constructor>
+</class>
+<class name="RSRuntimeException"
+ extends="java.lang.RuntimeException"
+ abstract="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<constructor name="RSRuntimeException"
+ type="android.renderscript.RSRuntimeException"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="string" type="java.lang.String">
+</parameter>
+</constructor>
+</class>
+<class name="RSSurfaceView"
+ extends="android.view.SurfaceView"
+ abstract="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<implements name="android.view.SurfaceHolder.Callback">
+</implements>
+<constructor name="RSSurfaceView"
+ type="android.renderscript.RSSurfaceView"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="context" type="android.content.Context">
+</parameter>
+</constructor>
+<constructor name="RSSurfaceView"
+ type="android.renderscript.RSSurfaceView"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="context" type="android.content.Context">
+</parameter>
+<parameter name="attrs" type="android.util.AttributeSet">
+</parameter>
+</constructor>
+<method name="createRenderScriptGL"
+ return="android.renderscript.RenderScriptGL"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="sc" type="android.renderscript.RenderScriptGL.SurfaceConfig">
+</parameter>
+</method>
+<method name="destroyRenderScriptGL"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="getRenderScriptGL"
+ return="android.renderscript.RenderScriptGL"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="pause"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="resume"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="setRenderScriptGL"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="rs" type="android.renderscript.RenderScriptGL">
+</parameter>
+</method>
+<method name="surfaceChanged"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="holder" type="android.view.SurfaceHolder">
+</parameter>
+<parameter name="format" type="int">
+</parameter>
+<parameter name="w" type="int">
+</parameter>
+<parameter name="h" type="int">
+</parameter>
+</method>
+<method name="surfaceCreated"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="holder" type="android.view.SurfaceHolder">
+</parameter>
+</method>
+<method name="surfaceDestroyed"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="holder" type="android.view.SurfaceHolder">
+</parameter>
+</method>
+</class>
<class name="RenderScript"
extends="java.lang.Object"
abstract="false"
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp
index 7ba5291..a43b190 100644
--- a/cmds/stagefright/stagefright.cpp
+++ b/cmds/stagefright/stagefright.cpp
@@ -678,10 +678,6 @@ int main(int argc, char **argv) {
const char *filename = argv[k];
CHECK_EQ(retriever->setDataSource(filename), (status_t)OK);
- CHECK_EQ(retriever->setMode(
- METADATA_MODE_FRAME_CAPTURE_AND_METADATA_RETRIEVAL),
- (status_t)OK);
-
sp<IMemory> mem =
retriever->getFrameAtTime(-1,
MediaSource::ReadOptions::SEEK_PREVIOUS_SYNC);
diff --git a/core/java/android/app/ProgressDialog.java b/core/java/android/app/ProgressDialog.java
index af1b294..d421173 100644
--- a/core/java/android/app/ProgressDialog.java
+++ b/core/java/android/app/ProgressDialog.java
@@ -18,7 +18,6 @@ package android.app;
import android.content.Context;
import android.graphics.drawable.Drawable;
-import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
@@ -75,12 +74,20 @@ public class ProgressDialog extends AlertDialog {
public ProgressDialog(Context context) {
super(context);
+ initFormats();
}
public ProgressDialog(Context context, int theme) {
super(context, theme);
+ initFormats();
}
+ private void initFormats() {
+ mProgressNumberFormat = "%1d/%2d";
+ mProgressPercentFormat = NumberFormat.getPercentInstance();
+ mProgressPercentFormat.setMaximumFractionDigits(0);
+ }
+
public static ProgressDialog show(Context context, CharSequence title,
CharSequence message) {
return show(context, title, message, false);
@@ -125,22 +132,27 @@ public class ProgressDialog extends AlertDialog {
/* Update the number and percent */
int progress = mProgress.getProgress();
int max = mProgress.getMax();
- double percent = (double) progress / (double) max;
- String format = mProgressNumberFormat;
- mProgressNumber.setText(String.format(format, progress, max));
- SpannableString tmp = new SpannableString(mProgressPercentFormat.format(percent));
- tmp.setSpan(new StyleSpan(android.graphics.Typeface.BOLD),
- 0, tmp.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
- mProgressPercent.setText(tmp);
+ if (mProgressNumberFormat != null) {
+ String format = mProgressNumberFormat;
+ mProgressNumber.setText(String.format(format, progress, max));
+ } else {
+ mProgressNumber.setText("");
+ }
+ if (mProgressPercentFormat != null) {
+ double percent = (double) progress / (double) max;
+ SpannableString tmp = new SpannableString(mProgressPercentFormat.format(percent));
+ tmp.setSpan(new StyleSpan(android.graphics.Typeface.BOLD),
+ 0, tmp.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
+ mProgressPercent.setText(tmp);
+ } else {
+ mProgressPercent.setText("");
+ }
}
};
View view = inflater.inflate(R.layout.alert_dialog_progress, null);
mProgress = (ProgressBar) view.findViewById(R.id.progress);
mProgressNumber = (TextView) view.findViewById(R.id.progress_number);
- mProgressNumberFormat = "%d/%d";
mProgressPercent = (TextView) view.findViewById(R.id.progress_percent);
- mProgressPercentFormat = NumberFormat.getPercentInstance();
- mProgressPercentFormat.setMaximumFractionDigits(0);
setView(view);
} else {
View view = inflater.inflate(R.layout.progress_dialog, null);
@@ -304,19 +316,36 @@ public class ProgressDialog extends AlertDialog {
}
/**
- * Change the format of Progress Number. The default is "current/max".
+ * Change the format of the small text showing current and maximum units
+ * of progress. The default is "%1d/%2d".
* Should not be called during the number is progressing.
- * @param format Should contain two "%d". The first is used for current number
- * and the second is used for the maximum.
- * @hide
+ * @param format A string passed to {@link String#format String.format()};
+ * use "%1d" for the current number and "%2d" for the maximum. If null,
+ * nothing will be shown.
*/
public void setProgressNumberFormat(String format) {
mProgressNumberFormat = format;
+ onProgressChanged();
+ }
+
+ /**
+ * Change the format of the small text showing the percentage of progress.
+ * The default is
+ * {@link NumberFormat#getPercentInstance() NumberFormat.getPercentageInstnace().}
+ * Should not be called during the number is progressing.
+ * @param format An instance of a {@link NumberFormat} to generate the
+ * percentage text. If null, nothing will be shown.
+ */
+ public void setProgressPercentFormat(NumberFormat format) {
+ mProgressPercentFormat = format;
+ onProgressChanged();
}
private void onProgressChanged() {
if (mProgressStyle == STYLE_HORIZONTAL) {
- mViewUpdateHandler.sendEmptyMessage(0);
+ if (!mViewUpdateHandler.hasMessages(0)) {
+ mViewUpdateHandler.sendEmptyMessage(0);
+ }
}
}
}
diff --git a/core/java/android/content/ContentProvider.java b/core/java/android/content/ContentProvider.java
index 6bb32c1..5467a30 100644
--- a/core/java/android/content/ContentProvider.java
+++ b/core/java/android/content/ContentProvider.java
@@ -247,11 +247,8 @@ public abstract class ContentProvider implements ComponentCallbacks {
return ContentProvider.this.openAssetFile(uri, mode);
}
- /**
- * @hide
- */
- public Bundle call(String method, String request, Bundle args) {
- return ContentProvider.this.call(method, request, args);
+ public Bundle call(String method, String arg, Bundle extras) {
+ return ContentProvider.this.call(method, arg, extras);
}
@Override
@@ -987,16 +984,17 @@ public abstract class ContentProvider implements ComponentCallbacks {
}
/**
- * @hide -- until interface has proven itself
- *
* Call a provider-defined method. This can be used to implement
- * interfaces that are cheaper than using a Cursor.
+ * interfaces that are cheaper and/or unnatural for a table-like
+ * model.
*
- * @param method Method name to call. Opaque to framework.
- * @param request Nullable String argument passed to method.
- * @param args Nullable Bundle argument passed to method.
+ * @param method method name to call. Opaque to framework, but should not be null.
+ * @param arg provider-defined String argument. May be null.
+ * @param extras provider-defined Bundle argument. May be null.
+ * @return provider-defined return value. May be null. Null is also
+ * the default for providers which don't implement any call methods.
*/
- public Bundle call(String method, String request, Bundle args) {
+ public Bundle call(String method, String arg, Bundle extras) {
return null;
}
diff --git a/core/java/android/content/ContentResolver.java b/core/java/android/content/ContentResolver.java
index d034229..da518c2 100644
--- a/core/java/android/content/ContentResolver.java
+++ b/core/java/android/content/ContentResolver.java
@@ -216,6 +216,8 @@ public abstract class ContentResolver {
String type = ActivityManagerNative.getDefault().getProviderMimeType(url);
return type;
} catch (RemoteException e) {
+ // Arbitrary and not worth documenting, as Activity
+ // Manager will kill this process shortly anyway.
return null;
} catch (java.lang.Exception e) {
Log.w(TAG, "Failed to get type for: " + url + " (" + e.getMessage() + ")");
@@ -249,10 +251,12 @@ public abstract class ContentResolver {
try {
return provider.getStreamTypes(url, mimeTypeFilter);
} catch (RemoteException e) {
+ // Arbitrary and not worth documenting, as Activity
+ // Manager will kill this process shortly anyway.
return null;
} finally {
- releaseProvider(provider);
- }
+ releaseProvider(provider);
+ }
}
/**
@@ -308,8 +312,11 @@ public abstract class ContentResolver {
return new CursorWrapperInner(qCursor, provider);
} catch (RemoteException e) {
releaseProvider(provider);
+
+ // Arbitrary and not worth documenting, as Activity
+ // Manager will kill this process shortly anyway.
return null;
- } catch(RuntimeException e) {
+ } catch (RuntimeException e) {
releaseProvider(provider);
throw e;
}
@@ -539,6 +546,8 @@ public abstract class ContentResolver {
return new AssetFileDescriptor(pfd, fd.getStartOffset(),
fd.getDeclaredLength());
} catch (RemoteException e) {
+ // Somewhat pointless, as Activity Manager will kill this
+ // process shortly anyway if the depdendent ContentProvider dies.
throw new FileNotFoundException("Dead content provider: " + uri);
} catch (FileNotFoundException e) {
throw e;
@@ -714,6 +723,8 @@ public abstract class ContentResolver {
maybeLogUpdateToEventLog(durationMillis, url, "insert", null /* where */);
return createdRow;
} catch (RemoteException e) {
+ // Arbitrary and not worth documenting, as Activity
+ // Manager will kill this process shortly anyway.
return null;
} finally {
releaseProvider(provider);
@@ -773,6 +784,8 @@ public abstract class ContentResolver {
maybeLogUpdateToEventLog(durationMillis, url, "bulkinsert", null /* where */);
return rowsCreated;
} catch (RemoteException e) {
+ // Arbitrary and not worth documenting, as Activity
+ // Manager will kill this process shortly anyway.
return 0;
} finally {
releaseProvider(provider);
@@ -802,6 +815,8 @@ public abstract class ContentResolver {
maybeLogUpdateToEventLog(durationMillis, url, "delete", where);
return rowsDeleted;
} catch (RemoteException e) {
+ // Arbitrary and not worth documenting, as Activity
+ // Manager will kill this process shortly anyway.
return -1;
} finally {
releaseProvider(provider);
@@ -818,7 +833,7 @@ public abstract class ContentResolver {
A null value will remove an existing field value.
* @param where A filter to apply to rows before updating, formatted as an SQL WHERE clause
(excluding the WHERE itself).
- * @return The number of rows updated.
+ * @return the number of rows updated.
* @throws NullPointerException if uri or values are null
*/
public final int update(Uri uri, ContentValues values, String where,
@@ -834,6 +849,8 @@ public abstract class ContentResolver {
maybeLogUpdateToEventLog(durationMillis, uri, "update", where);
return rowsUpdated;
} catch (RemoteException e) {
+ // Arbitrary and not worth documenting, as Activity
+ // Manager will kill this process shortly anyway.
return -1;
} finally {
releaseProvider(provider);
@@ -841,6 +858,42 @@ public abstract class ContentResolver {
}
/**
+ * Call an provider-defined method. This can be used to implement
+ * read or write interfaces which are cheaper than using a Cursor and/or
+ * do not fit into the traditional table model.
+ *
+ * @param method provider-defined method name to call. Opaque to
+ * framework, but must be non-null.
+ * @param arg provider-defined String argument. May be null.
+ * @param extras provider-defined Bundle argument. May be null.
+ * @return a result Bundle, possibly null. Will be null if the ContentProvider
+ * does not implement call.
+ * @throws NullPointerException if uri or method is null
+ * @throws IllegalArgumentException if uri is not known
+ */
+ public final Bundle call(Uri uri, String method, String arg, Bundle extras) {
+ if (uri == null) {
+ throw new NullPointerException("uri == null");
+ }
+ if (method == null) {
+ throw new NullPointerException("method == null");
+ }
+ IContentProvider provider = acquireProvider(uri);
+ if (provider == null) {
+ throw new IllegalArgumentException("Unknown URI " + uri);
+ }
+ try {
+ return provider.call(method, arg, extras);
+ } catch (RemoteException e) {
+ // Arbitrary and not worth documenting, as Activity
+ // Manager will kill this process shortly anyway.
+ return null;
+ } finally {
+ releaseProvider(provider);
+ }
+ }
+
+ /**
* Returns the content provider for the given content URI.
*
* @param uri The URI to a content provider
diff --git a/core/java/android/content/IContentProvider.java b/core/java/android/content/IContentProvider.java
index 8f122ce..72bc9c2 100644
--- a/core/java/android/content/IContentProvider.java
+++ b/core/java/android/content/IContentProvider.java
@@ -59,18 +59,7 @@ public interface IContentProvider extends IInterface {
throws RemoteException, FileNotFoundException;
public ContentProviderResult[] applyBatch(ArrayList<ContentProviderOperation> operations)
throws RemoteException, OperationApplicationException;
-
- /**
- * @hide -- until interface has proven itself
- *
- * Call an provider-defined method. This can be used to implement
- * interfaces that are cheaper than using a Cursor.
- *
- * @param method Method name to call. Opaque to framework.
- * @param request Nullable String argument passed to method.
- * @param args Nullable Bundle argument passed to method.
- */
- public Bundle call(String method, String request, Bundle args) throws RemoteException;
+ public Bundle call(String method, String arg, Bundle extras) throws RemoteException;
// Data interchange.
public String[] getStreamTypes(Uri url, String mimeTypeFilter) throws RemoteException;
diff --git a/core/java/android/widget/QuickContactBadge.java b/core/java/android/widget/QuickContactBadge.java
index 5598c65..bc89507 100644
--- a/core/java/android/widget/QuickContactBadge.java
+++ b/core/java/android/widget/QuickContactBadge.java
@@ -16,24 +16,26 @@
package android.widget;
+import com.android.internal.R;
+
import android.content.AsyncQueryHandler;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.res.TypedArray;
import android.database.Cursor;
+import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.net.Uri;
+import android.provider.ContactsContract.CommonDataKinds.Email;
import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.Intents;
import android.provider.ContactsContract.PhoneLookup;
import android.provider.ContactsContract.QuickContact;
import android.provider.ContactsContract.RawContacts;
-import android.provider.ContactsContract.CommonDataKinds.Email;
import android.util.AttributeSet;
import android.view.View;
import android.view.View.OnClickListener;
-import com.android.internal.R;
/**
* Widget used to show an image with the standard QuickContact badge
@@ -45,6 +47,7 @@ public class QuickContactBadge extends ImageView implements OnClickListener {
private String mContactEmail;
private String mContactPhone;
private int mMode;
+ private Drawable mOverlay;
private QueryHandler mQueryHandler;
private Drawable mBadgeBackground;
private Drawable mNoBadgeBackground;
@@ -100,6 +103,10 @@ public class QuickContactBadge extends ImageView implements OnClickListener {
a.recycle();
+ TypedArray styledAttributes = mContext.obtainStyledAttributes(R.styleable.Theme);
+ mOverlay = styledAttributes.getDrawable(com.android.internal.R.styleable.Theme_quickContactBadgeOverlay);
+ styledAttributes.recycle();
+
init();
mBadgeBackground = getBackground();
@@ -118,7 +125,28 @@ public class QuickContactBadge extends ImageView implements OnClickListener {
public void setMode(int size) {
mMode = size;
}
-
+
+ @Override
+ protected void onDraw(Canvas canvas) {
+ super.onDraw(canvas);
+
+ if (mOverlay == null || mOverlay.getIntrinsicWidth() == 0 || mOverlay.getIntrinsicHeight() == 0) {
+ return; // nothing to draw
+ }
+
+ mOverlay.setBounds(0, 0, getWidth(), getHeight());
+
+ if (mPaddingTop == 0 && mPaddingLeft == 0) {
+ mOverlay.draw(canvas);
+ } else {
+ int saveCount = canvas.getSaveCount();
+ canvas.save();
+ canvas.translate(mPaddingLeft, mPaddingTop);
+ mOverlay.draw(canvas);
+ canvas.restoreToCount(saveCount);
+ }
+ }
+
/**
* Resets the contact photo to the default state.
*/
@@ -132,7 +160,8 @@ public class QuickContactBadge extends ImageView implements OnClickListener {
/**
* Assign the contact uri that this QuickContactBadge should be associated
* with. Note that this is only used for displaying the QuickContact window and
- * won't bind the contact's photo for you.
+ * won't bind the contact's photo for you. Call {@link #setImageDrawable(Drawable)} to set the
+ * photo.
*
* @param contactUri Either a {@link Contacts#CONTENT_URI} or
* {@link Contacts#CONTENT_LOOKUP_URI} style URI.
@@ -146,9 +175,12 @@ public class QuickContactBadge extends ImageView implements OnClickListener {
private void onContactUriChanged() {
if (mContactUri == null && mContactEmail == null && mContactPhone == null) {
+ // Holo theme has no background on badges. Use a null background.
+ /*
if (mNoBadgeBackground == null) {
mNoBadgeBackground = getResources().getDrawable(R.drawable.quickcontact_nobadge);
}
+ */
setBackgroundDrawable(mNoBadgeBackground);
} else {
setBackgroundDrawable(mBadgeBackground);
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 67adc28..41c911a 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -540,14 +540,6 @@
android:description="@string/permdesc_sdcardWrite"
android:protectionLevel="dangerous" />
- <!-- Allows an application to write to internal media storage
- @hide -->
- <permission android:name="android.permission.WRITE_MEDIA_STORAGE"
- android:permissionGroup="android.permission-group.STORAGE"
- android:label="@string/permlab_mediaStorageWrite"
- android:description="@string/permdesc_mediaStorageWrite"
- android:protectionLevel="signatureOrSystem" />
-
<!-- ============================================ -->
<!-- Permissions for low-level system interaction -->
<!-- ============================================ -->
diff --git a/core/res/res/drawable-hdpi/quickcontact_badge_overlay_normal_dark.9.png b/core/res/res/drawable-hdpi/quickcontact_badge_overlay_normal_dark.9.png
new file mode 100644
index 0000000..a2264ec
--- /dev/null
+++ b/core/res/res/drawable-hdpi/quickcontact_badge_overlay_normal_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/quickcontact_badge_overlay_normal_light.9.png b/core/res/res/drawable-hdpi/quickcontact_badge_overlay_normal_light.9.png
new file mode 100644
index 0000000..9dd657f
--- /dev/null
+++ b/core/res/res/drawable-hdpi/quickcontact_badge_overlay_normal_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/quickcontact_badge_overlay_pressed_dark.9.png b/core/res/res/drawable-hdpi/quickcontact_badge_overlay_pressed_dark.9.png
new file mode 100644
index 0000000..7e7a164
--- /dev/null
+++ b/core/res/res/drawable-hdpi/quickcontact_badge_overlay_pressed_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/quickcontact_badge_overlay_pressed_light.9.png b/core/res/res/drawable-hdpi/quickcontact_badge_overlay_pressed_light.9.png
new file mode 100644
index 0000000..45a5e30
--- /dev/null
+++ b/core/res/res/drawable-hdpi/quickcontact_badge_overlay_pressed_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-hdpi/quickcontact_badge_pressed.9.png b/core/res/res/drawable-hdpi/quickcontact_badge_pressed.9.png
deleted file mode 100644
index 75c8162..0000000
--- a/core/res/res/drawable-hdpi/quickcontact_badge_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/quickcontact_badge_small_pressed.9.png b/core/res/res/drawable-hdpi/quickcontact_badge_small_pressed.9.png
deleted file mode 100644
index aebfa29..0000000
--- a/core/res/res/drawable-hdpi/quickcontact_badge_small_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/quickcontact_badge_small_unpressed.9.png b/core/res/res/drawable-hdpi/quickcontact_badge_small_unpressed.9.png
deleted file mode 100644
index ed416f1..0000000
--- a/core/res/res/drawable-hdpi/quickcontact_badge_small_unpressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/quickcontact_badge_unpressed.9.png b/core/res/res/drawable-hdpi/quickcontact_badge_unpressed.9.png
deleted file mode 100644
index d063229..0000000
--- a/core/res/res/drawable-hdpi/quickcontact_badge_unpressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-hdpi/quickcontact_nobadge.9.png b/core/res/res/drawable-hdpi/quickcontact_nobadge.9.png
deleted file mode 100644
index 68d43c4..0000000
--- a/core/res/res/drawable-hdpi/quickcontact_nobadge.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-ldpi/quickcontact_badge_pressed.9.png b/core/res/res/drawable-ldpi/quickcontact_badge_pressed.9.png
deleted file mode 100644
index ff43fed..0000000
--- a/core/res/res/drawable-ldpi/quickcontact_badge_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-ldpi/quickcontact_badge_small_pressed.9.png b/core/res/res/drawable-ldpi/quickcontact_badge_small_pressed.9.png
deleted file mode 100644
index 5aedb70..0000000
--- a/core/res/res/drawable-ldpi/quickcontact_badge_small_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-ldpi/quickcontact_badge_small_unpressed.9.png b/core/res/res/drawable-ldpi/quickcontact_badge_small_unpressed.9.png
deleted file mode 100644
index 6e212b6..0000000
--- a/core/res/res/drawable-ldpi/quickcontact_badge_small_unpressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-ldpi/quickcontact_badge_unpressed.9.png b/core/res/res/drawable-ldpi/quickcontact_badge_unpressed.9.png
deleted file mode 100644
index 417c11b..0000000
--- a/core/res/res/drawable-ldpi/quickcontact_badge_unpressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/quickcontact_badge_overlay_normal_dark.9.png b/core/res/res/drawable-mdpi/quickcontact_badge_overlay_normal_dark.9.png
new file mode 100644
index 0000000..9626ab9
--- /dev/null
+++ b/core/res/res/drawable-mdpi/quickcontact_badge_overlay_normal_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/quickcontact_badge_overlay_normal_light.9.png b/core/res/res/drawable-mdpi/quickcontact_badge_overlay_normal_light.9.png
new file mode 100644
index 0000000..3876d3b
--- /dev/null
+++ b/core/res/res/drawable-mdpi/quickcontact_badge_overlay_normal_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/quickcontact_badge_overlay_pressed_dark.9.png b/core/res/res/drawable-mdpi/quickcontact_badge_overlay_pressed_dark.9.png
new file mode 100644
index 0000000..db12ac6
--- /dev/null
+++ b/core/res/res/drawable-mdpi/quickcontact_badge_overlay_pressed_dark.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/quickcontact_badge_overlay_pressed_light.9.png b/core/res/res/drawable-mdpi/quickcontact_badge_overlay_pressed_light.9.png
new file mode 100644
index 0000000..b3a49fc
--- /dev/null
+++ b/core/res/res/drawable-mdpi/quickcontact_badge_overlay_pressed_light.9.png
Binary files differ
diff --git a/core/res/res/drawable-mdpi/quickcontact_badge_pressed.9.png b/core/res/res/drawable-mdpi/quickcontact_badge_pressed.9.png
deleted file mode 100644
index c8ca33a..0000000
--- a/core/res/res/drawable-mdpi/quickcontact_badge_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/quickcontact_badge_small_pressed.9.png b/core/res/res/drawable-mdpi/quickcontact_badge_small_pressed.9.png
deleted file mode 100644
index b23e921..0000000
--- a/core/res/res/drawable-mdpi/quickcontact_badge_small_pressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/quickcontact_badge_small_unpressed.9.png b/core/res/res/drawable-mdpi/quickcontact_badge_small_unpressed.9.png
deleted file mode 100644
index 38f14f7..0000000
--- a/core/res/res/drawable-mdpi/quickcontact_badge_small_unpressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/quickcontact_badge_unpressed.9.png b/core/res/res/drawable-mdpi/quickcontact_badge_unpressed.9.png
deleted file mode 100644
index d8dff34..0000000
--- a/core/res/res/drawable-mdpi/quickcontact_badge_unpressed.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable-mdpi/quickcontact_nobadge.9.png b/core/res/res/drawable-mdpi/quickcontact_nobadge.9.png
deleted file mode 100644
index ebe747b..0000000
--- a/core/res/res/drawable-mdpi/quickcontact_nobadge.9.png
+++ /dev/null
Binary files differ
diff --git a/core/res/res/drawable/quickcontact_badge.xml b/core/res/res/drawable/quickcontact_badge_overlay_dark.xml
index bd5aeb6..972488d 100644
--- a/core/res/res/drawable/quickcontact_badge.xml
+++ b/core/res/res/drawable/quickcontact_badge_overlay_dark.xml
@@ -19,10 +19,10 @@
android:state_focused="false"
android:state_selected="false"
android:state_pressed="false"
- android:drawable="@drawable/quickcontact_badge_unpressed" />
+ android:drawable="@drawable/quickcontact_badge_overlay_normal_dark" />
<item
android:state_pressed="true"
- android:drawable="@drawable/quickcontact_badge_pressed" />
+ android:drawable="@drawable/quickcontact_badge_overlay_pressed_dark" />
</selector>
diff --git a/core/res/res/drawable/quickcontact_badge_small.xml b/core/res/res/drawable/quickcontact_badge_overlay_light.xml
index a38ba1e..bf95d52 100644
--- a/core/res/res/drawable/quickcontact_badge_small.xml
+++ b/core/res/res/drawable/quickcontact_badge_overlay_light.xml
@@ -19,10 +19,10 @@
android:state_focused="false"
android:state_selected="false"
android:state_pressed="false"
- android:drawable="@drawable/quickcontact_badge_small_unpressed" />
+ android:drawable="@drawable/quickcontact_badge_overlay_normal_light" />
<item
android:state_pressed="true"
- android:drawable="@drawable/quickcontact_badge_small_pressed" />
+ android:drawable="@drawable/quickcontact_badge_overlay_pressed_light" />
</selector>
diff --git a/core/res/res/layout-xlarge/keyguard_screen_lock.xml b/core/res/res/layout-xlarge/keyguard_screen_lock.xml
index 733a350..c7aa654 100644
--- a/core/res/res/layout-xlarge/keyguard_screen_lock.xml
+++ b/core/res/res/layout-xlarge/keyguard_screen_lock.xml
@@ -16,7 +16,7 @@
** limitations under the License.
*/
-->
-
+
<!-- This is the general lock screen which shows information about the
state of the device, as well as instructions on how to get past it
depending on the state of the device. It is the same for landscape
@@ -25,9 +25,7 @@
android:orientation="vertical"
android:gravity="bottom"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="#ff800000"
- >
+ android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
diff --git a/core/res/res/layout-xlarge/keyguard_screen_tab_unlock.xml b/core/res/res/layout-xlarge/keyguard_screen_tab_unlock.xml
index 1c7b7e2..c9c1692 100644
--- a/core/res/res/layout-xlarge/keyguard_screen_tab_unlock.xml
+++ b/core/res/res/layout-xlarge/keyguard_screen_tab_unlock.xml
@@ -26,8 +26,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
- android:id="@+id/root"
- android:background="#70000000">
+ android:id="@+id/root">
<!-- top: status -->
<RelativeLayout
diff --git a/core/res/res/layout-xlarge/keyguard_screen_tab_unlock_land.xml b/core/res/res/layout-xlarge/keyguard_screen_tab_unlock_land.xml
index c24eecc..fbb9983 100644
--- a/core/res/res/layout-xlarge/keyguard_screen_tab_unlock_land.xml
+++ b/core/res/res/layout-xlarge/keyguard_screen_tab_unlock_land.xml
@@ -25,7 +25,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
- android:background="#70000000"
android:id="@+id/root">
<!-- left side: status -->
diff --git a/core/res/res/layout-xlarge/keyguard_screen_unlock_landscape.xml b/core/res/res/layout-xlarge/keyguard_screen_unlock_landscape.xml
index ec7c272..8acb656 100644
--- a/core/res/res/layout-xlarge/keyguard_screen_unlock_landscape.xml
+++ b/core/res/res/layout-xlarge/keyguard_screen_unlock_landscape.xml
@@ -25,8 +25,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="#70000000">
+ android:layout_height="match_parent">
<!-- left side: status -->
<RelativeLayout
diff --git a/core/res/res/layout-xlarge/keyguard_screen_unlock_portrait.xml b/core/res/res/layout-xlarge/keyguard_screen_unlock_portrait.xml
index 84ddd6a..f35897e 100644
--- a/core/res/res/layout-xlarge/keyguard_screen_unlock_portrait.xml
+++ b/core/res/res/layout-xlarge/keyguard_screen_unlock_portrait.xml
@@ -21,9 +21,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="#70000000"
- >
+ android:layout_height="match_parent">
<!-- top: status -->
<LinearLayout
diff --git a/core/res/res/layout/alert_dialog_progress.xml b/core/res/res/layout/alert_dialog_progress.xml
index c519692..ac95cdb 100644
--- a/core/res/res/layout/alert_dialog_progress.xml
+++ b/core/res/res/layout/alert_dialog_progress.xml
@@ -40,9 +40,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="12dip"
- android:layout_marginLeft="50dip"
- android:layout_marginRight="15dip"
- android:layout_alignParentLeft="true"
+ android:layout_marginLeft="10dip"
+ android:layout_marginRight="10dip"
+ android:layout_alignParentRight="true"
android:layout_below="@id/progress"
/>
</RelativeLayout>
diff --git a/core/res/res/layout/keyguard_screen_password_landscape.xml b/core/res/res/layout/keyguard_screen_password_landscape.xml
index 3d52f71..4d8c688 100644
--- a/core/res/res/layout/keyguard_screen_password_landscape.xml
+++ b/core/res/res/layout/keyguard_screen_password_landscape.xml
@@ -20,7 +20,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
- android:background="#70000000"
android:gravity="center_horizontal">
<LinearLayout
diff --git a/core/res/res/layout/keyguard_screen_password_portrait.xml b/core/res/res/layout/keyguard_screen_password_portrait.xml
index af8a3ef..93966de 100644
--- a/core/res/res/layout/keyguard_screen_password_portrait.xml
+++ b/core/res/res/layout/keyguard_screen_password_portrait.xml
@@ -20,7 +20,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
- android:background="#70000000"
android:gravity="center_horizontal">
<!-- "Enter PIN(Password) to unlock" -->
diff --git a/core/res/res/layout/keyguard_screen_tab_unlock.xml b/core/res/res/layout/keyguard_screen_tab_unlock.xml
index 8367157..5fe38d5 100644
--- a/core/res/res/layout/keyguard_screen_tab_unlock.xml
+++ b/core/res/res/layout/keyguard_screen_tab_unlock.xml
@@ -25,7 +25,6 @@
xmlns:tabunlock="http://schemas.android.com/apk/res/com.android.tabunlock"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="#70000000"
android:gravity="center_horizontal"
android:id="@+id/root">
diff --git a/core/res/res/layout/keyguard_screen_tab_unlock_land.xml b/core/res/res/layout/keyguard_screen_tab_unlock_land.xml
index 9547660..3c2ad9a 100644
--- a/core/res/res/layout/keyguard_screen_tab_unlock_land.xml
+++ b/core/res/res/layout/keyguard_screen_tab_unlock_land.xml
@@ -25,7 +25,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
- android:background="#70000000"
android:id="@+id/root">
<!-- left side -->
diff --git a/core/res/res/layout/keyguard_screen_unlock_landscape.xml b/core/res/res/layout/keyguard_screen_unlock_landscape.xml
index 759c906..c7b78c4 100644
--- a/core/res/res/layout/keyguard_screen_unlock_landscape.xml
+++ b/core/res/res/layout/keyguard_screen_unlock_landscape.xml
@@ -25,9 +25,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="#70000000"
- >
+ android:layout_height="match_parent">
<!-- left side: instructions and emergency call button -->
<LinearLayout
diff --git a/core/res/res/layout/keyguard_screen_unlock_portrait.xml b/core/res/res/layout/keyguard_screen_unlock_portrait.xml
index c438412..15f2afb 100644
--- a/core/res/res/layout/keyguard_screen_unlock_portrait.xml
+++ b/core/res/res/layout/keyguard_screen_unlock_portrait.xml
@@ -25,9 +25,7 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:gravity="center_horizontal"
- android:background="#70000000"
- >
+ android:gravity="center_horizontal">
<RelativeLayout
android:layout_width="match_parent"
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index c297751..3a3ca36 100755
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -491,8 +491,8 @@
<attr name="spinnerItemStyle" format="reference" />
<!-- Default MapView style. -->
<attr name="mapViewStyle" format="reference" />
- <!-- Default quickcontact badge style. -->
- <attr name="quickContactBadgeStyle" format="reference" />
+ <!-- Drawable used as an overlay on top of quickcontact photos. -->
+ <attr name="quickContactBadgeOverlay" format="reference" />
<!-- Default quickcontact badge style with small quickcontact window. -->
<attr name="quickContactBadgeStyleWindowSmall" format="reference" />
<!-- Default quickcontact badge style with medium quickcontact window. -->
diff --git a/core/res/res/values/styles.xml b/core/res/res/values/styles.xml
index b8beda6b..f52be0d 100644
--- a/core/res/res/values/styles.xml
+++ b/core/res/res/values/styles.xml
@@ -658,21 +658,21 @@
<item name="android:shadowRadius">2.75</item>
</style>
- <style name="Widget.QuickContactBadge">
- <item name="android:layout_width">47.33333dip</item>
- <item name="android:layout_height">56dip</item>
- <item name="android:background">@android:drawable/quickcontact_badge</item>
+ <style name="Widget.GenericQuickContactBadge">
+ <item name="android:background">@null</item>
<item name="android:clickable">true</item>
<item name="android:scaleType">fitCenter</item>
<item name="android:src">@android:drawable/ic_contact_picture</item>
</style>
+
+ <style name="Widget.QuickContactBadge" parent="Widget.GenericQuickContactBadge">
+ <item name="android:layout_width">64dip</item>
+ <item name="android:layout_height">64dip</item>
+ </style>
- <style name="Widget.QuickContactBadgeSmall">
- <item name="android:layout_width">39dip</item>
- <item name="android:layout_height">42dip</item>
- <item name="android:background">@android:drawable/quickcontact_badge_small</item>
- <item name="android:clickable">true</item>
- <item name="android:scaleType">fitCenter</item>
+ <style name="Widget.QuickContactBadgeSmall" parent="Widget.GenericQuickContactBadge">
+ <item name="android:layout_width">40dip</item>
+ <item name="android:layout_height">40dip</item>
</style>
<style name="Widget.QuickContactBadge.WindowSmall">
diff --git a/core/res/res/values/themes.xml b/core/res/res/values/themes.xml
index 2aaac66..d070c30 100644
--- a/core/res/res/values/themes.xml
+++ b/core/res/res/values/themes.xml
@@ -217,6 +217,7 @@
<item name="spinnerItemStyle">@android:style/Widget.TextView.SpinnerItem</item>
<item name="dropDownHintAppearance">@android:style/TextAppearance.Widget.DropDownHint</item>
<item name="keyboardViewStyle">@android:style/Widget.KeyboardView</item>
+ <item name="quickContactBadgeOverlay">@android:drawable/quickcontact_badge_overlay_dark</item>
<item name="quickContactBadgeStyleWindowSmall">@android:style/Widget.QuickContactBadge.WindowSmall</item>
<item name="quickContactBadgeStyleWindowMedium">@android:style/Widget.QuickContactBadge.WindowMedium</item>
<item name="quickContactBadgeStyleWindowLarge">@android:style/Widget.QuickContactBadge.WindowLarge</item>
@@ -341,6 +342,7 @@
<item name="listChoiceBackgroundIndicator">@android:drawable/list_selected_background_light</item>
<item name="activatedBackgroundIndicator">@android:drawable/activated_background_light</item>
+ <item name="quickContactBadgeOverlay">@android:drawable/quickcontact_badge_overlay_light</item>
<item name="popupWindowStyle">@android:style/Widget.PopupWindow</item>
@@ -369,6 +371,8 @@
<item name="searchViewGoIcon">@android:drawable/ic_go_search_api_holo_light</item>
<item name="searchViewVoiceIcon">@android:drawable/ic_voice_search_api_holo_light</item>
<item name="searchViewEditQuery">@android:drawable/ic_commit_search_api_holo_light</item>
+
+ <item name="detailsElementBackground">@android:drawable/panel_bg_holo_light</item>
</style>
<!-- Variant of the light theme with no title bar -->
diff --git a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/ConnectivityManagerMobileTest.java b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/ConnectivityManagerMobileTest.java
index 4e5fc0e..1655e27 100644
--- a/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/ConnectivityManagerMobileTest.java
+++ b/core/tests/ConnectivityManagerTest/src/com/android/connectivitymanagertest/functional/ConnectivityManagerMobileTest.java
@@ -63,11 +63,16 @@ public class ConnectivityManagerMobileTest
wl = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, "CMWakeLock");
wl.acquire();
// Each test case will start with cellular connection
+ if (Settings.System.getInt(getInstrumentation().getContext().getContentResolver(),
+ Settings.System.AIRPLANE_MODE_ON) == 1) {
+ Log.v(LOG_TAG, "airplane is not disabled, disable it.");
+ cmActivity.setAirplaneMode(getInstrumentation().getContext(), false);
+ }
if (!cmActivity.waitForNetworkState(ConnectivityManager.TYPE_MOBILE, State.CONNECTED,
ConnectivityManagerTestActivity.LONG_TIMEOUT)) {
// Note: When the test fails in setUp(), tearDown is not called. In that case,
// the activity is destroyed which blocks the next test at "getActivity()".
- // tearDown() is called hear to avoid that situation.
+ // tearDown() is called here to avoid that situation.
tearDown();
fail("Device is not connected to Mobile, setUp failed");
}
@@ -82,6 +87,7 @@ public class ConnectivityManagerMobileTest
// if airplane mode is set, disable it.
if (Settings.System.getInt(getInstrumentation().getContext().getContentResolver(),
Settings.System.AIRPLANE_MODE_ON) == 1) {
+ Log.v(LOG_TAG, "disable airplane mode if it is enabled");
cmActivity.setAirplaneMode(getInstrumentation().getContext(), false);
}
super.tearDown();
@@ -93,13 +99,11 @@ public class ConnectivityManagerMobileTest
assertEquals("network type is not MOBILE", ConnectivityManager.TYPE_MOBILE,
extraNetInfo.getType());
assertTrue("not connected to cellular network", extraNetInfo.isConnected());
- assertTrue("no data connection", cmActivity.mState.equals(State.CONNECTED));
}
// Test case 1: Test enabling Wifi without associating with any AP
@LargeTest
public void test3GToWifiNotification() {
- // To avoid UNKNOWN state when device boots up
cmActivity.enableWifi();
try {
Thread.sleep(2 * ConnectivityManagerTestActivity.SHORT_TIMEOUT);
@@ -108,7 +112,10 @@ public class ConnectivityManagerMobileTest
}
cmActivity.disableWifi();
- // As Wifi stays in DISCONNECTED, the connectivity manager will not broadcast
+
+ cmActivity.waitForNetworkState(ConnectivityManager.TYPE_WIFI,
+ State.DISCONNECTED, ConnectivityManagerTestActivity.LONG_TIMEOUT);
+ // As Wifi stays in DISCONNETED, the connectivity manager will not broadcast
// any network connectivity event for Wifi
NetworkInfo networkInfo = cmActivity.mCM.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
cmActivity.setStateTransitionCriteria(ConnectivityManager.TYPE_MOBILE, networkInfo.getState(),
diff --git a/core/tests/coretests/src/android/content/pm/AppCacheTest.java b/core/tests/coretests/src/android/content/pm/AppCacheTest.java
index dd25220..2982816 100755
--- a/core/tests/coretests/src/android/content/pm/AppCacheTest.java
+++ b/core/tests/coretests/src/android/content/pm/AppCacheTest.java
@@ -35,14 +35,17 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
public class AppCacheTest extends AndroidTestCase {
private static final boolean localLOGV = false;
public static final String TAG="AppCacheTest";
public final long MAX_WAIT_TIME=60*1000;
public final long WAIT_TIME_INCR=10*1000;
- private static final int THRESHOLD=5;
- private static final int ACTUAL_THRESHOLD=10;
+ private static final long THRESHOLD=5;
+ private static final long ACTUAL_THRESHOLD=10;
@Override
protected void setUp() throws Exception {
@@ -94,24 +97,27 @@ public class AppCacheTest extends AndroidTestCase {
String testName="testDeleteAllCacheFiles";
cleanUpCacheDirectory();
}
-
+
void failStr(String errMsg) {
Log.w(TAG, "errMsg="+errMsg);
fail(errMsg);
}
+
void failStr(Exception e) {
Log.w(TAG, "e.getMessage="+e.getMessage());
Log.w(TAG, "e="+e);
}
+
long getFreeStorageBlks(StatFs st) {
st.restat("/data");
return st.getFreeBlocks();
}
-
+
long getFreeStorageSize(StatFs st) {
st.restat("/data");
- return (st.getFreeBlocks()*st.getBlockSize());
+ return (long) st.getFreeBlocks() * (long) st.getBlockSize();
}
+
@LargeTest
public void testFreeApplicationCacheAllFiles() throws Exception {
boolean TRACKING = true;
@@ -124,7 +130,9 @@ public class AppCacheTest extends AndroidTestCase {
long blks2 = getFreeStorageBlks(st);
if(localLOGV || TRACKING) Log.i(TAG, "blk1="+blks1+", blks2="+blks2);
//this should free up the test files that were created earlier
- invokePMFreeApplicationCache(availableMem);
+ if (!invokePMFreeApplicationCache(availableMem)) {
+ fail("Could not successfully invoke PackageManager free app cache API");
+ }
long blks3 = getFreeStorageBlks(st);
if(localLOGV || TRACKING) Log.i(TAG, "blks3="+blks3);
verifyTestFiles1(cacheDir, "testtmpdir", 5);
@@ -139,7 +147,9 @@ public class AppCacheTest extends AndroidTestCase {
long blks2 = getFreeStorageBlks(st);
Log.i(TAG, "blk1="+blks1+", blks2="+blks2);
long diff = (blks1-blks2-2);
- assertTrue(invokePMFreeApplicationCache(diff*st.getBlockSize()));
+ if (!invokePMFreeApplicationCache(diff * st.getBlockSize())) {
+ fail("Could not successfully invoke PackageManager free app cache API");
+ }
long blks3 = getFreeStorageBlks(st);
//blks3 should be greater than blks2 and less than blks1
if(!((blks3 <= blks1) && (blks3 >= blks2))) {
@@ -256,23 +266,23 @@ public class AppCacheTest extends AndroidTestCase {
}
return sbuffer.getBytes();
}
-
- long getFileNumBlocks(long fileSize, int blkSize) {
+
+ long getFileNumBlocks(long fileSize, long blkSize) {
long ret = fileSize/blkSize;
if(ret*blkSize < fileSize) {
ret++;
}
return ret;
}
-
+
//@LargeTest
public void testAppCacheClear() {
String dataDir="/data/data";
StatFs st = new StatFs(dataDir);
- int blkSize = st.getBlockSize();
- int totBlks = st.getBlockCount();
+ long blkSize = st.getBlockSize();
+ long totBlks = st.getBlockCount();
long availableBlks = st.getFreeBlocks();
- long thresholdBlks = (totBlks*THRESHOLD)/100;
+ long thresholdBlks = (totBlks * THRESHOLD) / 100L;
String testDirName = "testdir";
//create directory in cache
File testDir = new File(mContext.getCacheDir(), testDirName);
@@ -345,7 +355,7 @@ public class AppCacheTest extends AndroidTestCase {
if((fileSize > (shouldFree-blkSize) && (fileSize < (shouldFree+blkSize)))) {
Log.i(TAG, "passed");
}
- assertTrue(removedFlag);
+ assertTrue("Files should have been removed", removedFlag);
}
//createTestFiles(new File(super.getContext().getCacheDir(), "testtmp", "dir", 3)
@@ -375,16 +385,21 @@ public class AppCacheTest extends AndroidTestCase {
}
}
}
-
+
void verifyTestFiles1(File cacheDir, String testFilePrefix, int numTestFiles) {
+ List<String> files = new ArrayList<String>();
for(int i = 0; i < numTestFiles; i++) {
File file1 = new File(cacheDir, testFilePrefix+i+".txt");
if(file1.exists()) {
- fail("file:"+file1+" should not exist");
+ files.add(file1.getName());
}
}
+ if (files.size() > 0) {
+ fail("Files should have been deleted: "
+ + Arrays.toString(files.toArray(new String[files.size()])));
+ }
}
-
+
void createTestFiles2(File cacheDir, String rootTestDirName, String subDirPrefix, int numDirs, String testFilePrefix) {
Context con = super.getContext();
File testTmpDir = new File(cacheDir, rootTestDirName);
@@ -639,7 +654,9 @@ public class AppCacheTest extends AndroidTestCase {
PendingIntent pi = PendingIntent.getBroadcast(mContext,
0, new Intent(FreeStorageReceiver.ACTION_FREE), 0);
// Invoke PackageManager api
- invokePMFreeStorage(availableMem, receiver, pi);
+ if (!invokePMFreeStorage(availableMem, receiver, pi)) {
+ fail("Could not invoke PackageManager free storage API");
+ }
long blks3 = getFreeStorageBlks(st);
if(localLOGV || TRACKING) Log.i(TAG, "Available blocks after freeing cache"+blks3);
assertEquals(receiver.getResultCode(), 1);
diff --git a/data/etc/platform.xml b/data/etc/platform.xml
index 8555be0..ea91c21 100644
--- a/data/etc/platform.xml
+++ b/data/etc/platform.xml
@@ -58,10 +58,6 @@
<group gid="sdcard_rw" />
</permission>
- <permission name="android.permission.WRITE_MEDIA_STORAGE" >
- <group gid="media_rw" />
- </permission>
-
<permission name="android.permission.ACCESS_USB" >
<group gid="usb" />
</permission>
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java
index abe66726..0c33a5f 100644
--- a/graphics/java/android/renderscript/Allocation.java
+++ b/graphics/java/android/renderscript/Allocation.java
@@ -46,15 +46,62 @@ public class Allocation extends BaseObj {
Bitmap mBitmap;
int mUsage;
+ /**
+ * The usage of the allocation. These signal to renderscript
+ * where to place the allocation in memory.
+ *
+ * SCRIPT The allocation will be bound to and accessed by
+ * scripts.
+ */
public static final int USAGE_SCRIPT = 0x0001;
+
+ /**
+ * GRAPHICS_TEXTURE The allcation will be used as a texture
+ * source by one or more graphcics programs.
+ *
+ */
public static final int USAGE_GRAPHICS_TEXTURE = 0x0002;
+
+ /**
+ * GRAPHICS_VERTEX The allocation will be used as a graphics
+ * mesh.
+ *
+ */
public static final int USAGE_GRAPHICS_VERTEX = 0x0004;
+
+
+ /**
+ * GRAPHICS_CONSTANTS The allocation will be used as the source
+ * of shader constants by one or more programs.
+ *
+ */
public static final int USAGE_GRAPHICS_CONSTANTS = 0x0008;
+ /**
+ * Controls mipmap behavior when using the bitmap creation and
+ * update functions.
+ */
public enum MipmapControl {
+ /**
+ * No mipmaps will be generated and the type generated from the
+ * incoming bitmap will not contain additional LODs.
+ */
MIPMAP_NONE(0),
+
+ /**
+ * A Full mipmap chain will be created in script memory. The
+ * type of the allocation will contain a full mipmap chain. On
+ * upload to graphics the full chain will be transfered.
+ */
MIPMAP_FULL(1),
+
+ /**
+ * The type of the allocation will be the same as MIPMAP_NONE.
+ * It will not contain mipmaps. On upload to graphics the
+ * graphics copy of the allocation data will contain a full
+ * mipmap chain generated from the top level in script memory.
+ */
MIPMAP_ON_SYNC_TO_TEXTURE(2);
int mID;
@@ -256,6 +303,20 @@ public class Allocation extends BaseObj {
}
}
+ /**
+ * Generate a mipmap chain. Requires the type of the allocation
+ * include mipmaps.
+ *
+ * This function will generate a complete set of mipmaps from
+ * the top level lod and place them into the script memoryspace.
+ *
+ * If the allocation is also using other memory spaces a
+ * followup sync will be required.
+ */
+ public void generateMipmaps() {
+ mRS.nAllocationGenerateMipmaps(getID());
+ }
+
public void copy1DRangeFrom(int off, int count, int[] d) {
int dataSize = mType.mElement.getSizeBytes() * count;
data1DChecks(off, count, d.length * 4, dataSize);
@@ -278,29 +339,49 @@ public class Allocation extends BaseObj {
}
- public void copy2DRangeFrom(int xoff, int yoff, int w, int h, byte[] d) {
+ /**
+ * Copy a rectanglular region from the array into the
+ * allocation. The incoming array is assumed to be tightly
+ * packed.
+ *
+ * @param xoff X offset of the region to update
+ * @param yoff Y offset of the region to update
+ * @param w Width of the incoming region to update
+ * @param h Height of the incoming region to update
+ * @param data to be placed into the allocation
+ */
+ public void copy2DRangeFrom(int xoff, int yoff, int w, int h, byte[] data) {
mRS.validate();
- mRS.nAllocationData2D(getID(), xoff, yoff, 0, 0, w, h, d, d.length);
+ mRS.nAllocationData2D(getID(), xoff, yoff, 0, 0, w, h, data, data.length);
}
- public void copy2DRangeFrom(int xoff, int yoff, int w, int h, short[] d) {
+ public void copy2DRangeFrom(int xoff, int yoff, int w, int h, short[] data) {
mRS.validate();
- mRS.nAllocationData2D(getID(), xoff, yoff, 0, 0, w, h, d, d.length * 2);
+ mRS.nAllocationData2D(getID(), xoff, yoff, 0, 0, w, h, data, data.length * 2);
}
- public void copy2DRangeFrom(int xoff, int yoff, int w, int h, int[] d) {
+ public void copy2DRangeFrom(int xoff, int yoff, int w, int h, int[] data) {
mRS.validate();
- mRS.nAllocationData2D(getID(), xoff, yoff, 0, 0, w, h, d, d.length * 4);
+ mRS.nAllocationData2D(getID(), xoff, yoff, 0, 0, w, h, data, data.length * 4);
}
- public void copy2DRangeFrom(int xoff, int yoff, int w, int h, float[] d) {
+ public void copy2DRangeFrom(int xoff, int yoff, int w, int h, float[] data) {
mRS.validate();
- mRS.nAllocationData2D(getID(), xoff, yoff, 0, 0, w, h, d, d.length * 4);
+ mRS.nAllocationData2D(getID(), xoff, yoff, 0, 0, w, h, data, data.length * 4);
}
- public void copy2DRangeFrom(int xoff, int yoff, Bitmap b) {
+ /**
+ * Copy a bitmap into an allocation. The height and width of
+ * the update will use the height and width of the incoming
+ * bitmap.
+ *
+ * @param xoff X offset of the region to update
+ * @param yoff Y offset of the region to update
+ * @param data the bitmap to be copied
+ */
+ public void copy2DRangeFrom(int xoff, int yoff, Bitmap data) {
mRS.validate();
- mRS.nAllocationData2D(getID(), xoff, yoff, 0, 0, b);
+ mRS.nAllocationData2D(getID(), xoff, yoff, 0, 0, data);
}
@@ -329,6 +410,18 @@ public class Allocation extends BaseObj {
mRS.nAllocationRead(getID(), d);
}
+ /**
+ * Resize a 1D allocation. The contents of the allocation are
+ * preserved. If new elements are allocated objects are created
+ * with null contents and the new region is otherwise undefined.
+ *
+ * If the new region is smaller the references of any objects
+ * outside the new region will be released.
+ *
+ * A new type will be created with the new dimension.
+ *
+ * @param dimX The new size of the allocation.
+ */
public synchronized void resize(int dimX) {
if ((mType.getY() > 0)|| (mType.getZ() > 0) || mType.hasFaces() || mType.hasMipmaps()) {
throw new RSInvalidStateException("Resize only support for 1D allocations at this time.");
diff --git a/graphics/java/android/renderscript/AllocationAdapter.java b/graphics/java/android/renderscript/AllocationAdapter.java
index e682e93..f2fedea 100644
--- a/graphics/java/android/renderscript/AllocationAdapter.java
+++ b/graphics/java/android/renderscript/AllocationAdapter.java
@@ -24,7 +24,6 @@ import android.util.Log;
import android.util.TypedValue;
/**
- * @hide
*
**/
public class AllocationAdapter extends Allocation {
diff --git a/graphics/java/android/renderscript/FileA3D.java b/graphics/java/android/renderscript/FileA3D.java
index 01a9a82..90d102c 100644
--- a/graphics/java/android/renderscript/FileA3D.java
+++ b/graphics/java/android/renderscript/FileA3D.java
@@ -28,7 +28,6 @@ import android.util.Log;
import android.util.TypedValue;
/**
- * @hide
*
**/
public class FileA3D extends BaseObj {
diff --git a/graphics/java/android/renderscript/Font.java b/graphics/java/android/renderscript/Font.java
index ae209fa..252ffc1 100644
--- a/graphics/java/android/renderscript/Font.java
+++ b/graphics/java/android/renderscript/Font.java
@@ -30,7 +30,6 @@ import android.util.Log;
import android.util.TypedValue;
/**
- * @hide
*
**/
public class Font extends BaseObj {
diff --git a/graphics/java/android/renderscript/Long2.java b/graphics/java/android/renderscript/Long2.java
index 11ead2f..834d13c 100644
--- a/graphics/java/android/renderscript/Long2.java
+++ b/graphics/java/android/renderscript/Long2.java
@@ -21,7 +21,6 @@ import android.util.Log;
/**
- * @hide
*
**/
public class Long2 {
diff --git a/graphics/java/android/renderscript/Long3.java b/graphics/java/android/renderscript/Long3.java
index 1604532..c6d7289 100644
--- a/graphics/java/android/renderscript/Long3.java
+++ b/graphics/java/android/renderscript/Long3.java
@@ -21,7 +21,6 @@ import android.util.Log;
/**
- * @hide
*
**/
public class Long3 {
diff --git a/graphics/java/android/renderscript/Long4.java b/graphics/java/android/renderscript/Long4.java
index 2fd2747..032c1d3 100644
--- a/graphics/java/android/renderscript/Long4.java
+++ b/graphics/java/android/renderscript/Long4.java
@@ -21,7 +21,6 @@ import android.util.Log;
/**
- * @hide
*
**/
public class Long4 {
diff --git a/graphics/java/android/renderscript/Mesh.java b/graphics/java/android/renderscript/Mesh.java
index b77fe7d..f1f1237 100644
--- a/graphics/java/android/renderscript/Mesh.java
+++ b/graphics/java/android/renderscript/Mesh.java
@@ -22,7 +22,6 @@ import android.util.Config;
import android.util.Log;
/**
- * @hide
* Mesh class is a container for geometric data displayed in
* renderscript.
*
@@ -205,7 +204,7 @@ public class Mesh extends BaseObj {
/**
* Adds a vertex data type to the builder object
*
- * @param r type of the vertex data allocation to be created
+ * @param t type of the vertex data allocation to be created
*
* @return this
**/
diff --git a/graphics/java/android/renderscript/RSDriverException.java b/graphics/java/android/renderscript/RSDriverException.java
index 61787e6..ce85b53 100644
--- a/graphics/java/android/renderscript/RSDriverException.java
+++ b/graphics/java/android/renderscript/RSDriverException.java
@@ -20,7 +20,6 @@ package android.renderscript;
/**
* Base class for all exceptions thrown by the Android
* Renderscript
- * @hide
*/
public class RSDriverException extends RSRuntimeException {
public RSDriverException(String string) {
diff --git a/graphics/java/android/renderscript/RSIllegalArgumentException.java b/graphics/java/android/renderscript/RSIllegalArgumentException.java
index 8d67a8d..954c0e8 100644
--- a/graphics/java/android/renderscript/RSIllegalArgumentException.java
+++ b/graphics/java/android/renderscript/RSIllegalArgumentException.java
@@ -20,7 +20,6 @@ package android.renderscript;
/**
* Base class for all exceptions thrown by the Android
* Renderscript
- * @hide
*/
public class RSIllegalArgumentException extends RSRuntimeException {
public RSIllegalArgumentException(String string) {
diff --git a/graphics/java/android/renderscript/RSInvalidStateException.java b/graphics/java/android/renderscript/RSInvalidStateException.java
index 53b9479..691aeba 100644
--- a/graphics/java/android/renderscript/RSInvalidStateException.java
+++ b/graphics/java/android/renderscript/RSInvalidStateException.java
@@ -20,7 +20,6 @@ package android.renderscript;
/**
* Base class for all exceptions thrown by the Android
* Renderscript
- * @hide
*/
public class RSInvalidStateException extends RSRuntimeException {
public RSInvalidStateException(String string) {
diff --git a/graphics/java/android/renderscript/RSRuntimeException.java b/graphics/java/android/renderscript/RSRuntimeException.java
index 4c97937..5a16478 100644
--- a/graphics/java/android/renderscript/RSRuntimeException.java
+++ b/graphics/java/android/renderscript/RSRuntimeException.java
@@ -20,7 +20,6 @@ package android.renderscript;
/**
* Base class for all exceptions thrown by the Android
* Renderscript
- * @hide
*/
public class RSRuntimeException
extends java.lang.RuntimeException {
diff --git a/graphics/java/android/renderscript/RSSurfaceView.java b/graphics/java/android/renderscript/RSSurfaceView.java
index 507f41f..be893bb 100644
--- a/graphics/java/android/renderscript/RSSurfaceView.java
+++ b/graphics/java/android/renderscript/RSSurfaceView.java
@@ -30,16 +30,16 @@ import android.view.SurfaceHolder;
import android.view.SurfaceView;
/**
- * @hide
*
- **/
+ */
public class RSSurfaceView extends SurfaceView implements SurfaceHolder.Callback {
private SurfaceHolder mSurfaceHolder;
private RenderScriptGL mRS;
/**
* Standard View constructor. In order to render something, you
- * must call {@link #setRenderer} to register a renderer.
+ * must call {@link android.opengl.GLSurfaceView#setRenderer} to
+ * register a renderer.
*/
public RSSurfaceView(Context context) {
super(context);
@@ -49,7 +49,8 @@ public class RSSurfaceView extends SurfaceView implements SurfaceHolder.Callback
/**
* Standard View constructor. In order to render something, you
- * must call {@link #setRenderer} to register a renderer.
+ * must call {@link android.opengl.GLSurfaceView#setRenderer} to
+ * register a renderer.
*/
public RSSurfaceView(Context context, AttributeSet attrs) {
super(context, attrs);
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index 4c9ad56..28b32d5 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -223,6 +223,10 @@ public class RenderScript {
synchronized void nAllocationSyncAll(int alloc, int src) {
rsnAllocationSyncAll(mContext, alloc, src);
}
+ native void rsnAllocationGenerateMipmaps(int con, int alloc);
+ synchronized void nAllocationGenerateMipmaps(int alloc) {
+ rsnAllocationGenerateMipmaps(mContext, alloc);
+ }
native void rsnAllocationCopyFromBitmap(int con, int alloc, Bitmap bmp);
synchronized void nAllocationCopyFromBitmap(int alloc, Bitmap bmp) {
rsnAllocationCopyFromBitmap(mContext, alloc, bmp);
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index 1817a1b..a7913d7 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -411,6 +411,13 @@ nAllocationSyncAll(JNIEnv *_env, jobject _this, RsContext con, jint a, jint bits
rsAllocationSyncAll(con, (RsAllocation)a, (RsAllocationUsageType)bits);
}
+static void
+nAllocationGenerateMipmaps(JNIEnv *_env, jobject _this, RsContext con, jint alloc)
+{
+ LOG_API("nAllocationGenerateMipmaps, con(%p), a(%p)", con, (RsAllocation)alloc);
+ rsAllocationGenerateMipmaps(con, (RsAllocation)alloc);
+}
+
static int
nAllocationCreateFromBitmap(JNIEnv *_env, jobject _this, RsContext con, jint type, jint mip, jobject jbitmap, jint usage)
{
@@ -445,10 +452,14 @@ nAllocationCopyFromBitmap(JNIEnv *_env, jobject _this, RsContext con, jint alloc
SkBitmap const * nativeBitmap =
(SkBitmap const *)_env->GetIntField(jbitmap, gNativeBitmapID);
const SkBitmap& bitmap(*nativeBitmap);
+ int w = bitmap.width();
+ int h = bitmap.height();
bitmap.lockPixels();
const void* ptr = bitmap.getPixels();
- rsAllocationCopyFromBitmap(con, (RsAllocation)alloc, ptr, bitmap.getSize());
+ rsAllocation2DData(con, (RsAllocation)alloc, 0, 0,
+ 0, RS_ALLOCATION_CUBMAP_FACE_POSITVE_X,
+ w, h, ptr, bitmap.getSize());
bitmap.unlockPixels();
}
@@ -1211,6 +1222,7 @@ static JNINativeMethod methods[] = {
{"rsnAllocationGetType", "(II)I", (void*)nAllocationGetType},
{"rsnAllocationResize1D", "(III)V", (void*)nAllocationResize1D },
{"rsnAllocationResize2D", "(IIII)V", (void*)nAllocationResize2D },
+{"rsnAllocationGenerateMipmaps", "(II)V", (void*)nAllocationGenerateMipmaps },
{"rsnScriptBindAllocation", "(IIII)V", (void*)nScriptBindAllocation },
{"rsnScriptSetTimeZone", "(II[B)V", (void*)nScriptSetTimeZone },
diff --git a/include/gui/SurfaceTexture.h b/include/gui/SurfaceTexture.h
index cbc15d8..09cf2a2 100644
--- a/include/gui/SurfaceTexture.h
+++ b/include/gui/SurfaceTexture.h
@@ -70,6 +70,26 @@ public:
// target texture belongs is bound to the calling thread.
status_t updateTexImage();
+ // getTransformMatrix retrieves the 4x4 texture coordinate transform matrix
+ // associated with the texture image set by the most recent call to
+ // updateTexImage.
+ //
+ // This transform matrix maps 2D homogeneous texture coordinates of the form
+ // (s, t, 0, 1) with s and t in the inclusive range [0, 1] to the texture
+ // coordinate that should be used to sample that location from the texture.
+ // Sampling the texture outside of the range of this transform is undefined.
+ //
+ // This transform is necessary to compensate for transforms that the stream
+ // content producer may implicitly apply to the content. By forcing users of
+ // a SurfaceTexture to apply this transform we avoid performing an extra
+ // copy of the data that would be needed to hide the transform from the
+ // user.
+ //
+ // The matrix is stored in column-major order so that it may be passed
+ // directly to OpenGL ES via the glLoadMatrixf or glUniformMatrix4fv
+ // functions.
+ void getTransformMatrix(float mtx[16]);
+
private:
// freeAllBuffers frees the resources (both GraphicBuffer and EGLImage) for
@@ -120,11 +140,37 @@ private:
// reset mCurrentTexture to INVALID_BUFFER_SLOT.
int mCurrentTexture;
+ // mCurrentCrop is the crop rectangle that applies to the current texture.
+ // It gets set to mLastQueuedCrop each time updateTexImage is called.
+ Rect mCurrentCrop;
+
+ // mCurrentTransform is the transform identifier for the current texture. It
+ // gets set to mLastQueuedTransform each time updateTexImage is called.
+ uint32_t mCurrentTransform;
+
// mLastQueued is the buffer slot index of the most recently enqueued buffer.
// At construction time it is initialized to INVALID_BUFFER_SLOT, and is
// updated each time queueBuffer is called.
int mLastQueued;
+ // mLastQueuedCrop is the crop rectangle for the buffer that was most
+ // recently queued. This gets set to mNextCrop each time queueBuffer gets
+ // called.
+ Rect mLastQueuedCrop;
+
+ // mLastQueuedTransform is the transform identifier for the buffer that was
+ // most recently queued. This gets set to mNextTransform each time
+ // queueBuffer gets called.
+ uint32_t mLastQueuedTransform;
+
+ // mNextCrop is the crop rectangle that will be used for the next buffer
+ // that gets queued. It is set by calling setCrop.
+ Rect mNextCrop;
+
+ // mNextTransform is the transform identifier that will be used for the next
+ // buffer that gets queued. It is set by calling setTransform.
+ uint32_t mNextTransform;
+
// mTexName is the name of the OpenGL texture to which streamed images will
// be bound when updateTexImage is called. It is set at construction time
// changed with a call to setTexName.
diff --git a/include/media/IMediaMetadataRetriever.h b/include/media/IMediaMetadataRetriever.h
index e517cf0..8e3cdbb 100644
--- a/include/media/IMediaMetadataRetriever.h
+++ b/include/media/IMediaMetadataRetriever.h
@@ -32,7 +32,6 @@ public:
virtual void disconnect() = 0;
virtual status_t setDataSource(const char* srcUrl) = 0;
virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0;
- virtual status_t setMode(int mode) = 0;
virtual sp<IMemory> getFrameAtTime(int64_t timeUs, int option) = 0;
virtual sp<IMemory> extractAlbumArt() = 0;
virtual const char* extractMetadata(int keyCode) = 0;
diff --git a/include/media/MediaMetadataRetrieverInterface.h b/include/media/MediaMetadataRetrieverInterface.h
index 717849d..0449122 100644
--- a/include/media/MediaMetadataRetrieverInterface.h
+++ b/include/media/MediaMetadataRetrieverInterface.h
@@ -32,7 +32,6 @@ public:
virtual ~MediaMetadataRetrieverBase() {}
virtual status_t setDataSource(const char *url) = 0;
virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0;
- virtual status_t setMode(int mode) = 0;
virtual VideoFrame* getFrameAtTime(int64_t timeUs, int option) = 0;
virtual MediaAlbumArt* extractAlbumArt() = 0;
virtual const char* extractMetadata(int keyCode) = 0;
@@ -42,35 +41,12 @@ public:
class MediaMetadataRetrieverInterface : public MediaMetadataRetrieverBase
{
public:
- MediaMetadataRetrieverInterface()
- : mMode(0) {
- }
+ MediaMetadataRetrieverInterface() {}
virtual ~MediaMetadataRetrieverInterface() {}
-
- // @param mode The intended mode of operations:
- // can be any of the following:
- // METADATA_MODE_NOOP: Experimental - just add and remove data source.
- // METADATA_MODE_FRAME_CAPTURE_ONLY: For capture frame/thumbnail only.
- // METADATA_MODE_METADATA_RETRIEVAL_ONLY: For meta data retrieval only.
- // METADATA_MODE_FRAME_CAPTURE_AND_METADATA_RETRIEVAL: For both frame
- // capture and meta data retrieval.
- virtual status_t setMode(int mode) {
- if (mode < METADATA_MODE_NOOP ||
- mode > METADATA_MODE_FRAME_CAPTURE_AND_METADATA_RETRIEVAL) {
- return BAD_VALUE;
- }
-
- mMode = mode;
- return NO_ERROR;
- }
-
- virtual status_t getMode(int* mode) const { *mode = mMode; return NO_ERROR; }
virtual VideoFrame* getFrameAtTime(int64_t timeUs, int option) { return NULL; }
virtual MediaAlbumArt* extractAlbumArt() { return NULL; }
virtual const char* extractMetadata(int keyCode) { return NULL; }
-
- uint32_t mMode;
};
}; // namespace android
diff --git a/include/media/mediametadataretriever.h b/include/media/mediametadataretriever.h
index 03dd52d..e905006 100644
--- a/include/media/mediametadataretriever.h
+++ b/include/media/mediametadataretriever.h
@@ -42,37 +42,14 @@ enum {
METADATA_KEY_YEAR = 8,
METADATA_KEY_DURATION = 9,
METADATA_KEY_NUM_TRACKS = 10,
- METADATA_KEY_IS_DRM_CRIPPLED = 11,
- METADATA_KEY_CODEC = 12,
- METADATA_KEY_RATING = 13,
- METADATA_KEY_COMMENT = 14,
- METADATA_KEY_COPYRIGHT = 15,
- METADATA_KEY_BIT_RATE = 16,
- METADATA_KEY_FRAME_RATE = 17,
- METADATA_KEY_VIDEO_FORMAT = 18,
- METADATA_KEY_VIDEO_HEIGHT = 19,
- METADATA_KEY_VIDEO_WIDTH = 20,
- METADATA_KEY_WRITER = 21,
- METADATA_KEY_MIMETYPE = 22,
- METADATA_KEY_DISC_NUMBER = 23,
- METADATA_KEY_ALBUMARTIST = 24,
- METADATA_KEY_COMPILATION = 25,
+ METADATA_KEY_WRITER = 11,
+ METADATA_KEY_MIMETYPE = 12,
+ METADATA_KEY_ALBUMARTIST = 13,
+ METADATA_KEY_DISC_NUMBER = 14,
+ METADATA_KEY_COMPILATION = 15,
// Add more here...
};
-// The intended mode of operations:$
-// METADATA_MODE_NOOP: Experimental - just add and remove data source.$
-// METADATA_MODE_FRAME_CAPTURE_ONLY: For capture frame/thumbnail only.$
-// METADATA_MODE_METADATA_RETRIEVAL_ONLY: For meta data retrieval only.$
-// METADATA_MODE_FRAME_CAPTURE_AND_METADATA_RETRIEVAL: For both frame capture
-// and meta data retrieval.$
-enum {
- METADATA_MODE_NOOP = 0x00,
- METADATA_MODE_METADATA_RETRIEVAL_ONLY = 0x01,
- METADATA_MODE_FRAME_CAPTURE_ONLY = 0x02,
- METADATA_MODE_FRAME_CAPTURE_AND_METADATA_RETRIEVAL = 0x03
-};
-
class MediaMetadataRetriever: public RefBase
{
public:
@@ -81,7 +58,6 @@ public:
void disconnect();
status_t setDataSource(const char* dataSourceUrl);
status_t setDataSource(int fd, int64_t offset, int64_t length);
- status_t setMode(int mode);
sp<IMemory> getFrameAtTime(int64_t timeUs, int option);
sp<IMemory> extractAlbumArt();
const char* extractMetadata(int keyCode);
diff --git a/libs/gui/SurfaceTexture.cpp b/libs/gui/SurfaceTexture.cpp
index 11a48d9..28f3dc2 100644
--- a/libs/gui/SurfaceTexture.cpp
+++ b/libs/gui/SurfaceTexture.cpp
@@ -34,6 +34,46 @@
namespace android {
+// Transform matrices
+static float mtxIdentity[16] = {
+ 1, 0, 0, 0,
+ 0, 1, 0, 0,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1,
+};
+static float mtxFlipH[16] = {
+ -1, 0, 0, 0,
+ 0, 1, 0, 0,
+ 0, 0, 1, 0,
+ 1, 0, 0, 1,
+};
+static float mtxFlipV[16] = {
+ 1, 0, 0, 0,
+ 0, -1, 0, 0,
+ 0, 0, 1, 0,
+ 0, 1, 0, 1,
+};
+static float mtxRot90[16] = {
+ 0, 1, 0, 0,
+ -1, 0, 0, 0,
+ 0, 0, 1, 0,
+ 1, 0, 0, 1,
+};
+static float mtxRot180[16] = {
+ -1, 0, 0, 0,
+ 0, -1, 0, 0,
+ 0, 0, 1, 0,
+ 1, 1, 0, 1,
+};
+static float mtxRot270[16] = {
+ 0, -1, 0, 0,
+ 1, 0, 0, 0,
+ 0, 0, 1, 0,
+ 0, 1, 0, 1,
+};
+
+static void mtxMul(float out[16], const float a[16], const float b[16]);
+
SurfaceTexture::SurfaceTexture(GLuint tex) :
mBufferCount(MIN_BUFFER_SLOTS), mCurrentTexture(INVALID_BUFFER_SLOT),
mLastQueued(INVALID_BUFFER_SLOT), mTexName(tex) {
@@ -121,6 +161,8 @@ status_t SurfaceTexture::queueBuffer(int buf) {
}
mSlots[buf].mOwnedByClient = false;
mLastQueued = buf;
+ mLastQueuedCrop = mNextCrop;
+ mLastQueuedTransform = mNextTransform;
return OK;
}
@@ -138,17 +180,17 @@ void SurfaceTexture::cancelBuffer(int buf) {
mSlots[buf].mOwnedByClient = false;
}
-status_t SurfaceTexture::setCrop(const Rect& reg) {
+status_t SurfaceTexture::setCrop(const Rect& crop) {
LOGV("SurfaceTexture::setCrop");
Mutex::Autolock lock(mMutex);
- // XXX: How should we handle crops?
+ mNextCrop = crop;
return OK;
}
status_t SurfaceTexture::setTransform(uint32_t transform) {
LOGV("SurfaceTexture::setTransform");
Mutex::Autolock lock(mMutex);
- // XXX: How should we handle transforms?
+ mNextTransform = transform;
return OK;
}
@@ -162,8 +204,12 @@ status_t SurfaceTexture::updateTexImage() {
// Initially both mCurrentTexture and mLastQueued are INVALID_BUFFER_SLOT,
// so this check will fail until a buffer gets queued.
if (mCurrentTexture != mLastQueued) {
- // XXX: Figure out the right target.
+ // Update the SurfaceTexture state.
mCurrentTexture = mLastQueued;
+ mCurrentCrop = mLastQueuedCrop;
+ mCurrentTransform = mLastQueuedTransform;
+
+ // Update the GL texture object.
EGLImageKHR image = mSlots[mCurrentTexture].mEglImage;
if (image == EGL_NO_IMAGE_KHR) {
EGLDisplay dpy = eglGetCurrentDisplay();
@@ -183,6 +229,49 @@ status_t SurfaceTexture::updateTexImage() {
return OK;
}
+void SurfaceTexture::getTransformMatrix(float mtx[16]) {
+ LOGV("SurfaceTexture::updateTexImage");
+ Mutex::Autolock lock(mMutex);
+
+ float* xform = mtxIdentity;
+ switch (mCurrentTransform) {
+ case 0:
+ xform = mtxIdentity;
+ break;
+ case NATIVE_WINDOW_TRANSFORM_FLIP_H:
+ xform = mtxFlipH;
+ break;
+ case NATIVE_WINDOW_TRANSFORM_FLIP_V:
+ xform = mtxFlipV;
+ break;
+ case NATIVE_WINDOW_TRANSFORM_ROT_90:
+ xform = mtxRot90;
+ break;
+ case NATIVE_WINDOW_TRANSFORM_ROT_180:
+ xform = mtxRot180;
+ break;
+ case NATIVE_WINDOW_TRANSFORM_ROT_270:
+ xform = mtxRot270;
+ break;
+ default:
+ LOGE("getTransformMatrix: unknown transform: %d", mCurrentTransform);
+ }
+
+ sp<GraphicBuffer>& buf(mSlots[mCurrentTexture].mGraphicBuffer);
+ float tx = float(mCurrentCrop.left) / float(buf->getWidth());
+ float ty = float(mCurrentCrop.bottom) / float(buf->getHeight());
+ float sx = float(mCurrentCrop.width()) / float(buf->getWidth());
+ float sy = float(mCurrentCrop.height()) / float(buf->getHeight());
+ float crop[16] = {
+ sx, 0, 0, sx*tx,
+ 0, sy, 0, sy*ty,
+ 0, 0, 1, 0,
+ 0, 0, 0, 1,
+ };
+
+ mtxMul(mtx, crop, xform);
+}
+
void SurfaceTexture::freeAllBuffers() {
for (int i = 0; i < NUM_BUFFER_SLOTS; i++) {
mSlots[i].mGraphicBuffer = 0;
@@ -214,4 +303,26 @@ EGLImageKHR SurfaceTexture::createImage(EGLDisplay dpy,
return image;
}
+static void mtxMul(float out[16], const float a[16], const float b[16]) {
+ out[0] = a[0]*b[0] + a[4]*b[1] + a[8]*b[2] + a[12]*b[3];
+ out[1] = a[1]*b[0] + a[5]*b[1] + a[9]*b[2] + a[13]*b[3];
+ out[2] = a[2]*b[0] + a[6]*b[1] + a[10]*b[2] + a[14]*b[3];
+ out[3] = a[3]*b[0] + a[7]*b[1] + a[11]*b[2] + a[15]*b[3];
+
+ out[4] = a[0]*b[4] + a[4]*b[5] + a[8]*b[6] + a[12]*b[7];
+ out[5] = a[1]*b[4] + a[5]*b[5] + a[9]*b[6] + a[13]*b[7];
+ out[6] = a[2]*b[4] + a[6]*b[5] + a[10]*b[6] + a[14]*b[7];
+ out[7] = a[3]*b[4] + a[7]*b[5] + a[11]*b[6] + a[15]*b[7];
+
+ out[8] = a[0]*b[8] + a[4]*b[9] + a[8]*b[10] + a[12]*b[11];
+ out[9] = a[1]*b[8] + a[5]*b[9] + a[9]*b[10] + a[13]*b[11];
+ out[10] = a[2]*b[8] + a[6]*b[9] + a[10]*b[10] + a[14]*b[11];
+ out[11] = a[3]*b[8] + a[7]*b[9] + a[11]*b[10] + a[15]*b[11];
+
+ out[12] = a[0]*b[12] + a[4]*b[13] + a[8]*b[14] + a[12]*b[15];
+ out[13] = a[1]*b[12] + a[5]*b[13] + a[9]*b[14] + a[13]*b[15];
+ out[14] = a[2]*b[12] + a[6]*b[13] + a[10]*b[14] + a[14]*b[15];
+ out[15] = a[3]*b[12] + a[7]*b[13] + a[11]*b[14] + a[15]*b[15];
+}
+
}; // namespace android
diff --git a/libs/rs/rs.spec b/libs/rs/rs.spec
index 33ac2f0..7e23cec 100644
--- a/libs/rs/rs.spec
+++ b/libs/rs/rs.spec
@@ -77,12 +77,6 @@ ElementCreate2 {
ret RsElement
}
-AllocationCopyFromBitmap {
- param RsAllocation alloc
- param const void * data
- param size_t dataLen
- }
-
AllocationCopyToBitmap {
param RsAllocation alloc
param void * data
@@ -135,6 +129,10 @@ Allocation2DElementData {
param uint32_t bytes
}
+AllocationGenerateMipmaps {
+ param RsAllocation va
+}
+
AllocationRead {
param RsAllocation va
param void * data
diff --git a/libs/rs/rsAllocation.cpp b/libs/rs/rsAllocation.cpp
index d6b90e6..cf394c0 100644
--- a/libs/rs/rsAllocation.cpp
+++ b/libs/rs/rsAllocation.cpp
@@ -342,26 +342,34 @@ void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t lod,
uint32_t lineSize = eSize * w;
uint32_t destW = mType->getDimX();
- const uint8_t *src = static_cast<const uint8_t *>(data);
- uint8_t *dst = static_cast<uint8_t *>(mPtr);
- dst += eSize * (xoff + yoff * destW);
+ //LOGE("data2d %p, %i %i %i %i %i %i %p %i", this, xoff, yoff, lod, face, w, h, data, sizeBytes);
- if ((lineSize * eSize * h) != sizeBytes) {
+ if ((lineSize * h) != sizeBytes) {
+ LOGE("Allocation size mismatch, expected %i, got %i", (lineSize * h), sizeBytes);
rsAssert(!"Allocation::subData called with mismatched size");
return;
}
- for (uint32_t line=yoff; line < (yoff+h); line++) {
- if (mType->getElement()->getHasReferences()) {
- incRefs(src, w);
- decRefs(dst, w);
+ if (mPtr) {
+ const uint8_t *src = static_cast<const uint8_t *>(data);
+ uint8_t *dst = static_cast<uint8_t *>(mPtr);
+ dst += mType->getLODOffset(lod, xoff, yoff);
+
+ //LOGE(" %p %p %i ", dst, src, eSize);
+ for (uint32_t line=yoff; line < (yoff+h); line++) {
+ if (mType->getElement()->getHasReferences()) {
+ incRefs(src, w);
+ decRefs(dst, w);
+ }
+ memcpy(dst, src, lineSize);
+ src += lineSize;
+ dst += destW * eSize;
}
- memcpy(dst, src, lineSize);
- src += lineSize;
- dst += destW * eSize;
+ sendDirty();
+ mUploadDefered = true;
+ } else {
+ upload2DTexture(false, data);
}
- sendDirty();
- mUploadDefered = true;
}
void Allocation::data(Context *rsc, uint32_t xoff, uint32_t yoff, uint32_t zoff, uint32_t lod, RsAllocationCubemapFace face,
@@ -685,28 +693,9 @@ void rsi_AllocationSyncAll(Context *rsc, RsAllocation va, RsAllocationUsageType
a->syncAll(rsc, src);
}
-void rsi_AllocationCopyFromBitmap(Context *rsc, RsAllocation va, const void *data, size_t dataLen) {
+void rsi_AllocationGenerateMipmaps(Context *rsc, RsAllocation va) {
Allocation *texAlloc = static_cast<Allocation *>(va);
- const Type * t = texAlloc->getType();
-
- uint32_t w = t->getDimX();
- uint32_t h = t->getDimY();
- bool genMips = t->getDimLOD();
- size_t s = w * h * t->getElementSizeBytes();
- if (s != dataLen) {
- rsc->setError(RS_ERROR_BAD_VALUE, "Bitmap size didn't match allocation size");
- return;
- }
-
- if (texAlloc->getIsScript()) {
- memcpy(texAlloc->getPtr(), data, s);
- if (genMips) {
- rsaAllocationGenerateScriptMips(rsc, texAlloc);
- }
- } else {
- texAlloc->upload2DTexture(false, data);
- }
-
+ rsaAllocationGenerateScriptMips(rsc, texAlloc);
}
void rsi_AllocationCopyToBitmap(Context *rsc, RsAllocation va, void *data, size_t dataLen) {
diff --git a/media/java/android/media/MediaMetadataRetriever.java b/media/java/android/media/MediaMetadataRetriever.java
index b99f7ed..77e939e 100644
--- a/media/java/android/media/MediaMetadataRetriever.java
+++ b/media/java/android/media/MediaMetadataRetriever.java
@@ -29,7 +29,6 @@ import java.io.IOException;
/**
* MediaMetadataRetriever class provides a unified interface for retrieving
* frame and meta data from an input media file.
- * {@hide}
*/
public class MediaMetadataRetriever
{
@@ -49,30 +48,6 @@ public class MediaMetadataRetriever
}
/**
- * Call this method before setDataSource() so that the mode becomes
- * effective for subsequent operations. This method can be called only once
- * at the beginning if the intended mode of operation for a
- * MediaMetadataRetriever object remains the same for its whole lifetime,
- * and thus it is unnecessary to call this method each time setDataSource()
- * is called. If this is not never called (which is allowed), by default the
- * intended mode of operation is to both capture frame and retrieve meta
- * data (i.e., MODE_GET_METADATA_ONLY | MODE_CAPTURE_FRAME_ONLY).
- * Often, this may not be what one wants, since doing this has negative
- * performance impact on execution time of a call to setDataSource(), since
- * both types of operations may be time consuming.
- *
- * @param mode The intended mode of operation. Can be any combination of
- * MODE_GET_METADATA_ONLY and MODE_CAPTURE_FRAME_ONLY:
- * 1. MODE_GET_METADATA_ONLY & MODE_CAPTURE_FRAME_ONLY:
- * For neither frame capture nor meta data retrieval
- * 2. MODE_GET_METADATA_ONLY: For meta data retrieval only
- * 3. MODE_CAPTURE_FRAME_ONLY: For frame capture only
- * 4. MODE_GET_METADATA_ONLY | MODE_CAPTURE_FRAME_ONLY:
- * For both frame capture and meta data retrieval
- */
- public native void setMode(int mode);
-
- /**
* Sets the data source (file pathname) to use. Call this
* method before the rest of the methods in this class. This method may be
* time-consuming.
@@ -199,15 +174,15 @@ public class MediaMetadataRetriever
* that the implementation considers as representative may be returned.
*
* @param option a hint on how the frame is found. Use
- * {@link OPTION_PREVIOUS_SYNC} if one wants to retrieve a sync frame
+ * {@link #OPTION_PREVIOUS_SYNC} if one wants to retrieve a sync frame
* that has a timestamp earlier than or the same as timeUs. Use
- * {@link OPTION_NEXT_SYNC} if one wants to retrieve a sync frame
+ * {@link #OPTION_NEXT_SYNC} if one wants to retrieve a sync frame
* that has a timestamp later than or the same as timeUs. Use
- * {@link OPTION_CLOSEST_SYNC} if one wants to retrieve a sync frame
+ * {@link #OPTION_CLOSEST_SYNC} if one wants to retrieve a sync frame
* that has a timestamp closest to or the same as timeUs. Use
- * {@link OPTION_CLOSEST} if one wants to retrieve a frame that may
+ * {@link #OPTION_CLOSEST} if one wants to retrieve a frame that may
* or may not be a sync frame but is closest to or the same as timeUs.
- * {@link OPTION_CLOSEST} often has larger performance overhead compared
+ * {@link #OPTION_CLOSEST} often has larger performance overhead compared
* to the other options if there is no sync frame located at timeUs.
*
* @return A Bitmap containing a representative video frame, which
@@ -228,7 +203,7 @@ public class MediaMetadataRetriever
* and returns it as a bitmap. This is useful for generating a thumbnail
* for an input data source. Call this method if one does not care
* how the frame is found as long as it is close to the given time;
- * otherwise, please call {@link getFrameAtTime(long, int)}.
+ * otherwise, please call {@link #getFrameAtTime(long, int)}.
*
* @param timeUs The time position where the frame will be retrieved.
* When retrieving the frame at the given time position, there is no
@@ -252,7 +227,7 @@ public class MediaMetadataRetriever
* and returns it as a bitmap. This is useful for generating a thumbnail
* for an input data source. Call this method if one does not
* care about where the frame is located; otherwise, please call
- * {@link getFrameAtTime(long)} or {@link getFrameAtTime(long, int)}
+ * {@link #getFrameAtTime(long)} or {@link #getFrameAtTime(long, int)}
*
* @return A Bitmap containing a representative video frame, which
* can be null, if such a frame cannot be retrieved.
@@ -269,8 +244,8 @@ public class MediaMetadataRetriever
/**
* Call this method after setDataSource(). This method finds the optional
- * graphic or album art associated (embedded or external url linked) the
- * related data source.
+ * graphic or album art associated associated with the data source. If
+ * there are more than one pictures, (any) one of them is returned.
*
* @return null if no such graphic is found.
*/
@@ -299,52 +274,129 @@ public class MediaMetadataRetriever
}
}
- public static final int MODE_GET_METADATA_ONLY = 0x01;
- public static final int MODE_CAPTURE_FRAME_ONLY = 0x02;
-
/**
- * Option used in method {@link getFrameAtTime(long, int)} to get a
+ * Option used in method {@link #getFrameAtTime(long, int)} to get a
* frame at a specified location.
*
* @see #getFrameAtTime(long, int)
*/
- /* Do not change these values without updating their counterparts
+ /* Do not change these option values without updating their counterparts
* in include/media/stagefright/MediaSource.h!
*/
+ /**
+ * This option is used with {@link #getFrameAtTime(long, int)} to retrieve
+ * a sync (or key) frame associated with a data source that is located
+ * right before or at the given time.
+ *
+ * @see #getFrameAtTime(long, int)
+ */
public static final int OPTION_PREVIOUS_SYNC = 0x00;
+ /**
+ * This option is used with {@link #getFrameAtTime(long, int)} to retrieve
+ * a sync (or key) frame associated with a data source that is located
+ * right after or at the given time.
+ *
+ * @see #getFrameAtTime(long, int)
+ */
public static final int OPTION_NEXT_SYNC = 0x01;
+ /**
+ * This option is used with {@link #getFrameAtTime(long, int)} to retrieve
+ * a sync (or key) frame associated with a data source that is located
+ * closest to (in time) or at the given time.
+ *
+ * @see #getFrameAtTime(long, int)
+ */
public static final int OPTION_CLOSEST_SYNC = 0x02;
+ /**
+ * This option is used with {@link #getFrameAtTime(long, int)} to retrieve
+ * a frame (not necessarily a key frame) associated with a data source that
+ * is located closest to or at the given time.
+ *
+ * @see #getFrameAtTime(long, int)
+ */
public static final int OPTION_CLOSEST = 0x03;
/*
- * Do not change these values without updating their counterparts
- * in include/media/mediametadataretriever.h!
+ * Do not change these metadata key values without updating their
+ * counterparts in include/media/mediametadataretriever.h!
+ */
+ /**
+ * The metadata key to retrieve the numberic string describing the
+ * order of the audio data source on its original recording.
*/
public static final int METADATA_KEY_CD_TRACK_NUMBER = 0;
+ /**
+ * The metadata key to retrieve the information about the album title
+ * of the data source.
+ */
public static final int METADATA_KEY_ALBUM = 1;
+ /**
+ * The metadata key to retrieve the information about the artist of
+ * the data source.
+ */
public static final int METADATA_KEY_ARTIST = 2;
+ /**
+ * The metadata key to retrieve the information about the author of
+ * the data source.
+ */
public static final int METADATA_KEY_AUTHOR = 3;
+ /**
+ * The metadata key to retrieve the information about the composer of
+ * the data source.
+ */
public static final int METADATA_KEY_COMPOSER = 4;
+ /**
+ * The metadata key to retrieve the date when the data source was created
+ * or modified.
+ */
public static final int METADATA_KEY_DATE = 5;
+ /**
+ * The metadata key to retrieve the content type or genre of the data
+ * source.
+ */
public static final int METADATA_KEY_GENRE = 6;
+ /**
+ * The metadata key to retrieve the data source title.
+ */
public static final int METADATA_KEY_TITLE = 7;
+ /**
+ * The metadata key to retrieve the year when the data source was created
+ * or modified.
+ */
public static final int METADATA_KEY_YEAR = 8;
+ /**
+ * The metadata key to retrieve the playback duration of the data source.
+ */
public static final int METADATA_KEY_DURATION = 9;
+ /**
+ * The metadata key to retrieve the number of tracks, such as audio, video,
+ * text, in the data source, such as a mp4 or 3gpp file.
+ */
public static final int METADATA_KEY_NUM_TRACKS = 10;
- public static final int METADATA_KEY_IS_DRM_CRIPPLED = 11;
- public static final int METADATA_KEY_CODEC = 12;
- public static final int METADATA_KEY_RATING = 13;
- public static final int METADATA_KEY_COMMENT = 14;
- public static final int METADATA_KEY_COPYRIGHT = 15;
- public static final int METADATA_KEY_BIT_RATE = 16;
- public static final int METADATA_KEY_FRAME_RATE = 17;
- public static final int METADATA_KEY_VIDEO_FORMAT = 18;
- public static final int METADATA_KEY_VIDEO_HEIGHT = 19;
- public static final int METADATA_KEY_VIDEO_WIDTH = 20;
- public static final int METADATA_KEY_WRITER = 21;
- public static final int METADATA_KEY_MIMETYPE = 22;
- public static final int METADATA_KEY_DISCNUMBER = 23;
- public static final int METADATA_KEY_ALBUMARTIST = 24;
- public static final int METADATA_KEY_COMPILATION = 25;
+ /**
+ * The metadata key to retrieve the information of the writer (such as
+ * lyricist) of the data source.
+ */
+ public static final int METADATA_KEY_WRITER = 11;
+ /**
+ * The metadata key to retrieve the mime type of the data source. Some
+ * example mime types include: "video/mp4", "audio/mp4", "audio/amr-wb",
+ * etc.
+ */
+ public static final int METADATA_KEY_MIMETYPE = 12;
+ /**
+ * The metadata key to retrieve the information about the performers or
+ * artist associated with the data source.
+ */
+ public static final int METADATA_KEY_ALBUMARTIST = 13;
+ /**
+ * The metadata key to retrieve the numberic string that describes which
+ * part of a set the audio data source comes from.
+ */
+ public static final int METADATA_KEY_DISC_NUMBER = 14;
+ /**
+ * The metadata key to retrieve the music album compilation status.
+ */
+ public static final int METADATA_KEY_COMPILATION = 15;
// Add more here...
}
diff --git a/media/java/android/media/MediaScanner.java b/media/java/android/media/MediaScanner.java
index 20cff84..6b438bf 100644
--- a/media/java/android/media/MediaScanner.java
+++ b/media/java/android/media/MediaScanner.java
@@ -292,7 +292,6 @@ public class MediaScanner
private boolean mProcessPlaylists, mProcessGenres;
private int mMtpObjectHandle;
- private final String mMediaStoragePath;
private final String mExternalStoragePath;
// used when scanning the image database so we know whether we have to prune
@@ -365,12 +364,6 @@ public class MediaScanner
setDefaultRingtoneFileNames();
- String mediaStoragePath = SystemProperties.get("ro.media.storage");
- if (mediaStoragePath != null && mediaStoragePath.length() > 0) {
- mMediaStoragePath = mediaStoragePath;
- } else {
- mMediaStoragePath = null;
- }
mExternalStoragePath = Environment.getExternalStorageDirectory().getAbsolutePath();
}
@@ -390,13 +383,6 @@ public class MediaScanner
return prop != null && prop.equals("true");
}
- private final String mediaToExternalPath(String path) {
- if (mMediaStoragePath != null && path.startsWith(mMediaStoragePath)) {
- path = mExternalStoragePath + path.substring(mMediaStoragePath.length());
- }
- return path;
- }
-
private class MyMediaScannerClient implements MediaScannerClient {
private String mArtist;
@@ -471,14 +457,15 @@ public class MediaScanner
}
}
- // MediaProvider uses external variant of path for _data, so we need to match
- // against that path instead.
- String key = mediaToExternalPath(path);
+ String key = path;
if (mCaseInsensitivePaths) {
key = path.toLowerCase();
}
FileCacheEntry entry = mFileCache.get(key);
- if (entry == null) {
+ // add some slack to avoid a rounding error
+ long delta = (entry != null) ? (lastModified - entry.mLastModified) : 0;
+ boolean wasModified = delta > 1 || delta < -1;
+ if (entry == null || wasModified) {
Uri tableUri;
if (isDirectory) {
tableUri = mFilesUri;
@@ -491,18 +478,17 @@ public class MediaScanner
} else {
tableUri = mFilesUri;
}
- entry = new FileCacheEntry(tableUri, 0, path, 0,
- (isDirectory ? MtpConstants.FORMAT_ASSOCIATION : 0));
- mFileCache.put(key, entry);
- }
- entry.mSeenInFileSystem = true;
-
- // add some slack to avoid a rounding error
- long delta = lastModified - entry.mLastModified;
- if (delta > 1 || delta < -1) {
- entry.mLastModified = lastModified;
+ if (wasModified) {
+ entry.mLastModified = lastModified;
+ entry.mTableUri = tableUri;
+ } else {
+ entry = new FileCacheEntry(tableUri, 0, path, lastModified,
+ (isDirectory ? MtpConstants.FORMAT_ASSOCIATION : 0));
+ mFileCache.put(key, entry);
+ }
entry.mLastModifiedChanged = true;
}
+ entry.mSeenInFileSystem = true;
if (mProcessPlaylists && MediaFile.isPlayListFileType(mFileType)) {
mPlayLists.add(entry);
@@ -800,6 +786,9 @@ public class MediaScanner
} else {
// updated file
result = ContentUris.withAppendedId(tableUri, rowId);
+ // path should never change, and we want to avoid replacing mixed cased paths
+ // with squashed lower case paths
+ values.remove(MediaStore.MediaColumns.DATA);
mMediaProvider.update(result, values, null, null);
}
if (mProcessGenres && mGenre != null) {
@@ -886,8 +875,6 @@ public class MediaScanner
}
public void addNoMediaFolder(String path) {
- path = mediaToExternalPath(path);
-
ContentValues values = new ContentValues();
values.put(MediaStore.Images.ImageColumns.DATA, "");
String [] pathSpec = new String[] {path + '%'};
@@ -946,10 +933,6 @@ public class MediaScanner
}
if (filePath != null) {
- // MediaProvider uses external variant of path for _data, so we need to query
- // using that path instead.
- filePath = mediaToExternalPath(filePath);
-
// query for only one file
where = Files.FileColumns.DATA + "=?";
selectionArgs = new String[] { filePath };
@@ -1007,10 +990,6 @@ public class MediaScanner
private boolean inScanDirectory(String path, String[] directories) {
for (int i = 0; i < directories.length; i++) {
String directory = directories[i];
- if (mExternalStoragePath != null && directory.equals(mMediaStoragePath)) {
- // database paths use external storage prefix
- directory = mExternalStoragePath;
- }
if (path.startsWith(directory)) {
return true;
}
@@ -1217,9 +1196,7 @@ public class MediaScanner
// build file cache so we can look up tracks in the playlist
prescan(null, true);
- // MediaProvider uses external variant of path for _data, so we need to match
- // against that path instead.
- String key = mediaToExternalPath(path);
+ String key = path;
if (mCaseInsensitivePaths) {
key = path.toLowerCase();
}
diff --git a/media/java/android/media/ThumbnailUtils.java b/media/java/android/media/ThumbnailUtils.java
index b5a82e3..7fdf448 100644
--- a/media/java/android/media/ThumbnailUtils.java
+++ b/media/java/android/media/ThumbnailUtils.java
@@ -146,7 +146,6 @@ public class ThumbnailUtils {
Bitmap bitmap = null;
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
try {
- retriever.setMode(MediaMetadataRetriever.MODE_CAPTURE_FRAME_ONLY);
retriever.setDataSource(filePath);
bitmap = retriever.getFrameAtTime(-1);
} catch (IllegalArgumentException ex) {
diff --git a/media/java/android/mtp/MtpDatabase.java b/media/java/android/mtp/MtpDatabase.java
index 43460ae..ac476ff 100644
--- a/media/java/android/mtp/MtpDatabase.java
+++ b/media/java/android/mtp/MtpDatabase.java
@@ -50,7 +50,6 @@ public class MtpDatabase {
private final String mVolumeName;
private final Uri mObjectsUri;
private final String mMediaStoragePath;
- private final String mExternalStoragePath;
// cached property groups for single properties
private final HashMap<Integer, MtpPropertyGroup> mPropertyGroupsByProperty
@@ -113,7 +112,6 @@ public class MtpDatabase {
mMediaProvider = context.getContentResolver().acquireProvider("media");
mVolumeName = volumeName;
mMediaStoragePath = storagePath;
- mExternalStoragePath = Environment.getExternalStorageDirectory().getAbsolutePath();
mObjectsUri = Files.getMtpObjectsUri(volumeName);
mMediaScanner = new MediaScanner(context);
openDevicePropertiesDatabase(context);
@@ -128,16 +126,6 @@ public class MtpDatabase {
}
}
- private String externalToMediaPath(String path) {
- // convert external storage path to media path
- if (path != null && mMediaStoragePath != null
- && mExternalStoragePath != null
- && path.startsWith(mExternalStoragePath)) {
- path = mMediaStoragePath + path.substring(mExternalStoragePath.length());
- }
- return path;
- }
-
private void openDevicePropertiesDatabase(Context context) {
mDevicePropDb = context.openOrCreateDatabase("device-properties", Context.MODE_PRIVATE, null);
int version = mDevicePropDb.getVersion();
@@ -525,7 +513,7 @@ public class MtpDatabase {
try {
c = mMediaProvider.query(mObjectsUri, PATH_PROJECTION, ID_WHERE, whereArgs, null);
if (c != null && c.moveToNext()) {
- path = externalToMediaPath(c.getString(1));
+ path = c.getString(1);
}
} catch (RemoteException e) {
Log.e(TAG, "RemoteException in getObjectFilePath", e);
@@ -707,7 +695,7 @@ public class MtpDatabase {
c = mMediaProvider.query(mObjectsUri, PATH_SIZE_FORMAT_PROJECTION,
ID_WHERE, new String[] { Integer.toString(handle) }, null);
if (c != null && c.moveToNext()) {
- String path = externalToMediaPath(c.getString(1));
+ String path = c.getString(1);
path.getChars(0, path.length(), outFilePath, 0);
outFilePath[path.length()] = 0;
outFileLengthFormat[0] = c.getLong(2);
diff --git a/media/jni/android_media_MediaMetadataRetriever.cpp b/media/jni/android_media_MediaMetadataRetriever.cpp
index 05623ec..b625c08 100644
--- a/media/jni/android_media_MediaMetadataRetriever.cpp
+++ b/media/jni/android_media_MediaMetadataRetriever.cpp
@@ -152,17 +152,6 @@ static void android_media_MediaMetadataRetriever_setDataSourceFD(JNIEnv *env, jo
process_media_retriever_call(env, retriever->setDataSource(fd, offset, length), "java/lang/RuntimeException", "setDataSource failed");
}
-static void android_media_MediaMetadataRetriever_setMode(JNIEnv *env, jobject thiz, jint mode)
-{
- LOGV("setMode");
- MediaMetadataRetriever* retriever = getRetriever(env, thiz);
- if (retriever == 0) {
- jniThrowException(env, "java/lang/IllegalStateException", "No retriever available");
- return;
- }
- process_media_retriever_call(env, retriever->setMode(mode), "java/lang/RuntimeException", "setMode failed");
-}
-
static jobject android_media_MediaMetadataRetriever_getFrameAtTime(JNIEnv *env, jobject thiz, jlong timeUs, jint option)
{
LOGV("getFrameAtTime: %lld us option: %d", timeUs, option);
@@ -447,7 +436,6 @@ static void android_media_MediaMetadataRetriever_native_setup(JNIEnv *env, jobje
static JNINativeMethod nativeMethods[] = {
{"setDataSource", "(Ljava/lang/String;)V", (void *)android_media_MediaMetadataRetriever_setDataSource},
{"setDataSource", "(Ljava/io/FileDescriptor;JJ)V", (void *)android_media_MediaMetadataRetriever_setDataSourceFD},
- {"setMode", "(I)V", (void *)android_media_MediaMetadataRetriever_setMode},
{"_getFrameAtTime", "(JI)Landroid/graphics/Bitmap;", (void *)android_media_MediaMetadataRetriever_getFrameAtTime},
{"extractMetadata", "(I)Ljava/lang/String;", (void *)android_media_MediaMetadataRetriever_extractMetadata},
{"getEmbeddedPicture", "(I)[B", (void *)android_media_MediaMetadataRetriever_getEmbeddedPicture},
diff --git a/media/libmedia/IMediaMetadataRetriever.cpp b/media/libmedia/IMediaMetadataRetriever.cpp
index 0193e25..d5298c9 100644
--- a/media/libmedia/IMediaMetadataRetriever.cpp
+++ b/media/libmedia/IMediaMetadataRetriever.cpp
@@ -81,7 +81,6 @@ enum {
DISCONNECT = IBinder::FIRST_CALL_TRANSACTION,
SET_DATA_SOURCE_URL,
SET_DATA_SOURCE_FD,
- SET_MODE,
GET_FRAME_AT_TIME,
EXTRACT_ALBUM_ART,
EXTRACT_METADATA,
@@ -123,15 +122,6 @@ public:
return reply.readInt32();
}
- status_t setMode(int mode)
- {
- Parcel data, reply;
- data.writeInterfaceToken(IMediaMetadataRetriever::getInterfaceDescriptor());
- data.writeInt32(mode);
- remote()->transact(SET_MODE, data, &reply);
- return reply.readInt32();
- }
-
sp<IMemory> getFrameAtTime(int64_t timeUs, int option)
{
LOGV("getTimeAtTime: time(%lld us) and option(%d)", timeUs, option);
@@ -209,12 +199,6 @@ status_t BnMediaMetadataRetriever::onTransact(
reply->writeInt32(setDataSource(fd, offset, length));
return NO_ERROR;
} break;
- case SET_MODE: {
- CHECK_INTERFACE(IMediaMetadataRetriever, data, reply);
- int mode = data.readInt32();
- reply->writeInt32(setMode(mode));
- return NO_ERROR;
- } break;
case GET_FRAME_AT_TIME: {
CHECK_INTERFACE(IMediaMetadataRetriever, data, reply);
int64_t timeUs = data.readInt64();
diff --git a/media/libmedia/mediametadataretriever.cpp b/media/libmedia/mediametadataretriever.cpp
index 39b5bc3..8dfcb3b 100644
--- a/media/libmedia/mediametadataretriever.cpp
+++ b/media/libmedia/mediametadataretriever.cpp
@@ -123,17 +123,6 @@ status_t MediaMetadataRetriever::setDataSource(int fd, int64_t offset, int64_t l
return mRetriever->setDataSource(fd, offset, length);
}
-status_t MediaMetadataRetriever::setMode(int mode)
-{
- LOGV("setMode(%d)", mode);
- Mutex::Autolock _l(mLock);
- if (mRetriever == 0) {
- LOGE("retriever is not initialized");
- return INVALID_OPERATION;
- }
- return mRetriever->setMode(mode);
-}
-
sp<IMemory> MediaMetadataRetriever::getFrameAtTime(int64_t timeUs, int option)
{
LOGV("getFrameAtTime: time(%lld us) option(%d)", timeUs, option);
diff --git a/media/libmediaplayerservice/MetadataRetrieverClient.cpp b/media/libmediaplayerservice/MetadataRetrieverClient.cpp
index abaec02..5fcf2a7 100644
--- a/media/libmediaplayerservice/MetadataRetrieverClient.cpp
+++ b/media/libmediaplayerservice/MetadataRetrieverClient.cpp
@@ -64,7 +64,6 @@ MetadataRetrieverClient::MetadataRetrieverClient(pid_t pid)
mThumbnail = NULL;
mAlbumArt = NULL;
mRetriever = NULL;
- mMode = METADATA_MODE_FRAME_CAPTURE_AND_METADATA_RETRIEVAL;
}
MetadataRetrieverClient::~MetadataRetrieverClient()
@@ -79,7 +78,7 @@ status_t MetadataRetrieverClient::dump(int fd, const Vector<String16>& args) con
char buffer[SIZE];
String8 result;
result.append(" MetadataRetrieverClient\n");
- snprintf(buffer, 255, " pid(%d) mode(%d)\n", mPid, mMode);
+ snprintf(buffer, 255, " pid(%d)\n", mPid);
result.append(buffer);
write(fd, result.string(), result.size());
write(fd, "\n", 1);
@@ -93,7 +92,6 @@ void MetadataRetrieverClient::disconnect()
mRetriever.clear();
mThumbnail.clear();
mAlbumArt.clear();
- mMode = METADATA_MODE_FRAME_CAPTURE_AND_METADATA_RETRIEVAL;
IPCThreadState::self()->flushCommands();
}
@@ -133,10 +131,7 @@ status_t MetadataRetrieverClient::setDataSource(const char *url)
LOGV("player type = %d", playerType);
sp<MediaMetadataRetrieverBase> p = createRetriever(playerType);
if (p == NULL) return NO_INIT;
- status_t ret = p->setMode(mMode);
- if (ret == NO_ERROR) {
- ret = p->setDataSource(url);
- }
+ status_t ret = p->setDataSource(url);
if (ret == NO_ERROR) mRetriever = p;
return ret;
}
@@ -174,28 +169,12 @@ status_t MetadataRetrieverClient::setDataSource(int fd, int64_t offset, int64_t
::close(fd);
return NO_INIT;
}
- status_t status = p->setMode(mMode);
- if (status == NO_ERROR) {
- p->setDataSource(fd, offset, length);
- }
+ status_t status = p->setDataSource(fd, offset, length);
if (status == NO_ERROR) mRetriever = p;
::close(fd);
return status;
}
-status_t MetadataRetrieverClient::setMode(int mode)
-{
- LOGV("setMode");
- Mutex::Autolock lock(mLock);
- if (mode < METADATA_MODE_NOOP ||
- mode > METADATA_MODE_FRAME_CAPTURE_AND_METADATA_RETRIEVAL) {
- LOGE("invalid mode %d", mode);
- return BAD_VALUE;
- }
- mMode = mode;
- return NO_ERROR;
-}
-
sp<IMemory> MetadataRetrieverClient::getFrameAtTime(int64_t timeUs, int option)
{
LOGV("getFrameAtTime: time(%lld us) option(%d)", timeUs, option);
diff --git a/media/libmediaplayerservice/MetadataRetrieverClient.h b/media/libmediaplayerservice/MetadataRetrieverClient.h
index 8b4c0c7..b834715 100644
--- a/media/libmediaplayerservice/MetadataRetrieverClient.h
+++ b/media/libmediaplayerservice/MetadataRetrieverClient.h
@@ -43,7 +43,6 @@ public:
virtual void disconnect();
virtual status_t setDataSource(const char *url);
virtual status_t setDataSource(int fd, int64_t offset, int64_t length);
- virtual status_t setMode(int mode);
virtual sp<IMemory> getFrameAtTime(int64_t timeUs, int option);
virtual sp<IMemory> extractAlbumArt();
virtual const char* extractMetadata(int keyCode);
@@ -59,7 +58,6 @@ private:
mutable Mutex mLock;
sp<MediaMetadataRetrieverBase> mRetriever;
pid_t mPid;
- int mMode;
// Keep the shared memory copy of album art and capture frame (for thumbnail)
sp<IMemory> mAlbumArt;
diff --git a/media/libstagefright/StagefrightMediaScanner.cpp b/media/libstagefright/StagefrightMediaScanner.cpp
index 5d15246..39b0021 100644
--- a/media/libstagefright/StagefrightMediaScanner.cpp
+++ b/media/libstagefright/StagefrightMediaScanner.cpp
@@ -131,9 +131,7 @@ status_t StagefrightMediaScanner::processFile(
if (status != OK) {
return status;
}
- } else if (mRetriever->setDataSource(path) == OK
- && mRetriever->setMode(
- METADATA_MODE_METADATA_RETRIEVAL_ONLY) == OK) {
+ } else if (mRetriever->setDataSource(path) == OK) {
const char *value;
if ((value = mRetriever->extractMetadata(
METADATA_KEY_MIMETYPE)) != NULL) {
@@ -182,9 +180,7 @@ char *StagefrightMediaScanner::extractAlbumArt(int fd) {
}
lseek64(fd, 0, SEEK_SET);
- if (mRetriever->setDataSource(fd, 0, size) == OK
- && mRetriever->setMode(
- METADATA_MODE_FRAME_CAPTURE_ONLY) == OK) {
+ if (mRetriever->setDataSource(fd, 0, size) == OK) {
sp<IMemory> mem = mRetriever->extractAlbumArt();
if (mem != NULL) {
diff --git a/media/libstagefright/StagefrightMetadataRetriever.cpp b/media/libstagefright/StagefrightMetadataRetriever.cpp
index 4f483ac..600de7c 100644
--- a/media/libstagefright/StagefrightMetadataRetriever.cpp
+++ b/media/libstagefright/StagefrightMetadataRetriever.cpp
@@ -266,11 +266,6 @@ VideoFrame *StagefrightMetadataRetriever::getFrameAtTime(
int64_t timeUs, int option) {
LOGV("getFrameAtTime: %lld us option: %d", timeUs, option);
- if (0 == (mMode & METADATA_MODE_FRAME_CAPTURE_ONLY)) {
- LOGV("getFrameAtTime disabled by mode (0x%08x)", mMode);
-
- return NULL;
- }
if (mExtractor.get() == NULL) {
LOGV("no extractor.");
@@ -324,12 +319,6 @@ VideoFrame *StagefrightMetadataRetriever::getFrameAtTime(
MediaAlbumArt *StagefrightMetadataRetriever::extractAlbumArt() {
LOGV("extractAlbumArt (extractor: %s)", mExtractor.get() != NULL ? "YES" : "NO");
- if (0 == (mMode & METADATA_MODE_METADATA_RETRIEVAL_ONLY)) {
- LOGV("extractAlbumArt/metadata retrieval disabled by mode");
-
- return NULL;
- }
-
if (mExtractor == NULL) {
return NULL;
}
@@ -348,12 +337,6 @@ MediaAlbumArt *StagefrightMetadataRetriever::extractAlbumArt() {
}
const char *StagefrightMetadataRetriever::extractMetadata(int keyCode) {
- if (0 == (mMode & METADATA_MODE_METADATA_RETRIEVAL_ONLY)) {
- LOGV("extractAlbumArt/metadata retrieval disabled by mode");
-
- return NULL;
- }
-
if (mExtractor == NULL) {
return NULL;
}
diff --git a/media/libstagefright/rtsp/ASessionDescription.cpp b/media/libstagefright/rtsp/ASessionDescription.cpp
index 547fbab..77917b3 100644
--- a/media/libstagefright/rtsp/ASessionDescription.cpp
+++ b/media/libstagefright/rtsp/ASessionDescription.cpp
@@ -265,15 +265,17 @@ bool ASessionDescription::getDurationUs(int64_t *durationUs) const {
const char *s = value.c_str() + 4;
char *end;
double from = strtod(s, &end);
- CHECK_GT(end, s);
- CHECK_EQ(*end, '-');
+
+ if (end == s || *end != '-') {
+ return false;
+ }
s = end + 1;
double to = strtod(s, &end);
- CHECK_GT(end, s);
- CHECK_EQ(*end, '\0');
- CHECK_GE(to, from);
+ if (end == s || *end != '\0' || to < from) {
+ return false;
+ }
*durationUs = (int64_t)((to - from) * 1E6);
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaMetadataTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaMetadataTest.java
index 95dbb97..6ded74d 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaMetadataTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/MediaMetadataTest.java
@@ -202,7 +202,6 @@ public class MediaMetadataTest extends AndroidTestCase {
}
String value = null;
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
- retriever.setMode(MediaMetadataRetriever.MODE_GET_METADATA_ONLY);
try {
retriever.setDataSource(meta_data_file[fileIndex][0]);
} catch(Exception e) {
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java
index 0870522..a66db05 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/unit/MediaMetadataRetrieverTest.java
@@ -37,7 +37,6 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
boolean supportWMA = MediaProfileReader.getWMAEnable();
boolean hasFailed = false;
boolean supportWMV = MediaProfileReader.getWMVEnable();
- retriever.setMode(MediaMetadataRetriever.MODE_GET_METADATA_ONLY);
for (int i = 0, n = MediaNames.ALBUMART_TEST_FILES.length; i < n; ++i) {
try {
Log.v(TAG, "File " + i + ": " + MediaNames.ALBUMART_TEST_FILES[i]);
@@ -116,7 +115,6 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
boolean supportWMV = MediaProfileReader.getWMVEnable();
boolean hasFailed = false;
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
- retriever.setMode(MediaMetadataRetriever.MODE_GET_METADATA_ONLY);
for(int i = 0, n = MediaNames.METADATA_RETRIEVAL_TEST_FILES.length; i < n; ++i) {
try {
Log.v(TAG, "File " + i + ": " + MediaNames.METADATA_RETRIEVAL_TEST_FILES[i]);
@@ -170,7 +168,6 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
public static void testBasicAbnormalMethodCallSequence() {
boolean hasFailed = false;
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
- retriever.setMode(MediaMetadataRetriever.MODE_GET_METADATA_ONLY);
if (retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ALBUM) != null) {
Log.e(TAG, "No album metadata expected, but is available");
hasFailed = true;
@@ -186,7 +183,6 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
@MediumTest
public static void testSetDataSource() {
MediaMetadataRetriever retriever = new MediaMetadataRetriever();
- retriever.setMode(MediaMetadataRetriever.MODE_GET_METADATA_ONLY);
boolean hasFailed = false;
// Null pointer argument
@@ -253,7 +249,6 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
assertTrue(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_NUM_TRACKS) != null);
// Do not capture frame or retrieve metadata
- retriever.setMode(MediaMetadataRetriever.MODE_CAPTURE_FRAME_ONLY & MediaMetadataRetriever.MODE_GET_METADATA_ONLY);
retriever.setDataSource(MediaNames.TEST_PATH_1);
if (retriever.getFrameAtTime(-1) != null) {
Log.e(TAG, "No frame expected, but is available");
@@ -265,12 +260,10 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
}
// Capture frame only
- retriever.setMode(MediaMetadataRetriever.MODE_CAPTURE_FRAME_ONLY);
retriever.setDataSource(MediaNames.TEST_PATH_1);
assertTrue(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_NUM_TRACKS) == null);
// Retriever metadata only
- retriever.setMode(MediaMetadataRetriever.MODE_GET_METADATA_ONLY);
retriever.setDataSource(MediaNames.TEST_PATH_1);
if (retriever.getFrameAtTime(-1) != null) {
Log.e(TAG, "No frame expected, but is available");
@@ -278,7 +271,6 @@ public class MediaMetadataRetrieverTest extends AndroidTestCase {
}
// Capture frame and retrieve metadata
- retriever.setMode(MediaMetadataRetriever.MODE_CAPTURE_FRAME_ONLY | MediaMetadataRetriever.MODE_GET_METADATA_ONLY);
retriever.setDataSource(MediaNames.TEST_PATH_1);
assertTrue(retriever.getFrameAtTime(-1) != null);
assertTrue(retriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_NUM_TRACKS) != null);
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java b/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java
index 82753b2..6b52454 100644
--- a/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java
+++ b/policy/src/com/android/internal/policy/impl/KeyguardViewBase.java
@@ -18,6 +18,11 @@ package com.android.internal.policy.impl;
import android.content.Context;
import android.content.Intent;
+import android.graphics.Canvas;
+import android.graphics.ColorFilter;
+import android.graphics.PixelFormat;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
import android.media.AudioManager;
import android.telephony.TelephonyManager;
import android.view.KeyEvent;
@@ -37,12 +42,34 @@ import android.util.AttributeSet;
*/
public abstract class KeyguardViewBase extends FrameLayout {
+ private static final int BACKGROUND_COLOR = 0x70000000;
private KeyguardViewCallback mCallback;
private AudioManager mAudioManager;
private TelephonyManager mTelephonyManager = null;
public KeyguardViewBase(Context context) {
super(context);
+
+ // This is a faster way to draw the background on devices without hardware acceleration
+ setBackgroundDrawable(new Drawable() {
+ @Override
+ public void draw(Canvas canvas) {
+ canvas.drawColor(BACKGROUND_COLOR, PorterDuff.Mode.SRC);
+ }
+
+ @Override
+ public void setAlpha(int alpha) {
+ }
+
+ @Override
+ public void setColorFilter(ColorFilter cf) {
+ }
+
+ @Override
+ public int getOpacity() {
+ return PixelFormat.TRANSLUCENT;
+ }
+ });
}
// used to inject callback
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index 7011f9a..7b7a891 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -9216,27 +9216,32 @@ public class WindowManagerService extends IWindowManager.Stub
return;
}
+ mInLayout = true;
boolean recoveringMemory = false;
- if (mForceRemoves != null) {
- recoveringMemory = true;
- // Wait a little it for things to settle down, and off we go.
- for (int i=0; i<mForceRemoves.size(); i++) {
- WindowState ws = mForceRemoves.get(i);
- Slog.i(TAG, "Force removing: " + ws);
- removeWindowInnerLocked(ws.mSession, ws);
- }
- mForceRemoves = null;
- Slog.w(TAG, "Due to memory failure, waiting a bit for next layout");
- Object tmp = new Object();
- synchronized (tmp) {
- try {
- tmp.wait(250);
- } catch (InterruptedException e) {
+
+ try {
+ if (mForceRemoves != null) {
+ recoveringMemory = true;
+ // Wait a little it for things to settle down, and off we go.
+ for (int i=0; i<mForceRemoves.size(); i++) {
+ WindowState ws = mForceRemoves.get(i);
+ Slog.i(TAG, "Force removing: " + ws);
+ removeWindowInnerLocked(ws.mSession, ws);
+ }
+ mForceRemoves = null;
+ Slog.w(TAG, "Due to memory failure, waiting a bit for next layout");
+ Object tmp = new Object();
+ synchronized (tmp) {
+ try {
+ tmp.wait(250);
+ } catch (InterruptedException e) {
+ }
}
}
+ } catch (RuntimeException e) {
+ Slog.e(TAG, "Unhandled exception while force removing for memory", e);
}
-
- mInLayout = true;
+
try {
performLayoutAndPlaceSurfacesLockedInner(recoveringMemory);
diff --git a/tests/CoreTests/android/core/HeapTest.java b/tests/CoreTests/android/core/HeapTest.java
index 98cb28a..400d041 100644
--- a/tests/CoreTests/android/core/HeapTest.java
+++ b/tests/CoreTests/android/core/HeapTest.java
@@ -46,73 +46,6 @@ public class HeapTest extends TestCase {
return new WeakReference<Object>(new Object());
}
- /**
- * Allocates the specified number of bytes. This is done in a separate method
- * to ensure that the Object's address isn't sitting in a stale local register.
- */
- private void allocateMemory(int size) {
- byte[] b = new byte[size];
- }
-
- @MediumTest
- public void testMinimumHeapSize() throws Exception {
- VMRuntime r = VMRuntime.getRuntime();
- final boolean RUN_FLAKY = false;
-
- long origSize = r.getMinimumHeapSize();
- if (RUN_FLAKY) {
- /* Check that the default value is zero. This will break if anyone
- * in this process sets the minimum heap size to a positive value
- * before calling this test.
- */
- assertTrue(origSize == 0);
- }
-
- long size = 4 * 1024 * 1024;
- long oldSize = r.setMinimumHeapSize(size);
- assertTrue(oldSize == origSize);
-
- long newSize = r.getMinimumHeapSize();
- /* This will fail if the maximum heap size (-Xmx) is smaller than 4MB.
- */
- assertTrue(newSize == size);
-
- /* Make sure that getting the size doesn't change anything.
- */
- newSize = r.getMinimumHeapSize();
- assertTrue(newSize == size);
-
- /* This test is flaky; if the heap is already large and fragmented,
- * it can fail. It can also fail if another thread causes a GC
- * at the wrong time.
- */
- if (RUN_FLAKY) {
- /* Increase the minimum size, allocate a big object, and make sure that
- * a GC didn't happen.
- */
- WeakReference ref = newRef();
- assertNotNull(ref.get());
-
- r.setMinimumHeapSize(8 * 1024 * 1024);
- allocateMemory(4 * 1024 * 1024);
-
- /* If a GC happened, this reference will be null.
- */
- assertNotNull(ref.get());
- }
-
- /* Restore the original setting.
- */
- r.setMinimumHeapSize(origSize);
- newSize = r.getMinimumHeapSize();
- assertTrue(newSize == origSize);
-
- /* Clean up any large stuff we've allocated,
- * and re-establish the normal utilization ratio.
- */
- Runtime.getRuntime().gc();
- }
-
private static void makeRefs(Object objects[], SoftReference<Object> refs[]) {
for (int i = 0; i < objects.length; i++) {
objects[i] = (Object) new byte[8 * 1024];