Merge "Cherry pick from Honeycomb-mr2 Change ID Id87a6000de458a1d3e4ac11aaf64355a244f2f07 sdk doc change: updated intro to developing and removed reference to G1 Bug: 4483863"
diff --git a/docs/html/guide/developing/debugging/index.jd b/docs/html/guide/developing/debugging/index.jd
index 1f1a4ca..0ad1a08 100644
--- a/docs/html/guide/developing/debugging/index.jd
+++ b/docs/html/guide/developing/debugging/index.jd
@@ -1,4 +1,4 @@
-page.title=Debugging
+page.title=Debugging
@jd:body
@@ -10,7 +10,7 @@
<li><a href="#stack">Debugging Environment</a></li>
<li><a href="#addltools">Additional Debugging Tools</a></li>
-
+
<li><a href="#tips">Debugging Tips</a></li>
</ol>
</div>
@@ -50,7 +50,7 @@
<dd>The Dalvik VM (Virtual Machine) supports the JDWP protocol to allow debuggers to attach to
a VM. Each application runs in a VM and exposes a unique port that you can attach a debugger to
- via DDMS. If you want to debug multiple applications, attaching to each port might become
+ via DDMS. If you want to debug multiple applications, attaching to each port might become
tedious, so DDMS provides a port forwarding feature that can forward a specific VM's debugging
port to port 8700. You can switch freely from application to application by highlighting it in the
Devices tab of DDMS. DDMS forwards the appropriate port to port 8700. Most modern Java IDEs include a JDWP debugger,
@@ -109,11 +109,11 @@
that provide useful information such as CPU usage and frame rate. You can also transfer the
application to a hardware device.</dd>
</dl>
-
-
- <h2 id="tips">Debugging Tips</h2>
-
-<p>While debugging, keep these helpful tips in mind to help you figure out common problems with your
+
+
+ <h2 id="tips">Debugging Tips</h2>
+
+<p>While debugging, keep these helpful tips in mind to help you figure out common problems with your
applications:</p>
<dl>
@@ -131,14 +131,14 @@
</dd>
<dt><strong>Get application and system state information from the emulator</strong></dt>
-<dd>You can access dumpstate information from the <code>adb shell</code> commands. See
+<dd>You can access dumpstate information from the <code>adb shell</code> commands. See
<a href="{@docRoot}guide/developing/tools/adb.html#dumpsys">dumpsys and
dumpstate</a> on the adb topic page.</dd>
<dt><strong>Get wireless connectivity information</strong></dt>
-<dd>You can get information about wireless connectivity using DDMS.
+<dd>You can get information about wireless connectivity using DDMS.
From the <strong>Device</strong> menu, select <strong>Dump
radio state</strong>.</dd>
@@ -165,6 +165,16 @@
<dt><strong>Use debugging helper classes</strong></dt>
<dd>Android provides debug helper classes such as {@link android.util.Log
util.Log} and {@link android.os.Debug} for your convenience. </dd>
+
+<dt><strong>Garbage collection</strong></dt>
+<dd>
+The debugger and garbage collector are currently loosely integrated. The VM guarantees that any
+object the debugger is aware of is not garbage collected until after the debugger disconnects.
+This can result in a buildup of objects over time while the debugger is connected. For example,
+if the debugger sees a running thread, the associated {@link java.lang.Thread} object is not
+garbage collected even after the thread terminates.
+</dd>
+
</dl>
<p>See the <a href="{@docRoot}resources/faq/troubleshooting.html">Troubleshooting</a> document
@@ -176,10 +186,3 @@
-
-
-
-
-
-
-
diff --git a/docs/html/guide/developing/tools/etc1tool.jd b/docs/html/guide/developing/tools/etc1tool.jd
new file mode 100644
index 0000000..a7f76f5
--- /dev/null
+++ b/docs/html/guide/developing/tools/etc1tool.jd
@@ -0,0 +1,68 @@
+page.title=etc1tool
+parent.title=Tools
+parent.link=index.html
+@jd:body
+
+
+ <p><code>etc1tool</code> is a command line utility that lets you encode PNG
+ images to the ETC1 compression standard and decode ETC1 compressed images back to PNG.</p>
+
+ <p>The usage for <code>etc1tool</code> is:</p>
+<pre>etc1tool infile [--help | --encode | --encodeNoHeader | --decode] [--showDifference
+diff-file] [-o outfile]</pre>
+
+ <table>
+ <tr>
+ <th>Option</th>
+
+ <th>Description</th>
+ </tr>
+
+ <tr>
+ <td><code>infile</code></td>
+
+ <td>The input file to compress</td>
+ </tr>
+
+ <tr>
+ <td><code>--help</code></td>
+
+ <td>Print usage information</td>
+ </tr>
+
+ <tr>
+ <td><code>--encode</code></td>
+
+ <td>Create an ETC1 file from a PNG file.
+ This is the default mode for the tool if nothing is specified.</td>
+ </tr>
+
+ <tr>
+ <td><code>--encodeNoHeader</code></td>
+
+ <td>Create a raw ETC1 data file (without a header) from a PNG file.</td>
+ </tr>
+
+ <tr>
+ <td><code>--decode</code></td>
+
+ <td>Create a PNG file from an ETC1 file</td>
+ </tr>
+
+ <tr>
+ <td><code>--showDifference <em>diff-file</em></code></td>
+
+ <td>Write the difference between the original and encoded image to
+ <code><em>diff-file</em></code> (only valid when encoding).</td>
+ </tr>
+
+ <tr>
+ <td><code>-o <em>outfile</em></code></td>
+
+ <td>Specify the name of the output file.
+ If <code><em>outfile</em></code> is not specified, the output file is constructed
+ from the input filename with the appropriate suffix (<code>.pkm</code> or <code>.png</code>).
+ </td>
+ </tr>
+
+ </table>
\ No newline at end of file
diff --git a/docs/html/guide/guide_toc.cs b/docs/html/guide/guide_toc.cs
index f7dbe30..c5c7ae2 100644
--- a/docs/html/guide/guide_toc.cs
+++ b/docs/html/guide/guide_toc.cs
@@ -148,7 +148,7 @@
</a></li>
</ul>
</li><!-- end of User Interface -->
-
+
<li class="toggle-list">
<div><a href="<?cs var:toroot ?>guide/topics/resources/index.html">
<span class="en">Application Resources</span>
@@ -221,7 +221,7 @@
<li><a href="<?cs var:toroot ?>guide/topics/manifest/provider-element.html"><provider></a></li>
<li><a href="<?cs var:toroot ?>guide/topics/manifest/receiver-element.html"><receiver></a></li>
<li><a href="<?cs var:toroot ?>guide/topics/manifest/service-element.html"><service></a></li>
- <li><a href="<?cs var:toroot ?>guide/topics/manifest/supports-gl-texture-element.html"><supports-gl-texture></a></li>
+ <li><a href="<?cs var:toroot ?>guide/topics/manifest/supports-gl-texture-element.html"><supports-gl-texture></a></li>
<li><a href="<?cs var:toroot ?>guide/topics/manifest/supports-screens-element.html"><supports-screens></a>
<span class="new">updated</span></li> <!-- ##api level 4## -->
<li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-configuration-element.html"><uses-configuration></a></li>
@@ -231,8 +231,8 @@
<li><a href="<?cs var:toroot ?>guide/topics/manifest/uses-sdk-element.html"><uses-sdk></a></li>
</ul>
</li><!-- end of the manifest file -->
- </ul>
-
+ </ul>
+
<ul>
<li class="toggle-list">
<div><a href="<?cs var:toroot ?>guide/topics/graphics/index.html">
@@ -265,7 +265,7 @@
<li><a href="<?cs var:toroot ?>guide/topics/renderscript/compute.html">
<span class="en">Compute</span>
</a>
- </li>
+ </li>
</ul>
</li>
@@ -571,8 +571,10 @@
<li><a href="<?cs var:toroot ?>guide/developing/tools/android.html">android</a></li>
<li><a href="<?cs var:toroot ?>guide/developing/tools/bmgr.html">bmgr</a>
<li><a href="<?cs var:toroot ?>guide/developing/tools/dmtracedump.html">dmtracedump</a></li>
- <li><a href="<?cs var:toroot ?>guide/developing/tools/draw9patch.html" >Draw 9-Patch</a></li>
+ <li><a href="<?cs var:toroot?>guide/developing/tools/draw9patch.html">Draw
+ 9-Patch</a></li>
<li><a href="<?cs var:toroot ?>guide/developing/tools/emulator.html">Emulator</a></li>
+ <li><a href="<?cs var:toroot ?>guide/developing/tools/etc1tool.html">etc1tool</a></li>
<li><a href="<?cs var:toroot ?>guide/developing/tools/hierarchy-viewer.html">Hierarchy Viewer</a></li>
<li><a href="<?cs var:toroot ?>guide/developing/tools/hprof-conv.html">hprof-conv</a></li>
<li><a href="<?cs var:toroot ?>guide/developing/tools/layoutopt.html">layoutopt</a></li>
diff --git a/docs/html/guide/topics/graphics/animation.jd b/docs/html/guide/topics/graphics/animation.jd
index 31e7c4b..e7a07e0 100644
--- a/docs/html/guide/topics/graphics/animation.jd
+++ b/docs/html/guide/topics/graphics/animation.jd
@@ -12,28 +12,33 @@
<ol>
<li><a href="#how">How property animation works</a></li>
</ol>
- </li>
+ </li>
- <li><a href="#value-animator">Animating with ValueAnimator</a></li>
+ <li><a href="#value-animator">Animating with ValueAnimator</a></li>
- <li><a href="#object-animator">Animating with ObjectAnimator</a></li>
+ <li><a href="#object-animator">Animating with ObjectAnimator</a></li>
- <li><a href="#choreography">Choreographing Multiple Animations with
- AnimatorSet</a></li>
-
- <li><a href="#listeners">Animation Listeners</a></li>
+ <li><a href="#choreography">Choreographing Multiple Animations with
+ AnimatorSet</a></li>
- <li><a href="#type-evaluator">Using a TypeEvaluator</a></li>
+ <li><a href="#listeners">Animation Listeners</a></li>
- <li><a href="#interpolators">Using Interpolators</a></li>
+ <li><a href="#type-evaluator">Using a TypeEvaluator</a></li>
- <li><a href="#keyframes">Specifying Keyframes</a></li>
- <li><a href="#layout">Animating Layout Changes to ViewGroups</a></li>
+ <li><a href="#interpolators">Using Interpolators</a></li>
- <li><a href="#views">Animating Views</a></li>
+ <li><a href="#keyframes">Specifying Keyframes</a></li>
- <li><a href="#declaring-xml">Declaring Animations in XML</a></li>
- </ol>
+ <li><a href="#layout">Animating Layout Changes to ViewGroups</a></li>
+
+ <li><a href="#views">Animating Views</a>
+ <ol>
+ <li><a href="#view-prop-animator">ViewPropertyAnimator</a></li>
+ </ol>
+ </li>
+
+ <li><a href="#declaring-xml">Declaring Animations in XML</a></li>
+ </ol>
<h2>Key classes</h2>
@@ -63,13 +68,13 @@
You can define an animation to change any object property over time, regardless of whether it
draws to the screen or not.The property animation system also has a few advantages over the view
animation system, which makes it more flexible to use.</p>
-
+
<p>The view animation system provides the capability to only animate View objects, so if
you wanted to animate non-View objects, you had to implement your own code to do so. The view
animation system also was constrained in the fact that it only exposed a few aspects of a View
object to animate, such as the scaling and rotation of a View but not the background color for
instance.</p>
-
+
<p>Another disadvantage of the view animation system is that it only modified where the
View was drawn, and not the actual View itself. For instance, if you animated a button to move
across the screen, the button draws correctly, but the actual location where you can click the
@@ -80,7 +85,7 @@
<p>The view animation system, however, takes less time to setup and requires less code to write.
If view animation accomplishes everything that you need to do, or if your existing code already
works the way you want, there is no need to use the property animation system.</p>
-
+
<p class="note"><strong>Tip:</strong> To see how the ADT layout editor allows you to develop and
preview animations in your layout, watch the <a
href="http://www.youtube.com/watch?v=Oq05KqjXTvs&feature=player_detailpage#t=1709s">Android
@@ -114,7 +119,7 @@
default is set to refresh every 10 ms, but the speed in which your application can refresh frames is
ultimately dependent on how busy the system is overall and how fast the system can service the underlying timer.</li>
</ul>
-
+
<h3 id="how">How the property animation system works</h3>
@@ -254,7 +259,7 @@
</tr>
</table>
-
+
<p>Evaluators tell the property animation system how to calculate values for a given
property. They take the timing data that is provided by an {@link android.animation.Animator}
class, the animation's start and end value, and calculate the animated values of the property
@@ -299,9 +304,9 @@
information on how to write a custom evaluator.</td>
</tr>
</table>
-
-
-
+
+
+
<p>A time interpolator defines how specific values in an animation are calculated as a
function of time. For example, you can specify animations to happen linearly across the whole
@@ -397,7 +402,7 @@
<pre>
ValueAnimator animation = ValueAnimator.ofFloat(0f, 1f);
animation.setDuration(1000);
-animation.start();
+animation.start();
</pre>
<p>In this code, the {@link android.animation.ValueAnimator} starts calculating the values of the
@@ -408,7 +413,7 @@
<pre>
ValueAnimator animation = ValueAnimator.ofObject(new MyTypeEvaluator(), startPropertyValue, endPropertyValue);
animation.setDuration(1000);
-animation.start();
+animation.start();
</pre>
<p>In this code, the {@link android.animation.ValueAnimator} starts calculating the values of the
@@ -483,7 +488,7 @@
<li>Depending on what property or object you are animating, you might need to call the {@link
android.view.View#invalidate invalidate()} method on a View force the screen to redraw itself with the
- updated animated values. You do this in the
+ updated animated values. You do this in the
{@link android.animation.ValueAnimator.AnimatorUpdateListener#onAnimationUpdate onAnimationUpdate()}
callback. For example, animating the color property of a Drawable object only cause updates to the
screen when that object redraws itself. All of the property setters on View, such as
@@ -492,7 +497,7 @@
methods with new values. For more information on listeners, see the section about <a href="#listeners">Animation Listeners</a>.
</li>
</ul>
-
+
<h2 id="choreography">Choreographing Multiple Animations with AnimatorSet</h2>
<p>In many cases, you want to play an animation that depends on when another animation starts or
@@ -576,12 +581,12 @@
{@link android.view.View#invalidate invalidate()} on a View to force that area of the
screen to redraw itself with the new animated values. For example, animating the
color property of a Drawable object only cause updates to the screen when that object
- redraws itself. All of the property setters on View,
+ redraws itself. All of the property setters on View,
such as {@link android.view.View#setAlpha setAlpha()} and
{@link android.view.View#setTranslationX setTranslationX()} invalidate the View
properly, so you do not need to invalidate the View when calling these methods with new values.
</p>
-
+
</li>
</ul>
</li>
@@ -658,7 +663,7 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/verticalContainer"
- android:animateLayoutChanges="true" />
+ android:animateLayoutChanges="true" />
</pre>
<p>Setting this attribute to true automatically animates Views that are added or removed from the
@@ -872,16 +877,55 @@
ObjectAnimator.ofFloat(myView, "rotation", 0f, 360f);
</pre>
-For more information on creating animators, see the sections on animating with
-<a href="#value-animator">ValueAnimator</a> and <a href="#object-animator">ObjectAnimator</a>
+<p>For more information on creating animators, see the sections on animating with
+<a href="#value-animator">ValueAnimator</a> and <a href="#object-animator">ObjectAnimator</a>.
+</p>
+<h3 id="view-prop-animator">Animating with ViewPropertyAnimator</h3>
+<p>The {@link android.view.ViewPropertyAnimator} provides a simple way to animate several
+properties of a {@link android.view.View} in parallel, using a single underlying {@link
+android.animation.Animator}
+object. It behaves much like an {@link android.animation.ObjectAnimator}, because it modifies the
+actual values of the view's properties, but is more efficient when animating many properties at
+once. In addition, the code for using the {@link android.view.ViewPropertyAnimator} is much
+more concise and easier to read. The following code snippets show the differences in using multiple
+{@link android.animation.ObjectAnimator} objects, a single
+{@link android.animation.ObjectAnimator}, and the {@link android.view.ViewPropertyAnimator} when
+simultaneously animating the <code>x</code> and <code>y</code> property of a view.</p>
+
+<p><strong>Multiple ObjectAnimator objects</strong></p>
+<pre>
+ObjectAnimator animX = ObjectAnimator.ofFloat(myView, "x", 50f);
+ObjectAnimator animY = ObjectAnimator.ofFloat(myView, "y", 100f);
+AnimatorSet animSetXY = new AnimatorSet();
+animSetXY.playTogether(animX, animY);
+animSetXY.start();
+</pre>
+
+<p><strong>One ObjectAnimator</strong></p>
+<pre>
+PropertyValuesHolder pvhX = PropertyValuesHolder.ofFloat("x", 50f);
+PropertyValuesHolder pvhY = PropertyValuesHolder.ofFloat("y", 100f);
+ObjectAnimator.ofPropertyValuesHolder(myView, pvhX, pvyY).start();
+</pre>
+
+<p><strong>ViewPropertyAnimator</strong></p>
+<pre>
+myView.animate().x(50f).y(100f);
+</pre>
+
+<p>
+For more detailed information about {@link
+android.view.ViewPropertyAnimator}, see the corresponding Android Developers
+<a href="http://android-developers.blogspot.com/2011/05/introducing-viewpropertyanimator.html">blog
+post</a>.</p>
<h2 id="declaring-xml">Declaring Animations in XML</h2>
<p>The property animation system lets you declare property animations with XML instead of doing
it programmatically. By defining your animations in XML, you can easily reuse your animations
in multiple activities and more easily edit the animation sequence.</p>
-
+
<p>To distinguish animation files that use the new property animation APIs from those that use the
legacy <a href="{@docRoot}guide/topics/graphics/view-animation.html">view animation</a> framework,
starting with Android 3.1, you should save the XML files for property animations in the {@code
diff --git a/docs/html/guide/topics/usb/adk.jd b/docs/html/guide/topics/usb/adk.jd
index b5a3f30..463ec9c 100644
--- a/docs/html/guide/topics/usb/adk.jd
+++ b/docs/html/guide/topics/usb/adk.jd
@@ -59,7 +59,6 @@
<li><a href="https://dl-ssl.google.com/android/adk/adk_release_0512.zip">ADK package</a></li>
</ol>
-
<h2>See also</h2>
<ol>
@@ -70,22 +69,29 @@
<h2>Where to buy</h2>
<ol>
+
+ <li><a href="http://store.arduino.cc/">
+ Arduino Store</a></li>
+
+ <li><a href="https://store.diydrones.com/ProductDetails.asp?ProductCode=BR-PhoneDrone">
+ DIY Drones</a></li>
+
+ <li><a href=
+ "http://www.microchip.com/android">
+ Microchip</a></li>
+
<li><a href="http://shop.moderndevice.com/products/freeduino-usb-host-board">
Modern Device</a></li>
+ <li><a href=
+ "http://www.rt-net.jp/shop/index.php?main_page=product_info&cPath=3_4&products_id=1">
+ RT Corp</a></li>
+
<li><a href="http://www.seeedstudio.com/depot/seeeduino-adk-main-board-p-846.html">
Seeed Studio</a></li>
- <li><a href=
- "http://www.rt-net.jp/shop/index.php?main_page=product_info&cPath=3_4&products_id=1">
- RT Corp</a></li>
-
- <li><a href=
- "http://www.microchip.com/android">
- Microchip</a></li>
-
- <li><a href="https://store.diydrones.com/ProductDetails.asp?ProductCode=BR-PhoneDrone">
- DIY Drones</a></li>
+ <li><a href="http://www.sparkfun.com/products/10748">
+ SparkFun</a></li>
</ol>
</div>
@@ -114,22 +120,31 @@
development boards:</p>
<ul>
- <li><a href="http://shop.moderndevice.com/products/freeduino-usb-host-board">Modern
- Device</a> provides an Arduino-compatible board that supports the ADK firmware.</li>
- <li><a href="http://www.seeedstudio.com/depot/seeeduino-adk-main-board-p-846.html">
- Seeed Studio</a> provides an Arduino-compatible board that supports the ADK firmware.</li>
-
- <li><a href="http://www.rt-net.jp/shop/index.php?main_page=product_info&cPath=3_4&products_id=1">
- RT Corp</a> provides an Arduino-compatible board based on the Android ADK board design.</li>
-
- <li><a href="http://www.microchip.com/android">Microchip</a> provides a A PIC based USB
- microcontroller board.</li>
+ <li>The <a href="http://store.arduino.cc/">Arduino Store</a> provides the Arduino Mega ADK
+ (in <a href="http://store.arduino.cc/eu/index.php?main_page=product_info&cPath=11_12&products_id=144">EU nations</a>
+ or <a href="http://store.arduino.cc/ww/index.php?main_page=product_info&cPath=11_12&products_id=144">non-EU nations</a>)
+ that is based on the ATmega2560 and supports the ADK firmware.</li>
<li><a href="https://store.diydrones.com/ProductDetails.asp?ProductCode=BR-PhoneDrone">DIY
Drones</a> provides an Arduino-compatible board geared towards RC (radio controlled) and UAV
(unmanned aerial vehicle) enthusiasts.</li>
+ <li><a href="http://www.microchip.com/android">Microchip</a> provides a PIC based USB
+ microcontroller board.</li>
+
+ <li><a href="http://shop.moderndevice.com/products/freeduino-usb-host-board">Modern
+ Device</a> provides an Arduino-compatible board that supports the ADK firmware.</li>
+
+ <li><a href="http://www.rt-net.jp/shop/index.php?main_page=product_info&cPath=3_4&products_id=1">
+ RT Corp</a> provides an Arduino-compatible board based on the Android ADK board design.</li>
+
+ <li><a href="http://www.seeedstudio.com/depot/seeeduino-adk-main-board-p-846.html">
+ Seeed Studio</a> provides an Arduino-compatible board that supports the ADK firmware.</li>
+
+ <li><a href="http://www.sparkfun.com/products/10748">
+ SparkFun</a>'s IOIO board now has beta support for the ADK firmware.</li>
+
</ul>
<p>We expect more hardware distributers to create a variety of kits, so please stay tuned for
@@ -140,7 +155,7 @@
accessory that is based on the <a href="http://www.arduino.cc/">Arduino open source electronics
prototyping platform</a>, the accessory's hardware design files, code that implements the
accessory's firmware, and the Android application that interacts with the accessory. The hardware
- design files and firmware code are contained in the <a href=ctive
+ design files and firmware code are contained in the <a href=
"https://dl-ssl.google.com/android/adk/adk_release_0512.zip">ADK package download</a>.</p>
<p>The main hardware and software components of the ADK include:</p>
@@ -347,7 +362,7 @@
2.3.4 devices that support accessory mode. This library is also forward compatible with Android
3.1 or newer devices that support accessory mode. If you only care about Android 3.1 or newer
devices, all you need is API Level 12. For more information on deciding which API level to use,
- see the <a href="{@docRoot}guide/topics/USB/accessory.html#choosing">USB Accessory</a>
+ see the <a href="{@docRoot}guide/topics/usb/accessory.html#choosing">USB Accessory</a>
documentation.</li>
<li>Click <strong>File > New > Project...</strong>, then select <strong>Android >
@@ -885,4 +900,4 @@
</pre>
<p>See the <code>firmware/demokit/demokit.pde</code> file for information about how the ADK board
- reads and writes data.</p>
\ No newline at end of file
+ reads and writes data.</p>
diff --git a/docs/html/guide/topics/usb/host.jd b/docs/html/guide/topics/usb/host.jd
index 942708d..4967033 100644
--- a/docs/html/guide/topics/usb/host.jd
+++ b/docs/html/guide/topics/usb/host.jd
@@ -264,11 +264,7 @@
UsbManager manager = (UsbManager) getSystemService(Context.USB_SERVICE);
...
HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
-Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();
-while(deviceIterator.hasNext()){
- UsbDevice device = deviceIterator.next();
- // your code
-}
+UsbDevice device = deviceList.get("deviceName");
</pre>
<p>If desired, you can also just obtain an iterator from the hash map and process each device one
diff --git a/media/libstagefright/omx/OMXMaster.cpp b/media/libstagefright/omx/OMXMaster.cpp
index 504d470..c8278ab 100644
--- a/media/libstagefright/omx/OMXMaster.cpp
+++ b/media/libstagefright/omx/OMXMaster.cpp
@@ -57,6 +57,9 @@
typedef OMXPluginBase *(*CreateOMXPluginFunc)();
CreateOMXPluginFunc createOMXPlugin =
(CreateOMXPluginFunc)dlsym(
+ mVendorLibHandle, "createOMXPlugin");
+ if (!createOMXPlugin)
+ createOMXPlugin = (CreateOMXPluginFunc)dlsym(
mVendorLibHandle, "_ZN7android15createOMXPluginEv");
if (createOMXPlugin) {
@@ -96,11 +99,19 @@
void OMXMaster::clearPlugins() {
Mutex::Autolock autoLock(mLock);
+ typedef void (*DestroyOMXPluginFunc)(OMXPluginBase*);
+ DestroyOMXPluginFunc destroyOMXPlugin =
+ (DestroyOMXPluginFunc)dlsym(
+ mVendorLibHandle, "destroyOMXPlugin");
+
mPluginByComponentName.clear();
for (List<OMXPluginBase *>::iterator it = mPlugins.begin();
- it != mPlugins.end(); ++it) {
- delete *it;
+ it != mPlugins.end(); ++it) {
+ if (destroyOMXPlugin)
+ destroyOMXPlugin(*it);
+ else
+ delete *it;
*it = NULL;
}
diff --git a/services/camera/libcameraservice/CameraHardwareInterface.h b/services/camera/libcameraservice/CameraHardwareInterface.h
index a583aad..09e88c4 100644
--- a/services/camera/libcameraservice/CameraHardwareInterface.h
+++ b/services/camera/libcameraservice/CameraHardwareInterface.h
@@ -386,7 +386,10 @@
if (mDevice->ops->get_parameters) {
char *temp = mDevice->ops->get_parameters(mDevice);
String8 str_parms(temp);
- free(temp);
+ if (mDevice->ops->put_parameters)
+ mDevice->ops->put_parameters(mDevice, temp);
+ else
+ free(temp);
parms.unflatten(str_parms);
}
return parms;
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java
index 8a21f4f..9a9cc8f 100644
--- a/services/java/com/android/server/ConnectivityService.java
+++ b/services/java/com/android/server/ConnectivityService.java
@@ -1985,12 +1985,6 @@
LinkProperties p = nt.getLinkProperties();
if (p == null) return;
Collection<InetAddress> dnses = p.getDnses();
- try {
- mNetd.setDnsServersForInterface(p.getInterfaceName(),
- NetworkUtils.makeStrings(dnses));
- } catch (Exception e) {
- Slog.e(TAG, "exception setting dns servers: " + e);
- }
boolean changed = false;
if (mNetConfigs[netType].isDefault()) {
String network = nt.getNetworkInfo().getTypeName();
@@ -2001,7 +1995,7 @@
}
} else {
try {
- mNetd.setDnsServersForInterface(Integer.toString(netType),
+ mNetd.setDnsServersForInterface(p.getInterfaceName(),
NetworkUtils.makeStrings(dnses));
} catch (Exception e) {
Slog.e(TAG, "exception setting dns servers: " + e);