Merge "Immediately close the shade when the status bar is disabled. (DO NOT MERGE)" into eclair
diff --git a/core/java/android/accounts/AccountManagerService.java b/core/java/android/accounts/AccountManagerService.java
index 800ad749..440668f 100644
--- a/core/java/android/accounts/AccountManagerService.java
+++ b/core/java/android/accounts/AccountManagerService.java
@@ -152,8 +152,7 @@
new AtomicReference<AccountManagerService>();
private static final boolean isDebuggableMonkeyBuild =
- SystemProperties.getBoolean("ro.monkey", false)
- && SystemProperties.getBoolean("ro.debuggable", false);
+ SystemProperties.getBoolean("ro.monkey", false);
private static final Account[] EMPTY_ACCOUNT_ARRAY = new Account[]{};
static {
diff --git a/core/java/android/provider/ContactsContract.java b/core/java/android/provider/ContactsContract.java
index c3b0f1c..a56bb45 100644
--- a/core/java/android/provider/ContactsContract.java
+++ b/core/java/android/provider/ContactsContract.java
@@ -48,49 +48,49 @@
* ContactsContract defines an extensible database of contact-related
* information. Contact information is stored in a three-tier data model:
* </p>
- * <blockquote>
- * <p>
+ * <ul>
+ * <li>
* The {@link Data} table contains all kinds of personal data: phone numbers,
* email addresses etc. The list of data kinds that can be stored in this table
* is open-ended. There is a predefined set of common kinds, but any application
* can add its own data kinds.
- * </p>
- * <p>
+ * </li>
+ * <li>
* A row in the {@link RawContacts} table represents a set of Data describing a
* person and associated with a single account.
- * </p>
- * <p>
+ * </li>
+ * <li>
* A row in the {@link Contacts} table represents an aggregate of one or more
* RawContacts presumably describing the same person.
- * </p>
- * </blockquote>
+ * </li>
+ * </ul>
* <p>
* Other tables include:
* </p>
- * <blockquote>
- * <p>
+ * <ul>
+ * <li>
* {@link Groups}, which contains information about raw contact groups - the
* current API does not support the notion of groups spanning multiple accounts.
- * </p>
- * <p>
+ * </li>
+ * <li>
* {@link StatusUpdates}, which contains social status updates including IM
* availability.
- * </p>
- * <p>
+ * </li>
+ * <li>
* {@link AggregationExceptions}, which is used for manual aggregation and
* disaggregation of raw contacts
- * </p>
- * <p>
+ * </li>
+ * <li>
* {@link Settings}, which contains visibility and sync settings for accounts
* and groups.
- * </p>
- * <p>
+ * </li>
+ * <li>
* {@link SyncState}, which contains free-form data maintained on behalf of sync
* adapters
- * </p>
- * <p>
- * {@link PhoneLookup}, which is used for quick caller-ID lookup</id>
- * </blockquote>
+ * </li>
+ * <li>
+ * {@link PhoneLookup}, which is used for quick caller-ID lookup</li>
+ * </ul>
*/
@SuppressWarnings("unused")
public final class ContactsContract {
diff --git a/core/java/android/server/BluetoothA2dpService.java b/core/java/android/server/BluetoothA2dpService.java
index dfec1eb..8859339 100644
--- a/core/java/android/server/BluetoothA2dpService.java
+++ b/core/java/android/server/BluetoothA2dpService.java
@@ -459,11 +459,8 @@
checkSinkSuspendState(state);
mTargetA2dpState = -1;
- if (state == BluetoothA2dp.STATE_CONNECTING) {
- mAudioManager.setParameters("A2dpSuspended=false");
- }
-
- if (state == BluetoothA2dp.STATE_CONNECTING ||
+ if (getSinkPriority(device) > BluetoothA2dp.PRIORITY_OFF &&
+ state == BluetoothA2dp.STATE_CONNECTING ||
state == BluetoothA2dp.STATE_CONNECTED) {
// We have connected or attempting to connect.
// Bump priority
diff --git a/docs/html/guide/appendix/faq/commontasks.jd b/docs/html/guide/appendix/faq/commontasks.jd
index e88a867..107199a 100644
--- a/docs/html/guide/appendix/faq/commontasks.jd
+++ b/docs/html/guide/appendix/faq/commontasks.jd
@@ -160,11 +160,9 @@
<li>Create an {@link android.app.AlertDialog app.AlertDialog} class </li>
<li>Set the {@link android.R.style#Theme_Dialog} <em>theme</em> attribute to <code>@android:style/Theme.Dialog</code>
in your AndroidManifest.xml file. For example:
-</ul>
-<blockquote>
<pre><activity class="AddRssItem" android:label="Add an item" android:theme="@android:style/Theme.Dialog"/>
-</pre>
-</blockquote>
+</pre></li>
+</ul>
<p>Calling startActivity() or startActivityForResult() will open a new screen in whatever
way it defines itself (if it uses a floating theme it will be floating,
otherwise it will be full screen). </p>
diff --git a/docs/html/guide/developing/tools/adb.jd b/docs/html/guide/developing/tools/adb.jd
index e8c726f..dd60a3cc 100644
--- a/docs/html/guide/developing/tools/adb.jd
+++ b/docs/html/guide/developing/tools/adb.jd
@@ -83,12 +83,12 @@
<p>The server then sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585, the range used by emulators/devices. Where the server finds an adb daemon, it sets up a connection to that port. Note that each emulator/device instance acquires a pair of sequential ports — an even-numbered port for console connections and an odd-numbered port for adb connections. For example: </p>
-<blockquote>
+<p style="margin-left:2em">
Emulator 1, console: 5554<br/>
Emulator 1, adb: 5555<br>
Emulator 2, console: 5556<br>
Emulator 2, adb: 5557 ...
-</blockquote>
+</p>
<p>As shown, the emulator instance connected to adb on port 5555 is the same as the instance whose console listens on port 5554. </p>
diff --git a/docs/html/guide/practices/design/performance.jd b/docs/html/guide/practices/design/performance.jd
index 1eef342..ec34ac9 100644
--- a/docs/html/guide/practices/design/performance.jd
+++ b/docs/html/guide/practices/design/performance.jd
@@ -22,6 +22,7 @@
<p>This document covers these topics: </p>
<ul>
<li><a href="#intro">Introduction</a></li>
+ <li><a href="#optimize_judiciously">Optimize Judiciously</a></li>
<li><a href="#object_creation">Avoid Creating Objects</a></li>
<li><a href="#native_methods">Use Native Methods</a></li>
<li><a href="#prefer_virtual">Prefer Virtual Over Interface</a></li>
@@ -74,6 +75,180 @@
probably be as fast or faster than compiled bar(). It is unwise to rely on a
compiler to "save" you and make your code fast enough.</p>
+<h2 id="optimize_judiciously">Optimize Judiciously</h2>
+
+<p>As you get started thinking about how to design your application, consider
+the cautionary points about optimization that Josh Bloch makes in his book
+<em>Effective Java</em>. Here's "Item 47: Optimize Judiciously", excerpted from
+the latest edition of the book with permission. Although Josh didn't have
+Android application development in mind when writing this section — for
+example, the <code style="color:black">java.awt.Component</code> class
+referenced is not available in Android, and Android uses the
+Dalvik VM, rather than a standard JVM — his points are still valid. </p>
+
+<blockquote>
+
+<p>There are three aphorisms concerning optimization that everyone should know.
+They are perhaps beginning to suffer from overexposure, but in case you aren't
+yet familiar with them, here they are:</p>
+
+<div style="padding-left:3em;padding-right:4em;">
+
+<p style="margin-bottom:.5em;">More computing sins are committed in the name of
+efficiency (without necessarily achieving it) than for any other single
+reason—including blind stupidity.</p>
+<p>—William A. Wulf <span style="font-size:80%;"><sup>1</sup></span></p>
+
+<p style="margin-bottom:.5em;">We should forget about small efficiencies, say
+about 97% of the time: premature optimization is the root of all evil. </p>
+<p>—Donald E. Knuth <span style="font-size:80%;"><sup>2</sup></span></p>
+
+
+<p style="margin-bottom:.5em;">We follow two rules in the matter of optimization:</p>
+<ul style="margin-bottom:0">
+<li>Rule 1. Don't do it.</li>
+<li>Rule 2 (for experts only). Don't do it yet — that is, not until you have a
+perfectly clear and unoptimized solution. </li>
+</ul>
+<p>—M. A. Jackson <span style="font-size:80%;"><sup>3</sup></span></p>
+</div>
+
+<p>All of these aphorisms predate the Java programming language by two decades.
+They tell a deep truth about optimization: it is easy to do more harm than good,
+especially if you optimize prematurely. In the process, you may produce software
+that is neither fast nor correct and cannot easily be fixed.</p>
+
+<p>Don't sacrifice sound architectural principles for performance.
+<strong>Strive to write good programs rather than fast ones.</strong> If a good
+program is not fast enough, its architecture will allow it to be optimized. Good
+programs embody the principle of <em>information hiding</em>: where possible,
+they localize design decisions within individual modules, so individual
+decisions can be changed without affecting the remainder of the system (Item
+13).</p>
+
+<p>This does <em>not</em> mean that you can ignore performance concerns until
+your program is complete. Implementation problems can be fixed by later
+optimization, but pervasive architectural flaws that limit performance can be
+impossible to fix without rewriting the system. Changing a fundamental facet of
+your design after the fact can result in an ill-structured system that is
+difficult to maintain and evolve. Therefore you must think about performance
+during the design process.</p>
+
+<p><strong>Strive to avoid design decisions that limit performance.</strong> The
+components of a design that are most difficult to change after the fact are
+those specifying interactions between modules and with the outside world. Chief
+among these design components are APIs, wire-level protocols, and persistent
+data formats. Not only are these design components difficult or impossible to
+change after the fact, but all of them can place significant limitations on the
+performance that a system can ever achieve.</p>
+
+<p><strong>Consider the performance consequences of your API design
+decisions.</strong> Making a public type mutable may require a lot of needless
+defensive copying (Item 39). Similarly, using inheritance in a public class
+where composition would have been appropriate ties the class forever to its
+superclass, which can place artificial limits on the performance of the subclass
+(Item 16). As a final example, using an implementation type rather than an
+interface in an API ties you to a specific implementation, even though faster
+implementations may be written in the future (Item 52).</p>
+
+<p>The effects of API design on performance are very real. Consider the <code
+style="color:black">getSize</code> method in the <code
+style="color:black">java.awt.Component</code> class. The decision that this
+performance-critical method was to return a <code
+style="color:black">Dimension</code> instance, coupled with the decision that
+<code style="color:black">Dimension</code> instances are mutable, forces any
+implementation of this method to allocate a new <code
+style="color:black">Dimension</code> instance on every invocation. Even though
+allocating small objects is inexpensive on a modern VM, allocating millions of
+objects needlessly can do real harm to performance.</p>
+
+<p>In this case, several alternatives existed. Ideally, <code
+style="color:black">Dimension</code> should have been immutable (Item 15);
+alternatively, the <code style="color:black">getSize</code> method could have
+been replaced by two methods returning the individual primitive components of a
+<code style="color:black">Dimension</code> object. In fact, two such methods
+were added to the Component API in the 1.2 release for performance reasons.
+Preexisting client code, however, still uses the <code
+style="color:black">getSize</code> method and still suffers the performance
+consequences of the original API design decisions.</p>
+
+<p>Luckily, it is generally the case that good API design is consistent with
+good performance. <strong>It is a very bad idea to warp an API to achieve good
+performance.</strong> The performance issue that caused you to warp the API may
+go away in a future release of the platform or other underlying software, but
+the warped API and the support headaches that come with it will be with you for
+life.</p>
+
+<p>Once you've carefully designed your program and produced a clear, concise,
+and well-structured implementation, <em>then</em> it may be time to consider
+optimization, assuming you're not already satisfied with the performance of the
+program.</p>
+
+<p>Recall that Jackson's two rules of optimization were "Don't do it," and "(for
+experts only). Don't do it yet." He could have added one more: <strong>measure
+performance before and after each attempted optimization.</strong> You may be
+surprised by what you find. Often, attempted optimizations have no measurable
+effect on performance; sometimes, they make it worse. The main reason is that
+it's difficult to guess where your program is spending its time. The part of the
+program that you think is slow may not be at fault, in which case you'd be
+wasting your time trying to optimize it. Common wisdom says that programs spend
+80 percent of their time in 20 percent of their code.</p>
+
+<p>Profiling tools can help you decide where to focus your optimization efforts.
+Such tools give you runtime information, such as roughly how much time each
+method is consuming and how many times it is invoked. In addition to focusing
+your tuning efforts, this can alert you to the need for algorithmic changes. If
+a quadratic (or worse) algorithm lurks inside your program, no amount of tuning
+will fix the problem. You must replace the algorithm with one that is more
+efficient. The more code in the system, the more important it is to use a
+profiler. It's like looking for a needle in a haystack: the bigger the haystack,
+the more useful it is to have a metal detector. The JDK comes with a simple
+profiler and modern IDEs provide more sophisticated profiling tools.</p>
+
+<p>The need to measure the effects of attempted optimization is even greater on
+the Java platform than on more traditional platforms, because the Java
+programming language does not have a strong <em>performance model</em>. The
+relative costs of the various primitive operations are not well defined. The
+"semantic gap" between what the programmer writes and what the CPU executes is
+far greater than in traditional statically compiled languages, which makes it
+very difficult to reliably predict the performance consequences of any
+optimization. There are plenty of performance myths floating around that turn
+out to be half-truths or outright lies.</p>
+
+<p>Not only is Java's performance model ill-defined, but it varies from JVM
+implementation to JVM implementation, from release to release, and from
+processor to processor. If you will be running your program on multiple JVM
+implementations or multiple hardware platforms, it is important that you measure
+the effects of your optimization on each. Occasionally you may be forced to make
+trade-offs between performance on different JVM implementations or hardware
+platforms.</p>
+
+<p>To summarize, do not strive to write fast programs — strive to write
+good ones; speed will follow. Do think about performance issues while you're
+designing systems and especially while you're designing APIs, wire-level
+protocols, and persistent data formats. When you've finished building the
+system, measure its performance. If it's fast enough, you're done. If not,
+locate the source of the problems with the aid of a profiler, and go to work
+optimizing the relevant parts of the system. The first step is to examine your
+choice of algorithms: no amount of low-level optimization can make up for a poor
+choice of algorithm. Repeat this process as necessary, measuring the performance
+after every change, until you're satisfied.</p>
+
+<p>—Excerpted from Josh Bloch's <em>Effective Java</em>, Second Ed.
+(Addison-Wesley, 2008).</em></p>
+
+<p style="font-size:80%;margin-bottom:0;"><sup>1</sup> Wulf, W. A Case Against
+the GOTO. <em>Proceedings of the 25th ACM National
+Conference</em> 2 (1972): 791–797.</p>
+<p style="font-size:80%;margin-bottom:0;"><sup>2</sup> Knuth, Donald. Structured
+Programming with go to Statements. <em>Computing
+Surveys 6</em> (1974): 261–301.</p>
+<p style="font-size:80%"><sup>3</sup> Jackson, M. A. <em>Principles of Program
+Design</em>, Academic Press, London, 1975.
+ISBN: 0123790506.</p>
+
+</blockquote>
+
<a name="object_creation"></a>
<h2>Avoid Creating Objects</h2>
diff --git a/docs/html/guide/practices/ui_guidelines/menu_design.jd b/docs/html/guide/practices/ui_guidelines/menu_design.jd
index 518cea1..ebf8a4b 100644
--- a/docs/html/guide/practices/ui_guidelines/menu_design.jd
+++ b/docs/html/guide/practices/ui_guidelines/menu_design.jd
@@ -93,10 +93,10 @@
<h2 id="tour_of_the_menus">Tour of the Menus</h2>
-<blockquote>
- <b>NOTE</b> - Your menus and screens might not look like those shown in this document;
- they may vary from one version of Android or device to another.
-</blockquote>
+<p class="note"><strong>Note:</strong> Your menus and screens might not look
+like those shown in this document; they may vary from one version of Android
+or device to another.
+</p>
<h3 id="options_menu">Options Menu</h3>
diff --git a/docs/html/guide/samples/index.jd b/docs/html/guide/samples/index.jd
index fc437e9..7923532 100644
--- a/docs/html/guide/samples/index.jd
+++ b/docs/html/guide/samples/index.jd
@@ -77,7 +77,7 @@
<dt><a href="{@docRoot}resources/samples/SoftKeyboard/index.html">Soft Keyboard</a></dt>
<dd>An example of writing an input method for a software keyboard.</dd>
- <dt><a href={@docRoot}resources/samples/Wiktionary/index.html">Wiktionary</a></dt>
+ <dt><a href=""{@docRoot}resources/samples/Wiktionary/index.html">Wiktionary</a></dt>
<dd>An example of creating interactive widgets for display on the Android
home screen.</dd>
diff --git a/docs/html/guide/topics/resources/resources-i18n.jd b/docs/html/guide/topics/resources/resources-i18n.jd
index 091bc62..0c7baa1 100755
--- a/docs/html/guide/topics/resources/resources-i18n.jd
+++ b/docs/html/guide/topics/resources/resources-i18n.jd
@@ -643,14 +643,14 @@
<p>Android will pick which of the various underlying resource files should be
used at runtime, depending on the current configuration of the device.
The example used here assumes the following device configuration:</p>
-<blockquote>
- <p>Locale = <code>en-GB</code><br>
+
+ <p style="margin-left:2em">Locale = <code>en-GB</code><br>
Screen orientation = <code>port</code><br>
Screen pixel density = <code>mdpi</code><br>
Touchscreen type = <code>notouch</code><br>
Primary text input method = <code>12key</code><br>
</p>
-</blockquote>
+
<p>Here is how Android makes the selection: </p>
<ol>
<li>
diff --git a/docs/html/resources/articles/qsb.jd b/docs/html/resources/articles/qsb.jd
index 1249f21..e497f50 100644
--- a/docs/html/resources/articles/qsb.jd
+++ b/docs/html/resources/articles/qsb.jd
@@ -23,8 +23,8 @@
<p class="note"><strong>Note:</strong> The code fragments in this document are
related to a sample app called <a
-href="http://developer.android.com/guide/samples/SearchableDictionary/index.
-html" title="Searchable Dictionary">Searchable Dictionary</a>. The app is
+href="{@docRoot}resources/samples/SearchableDictionary/index.html"
+title="Searchable Dictionary">Searchable Dictionary</a>. The app is
available for Android 1.6 and later platforms.</p>
<h3>The story before now: searching within your app</h3>
diff --git a/docs/html/resources/dashboard/platform-versions.jd b/docs/html/resources/dashboard/platform-versions.jd
index 883f64a..ec7e9da 100644
--- a/docs/html/resources/dashboard/platform-versions.jd
+++ b/docs/html/resources/dashboard/platform-versions.jd
@@ -45,9 +45,11 @@
<div class="dashboard-panel">
<img alt="" width="400" height="250"
-src="http://chart.apis.google.com/chart?cht=p&chs=400x250&chd=t:0.3,27.7,54.2,2.9,14.8&chl=Android%201.1|Android%201.5|Android%201.6|Android%202.0|Android%202.0.1&chco=c4df9b,6fad0c" />
+src="http://chart.apis.google.com/chart?cht=p&chs=400x250&chd=t:0.3,31.0,47.6,0.7,20.4&chl=Android%201.1|Android%201.5|Android%201.6|Android%202.0|Android%202.0.1&chco=c4df9b,6fad0c" />
-<!-- f6faf2,a3c539 -->
+<!-- HISTORY
+12/14/09 http://chart.apis.google.com/chart?cht=p&chs=400x250&chd=t:0.3,27.7,54.2,2.9,14.8&chl=Android%201.1|Android%201.5|Android%201.6|Android%202.0|Android%202.0.1&chco=c4df9b,6fad0c
+-->
<table>
<tr>
@@ -60,20 +62,20 @@
</tr>
<tr>
<td>Android 1.5</td>
- <td>27.7%</td>
+ <td>31.0%</td>
</tr>
<tr>
<td>Android 1.6</td>
- <td>54.2%</td></tr>
+ <td>47.6%</td></tr>
<tr>
<td>Android 2.0</td>
- <td>2.9%</td>
+ <td>0.7%</td>
</tr>
<tr>
<td>Android 2.0.1</td>
- <td>14.8%</td>
+ <td>20.4%</td>
</tr>
</table>
</div>
-<p><em>Data collected during two weeks ending on 12/14/2009</em></p>
+<p><em>Data collected during two weeks ending on 1/4/2010</em></p>
diff --git a/docs/html/resources/faq/commontasks.jd b/docs/html/resources/faq/commontasks.jd
index fa487f7..2f09b00 100644
--- a/docs/html/resources/faq/commontasks.jd
+++ b/docs/html/resources/faq/commontasks.jd
@@ -160,11 +160,9 @@
<li>Create an {@link android.app.AlertDialog app.AlertDialog} class </li>
<li>Set the {@link android.R.style#Theme_Dialog} <em>theme</em> attribute to <code>@android:style/Theme.Dialog</code>
in your AndroidManifest.xml file. For example:
+ <pre><activity class="AddRssItem" android:label="Add an item" android:theme="@android:style/Theme.Dialog"/></pre></li>
</ul>
-<blockquote>
- <pre><activity class="AddRssItem" android:label="Add an item" android:theme="@android:style/Theme.Dialog"/>
-</pre>
-</blockquote>
+
<p>Calling startActivity() or startActivityForResult() will open a new screen in whatever
way it defines itself (if it uses a floating theme it will be floating,
otherwise it will be full screen). </p>
diff --git a/docs/html/resources/resources_toc.cs b/docs/html/resources/resources_toc.cs
index 40ee818..6aaf060 100644
--- a/docs/html/resources/resources_toc.cs
+++ b/docs/html/resources/resources_toc.cs
@@ -38,93 +38,93 @@
<span class="en">List of Articles</span>
</a> <span class="new">new!</span></div>
<ul>
- <li><a href="<?cs var:toroot ?>resources/articles/avoiding-memory-leaks.html">
- <span class="en">Avoiding Memory Leaks</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/backward-compatibility.html">
- <span class="en">Backward Compatibility</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/can-i-use-this-intent.html">
- <span class="en">Can I Use this Intent?</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/creating-input-method.html">
- <span class="en">Creating an Input Method</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/drawable-mutations.html">
- <span class="en">Drawable Mutations</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/faster-screen-orientation-change.html">
- <span class="en">Faster Screen Orientation Change</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/future-proofing.html">
- <span class="en">Future-Proofing Your Apps</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/gestures.html">
- <span class="en">Gestures</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/glsurfaceview.html">
- <span class="en">Introducing GLSurfaceView</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/layout-tricks-reuse.html">
- <span class="en">Layout Tricks: Reusing </span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/layout-tricks-efficiency.html">
- <span class="en">Layout Tricks: Efficiency</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/layout-tricks-stubs.html">
- <span class="en">Layout Tricks: ViewStubs </span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/layout-tricks-merge.html">
- <span class="en">Layout Tricks: Merging </span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/listview-backgrounds.html">
- <span class="en">ListView Backgrounds</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/live-folders.html">
- <span class="en">Live Folders</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/on-screen-inputs.html">
- <span class="en">Onscreen Input Methods</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/painless-threading.html">
- <span class="en">Painless Threading</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/qsb.html">
- <span class="en">Quick Search Box</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/touch-mode.html">
- <span class="en">Touch Mode</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/track-mem.html">
- <span class="en">Tracking Memory Allocations</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/ui-1.5.html">
- <span class="en">UI Framework Changes in Android 1.5</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/ui-1.6.html">
- <span class="en">UI Framework Changes in Android 1.6</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/timed-ui-updates.html">
- <span class="en">Updating the UI from a Timer</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/tts.html">
- <span class="en">Using Text-to-Speech</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/using-webviews.html">
- <span class="en">Using WebViews</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/wikinotes-linkify.html">
- <span class="en">WikiNotes: Linkify your Text!</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/wikinotes-intents.html">
- <span class="en">WikiNotes: Routing Intents</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/window-bg-speed.html">
- <span class="en">Window Backgrounds & UI Speed</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/articles/zipalign.html">
- <span class="en">Zipalign: An Easy Optimization</span>
- </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/avoiding-memory-leaks.html">
+ <span class="en">Avoiding Memory Leaks</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/backward-compatibility.html">
+ <span class="en">Backward Compatibility</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/can-i-use-this-intent.html">
+ <span class="en">Can I Use this Intent?</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/creating-input-method.html">
+ <span class="en">Creating an Input Method</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/drawable-mutations.html">
+ <span class="en">Drawable Mutations</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/faster-screen-orientation-change.html">
+ <span class="en">Faster Screen Orientation Change</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/future-proofing.html">
+ <span class="en">Future-Proofing Your Apps</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/gestures.html">
+ <span class="en">Gestures</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/glsurfaceview.html">
+ <span class="en">Introducing GLSurfaceView</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/layout-tricks-reuse.html">
+ <span class="en">Layout Tricks: Reusing </span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/layout-tricks-efficiency.html">
+ <span class="en">Layout Tricks: Efficiency</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/layout-tricks-stubs.html">
+ <span class="en">Layout Tricks: ViewStubs </span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/layout-tricks-merge.html">
+ <span class="en">Layout Tricks: Merging </span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/listview-backgrounds.html">
+ <span class="en">ListView Backgrounds</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/live-folders.html">
+ <span class="en">Live Folders</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/on-screen-inputs.html">
+ <span class="en">Onscreen Input Methods</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/painless-threading.html">
+ <span class="en">Painless Threading</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/qsb.html">
+ <span class="en">Quick Search Box</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/touch-mode.html">
+ <span class="en">Touch Mode</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/track-mem.html">
+ <span class="en">Tracking Memory Allocations</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/ui-1.5.html">
+ <span class="en">UI Framework Changes in Android 1.5</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/ui-1.6.html">
+ <span class="en">UI Framework Changes in Android 1.6</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/timed-ui-updates.html">
+ <span class="en">Updating the UI from a Timer</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/tts.html">
+ <span class="en">Using Text-to-Speech</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/using-webviews.html">
+ <span class="en">Using WebViews</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/wikinotes-linkify.html">
+ <span class="en">WikiNotes: Linkify your Text!</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/wikinotes-intents.html">
+ <span class="en">WikiNotes: Routing Intents</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/window-bg-speed.html">
+ <span class="en">Window Backgrounds & UI Speed</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/articles/zipalign.html">
+ <span class="en">Zipalign: An Easy Optimization</span>
+ </a></li>
</ul>
</li>
</ul>
@@ -234,15 +234,15 @@
<span class="en">FAQs</span>
</a></div>
<ul>
- <li><a href="<?cs var:toroot ?>resources/faq/framework.html">
- <span class="en">App Framework FAQ</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/faq/licensingandoss.html">
- <span class="en">Licensing FAQ</span>
- </a></li>
- <li><a href="<?cs var:toroot ?>resources/faq/security.html">
- <span class="en">Security FAQ</span>
- </a></li>
+ <li><a href="<?cs var:toroot ?>resources/faq/framework.html">
+ <span class="en">App Framework FAQ</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/faq/licensingandoss.html">
+ <span class="en">Licensing FAQ</span>
+ </a></li>
+ <li><a href="<?cs var:toroot ?>resources/faq/security.html">
+ <span class="en">Security FAQ</span>
+ </a></li>
</ul>
</li>
</ul>
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java
index 4a1c2a5..d62f6c3 100644
--- a/media/java/android/media/AudioService.java
+++ b/media/java/android/media/AudioService.java
@@ -1438,6 +1438,8 @@
AudioSystem.setDeviceConnectionState(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP,
AudioSystem.DEVICE_STATE_AVAILABLE,
address);
+ // Reset A2DP suspend state each time a new sink is connected
+ AudioSystem.setParameters("A2dpSuspended=false");
mConnectedDevices.put( new Integer(AudioSystem.DEVICE_OUT_BLUETOOTH_A2DP),
address);
}
diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp
index 0ef5d55..8be9db3 100644
--- a/tools/aapt/Command.cpp
+++ b/tools/aapt/Command.cpp
@@ -678,7 +678,7 @@
REQ_NAVIGATION_ATTR, NULL, 0);
int32_t reqFiveWayNav = getIntegerAttribute(tree,
REQ_FIVE_WAY_NAV_ATTR, NULL, 0);
- printf("uses-configuation:");
+ printf("uses-configuration:");
if (reqTouchScreen != 0) {
printf(" reqTouchScreen='%d'", reqTouchScreen);
}
diff --git a/tools/layoutlib/.gitignore b/tools/layoutlib/.gitignore
index d44a17d..0ec5000 100644
--- a/tools/layoutlib/.gitignore
+++ b/tools/layoutlib/.gitignore
@@ -1,3 +1,2 @@
-api/bin
bridge/bin
create/bin
diff --git a/tools/layoutlib/api/.classpath b/tools/layoutlib/api/.classpath
deleted file mode 100644
index a09ce5f..0000000
--- a/tools/layoutlib/api/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="var" path="ANDROID_SRC/prebuilt/common/kxml2/kxml2-2.3.0.jar" sourcepath="/ANDROID_SRC/dalvik/libcore/xml/src/main/java"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/tools/layoutlib/api/.project b/tools/layoutlib/api/.project
deleted file mode 100644
index 4e4ca3b..0000000
--- a/tools/layoutlib/api/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>layoutlib_api</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/tools/layoutlib/api/Android.mk b/tools/layoutlib/api/Android.mk
deleted file mode 100644
index d60987c..0000000
--- a/tools/layoutlib/api/Android.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Copyright (C) 2008 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := $(call all-java-files-under,src)
-
-LOCAL_JAVA_LIBRARIES := \
- kxml2-2.3.0
-
-LOCAL_MODULE := layoutlib_api
-
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/tools/layoutlib/api/src/com/android/layoutlib/api/IDensityBasedResourceValue.java b/tools/layoutlib/api/src/com/android/layoutlib/api/IDensityBasedResourceValue.java
deleted file mode 100644
index 57a776f..0000000
--- a/tools/layoutlib/api/src/com/android/layoutlib/api/IDensityBasedResourceValue.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.layoutlib.api;
-
-/**
- * Represents an Android Resources that has a density info attached to it.
- */
-public interface IDensityBasedResourceValue extends IResourceValue {
-
- public static enum Density {
- HIGH(240),
- MEDIUM(160),
- LOW(120),
- NODPI(0);
-
- public final static int DEFAULT_DENSITY = 160;
-
- private final int mValue;
-
- Density(int value) {
- mValue = value;
- }
-
- public int getValue() {
- return mValue;
- }
- }
-
- /**
- * Returns the density associated to the resource.
- */
- Density getDensity();
-}
diff --git a/tools/layoutlib/api/src/com/android/layoutlib/api/ILayoutBridge.java b/tools/layoutlib/api/src/com/android/layoutlib/api/ILayoutBridge.java
deleted file mode 100644
index 4dbcfdc..0000000
--- a/tools/layoutlib/api/src/com/android/layoutlib/api/ILayoutBridge.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.layoutlib.api;
-
-import java.util.Map;
-
-/**
- * Entry point of the Layout Lib. Implementations of this interface provide a method to compute
- * and render a layout.
- * <p/>
- * <p/>{@link #getApiLevel()} gives the ability to know which methods are available.
- * <p/>
- * Changes in API level 4:
- * <ul>
- * <li>new render method: {@link #computeLayout(IXmlPullParser, Object, int, int, boolean, int, float, float, String, boolean, Map, Map, IProjectCallback, ILayoutLog)}</li>
- * <li>deprecated {@link #computeLayout(IXmlPullParser, Object, int, int, int, float, float, String, boolean, Map, Map, IProjectCallback, ILayoutLog)}</li>
- * </ul>
- * Changes in API level 3:
- * <ul>
- * <li>new render method: {@link #computeLayout(IXmlPullParser, Object, int, int, int, float, float, String, boolean, Map, Map, IProjectCallback, ILayoutLog)}</li>
- * <li>deprecated {@link #computeLayout(IXmlPullParser, Object, int, int, String, boolean, Map, Map, IProjectCallback, ILayoutLog)}</li>
- * </ul>
- * Changes in API level 2:
- * <ul>
- * <li>new API Level method: {@link #getApiLevel()}</li>
- * <li>new render method: {@link #computeLayout(IXmlPullParser, Object, int, int, String, boolean, Map, Map, IProjectCallback, ILayoutLog)}</li>
- * <li>deprecated {@link #computeLayout(IXmlPullParser, Object, int, int, String, Map, Map, IProjectCallback, ILayoutLog)}</li>
- * </ul>
- */
-public interface ILayoutBridge {
-
- final int API_CURRENT = 4;
-
- /**
- * Returns the API level of the layout library.
- * While no methods will ever be removed, some may become deprecated, and some new ones
- * will appear.
- * <p/>If calling this method throws an {@link AbstractMethodError}, then the API level
- * should be considered to be 1.
- */
- int getApiLevel();
-
- /**
- * Initializes the Bridge object.
- * @param fontOsLocation the location of the fonts.
- * @param enumValueMap map attrName => { map enumFlagName => Integer value }.
- * @return true if success.
- * @since 1
- */
- boolean init(String fontOsLocation, Map<String, Map<String, Integer>> enumValueMap);
-
- /**
- * Computes and renders a layout
- * @param layoutDescription the {@link IXmlPullParser} letting the LayoutLib Bridge visit the
- * layout file.
- * @param projectKey An Object identifying the project. This is used for the cache mechanism.
- * @param screenWidth the screen width
- * @param screenHeight the screen height
- * @param renderFullSize if true, the rendering will render the full size needed by the
- * layout. This size is never smaller than <var>screenWidth</var> x <var>screenHeight</var>.
- * @param density the density factor for the screen.
- * @param xdpi the screen actual dpi in X
- * @param ydpi the screen actual dpi in Y
- * @param themeName The name of the theme to use.
- * @param isProjectTheme true if the theme is a project theme, false if it is a framework theme.
- * @param projectResources the resources of the project. The map contains (String, map) pairs
- * where the string is the type of the resource reference used in the layout file, and the
- * map contains (String, {@link IResourceValue}) pairs where the key is the resource name,
- * and the value is the resource value.
- * @param frameworkResources the framework resources. The map contains (String, map) pairs
- * where the string is the type of the resource reference used in the layout file, and the map
- * contains (String, {@link IResourceValue}) pairs where the key is the resource name, and the
- * value is the resource value.
- * @param projectCallback The {@link IProjectCallback} object to get information from
- * the project.
- * @param logger the object responsible for displaying warning/errors to the user.
- * @return a new {@link ILayoutResult} object that contains the result of the layout.
- * @since 4
- */
- ILayoutResult computeLayout(IXmlPullParser layoutDescription,
- Object projectKey,
- int screenWidth, int screenHeight, boolean renderFullSize,
- int density, float xdpi, float ydpi,
- String themeName, boolean isProjectTheme,
- Map<String, Map<String, IResourceValue>> projectResources,
- Map<String, Map<String, IResourceValue>> frameworkResources,
- IProjectCallback projectCallback, ILayoutLog logger);
-
- /**
- * Computes and renders a layout
- * @param layoutDescription the {@link IXmlPullParser} letting the LayoutLib Bridge visit the
- * layout file.
- * @param projectKey An Object identifying the project. This is used for the cache mechanism.
- * @param screenWidth the screen width
- * @param screenHeight the screen height
- * @param density the density factor for the screen.
- * @param xdpi the screen actual dpi in X
- * @param ydpi the screen actual dpi in Y
- * @param themeName The name of the theme to use.
- * @param isProjectTheme true if the theme is a project theme, false if it is a framework theme.
- * @param projectResources the resources of the project. The map contains (String, map) pairs
- * where the string is the type of the resource reference used in the layout file, and the
- * map contains (String, {@link IResourceValue}) pairs where the key is the resource name,
- * and the value is the resource value.
- * @param frameworkResources the framework resources. The map contains (String, map) pairs
- * where the string is the type of the resource reference used in the layout file, and the map
- * contains (String, {@link IResourceValue}) pairs where the key is the resource name, and the
- * value is the resource value.
- * @param projectCallback The {@link IProjectCallback} object to get information from
- * the project.
- * @param logger the object responsible for displaying warning/errors to the user.
- * @return a new {@link ILayoutResult} object that contains the result of the layout.
- * @since 3
- */
- @Deprecated
- ILayoutResult computeLayout(IXmlPullParser layoutDescription,
- Object projectKey,
- int screenWidth, int screenHeight, int density, float xdpi, float ydpi,
- String themeName, boolean isProjectTheme,
- Map<String, Map<String, IResourceValue>> projectResources,
- Map<String, Map<String, IResourceValue>> frameworkResources,
- IProjectCallback projectCallback, ILayoutLog logger);
-
- /**
- * Computes and renders a layout
- * @param layoutDescription the {@link IXmlPullParser} letting the LayoutLib Bridge visit the
- * layout file.
- * @param projectKey An Object identifying the project. This is used for the cache mechanism.
- * @param screenWidth the screen width
- * @param screenHeight the screen height
- * @param themeName The name of the theme to use.
- * @param isProjectTheme true if the theme is a project theme, false if it is a framework theme.
- * @param projectResources the resources of the project. The map contains (String, map) pairs
- * where the string is the type of the resource reference used in the layout file, and the
- * map contains (String, {@link IResourceValue}) pairs where the key is the resource name,
- * and the value is the resource value.
- * @param frameworkResources the framework resources. The map contains (String, map) pairs
- * where the string is the type of the resource reference used in the layout file, and the map
- * contains (String, {@link IResourceValue}) pairs where the key is the resource name, and the
- * value is the resource value.
- * @param projectCallback The {@link IProjectCallback} object to get information from
- * the project.
- * @param logger the object responsible for displaying warning/errors to the user.
- * @return a new {@link ILayoutResult} object that contains the result of the layout.
- * @deprecated Use {@link #computeLayout(IXmlPullParser, Object, int, int, int, float, float, String, boolean, Map, Map, IProjectCallback, ILayoutLog)}
- * @since 2
- */
- @Deprecated
- ILayoutResult computeLayout(IXmlPullParser layoutDescription,
- Object projectKey,
- int screenWidth, int screenHeight, String themeName, boolean isProjectTheme,
- Map<String, Map<String, IResourceValue>> projectResources,
- Map<String, Map<String, IResourceValue>> frameworkResources,
- IProjectCallback projectCallback, ILayoutLog logger);
-
- /**
- * Computes and renders a layout
- * @param layoutDescription the {@link IXmlPullParser} letting the LayoutLib Bridge visit the
- * layout file.
- * @param projectKey An Object identifying the project. This is used for the cache mechanism.
- * @param screenWidth
- * @param screenHeight
- * @param themeName The name of the theme to use. In order to differentiate project and platform
- * themes sharing the same name, all project themes must be prepended with a '*' character.
- * @param projectResources the resources of the project. The map contains (String, map) pairs
- * where the string is the type of the resource reference used in the layout file, and the
- * map contains (String, {@link IResourceValue}) pairs where the key is the resource name,
- * and the value is the resource value.
- * @param frameworkResources the framework resources. The map contains (String, map) pairs
- * where the string is the type of the resource reference used in the layout file, and the map
- * contains (String, {@link IResourceValue}) pairs where the key is the resource name, and the
- * value is the resource value.
- * @param projectCallback The {@link IProjectCallback} object to get information from
- * the project.
- * @param logger the object responsible for displaying warning/errors to the user.
- * @return a new {@link ILayoutResult} object that contains the result of the layout.
- * @deprecated Use {@link #computeLayout(IXmlPullParser, Object, int, int, int, float, float, String, boolean, Map, Map, IProjectCallback, ILayoutLog)}
- * @since 1
- */
- @Deprecated
- ILayoutResult computeLayout(IXmlPullParser layoutDescription,
- Object projectKey,
- int screenWidth, int screenHeight, String themeName,
- Map<String, Map<String, IResourceValue>> projectResources,
- Map<String, Map<String, IResourceValue>> frameworkResources,
- IProjectCallback projectCallback, ILayoutLog logger);
-
- /**
- * Clears the resource cache for a specific project.
- * <p/>This cache contains bitmaps and nine patches that are loaded from the disk and reused
- * until this method is called.
- * <p/>The cache is not configuration dependent and should only be cleared when a
- * resource changes (at this time only bitmaps and 9 patches go into the cache).
- * @param projectKey the key for the project.
- * @since 1
- */
- void clearCaches(Object projectKey);
-}
diff --git a/tools/layoutlib/api/src/com/android/layoutlib/api/ILayoutLog.java b/tools/layoutlib/api/src/com/android/layoutlib/api/ILayoutLog.java
deleted file mode 100644
index cae15d3..0000000
--- a/tools/layoutlib/api/src/com/android/layoutlib/api/ILayoutLog.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.layoutlib.api;
-
-/**
- * Callback interface to display warnings/errors that happened during the computation and
- * rendering of the layout.
- */
-public interface ILayoutLog {
-
- /**
- * Displays a warning message.
- * @param message the message to display.
- */
- void warning(String message);
-
- /**
- * Displays an error message.
- * @param message the message to display.
- */
- void error(String message);
-
- /**
- * Displays an exception
- * @param t the {@link Throwable} to display.
- */
- void error(Throwable t);
-}
diff --git a/tools/layoutlib/api/src/com/android/layoutlib/api/ILayoutResult.java b/tools/layoutlib/api/src/com/android/layoutlib/api/ILayoutResult.java
deleted file mode 100644
index 2d8a210..0000000
--- a/tools/layoutlib/api/src/com/android/layoutlib/api/ILayoutResult.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.layoutlib.api;
-
-import java.awt.image.BufferedImage;
-
-/**
- * The result of a layout computation through
- * {@link ILayoutLibBridge#computeLayout(IXmlPullParser, int, int, String, java.util.Map, java.util.Map, java.util.Map, IFontLoader, ILayoutLibLog, ICustomViewLoader)}
- */
-public interface ILayoutResult {
- /**
- * Success return code
- */
- final static int SUCCESS = 0;
-
- /**
- * Error return code, in which case an error message is guaranteed to be defined.
- * @See {@link #getErrorMessage()}
- */
- final static int ERROR = 1;
-
- /**
- * Returns the result code.
- * @see #SUCCESS
- * @see #ERROR
- */
- int getSuccess();
-
- /**
- * Returns the {@link ILayoutViewInfo} object for the top level view.
- */
- ILayoutViewInfo getRootView();
-
- /**
- * Returns the rendering of the full layout.
- */
- BufferedImage getImage();
-
- /**
- * Returns the error message.
- * <p/>Only valid when {@link #getSuccess()} returns {@link #ERROR}
- */
- String getErrorMessage();
-
- /**
- * Layout information for a specific view.
- */
- public interface ILayoutViewInfo {
-
- /**
- * Returns the list of children views.
- */
- ILayoutViewInfo[] getChildren();
-
- /**
- * Returns the key associated with the node.
- * @see IXmlPullParser#getViewKey()
- */
- Object getViewKey();
-
- /**
- * Returns the name of the view.
- */
- String getName();
-
- /**
- * Returns the left of the view bounds.
- */
- int getLeft();
-
- /**
- * Returns the top of the view bounds.
- */
- int getTop();
-
- /**
- * Returns the right of the view bounds.
- */
- int getRight();
-
- /**
- * Returns the bottom of the view bounds.
- */
- int getBottom();
- }
-}
diff --git a/tools/layoutlib/api/src/com/android/layoutlib/api/IProjectCallback.java b/tools/layoutlib/api/src/com/android/layoutlib/api/IProjectCallback.java
deleted file mode 100644
index 5ad5082..0000000
--- a/tools/layoutlib/api/src/com/android/layoutlib/api/IProjectCallback.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.layoutlib.api;
-
-/**
- * Callback for project information needed by the Layout Library.
- * Classes implementing this interface provide methods giving access to some project data, like
- * resource resolution, namespace information, and instantiation of custom view.
- */
-public interface IProjectCallback {
-
- /**
- * Loads a custom view with the given constructor signature and arguments.
- * @param name The fully qualified name of the class.
- * @param constructorSignature The signature of the class to use
- * @param constructorArgs The arguments to use on the constructor
- * @return A newly instantiated android.view.View object.
- * @throws ClassNotFoundException.
- * @throws Exception
- */
- @SuppressWarnings("unchecked")
- Object loadView(String name, Class[] constructorSignature, Object[] constructorArgs)
- throws ClassNotFoundException, Exception;
-
- /**
- * Returns the namespace of the application.
- * <p/>This lets the Layout Lib load custom attributes for custom views.
- */
- String getNamespace();
-
- /**
- * Resolves the id of a resource Id.
- * <p/>The resource id is the value of a <code>R.<type>.<name></code>, and
- * this method will return both the type and name of the resource.
- * @param id the Id to resolve.
- * @return an array of 2 strings containing the resource name and type, or null if the id
- * does not match any resource.
- */
- String[] resolveResourceValue(int id);
-
- /**
- * Resolves the id of a resource Id of type int[]
- * <p/>The resource id is the value of a R.styleable.<name>, and this method will
- * return the name of the resource.
- * @param id the Id to resolve.
- * @return the name of the resource or <code>null</code> if not found.
- */
- String resolveResourceValue(int[] id);
-
- /**
- * Returns the id of a resource.
- * <p/>The provided type and name must match an existing constant defined as
- * <code>R.<type>.<name></code>.
- * @param type the type of the resource
- * @param name the name of the resource
- * @return an Integer containing the resource Id, or <code>null</code> if not found.
- */
- Integer getResourceValue(String type, String name);
-
-}
diff --git a/tools/layoutlib/api/src/com/android/layoutlib/api/IResourceValue.java b/tools/layoutlib/api/src/com/android/layoutlib/api/IResourceValue.java
deleted file mode 100644
index 1da9508..0000000
--- a/tools/layoutlib/api/src/com/android/layoutlib/api/IResourceValue.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.layoutlib.api;
-
-/**
- * Represents an android resource with a name and a string value.
- */
-public interface IResourceValue {
-
- /**
- * Returns the type of the resource. For instance "drawable", "color", etc...
- */
- String getType();
-
- /**
- * Returns the name of the resource, as defined in the XML.
- */
- String getName();
-
- /**
- * Returns the value of the resource, as defined in the XML. This can be <code>null</code>
- */
- String getValue();
-
- /**
- * Returns whether the resource is a framework resource (<code>true</code>) or a project
- * resource (<code>false</false>).
- */
- boolean isFramework();
-}
diff --git a/tools/layoutlib/api/src/com/android/layoutlib/api/IStyleResourceValue.java b/tools/layoutlib/api/src/com/android/layoutlib/api/IStyleResourceValue.java
deleted file mode 100644
index 2f17e69..0000000
--- a/tools/layoutlib/api/src/com/android/layoutlib/api/IStyleResourceValue.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.layoutlib.api;
-
-
-/**
- * Represents an android style resources with a name and a list of children {@link IResourceValue}.
- */
-public interface IStyleResourceValue extends IResourceValue {
-
- /**
- * Returns the parent style name or <code>null</code> if unknown.
- */
- String getParentStyle();
-
- /**
- * Find an item in the list by name
- * @param name
- */
- IResourceValue findItem(String name);
-}
diff --git a/tools/layoutlib/api/src/com/android/layoutlib/api/IXmlPullParser.java b/tools/layoutlib/api/src/com/android/layoutlib/api/IXmlPullParser.java
deleted file mode 100644
index cd43c56..0000000
--- a/tools/layoutlib/api/src/com/android/layoutlib/api/IXmlPullParser.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.layoutlib.api;
-
-import com.android.layoutlib.api.ILayoutResult.ILayoutViewInfo;
-
-import org.xmlpull.v1.XmlPullParser;
-
-/**
- * Extended version of {@link XmlPullParser} to use with
- * {@link ILayoutLibBridge#computeLayout(XmlPullParser, int, int, String, java.util.Map, java.util.Map, java.util.Map, com.android.layoutlib.api.ILayoutLibBridge.IFontInfo)}
- */
-public interface IXmlPullParser extends XmlPullParser {
-
- /**
- * Returns a key for the current XML node.
- * <p/>This key will be passed back in the {@link ILayoutViewInfo} objects, allowing association
- * of a particular XML node with its result from the layout computation.
- */
- Object getViewKey();
-}
-