summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.mk2
-rw-r--r--core/java/android/speech/IRecognitionListener.aidl55
-rw-r--r--core/java/android/speech/IRecognitionService.aidl33
-rw-r--r--core/java/android/speech/RecognitionServiceUtil.java93
-rw-r--r--core/java/com/android/internal/util/BitwiseInputStream.java12
-rw-r--r--core/java/com/android/internal/util/BitwiseOutputStream.java16
-rw-r--r--docs/html/guide/appendix/media-formats.jd37
-rw-r--r--docs/html/guide/topics/manifest/action-element.jd4
-rw-r--r--docs/html/guide/topics/manifest/activity-alias-element.jd4
-rw-r--r--docs/html/guide/topics/manifest/activity-element.jd201
-rw-r--r--docs/html/guide/topics/manifest/application-element.jd4
-rw-r--r--docs/html/guide/topics/manifest/category-element.jd6
-rw-r--r--docs/html/guide/topics/manifest/data-element.jd22
-rw-r--r--docs/html/guide/topics/manifest/grant-uri-permission-element.jd4
-rw-r--r--docs/html/guide/topics/manifest/instrumentation-element.jd4
-rw-r--r--docs/html/guide/topics/manifest/intent-filter-element.jd4
-rw-r--r--docs/html/guide/topics/manifest/manifest-element.jd22
-rw-r--r--docs/html/guide/topics/manifest/manifest-intro.jd2
-rw-r--r--docs/html/guide/topics/manifest/meta-data-element.jd4
-rw-r--r--docs/html/guide/topics/manifest/permission-element.jd4
-rw-r--r--docs/html/guide/topics/manifest/permission-group-element.jd4
-rw-r--r--docs/html/guide/topics/manifest/permission-tree-element.jd5
-rw-r--r--docs/html/guide/topics/manifest/provider-element.jd5
-rw-r--r--docs/html/guide/topics/manifest/receiver-element.jd25
-rw-r--r--docs/html/guide/topics/manifest/service-element.jd4
-rwxr-xr-xdocs/html/guide/topics/manifest/uses-configuration-element.jd176
-rw-r--r--docs/html/guide/topics/manifest/uses-library-element.jd4
-rw-r--r--docs/html/guide/topics/manifest/uses-permission-element.jd4
-rw-r--r--docs/html/guide/topics/manifest/uses-sdk-element.jd6
-rw-r--r--docs/html/guide/topics/media/index.jd15
-rw-r--r--docs/html/sdk/terms.jd4
-rw-r--r--docs/html/sdk/terms_body.html6
-rw-r--r--media/java/android/media/SoundPool.java190
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/SIMRecords.java25
-rw-r--r--tests/AndroidTests/src/com/android/unit_tests/BitwiseStreamsTest.java25
-rw-r--r--tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeCanvas.java4
36 files changed, 925 insertions, 110 deletions
diff --git a/Android.mk b/Android.mk
index e2c3def5a312..4bd1220f8756 100644
--- a/Android.mk
+++ b/Android.mk
@@ -96,6 +96,8 @@ LOCAL_SRC_FILES += \
core/java/android/view/IWindow.aidl \
core/java/android/view/IWindowManager.aidl \
core/java/android/view/IWindowSession.aidl \
+ core/java/android/speech/IRecognitionListener.aidl \
+ core/java/android/speech/IRecognitionService.aidl \
core/java/com/android/internal/app/IBatteryStats.aidl \
core/java/com/android/internal/app/IUsageStats.aidl \
core/java/com/android/internal/appwidget/IAppWidgetService.aidl \
diff --git a/core/java/android/speech/IRecognitionListener.aidl b/core/java/android/speech/IRecognitionListener.aidl
new file mode 100644
index 000000000000..6ed32b502b42
--- /dev/null
+++ b/core/java/android/speech/IRecognitionListener.aidl
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.speech;
+
+import android.os.Bundle;
+
+/**
+ * Listener for speech recognition events, used with RecognitionService.
+ * This gives you both the final recognition results, as well as various
+ * intermediate events that can be used to show visual feedback to the user.
+ * {@hide}
+ */
+interface IRecognitionListener {
+ /** Called when the endpointer is ready for the user to start speaking. */
+ void onReadyForSpeech(in Bundle noiseParams);
+
+ /** The user has started to speak. */
+ void onBeginningOfSpeech();
+
+ /** The sound level in the audio stream has changed. */
+ void onRmsChanged(in float rmsdB);
+
+ /**
+ * More sound has been received. Buffer is a byte buffer containing
+ * a sequence of 16-bit shorts.
+ */
+ void onBufferReceived(in byte[] buffer);
+
+ /** Called after the user stops speaking. */
+ void onEndOfSpeech();
+
+ /** A network or recognition error occurred. */
+ void onError(in String error);
+
+ /**
+ * Called when recognition transcripts are ready.
+ * results: an ordered list of the most likely transcripts (N-best list).
+ * @hide
+ */
+ void onResults(in List<String> results);
+}
diff --git a/core/java/android/speech/IRecognitionService.aidl b/core/java/android/speech/IRecognitionService.aidl
new file mode 100644
index 000000000000..8f069769cf83
--- /dev/null
+++ b/core/java/android/speech/IRecognitionService.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.speech;
+
+import android.os.Bundle;
+import android.speech.IRecognitionListener;
+
+// A Service interface to speech recognition. Call startListening when
+// you want to begin capturing audio; RecognitionService will automatically
+// determine when the user has finished speaking, stream the audio to the
+// recognition servers, and notify you when results are ready.
+/** {@hide} */
+interface IRecognitionService {
+ // Start listening for speech. Can only call this from one thread at once.
+ void startListening(in Bundle recognitionParams,
+ in IRecognitionListener listener);
+
+ void cancel();
+}
diff --git a/core/java/android/speech/RecognitionServiceUtil.java b/core/java/android/speech/RecognitionServiceUtil.java
new file mode 100644
index 000000000000..650c0fd24881
--- /dev/null
+++ b/core/java/android/speech/RecognitionServiceUtil.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package android.speech;
+
+import android.content.ComponentName;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.os.Bundle;
+import android.os.IBinder;
+
+import java.util.List;
+
+/**
+ * Utils for Google's network-based speech recognizer, which lets you perform
+ * speech-to-text translation through RecognitionService. IRecognitionService
+ * and IRecognitionListener are the core interfaces; you begin recognition
+ * through IRecognitionService and subscribe to callbacks about when the user
+ * stopped speaking, results come in, errors, etc. through IRecognitionListener.
+ * RecognitionServiceUtil includes default IRecognitionListener and
+ * ServiceConnection implementations to reduce the amount of boilerplate.
+ *
+ * The Service provides no user interface. See RecognitionActivity if you
+ * want the standard voice search UI.
+ *
+ * Below is a small skeleton of how to use the recognizer:
+ *
+ * ServiceConnection conn = new RecognitionServiceUtil.Connection();
+ * mContext.bindService(RecognitionServiceUtil.sDefaultIntent,
+ * conn, Context.BIND_AUTO_CREATE);
+ * IRecognitionListener listener = new RecognitionServiceWrapper.NullListener() {
+ * public void onResults(List<String> results) {
+ * // Do something with recognition transcripts
+ * }
+ * }
+ *
+ * // Must wait for conn.mService to be populated, then call below
+ * conn.mService.startListening(null, listener);
+ *
+ * {@hide}
+ */
+public class RecognitionServiceUtil {
+ public static final Intent sDefaultIntent = new Intent(
+ RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
+
+ public static final String NOISE_LEVEL = "NoiseLevel";
+ public static final String SIGNAL_NOISE_RATIO = "SignalNoiseRatio";
+
+ private RecognitionServiceUtil() {}
+
+ /**
+ * IRecognitionListener which does nothing in response to recognition
+ * callbacks. You can subclass from this and override only the methods
+ * whose events you want to respond to.
+ */
+ public static class NullListener extends IRecognitionListener.Stub {
+ public void onReadyForSpeech(Bundle bundle) {}
+ public void onBeginningOfSpeech() {}
+ public void onRmsChanged(float rmsdB) {}
+ public void onBufferReceived(byte[] buf) {}
+ public void onEndOfSpeech() {}
+ public void onError(String error) {}
+ public void onResults(List<String> results) {}
+ }
+
+ /**
+ * Basic ServiceConnection which just records mService variable.
+ */
+ public static class Connection implements ServiceConnection {
+ public IRecognitionService mService;
+
+ public synchronized void onServiceConnected(ComponentName name, IBinder service) {
+ mService = IRecognitionService.Stub.asInterface(service);
+ }
+
+ public void onServiceDisconnected(ComponentName name) {
+ mService = null;
+ }
+ }
+}
diff --git a/core/java/com/android/internal/util/BitwiseInputStream.java b/core/java/com/android/internal/util/BitwiseInputStream.java
index 5da3bc64fc91..4757919f23f5 100644
--- a/core/java/com/android/internal/util/BitwiseInputStream.java
+++ b/core/java/com/android/internal/util/BitwiseInputStream.java
@@ -51,7 +51,7 @@ public class BitwiseInputStream {
*/
public BitwiseInputStream(byte buf[]) {
mBuf = buf;
- mEnd = buf.length * 8;
+ mEnd = buf.length << 3;
mPos = 0;
}
@@ -70,13 +70,13 @@ public class BitwiseInputStream {
* @return byte of read data (possibly partially filled, from lsb)
*/
public byte read(int bits) throws AccessException {
- int index = mPos / 8;
- int offset = 16 - (mPos % 8) - bits;
+ int index = mPos >>> 3;
+ int offset = 16 - (mPos & 0x07) - bits; // &7==%8
if ((bits < 0) || (bits > 8) || ((mPos + bits) > mEnd)) {
throw new AccessException("illegal read " +
"(pos " + mPos + ", end " + mEnd + ", bits " + bits + ")");
}
- int data = (mBuf[index] & 0xFF) << 8;
+ int data = (mBuf[index] & 0x00FF) << 8;
if (offset < 8) data |= (mBuf[index + 1] & 0xFF);
data >>>= offset;
data &= (-1 >>> (32 - bits));
@@ -92,10 +92,10 @@ public class BitwiseInputStream {
* @return newly allocated byte array of read data
*/
public byte[] readByteArray(int bits) throws AccessException {
- int bytes = (bits / 8) + ((bits % 8) > 0 ? 1 : 0);
+ int bytes = (bits >>> 3) + ((bits & 0x07) > 0 ? 1 : 0); // &7==%8
byte[] arr = new byte[bytes];
for (int i = 0; i < bytes; i++) {
- int increment = Math.min(8, bits - (i * 8));
+ int increment = Math.min(8, bits - (i << 3));
arr[i] = (byte)(read(increment) << (8 - increment));
}
return arr;
diff --git a/core/java/com/android/internal/util/BitwiseOutputStream.java b/core/java/com/android/internal/util/BitwiseOutputStream.java
index 5941bf3203e9..17f5c7ca7f3f 100644
--- a/core/java/com/android/internal/util/BitwiseOutputStream.java
+++ b/core/java/com/android/internal/util/BitwiseOutputStream.java
@@ -51,7 +51,7 @@ public class BitwiseOutputStream {
*/
public BitwiseOutputStream(int startingLength) {
mBuf = new byte[startingLength];
- mEnd = startingLength * 8;
+ mEnd = startingLength << 3;
mPos = 0;
}
@@ -61,7 +61,7 @@ public class BitwiseOutputStream {
* @return newly allocated byte array
*/
public byte[] toByteArray() {
- int len = (mPos / 8) + ((mPos % 8) > 0 ? 1 : 0);
+ int len = (mPos >>> 3) + ((mPos & 0x07) > 0 ? 1 : 0); // &7==%8
byte[] newBuf = new byte[len];
System.arraycopy(mBuf, 0, newBuf, 0, len);
return newBuf;
@@ -74,8 +74,8 @@ public class BitwiseOutputStream {
*/
private void possExpand(int bits) {
if ((mPos + bits) < mEnd) return;
- byte[] newBuf = new byte[((mPos + bits) * 2) / 8];
- System.arraycopy(mBuf, 0, newBuf, 0, mEnd / 8);
+ byte[] newBuf = new byte[(mPos + bits) >>> 2];
+ System.arraycopy(mBuf, 0, newBuf, 0, mEnd >>> 3);
mBuf = newBuf;
}
@@ -91,12 +91,12 @@ public class BitwiseOutputStream {
}
possExpand(bits);
data &= (-1 >>> (32 - bits));
- int index = mPos / 8;
- int offset = 16 - (mPos % 8) - bits;
+ int index = mPos >>> 3;
+ int offset = 16 - (mPos & 0x07) - bits; // &7==%8
data <<= offset;
mPos += bits;
mBuf[index] |= (data >>> 8);
- if (offset < 8) mBuf[index + 1] |= (data & 0xFF);
+ if (offset < 8) mBuf[index + 1] |= (data & 0x00FF);
}
/**
@@ -107,7 +107,7 @@ public class BitwiseOutputStream {
*/
public void writeByteArray(int bits, byte[] arr) throws AccessException {
for (int i = 0; i < arr.length; i++) {
- int increment = Math.min(8, bits - (i * 8));
+ int increment = Math.min(8, bits - (i << 3));
if (increment > 0) {
write(increment, (byte)(arr[i] >>> (8 - increment)));
}
diff --git a/docs/html/guide/appendix/media-formats.jd b/docs/html/guide/appendix/media-formats.jd
index 5419ad679297..a3cc0ff09692 100644
--- a/docs/html/guide/appendix/media-formats.jd
+++ b/docs/html/guide/appendix/media-formats.jd
@@ -1,8 +1,8 @@
page.title=Android Supported Media Formats
@jd:body
-<p>The <a href="#core">Core Media Formats</a> table below describes the media format support built into the Android platform. Note that any given mobile device may provide support for additional formats or file types not listed here. </p>
-<p>For your convenience, the table <a href="#g1">T-Mobile G1 Media Formats</a> describes the additional media formats supported by the T-Mobile G1 device. </p>
+<p>The <a href="#core">Core Media Formats</a> table below describes the media format support built into the Android platform. Note that any given mobile device may provide support for additional formats or file types not listed in the table. </p>
+<p>For your convenience, the table <a href="#g1">T-Mobile G1 Media Formats</a> describes additional media format details for the T-Mobile G1 device. </p>
<h2 id="core">Core Media Formats</h2>
@@ -95,7 +95,7 @@ page.title=Android Supported Media Formats
<td>JPEG</td>
<td style="text-align: center;">X</td>
<td style="text-align: center;">X</td>
-<td>base+progressive</td>
+<td>Base+progressive</td>
<td>JPEG (.jpg)</td>
</tr>
@@ -134,17 +134,17 @@ page.title=Android Supported Media Formats
</tr>
<tr>
-<td>H.264</td>
-<td style="text-align: center;">X</td>
+<td>H.264 AVC</td>
+<td style="text-align: center;"></td>
<td style="text-align: center;">X</td>
<td>&nbsp;</td>
<td>3GPP (.3gp) and MPEG-4 (.mp4)</td>
</tr>
<tr>
-<td>MPEG4 SP</td>
-<td>&nbsp;</td>
+<td>MPEG-4 SP</td>
<td>&nbsp;</td>
+<td style="text-align: center;">X</td>
<td>&nbsp;</td>
<td>3GPP (.3gp)</td>
</tr>
@@ -171,7 +171,7 @@ page.title=Android Supported Media Formats
<td>Audio</td>
<td>WMA</td>
<td>&nbsp;</td>
-<td>X</td>
+<td style="text-align: center;">X</td>
<td>Supports WMA standard L1-L3:
<ul>
<li>L1: 64 kbps - 161 kbps @ 44.1kHz</li>
@@ -184,13 +184,30 @@ Mono and stereo profiles with 16-bits per sample. Decoder does not support WMA P
</tr>
<tr>
-<td>Video</td>
+<td rowspan="3">Video</td>
<td>WMV</td>
<td>&nbsp;</td>
-<td>X</td>
+<td style="text-align: center;">X</td>
<td>Versions 7, 8 and 9. Simple profile only</td>
<td>Windows Media Video (.wmv)</td>
</tr>
+
+<tr>
+<td>H.263</td>
+<td style="text-align: center;">X</td>
+<td style="text-align: center;">X</td>
+<td>&nbsp;</td>
+<td>3GPP (.3gp) and MPEG-4 (.mp4)</td>
+</tr>
+
+<tr>
+<td>H.264&nbsp;AVC</td>
+<td>&nbsp;</td>
+<td style="text-align: center;">X</td>
+<td>Limited to baseline profile up to 480x320, and 600 kbps average bitrate for the video stream.</td>
+<td>3GPP (.3gp) and MPEG-4 (.mp4)</td>
+</tr>
+
</tbody></table>
diff --git a/docs/html/guide/topics/manifest/action-element.jd b/docs/html/guide/topics/manifest/action-element.jd
index bc2e1d3a2766..d7ba78d73418 100644
--- a/docs/html/guide/topics/manifest/action-element.jd
+++ b/docs/html/guide/topics/manifest/action-element.jd
@@ -40,6 +40,10 @@ as follows:
</dd>
</dl></dd>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
+
<dt>see also:</dt>
<dd><code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">&lt;intent-filter&gt;</a></code></dd>
diff --git a/docs/html/guide/topics/manifest/activity-alias-element.jd b/docs/html/guide/topics/manifest/activity-alias-element.jd
index 9d81d502e46d..4521b4bddc3f 100644
--- a/docs/html/guide/topics/manifest/activity-alias-element.jd
+++ b/docs/html/guide/topics/manifest/activity-alias-element.jd
@@ -123,6 +123,10 @@ the alias in the manifest.
</p></dd>
</dl></dd>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
+
<dt>see also:</dt>
<dd><code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code></dd>
diff --git a/docs/html/guide/topics/manifest/activity-element.jd b/docs/html/guide/topics/manifest/activity-element.jd
index aba89d72cd6c..83237c61dd5b 100644
--- a/docs/html/guide/topics/manifest/activity-element.jd
+++ b/docs/html/guide/topics/manifest/activity-element.jd
@@ -19,6 +19,7 @@ page.title=&lt;activity&gt;
"singleTask" | "singleInstance"]
android:<a href="#multi">multiprocess</a>=["true" | "false"]
android:<a href="#nm">name</a>="<i>string</i>"
+ android:<a href="#nohist">noHistory</a>=["true" | "false"] <!-- ##api level 3## -->
android:<a href="#prmsn">permission</a>="<i>string</i>"
android:<a href="#proc">process</a>="<i>string</i>"
android:<a href="#screen">screenOrientation</a>=["unspecified" | "user" | "behind" |
@@ -26,7 +27,12 @@ page.title=&lt;activity&gt;
"sensor" | "nonsensor"]
android:<a href="#state">stateNotNeeded</a>=["true" | "false"]
android:<a href="#aff">taskAffinity</a>="<i>string</i>"
- android:<a href="#theme">theme</a>="<i>resource or theme</i>" &gt;
+ android:<a href="#theme">theme</a>="<i>resource or theme</i>"
+ android:<a href="#wsoft">windowSoftInputMode</a>=[<i>one or more of</i>: "stateUnspecified"
+ "stateUnchanged" "stateHidden"
+ "stateAlwaysHidden" "stateVisible"
+ "stateAlwaysVisible" "adjustUnspecified"
+ "adjustResize" "adjustPan"] &gt; <!-- ##api level 3## -->
. . .
&lt;/activity&gt;</pre></dd>
@@ -158,8 +164,8 @@ separated by '{@code |}' &mdash; for example, "{@code locale|navigation|orientat
<table>
<tr>
- <td><b>Value</b></td>
- <td><b>Description</b></td>
+ <th>Value</th>
+ <th>Description</th>
</tr><tr>
<td>"{@code mcc}"</td>
<td>The IMSI mobile country code (MCC) has changed &mdash;
@@ -212,12 +218,12 @@ is "{@code true}".
<p>
The <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element has its own
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html#enabled">enabled</a></code> attribute that applies to all
-application components, including activities. The
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> and {@code &lt;activity&gt;}
-attributes must both be "{@code true}" (as they both are by default) for
-the system to be able to instantiate the activity. If either is
-"{@code false}", it cannot be instantiated.
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#enabled">enabled</a></code>
+attribute that applies to all application components, including activities. The
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
+and {@code &lt;activity&gt;} attributes must both be "{@code true}" (as they both
+are by default) for the system to be able to instantiate the activity. If either
+is "{@code false}", it cannot be instantiated.
</p></dd>
<dt><a name="exclude"></a>{@code android:excludeFromRecents}</dt>
@@ -246,7 +252,8 @@ is intended for external use, so the default value is "{@code true}".
<p>
This attribute is not the only way to limit an activity's exposure to other
applications. You can also use a permission to limit the external entities that
-can invoke the activity (see the <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#prmsn">permission</a></code>
+can invoke the activity (see the
+<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#prmsn">permission</a></code>
attribute).
</p></dd>
@@ -257,7 +264,8 @@ home screen) &mdash; "{@code true}" if it should be shut down, and "{@code false
if not. The default value is "{@code false}".
<p>
-If this attribute and <code><a href="{@docRoot}guide/topics/manifest/activity-element.html#reparent">allowTaskReparenting</a></code>
+If this attribute and
+<code><a href="{@docRoot}guide/topics/manifest/activity-element.html#reparent">allowTaskReparenting</a></code>
are both "{@code true}", this attribute trumps the other. The affinity of the
activity is ignored. The activity is not re-parented, but destroyed.
</p>
@@ -272,14 +280,15 @@ The icon is often accompanied by a label (see the {@code label} attribute).
<p>
This attribute must be set as a reference to a drawable resource containing
the image definition. If it is not set, the icon specified for the application
-as a whole is used instead (see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
+as a whole is used instead (see the
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
element's <code><a href="{@docRoot}guide/topics/manifest/application-element.html#icon">icon</a></code> attribute).
</p>
<p>
The activity's icon &mdash; whether set here or by the
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element &mdash; is also the
-default icon for all the activity's intent filters (see the
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
+element &mdash; is also the default icon for all the activity's intent filters (see the
<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">&lt;intent-filter&gt;</a></code> element's
<code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html#icon">icon</a></code> attribute).
</p></dd>
@@ -413,6 +422,24 @@ element.
There is no default. The name must be specified.
</p></dd>
+<!-- ##api level 3## -->
+<dt><a name="nohist"></a>{@code android:noHistory}</dt>
+<dd>Whether or not the activity should be removed from the activity stack and
+finished (its <code>{@link android.app.Activity#finish finish()}</code>
+method called) when the user navigates away from it and it's no longer
+visible on screen &mdash; "{@code true}" if it should be finished, and
+"{@code false}" if not. The default value is "{@code false}".
+
+<p>
+A value of "{@code true}" means that the activity will not leave a
+historical trace. It will not remain in the activity stack for the task,
+so the user will not be able to return to it.
+</p>
+
+<p>
+This attribute was introduced in API Level 3.
+</p>
+
<dt><a name="prmsn"></a>{@code android:permission}</dt>
<dd>The name of a permission that clients must have to launch the activity
or otherwise get it to respond to an intent. If a caller of
@@ -423,9 +450,10 @@ delivered to the activity.
<p>
If this attribute is not set, the permission set by the
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element's
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html#prmsn">permission</a></code> attribute applies
-to the activity. If neither attribute is set, the activity is
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
+element's
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#prmsn">permission</a></code>
+attribute applies to the activity. If neither attribute is set, the activity is
not protected by a permission.
</p>
@@ -441,9 +469,10 @@ Permissions</a>.
<dd>The name of the process in which the activity should run. Normally,
all components of an application run in the default process created for the
application. It has the same name as the application package. The <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> element's
-<code><a href="{@docRoot}guide/topics/manifest/application-element.html#proc">process</a></code> attribute can set a different
-default for all components. But each component can override the default,
-allowing you to spread your application across multiple processes.
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#proc">process</a></code>
+attribute can set a different default for all components. But each component
+can override the default, allowing you to spread your application across
+multiple processes.
<p>
If the name assigned to this attribute begins with a colon (':'), a new
@@ -540,10 +569,14 @@ it to an empty string.
<p>
If this attribute is not set, the activity inherits the affinity set
-for the application (see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
-element's <code><a href="{@docRoot}guide/topics/manifest/application-element.html#aff">taskAffinity</a></code> attribute).
-The name of the default affinity for an application is the package name set
-by the <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code> element.
+for the application (see the
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
+element's
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#aff">taskAffinity</a></code>
+attribute). The name of the default affinity for an application is
+the package name set by the
+<code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code>
+element.
</p>
<dt><a name="theme"></a>{@code android:theme}</dt>
@@ -555,11 +588,123 @@ match what the activity actually looks like).
<p>
If this attribute is not set, the activity inherits the theme set for the
-application as a whole &mdash; see the <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
-element's <code><a href="{@docRoot}guide/topics/manifest/application-element.html#theme">theme</a></code> attribute. If that attribute is
-also not set, the default system theme is used.
+application as a whole &mdash; see the
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
+element's
+<code><a href="{@docRoot}guide/topics/manifest/application-element.html#theme">theme</a></code>
+attribute. If that attribute is also not set, the default system theme is used.
</p>
-<dd>
+<dd>
+
+<!-- ##api level 3## -->
+<dt><a name="wsoft"></a>{@code android:windowSoftInputMode}</dt>
+<dd>How the main window of the activity interacts with the window containing
+the on-screen soft keyboard. The setting for this attribute affects two
+things:
+
+<ul>
+<li>The state of the soft keyboard &mdash; whether it is hidden or visible
+&mdash; when the activity becomes the focus of user attention.</li>
+
+<li>The adjustment made to the activity's main window &mdash; whether it is
+resized smaller to make room for the soft keyboard or whether its contents
+pan to make the current focus visible when part of the window is covered by
+the soft keyboard.</li>
+</ul>
+
+<p>
+The setting must be one of the values listed in the following table, or a
+combination of one "{@code state...}" value plus one "{@code adjust...}"
+value. Setting multiple values in either group &mdash; multiple
+"{@code state...}" values, for example &mdash has undefined results.
+Individual values are separated by a vertical bar ({@code |}). For example:
+</p>
+
+<pre>&lt;activity android:windowSoftInputMode="stateVisible|adjustResize" . . . &gt;</pre>
+
+<p>
+Values set here (other than "{@code stateUnspecified}" and
+"{@code adjustUnspecified}") override values set in the theme.
+</p>
+
+<table>
+<tr>
+ <th>Value</th>
+ <th>Description</th>
+</tr><tr>
+ <td>"{@code stateUnspecified}"</td>
+ <td>The state of the soft keyboard (whether it is hidden or visible)
+ is not specified. The system will choose an appropriate state or
+ rely on the setting in the theme.
+
+ <p>
+ This is the default setting for the behavior of the soft keyboard.
+ </p></td>
+</tr></tr>
+ <td>"{@code stateUnchanged}"</td>
+ <td>The soft keyboard is kept in whatever state it was last in,
+ whether visible or hidden, when the activity comes to the fore.</td>
+</tr></tr>
+ <td>"{@code stateHidden}"</td>
+ <td>The soft keyboard is hidden when the user chooses the activity
+ &mdash; that is, when the user affirmatively navigates forward to the
+ activity, rather than backs into it because of leaving another activity.</td>
+</tr></tr>
+ <td>"{@code stateAlwaysHidden}"</td>
+ <td>The soft keyboard is always hidden when the activity's main window
+ has input focus.</td>
+</tr></tr>
+ <td>"{@code stateVisible}"</td>
+ <td>The soft keyboard is visible when that's normally appropriate
+ (when the user is navigating forward to the activity's main window).</td>
+</tr></tr>
+ <td>"{@code stateAlwaysVisible}"</td>
+ <td>The soft keyboard is made visible when the user chooses the
+ activity &mdash; that is, when the user affirmatively navigates forward
+ to the activity, rather than backs into it because of leaving another
+ activity.</td>
+</tr></tr>
+ <td>"{@code adjustUnspecified}"</td>
+ <td>It is unspecified whether the activity's main window resizes
+ to make room for the soft keyboard, or whether the contents
+ of the window pan to make the currentfocus visible on-screen.
+ The system will automatically select one of these modes depending
+ on whether the content of the window has any layout views that
+ can scroll their contents. If there is such a view, the window
+ will be resized, on the assumption that scrolling can make all
+ of the window's contents visible within a smaller area.
+
+ <p>
+ This is the default setting for the behavior of the main window.
+ </p></td>
+</tr></tr>
+ <td>"{@code adjustResize}"</td>
+ <td>The activity's main window is always resized to make room for
+ the soft keyboard on screen.</td>
+</tr></tr>
+ <td>"{@code adjustPan}"</td>
+ <td>The activity's main window is not resized to make room for the soft
+ keyboard. Rather, the contents of the window are automatically
+ panned so that the current focus is never obscured by the keyboard
+ and users can always see what they are typing. This is generally less
+ desireable than resizing, because the user may need to close the soft
+ keyboard to get at and interact with obscured parts of the window.</td>
+</tr>
+</table>
+
+<p>
+This attribute was introduced in API Level 3.
+</p></dd>
</dl></dd>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1 for all attributes except for
+<code><a href="#nohist">noHistory</a></code> and
+<code><a href="#wsoft">windowSoftInputMode</a></code>, which were added in API
+Level 3.</dd>
+
+<dt>see also:</dt>
+<dd><code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
+<br/><code><a href="{@docRoot}guide/topics/manifest/activity-alias-element.html">&lt;activity-alias&gt;</a></code></dd>
</dl> \ No newline at end of file
diff --git a/docs/html/guide/topics/manifest/application-element.jd b/docs/html/guide/topics/manifest/application-element.jd
index 362c205880f9..5b3fcd53f1da 100644
--- a/docs/html/guide/topics/manifest/application-element.jd
+++ b/docs/html/guide/topics/manifest/application-element.jd
@@ -217,6 +217,10 @@ attributes; see that attribute for more information.</dd>
</dl></dd>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
+
<dt>see also:</dt>
<dd><code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/service-element.html">&lt;service&gt;</a></code>
diff --git a/docs/html/guide/topics/manifest/category-element.jd b/docs/html/guide/topics/manifest/category-element.jd
index 50ea57674abc..b9a1aa68df65 100644
--- a/docs/html/guide/topics/manifest/category-element.jd
+++ b/docs/html/guide/topics/manifest/category-element.jd
@@ -29,7 +29,11 @@ the string value for {@code CATEGORY_LAUNCHER} is
Custom categories should use the package name as a prefix, to ensure
that they are unique.
</p></dd>
-</dl></dd>
+</dl></dd>
+
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
<dt>see also:</dt>
<dd><code><a href="{@docRoot}guide/topics/manifest/action-element.html">&lt;action&gt;</a></code>
diff --git a/docs/html/guide/topics/manifest/data-element.jd b/docs/html/guide/topics/manifest/data-element.jd
index 5d8fde25b08d..b48c5e043247 100644
--- a/docs/html/guide/topics/manifest/data-element.jd
+++ b/docs/html/guide/topics/manifest/data-element.jd
@@ -72,12 +72,21 @@ section in the introduction.
<dd>The host part of a URI authority. This attribute is meaningless
unless a <code><a href="{@docRoot}guide/topics/manifest/data-element.html#scheme">scheme</a></code> attribute is also
specified for the filter.
+
+<p class="note">Note: host name matching in the Android framework is
+case-sensitive, unlike the formal RFC. As a result, you should always specify
+host names using lowercase letters.</p>
</dd>
<dt><a name="mime"></a>{@code android:mimeType}</dt>
<dd>A MIME media type, such as {@code image/jpeg} or {@code audio/mpeg4-generic}.
The subtype can be the asterisk wildcard ({@code *}) to indicate that any
-subtype matches.</dd>
+subtype matches.
+
+<p class="note">Note: MIME type matching in the Android framework is
+case-sensitive, unlike formal RFC MIME types. As a result, you should always
+specify MIME types using lowercase letters.</p>
+</dd>
<dt><a name="path"></a>{@code android:path}
<br/>{@code android:pathPrefix}
@@ -138,9 +147,18 @@ A scheme is specified without the trailing colon (for example,
If the filter has a data type set (the <code><a href="{@docRoot}guide/topics/manifest/data-element.html#mime">mimeType</a></code>
attribute) but no scheme, the {@code content:} and {@code file:} schemes are
assumed.
-</p></dd>
+</p>
+
+<p class="note">Note: scheme matching in the Android framework is
+case-sensitive, unlike the RFC. As a result, you should always specify schemes
+using lowercase letters.</p>
+</dd>
</dl></dd>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
+
<dt>see also:</dt>
<dd><code><a href="{@docRoot}guide/topics/manifest/action-element.html">&lt;action&gt;</a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/category-element.html">&lt;category&gt;</a></code></dd>
diff --git a/docs/html/guide/topics/manifest/grant-uri-permission-element.jd b/docs/html/guide/topics/manifest/grant-uri-permission-element.jd
index f5b37b5364b2..9dafe8514f12 100644
--- a/docs/html/guide/topics/manifest/grant-uri-permission-element.jd
+++ b/docs/html/guide/topics/manifest/grant-uri-permission-element.jd
@@ -74,6 +74,10 @@ For more information on these types of patterns, see the descriptions of
</p></dd>
</dl></dd>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
+
<dt>see also:</dt>
<dd>the
<code><a href="{@docRoot}guide/topics/manifest/provider-element.html#gprmns">grantUriPermissions</a></code>
diff --git a/docs/html/guide/topics/manifest/instrumentation-element.jd b/docs/html/guide/topics/manifest/instrumentation-element.jd
index fdec949594eb..1fd1dd0b2db9 100644
--- a/docs/html/guide/topics/manifest/instrumentation-element.jd
+++ b/docs/html/guide/topics/manifest/instrumentation-element.jd
@@ -51,6 +51,10 @@ name specified in the <code><a href="{@docRoot}guide/topics/manifest/manifest-el
There is no default. The name must be specified.
</p></dd>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
+
<dt><a name="trgt"></a>{@code android:targetPackage}</dt>
<dd>The application that the Instrumentation object will run against.
An application is identified by the package name assigned in its manifest
diff --git a/docs/html/guide/topics/manifest/intent-filter-element.jd b/docs/html/guide/topics/manifest/intent-filter-element.jd
index 58d1f9114426..2b1322c5021f 100644
--- a/docs/html/guide/topics/manifest/intent-filter-element.jd
+++ b/docs/html/guide/topics/manifest/intent-filter-element.jd
@@ -122,6 +122,10 @@ higher priority.
</dl></dd>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
+
<dt>see also:</dt>
<dd><code><a href="{@docRoot}guide/topics/manifest/action-element.html">&lt;action&gt;</a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/category-element.html">&lt;category&gt;</a></code>
diff --git a/docs/html/guide/topics/manifest/manifest-element.jd b/docs/html/guide/topics/manifest/manifest-element.jd
index 02023909fee4..a9d10906add0 100644
--- a/docs/html/guide/topics/manifest/manifest-element.jd
+++ b/docs/html/guide/topics/manifest/manifest-element.jd
@@ -6,6 +6,7 @@ page.title=&lt;manifest&gt;
<dd><pre class="stx">&lt;manifest xmlns:<a href="#nspace">android</a>="http://schemas.android.com/apk/res/android"
<a href="#package">package</a>="<i>string</i>"
android:<a href="#uid">sharedUserId</a>="<i>string</i>"
+ android:<a href="#uidlabel">sharedUserLabel</a>="<i>string resource</i>" <!-- ##api level 3## -->
android:<a href="#vcode">versionCode</a>="<i>integer</i>"
android:<a href="#vname">versionName</a>="<i>string</i>" &gt;
. . .
@@ -25,7 +26,8 @@ page.title=&lt;manifest&gt;
<br/><code><a href="{@docRoot}guide/topics/manifest/permission-element.html">&lt;permission&gt;</a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/permission-group-element.html">&lt;permission-group&gt;</a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/permission-tree-element.html">&lt;permission-tree&gt;</a></code>
-<br/><code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">&lt;uses-permission&gt;</a></code>
+<br/><code><a href="{@docRoot}guide/topics/manifest/uses-configuration-element.html">&lt;uses-configuration&gt;</a></code> <!-- ##api level 3## -->
+<br/><code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">&lt;uses-permission&gt;</a></code></dd>
<br/><code><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">&lt;uses-sdk&gt;</a></code></dd>
<p>
@@ -64,7 +66,17 @@ By default, Android assigns each application its own unique user ID.
However, if this attribute is set to the same value for two or more applications,
they will all share the same ID &mdash; provided that they are also signed
by the same certificate. Application with the same user ID can access each
-other's data and, if desired, run in the same process.</dd>
+other's data and, if desired, run in the same process.</dd>
+
+<dt><a name="uidlabel"></a>{@code android:sharedUserLabel}</dt>
+<dd>A user-readable label for the shared user ID. The label must be set as
+a reference to a string resource; it cannot be a raw string.
+
+<p>
+<!-- ##api level indication## -->
+This attribute was introduced in API Level 3. It is meaningful only if the
+<code><a href="#uid">sharedUserId</a></code> attribute is also set.
+</p></dd>
<dt><a name="vcode"></a>{@code android:versionCode}</dt>
<dd>An internal version number. This number is used only to determine whether
@@ -88,6 +100,12 @@ than to be displayed to users. The {@code versionCode} attribute holds
the significant version number used internally.
</dl></dd>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1 for all attributes except for
+<code><a href="#uidlabel">sharedUserLabel</a></code>, which was added in
+level 3.</dd>
+
<p>
<dt>see also:</dt>
<dd><code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code></dd>
diff --git a/docs/html/guide/topics/manifest/manifest-intro.jd b/docs/html/guide/topics/manifest/manifest-intro.jd
index aa14308d3898..190702451f8d 100644
--- a/docs/html/guide/topics/manifest/manifest-intro.jd
+++ b/docs/html/guide/topics/manifest/manifest-intro.jd
@@ -115,6 +115,7 @@ other mention of the element name.
<a href="{@docRoot}guide/topics/manifest/provider-element.html">&lt;/provider&gt;</a>
<a href="{@docRoot}guide/topics/manifest/uses-library-element.html">&lt;uses-library /&gt;</a>
+ <a href="{@docRoot}guide/topics/manifest/uses-configuration-element.html">&lt;uses-configuration /&gt;</a> <!-- ##api level 3## -->
<a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;/application&gt;</a>
@@ -145,6 +146,7 @@ add your own elements or attributes.
<br/><code><a href="{@docRoot}guide/topics/manifest/provider-element.html">&lt;provider&gt;</a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/receiver-element.html">&lt;receiver&gt;</a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/service-element.html">&lt;service&gt;</a></code>
+<br/><code><a href="{@docRoot}guide/topics/manifest/uses-configuration-element.html">&lt;uses-configuration&gt;</a></code> <!-- ##api level 3## -->
<br/><code><a href="{@docRoot}guide/topics/manifest/uses-library-element.html">&lt;uses-library&gt;</a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">&lt;uses-permission&gt;</a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html">&lt;uses-sdk&gt;</a></code>
diff --git a/docs/html/guide/topics/manifest/meta-data-element.jd b/docs/html/guide/topics/manifest/meta-data-element.jd
index 1c914077e773..101b05a4987e 100644
--- a/docs/html/guide/topics/manifest/meta-data-element.jd
+++ b/docs/html/guide/topics/manifest/meta-data-element.jd
@@ -87,4 +87,8 @@ to the item. The ID can be retrieved from the meta-data Bundle by the
</dd>
</dl></dd>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
+
</dl>
diff --git a/docs/html/guide/topics/manifest/permission-element.jd b/docs/html/guide/topics/manifest/permission-element.jd
index 6eef081b2318..ad64d5dd31f7 100644
--- a/docs/html/guide/topics/manifest/permission-element.jd
+++ b/docs/html/guide/topics/manifest/permission-element.jd
@@ -122,6 +122,10 @@ The value can be set to one of the following strings:
</dd>
</dl></dd>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
+
<dt>see also:</dt>
<dd><code><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">&lt;uses-permission&gt;</a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/permission-tree-element.html">&lt;permission-tree&gt;</a></code>
diff --git a/docs/html/guide/topics/manifest/permission-group-element.jd b/docs/html/guide/topics/manifest/permission-group-element.jd
index 9cfca6edac75..0ad76a68044f 100644
--- a/docs/html/guide/topics/manifest/permission-group-element.jd
+++ b/docs/html/guide/topics/manifest/permission-group-element.jd
@@ -51,6 +51,10 @@ element's
attribute.</dd>
</dl></dd>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
+
<dt>see also:</dt>
<dd><code><a href="{@docRoot}guide/topics/manifest/permission-element.html">&lt;permission&gt;</a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/permission-tree-element.html">&lt;permission-tree&gt;</a></code>
diff --git a/docs/html/guide/topics/manifest/permission-tree-element.jd b/docs/html/guide/topics/manifest/permission-tree-element.jd
index e2f7474258a1..3074354c773e 100644
--- a/docs/html/guide/topics/manifest/permission-tree-element.jd
+++ b/docs/html/guide/topics/manifest/permission-tree-element.jd
@@ -51,7 +51,10 @@ two period-separated seqments in its path &mdash; for example,
</dl></dd>
-<p>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
+
<dt>see also:</dt>
<dd><code><a href="{@docRoot}guide/topics/manifest/permission-element.html">&lt;permission&gt;</a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/permission-group-element.html">&lt;permission-group&gt;</a></code>
diff --git a/docs/html/guide/topics/manifest/provider-element.jd b/docs/html/guide/topics/manifest/provider-element.jd
index 7359e5039562..2bb4ff40f03b 100644
--- a/docs/html/guide/topics/manifest/provider-element.jd
+++ b/docs/html/guide/topics/manifest/provider-element.jd
@@ -260,7 +260,10 @@ See also the <code><a href="#prmsn">permission</a></code> and
</dl></dd>
-<p>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
+
<dt>see also:</dt>
<dd><a href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a></dd>
diff --git a/docs/html/guide/topics/manifest/receiver-element.jd b/docs/html/guide/topics/manifest/receiver-element.jd
index 8df6273bbf99..280d40243b84 100644
--- a/docs/html/guide/topics/manifest/receiver-element.jd
+++ b/docs/html/guide/topics/manifest/receiver-element.jd
@@ -17,7 +17,7 @@ page.title=&lt;receiver&gt;
<dd><code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code></dd>
<dt>can contain:</dt>
-<dd><code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">&lt;intent-filter&gt;</a></code>
+<dd><code><a href="{@docRoot}guide/topics/manifest/intent-filter-element.html">&lt;intent-filer&gt;</a></code>
<br/><code><a href="{@docRoot}guide/topics/manifest/meta-data-element.html">&lt;meta-data&gt;</a></code></dd>
<dt>description:</dt>
@@ -47,16 +47,10 @@ The <code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt
<code><a href="{@docRoot}guide/topics/manifest/application-element.html#enabled">enabled</a></code> attribute that applies to all
application components, including broadcast receivers. The
<code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code> and
-{@code &lt;receiver&gt;} elements must both set {@code android:enabled} equal to
-"{@code true}" for the broadcast receiver to be enabled. If either is "{@code false}",
-the receiver is disabled and cannot be instantiated.
-</p>
-
-<p>
-The default value depends on whether the broadcast receiver contains intent filters.
-If any intent filters are specified, the default value is "{@code true}". If no
-filters are specified, the default value is "{@code false}".
-</dd>
+{@code &lt;receiver&gt;} attributes must both be "{@code true}" for
+the broadcast receiver to be enabled. If either is "{@code false}", it is
+disabled; it cannot be instantiated.
+</p></dd>
<dt><a name="exported"></a>{@code android:exported}</dt>
<dd>Whether or not the broadcast receiver can receive messages from sources
@@ -123,12 +117,9 @@ it can also be set as a raw string.
{@link android.content.BroadcastReceiver}. This should be a fully qualified
class name (such as, "{@code com.example.project.ReportReceiver}"). However,
as a shorthand, if the first character of the name is a period (for example,
-"{@code .ReportReceiver}"), it is appended to the package name specified in
+"{@code . ReportReceiver}"), it is appended to the package name specified in
the <code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code> element.
-<p>The {@link android.content.BroadcastReceiver} subclass can be a static inner
-class, although it cannot be an ordinary (non-static) inner class.
-
<p>
There is no default. The name must be specified.
</p></dd>
@@ -170,4 +161,8 @@ resource usage.
</p></dd>
</dl></dd>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
+
</dl>
diff --git a/docs/html/guide/topics/manifest/service-element.jd b/docs/html/guide/topics/manifest/service-element.jd
index ad65abeae791..e5ac7b58148a 100644
--- a/docs/html/guide/topics/manifest/service-element.jd
+++ b/docs/html/guide/topics/manifest/service-element.jd
@@ -173,4 +173,8 @@ resource usage.
<dd><code><a href="{@docRoot}guide/topics/manifest/application-element.html">&lt;application&gt;</a></code>
<br><code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code></dd>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
+
</dl>
diff --git a/docs/html/guide/topics/manifest/uses-configuration-element.jd b/docs/html/guide/topics/manifest/uses-configuration-element.jd
new file mode 100755
index 000000000000..b26881e1f084
--- /dev/null
+++ b/docs/html/guide/topics/manifest/uses-configuration-element.jd
@@ -0,0 +1,176 @@
+page.title=&lt;uses-configuration&gt;
+@jd:body
+
+<!-- ##api level 3## see comment below -->
+
+<!-- the "no___" values are nonsensical if they mean "doesn't work on devices with a
+keyboard / navigation control / touch screen." Dianne says that that's what they mean and
+that they therefore should be eliminated. Suchi says that they mean "doesn't require a
+keyboard / navigation control / touch screen to work." But then what does "undefined" mean?
+Seems like some API change is in the works, either eliminating the "no___" values or
+"undefined". Since it's unclear what the change will be, I've chosen to document the "no___"
+and "undefined" attributes using the same language, which is surely wrong but may make it
+easier to update the doc when the change is made. -->
+
+<dl class="xml">
+<dt>syntax:</dt>
+<dd><pre class="stx">&lt;uses-configuration android:<a href="#five">reqFiveWayNav</a>=["true" | "false"]
+ android:<a href="#hard">reqHardKeyboard</a>=["true" | "false"]
+ android:<a href="#kbd">reqKeyboardType</a>=["undefined" | "nokeys" | "qwerty" |
+ "twelvekey"]
+ android:<a href="#nav">reqNavigation</a>=["undefined" | "nonav" | "dpad" |
+ "trackball" | "wheel"]
+ android:<a href="#touch">reqTouchScreen</a>=["undefined" | "notouch" | "stylus" |
+ "finger"] /&gt;</pre></dd>
+
+<dt>contained in:</dt>
+<dd><code><a href="{@docRoot}guide/topics/manifest/manifest-element.html">&lt;manifest&gt;</a></code></dd>
+
+<dt>description:</dt>
+<dd>Indicates what hardware and software features the application requires.
+For example, an application might specify that it requires a physical keyboard
+or a particular navigation device, like a trackball. The specification is
+used to avoid installing the application on devices where it will not work.
+
+<p>
+If an application can work with different device configurations, it
+should include separate {@code &lt;uses-configuration&gt;} declarations for
+each one. Each declaration must be complete. For example, if an application
+requires a five-way navigation control, a touch screen that can be operated
+with a finger, and either a standard QWERTY keyboard or a numeric 12-key
+keypad like those found on most phones, it would specify these requirements
+with two {@code &lt;uses-configuration&gt;} elements as follows:
+</p>
+
+<pre>&lt;uses-configuration android:reqFiveWayNav="true" android:reqTouchScreen="finger"
+ android:reqKeyboardType="qwerty" /&gt;
+&lt;uses-configuration android:reqFiveWayNav="true" android:reqTouchScreen="finger"
+ android:reqKeyboardType="twelvekey" /&gt;</pre></dd>
+
+<dt>attributes:</dt>
+<dd><dl class="attr">
+<dt><a name="five"></a>{@code android:reqFiveWayNav}</dt>
+<dd>Whether or not the application requires a five-way navigation control
+&mdash; "{@code true}" if it does, and "{@code false}" if not. A five-way
+control is one that can move the selection up, down, right, or left, and
+also provides a way of invoking the current selection. It could be a
+D-pad (directional pad), trackball, or other device.
+
+<p>
+If an application requires a directional control, but not a control of a
+particular type, it can set this attribute to "{@code true}" and ignore
+the <code><a href="#nav">reqNavigation</a></code> attribute. However,
+if it requires a particular type of directional control, it can ignore
+this attribute and set {@code reqNavigation} instead.
+</p></dd>
+
+<dt><a name="hard"></a>{@code android:reqHardKeyboard}</dt>
+<dd>Whether or not the application requires a hardware keyboard &mdash;
+"{@code true}" if it does, and "{@code false}" if not.</dd>
+
+<dt><a name="kbd"></a>{@code android:reqKeyboardType}</dt>
+<dd>The type of keyboard the application requires, if any at all.
+This attribute does not distinguish between hardware and software
+keyboards. If a hardware keyboard of a certain type is required,
+specify the type here and also set the {@code reqHardKeyboard} attribute
+to "{@code true}".
+
+<p>
+The value must be one of the following strings:
+</p>
+
+<table>
+<tr>
+ <th>Value</th>
+ <th>Description</th>
+</tr><tr>
+ <td>"{@code undefined}"</td>
+ <td>The application does not require a keyboard.
+ (A keyboard requirement is not defined.)
+ This is the default value.</td>
+</tr><tr>
+ <td>"{@code nokeys}"</td>
+ <td>The application does not require a keyboard.</td>
+</tr><tr>
+ <td>"{@code qwerty}"</td>
+ <td>The application requires a standard QWERTY keyboard.</td>
+</tr><tr>
+ <td>"{@code twelvekey}"</td>
+ <td>The application requires a twelve-key keypad, like those on most
+ phones &mdash; with keys for the digits from {@code 0} through
+ {@code 9} plus star ({@code *}) and pound ({@code #}) keys.</td>
+</tr>
+</table></dd>
+
+<dt><a name="nav"></a>{@code android:reqNavigation}</dt>
+<dd>The navigation device required by the application, if any. The value
+must be one of the following strings:
+
+<table>
+<tr>
+ <th>Value</th>
+ <th>Description</th>
+</tr><tr>
+ <td>"{@code undefined}"</td>
+ <td>The application does not require any type of navigation control.
+ (The navigation requirement is not defined.)
+ This is the default value.</td>
+</tr><tr>
+ <td>"{@code nonav}"</td>
+ <td>The application does not require a navigation control.</td>
+</tr><tr>
+ <td>"{@code dpad}"</td>
+ <td>The application requires a D-pad (directional pad) for navigation.</td>
+</tr><tr>
+ <td>"{@code trackball}"</td>
+ <td>The application requires a trackball for navigation.</td>
+</tr><tr>
+ <td>"{@code wheel}"</td>
+ <td>The application requires a navigation wheel.</td>
+</tr>
+</table>
+
+<p>
+If an application requires a navigational control, but the exact type of
+control doesn't matter, it can set the
+<code><a href="#five">reqFiveWayNav</a></code> attribute to "{@code true}"
+rather than set this one.
+</p></dd>
+
+<dt><a name="touch"></a>{@code android:reqTouchScreen}</dt>
+<dd>The type of touch screen the application requires, if any at all.
+The value must be one of the following strings:
+
+<table>
+<tr>
+ <th>Value</th>
+ <th>Description</th>
+</tr><tr>
+ <td>"{@code undefined}"</td>
+ <td>The application doesn't require a touch screen.
+ (The touch screen requirement is undefined.)
+ This is the default value.</td>
+</tr><tr>
+ <td>"{@code notouch}"</td>
+ <td>The application doesn't require a touch screen.</td>
+</tr><tr>
+ <td>"{@code stylus}"</td>
+ <td>The application requires a touch screen that's operated with a stylus.</td>
+</tr><tr>
+ <td>"{@code finger}"</td>
+ <td>The application requires a touch screen that can be operated with a finger.</td>
+</tr>
+</table></dd>
+</dl></dd>
+
+<!-- ##api level 3## -->
+<dt>introduced in:</dt>
+<dd>API Level 3</dd>
+
+<dt>see also:</dt>
+<dd><code><a href="{@docRoot}guide/topics/manifest/activity-element.html#config">configChanges</a></code>
+attribute of the
+<code><a href="{@docRoot}guide/topics/manifest/activity-element.html">&lt;activity&gt;</a></code>
+element</dd>
+
+</dl>
diff --git a/docs/html/guide/topics/manifest/uses-library-element.jd b/docs/html/guide/topics/manifest/uses-library-element.jd
index d66da2c79225..f1b5e70ff7ec 100644
--- a/docs/html/guide/topics/manifest/uses-library-element.jd
+++ b/docs/html/guide/topics/manifest/uses-library-element.jd
@@ -29,4 +29,8 @@ contains the package code.
<dd>The name of the library.</dd>
</dl></dd>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
+
</dl>
diff --git a/docs/html/guide/topics/manifest/uses-permission-element.jd b/docs/html/guide/topics/manifest/uses-permission-element.jd
index 07741b15d1e0..aec765ca6969 100644
--- a/docs/html/guide/topics/manifest/uses-permission-element.jd
+++ b/docs/html/guide/topics/manifest/uses-permission-element.jd
@@ -33,6 +33,10 @@ a permission name typically includes the package name as a prefix.</dd>
</dl></dd>
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
+
<dt>see also:</dt>
<dd><code><a href="{@docRoot}guide/topics/manifest/permission-element.html">&lt;permission&gt;</a></code></dd>
diff --git a/docs/html/guide/topics/manifest/uses-sdk-element.jd b/docs/html/guide/topics/manifest/uses-sdk-element.jd
index e62af68b4539..b6e73746cfd6 100644
--- a/docs/html/guide/topics/manifest/uses-sdk-element.jd
+++ b/docs/html/guide/topics/manifest/uses-sdk-element.jd
@@ -58,4 +58,8 @@ in the <code>minSdkVersion</code> attribute.</p>
</dl></dd>
-</dl> \ No newline at end of file
+<!-- ##api level indication## -->
+<dt>introduced in:</dt>
+<dd>API Level 1</dd>
+
+</dl>
diff --git a/docs/html/guide/topics/media/index.jd b/docs/html/guide/topics/media/index.jd
index ba6d89f675cc..4541024111b9 100644
--- a/docs/html/guide/topics/media/index.jd
+++ b/docs/html/guide/topics/media/index.jd
@@ -44,14 +44,13 @@ can play audio or video from media files stored in the application's resources
arriving over a network connection. To play audio or video from your
application, use the {@link android.media.MediaPlayer} class.</p>
-<p>The platform also lets you record audio, where supported by the mobile device
-hardware. Recording of video is not currently supported, but is planned for a
-future release. To record audio, use the
-{@link android.media.MediaRecorder} class. Note that the emulator doesn't have
-hardware to capture audio, but actual mobile devices are likely to provide these
-capabilities that you can access through MediaRecorder. </p>
-
-<p>For a list of the media formats for which Android offers built-in support,
+<p>The platform also lets you record audio and video, where supported by the
+mobile device hardware. To record audio or video, use the {@link
+android.media.MediaRecorder} class. Note that the emulator doesn't have hardware
+to capture audio or video, but actual mobile devices are likely to provide these
+capabilities, accessible through the MediaRecorder class. </p>
+
+<p>For a list of media formats for which Android offers built-in support,
see the <a href="{@docRoot}guide/appendix/media-formats.html">Android Media
Formats</a> appendix. </p>
diff --git a/docs/html/sdk/terms.jd b/docs/html/sdk/terms.jd
index b3c5ea253cc4..614a438ef17c 100644
--- a/docs/html/sdk/terms.jd
+++ b/docs/html/sdk/terms.jd
@@ -8,7 +8,7 @@ hide_license_footer=true
1. Introduction
</h2>
<p>
- 1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google Services add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK.
+ 1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK.
</p>
<p>
@@ -46,7 +46,7 @@ hide_license_footer=true
</p>
<p>
- 3.3. Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. Except to the extent required by applicable third party licenses, you may not load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK.
+ 3.3 Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. Except to the extent required by applicable third party licenses, you may not load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK.
</p>
<p>
3.4 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement.
diff --git a/docs/html/sdk/terms_body.html b/docs/html/sdk/terms_body.html
index a73801f06f86..03e09066d98c 100644
--- a/docs/html/sdk/terms_body.html
+++ b/docs/html/sdk/terms_body.html
@@ -5,7 +5,7 @@
1. Introduction
</h2>
<p>
- 1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google Services add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK.
+ 1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK.
</p>
<p>
@@ -43,7 +43,7 @@
</p>
<p>
- 3.3. Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. Except to the extent required by applicable third party licenses, you may not load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK.
+ 3.3 Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. Except to the extent required by applicable third party licenses, you may not load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK.
</p>
<p>
3.4 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement.
@@ -201,4 +201,4 @@
</p>
<p>
<em>April 10, 2009</em>
-</p> \ No newline at end of file
+</p>
diff --git a/media/java/android/media/SoundPool.java b/media/java/android/media/SoundPool.java
index 000430f96b63..ab3274b1aa66 100644
--- a/media/java/android/media/SoundPool.java
+++ b/media/java/android/media/SoundPool.java
@@ -26,8 +26,57 @@ import android.content.Context;
import android.content.res.AssetFileDescriptor;
import java.io.IOException;
-/*
+/**
* The SoundPool class manages and plays audio resources for applications.
+ *
+ * <p>A SoundPool is a collection of samples that can be loaded into memory
+ * from a resource inside the APK or from a file in the file system. The
+ * SoundPool library uses the MediaPlayer service to decode the audio
+ * into a raw 16-bit PCM mono or stereo stream. This allows applications
+ * to ship with compressed streams without having to suffer the CPU load
+ * and latency of decompressing during playback.</p>
+ *
+ * <p>In addition to low-latency playback, SoundPool can also manage the number
+ * of audio streams being rendered at once. When the SoundPool object is
+ * constructed, the maxStreams parameter sets the maximum number of streams
+ * that can be played at a time from this single SoundPool. SoundPool tracks
+ * the number of active streams. If the maximum number of streams is exceeded,
+ * SoundPool will automatically stop a previously playing stream based first
+ * on priority and then by age within that priority. Limiting the maximum
+ * number of streams helps to cap CPU loading and reducing the likelihood that
+ * audio mixing will impact visuals or UI performance.</p>
+ *
+ * <p>Priority runs low to high, i.e. higher numbers are higher priority.
+ * Priority is used when a call to play() would cause the number of active
+ * streams to exceed the value established by the maxStreams parameter when
+ * the SoundPool was created. In this case, the stream allocator will stop
+ * the lowest priority stream. If there are multiple streams with the same
+ * low priority, it will choose the oldest stream to stop. In the case
+ * where the priority of the new stream is lower than all the active
+ * streams, the new sound will not play and the play() function will return
+ * a streamID of zero.</p>
+ *
+ * <p>Let's examine a typical use case: A game consists of several levels of
+ * play. For each level, there is a set of unique sounds that are used only
+ * by that level. In this case, the game logic should create a new SoundPool
+ * object when the first level is loaded. The level data itself might contain
+ * the list of sounds to be used by this level. The loading logic iterates
+ * through the list of sounds calling the appropriate SoundPool.load()
+ * function. This should typically be done early in the process to allow time
+ * for decompressing the audio to raw PCM format before they are needed for
+ * playback.</p>
+ *
+ * <p>Once the sounds are loaded and play has started, the application can
+ * trigger sounds by calling SoundPool.play(). Playing streams can be
+ * paused or resumed, and the application can also alter the pitch by
+ * adjusting the playback rate in real-time for doppler or synthesis
+ * effects.</p>
+ *
+ * <p>In our example, when the player has completed the level, the game
+ * logic should call SoundPool.release() to release all the native resources
+ * in use and then set the SoundPool reference to null. If the player starts
+ * another level, a new SoundPool is created, sounds are loaded, and play
+ * resumes.</p>
*/
public class SoundPool
{
@@ -37,10 +86,30 @@ public class SoundPool
private int mNativeContext; // accessed by native methods
+ /**
+ * Constructor. Constructs a SoundPool object with the following
+ * characteristics:
+ *
+ * @param maxStreams the maximum number of simultaneous streams for this
+ * SoundPool object
+ * @param streamType the audio stream type as described in AudioManager
+ * For example, game applications will normally use
+ * {@link AudioManager#STREAM_MUSIC}.
+ * @param srcQuality the sample-rate converter quality. Currently has no
+ * effect. Use 0 for the default.
+ * @return a SoundPool object, or null if creation failed
+ */
public SoundPool(int maxStreams, int streamType, int srcQuality) {
native_setup(new WeakReference<SoundPool>(this), maxStreams, streamType, srcQuality);
}
+ /**
+ * Load the sound from the specified path
+ *
+ * @param path the path to the audio file
+ * @param priority the priority of the sound. Currently has no effect.
+ * @return a sound ID. This value can be used to play or unload the sound.
+ */
public int load(String path, int priority)
{
// pass network streams to player
@@ -63,6 +132,20 @@ public class SoundPool
return id;
}
+ /**
+ * Load the sound from the specified APK resource
+ *
+ * <p>Note that the extension is dropped. For example, if you want to load
+ * a sound from the raw resource file "explosion.mp3", you would specify
+ * "R.raw.explosion" as the resource ID. Note that this means you cannot
+ * have both an "explosion.wav" and an "explosion.mp3" in the res/raw
+ * directory.</p>
+ *
+ * @param context the application context
+ * @param resId the resource ID
+ * @param priority the priority of the sound. Currently has no effect.
+ * @return a sound ID. This value can be used to play or unload the sound.
+ */
public int load(Context context, int resId, int priority) {
AssetFileDescriptor afd = context.getResources().openRawResourceFd(resId);
int id = 0;
@@ -78,6 +161,13 @@ public class SoundPool
return id;
}
+ /**
+ * Load the sound from an asset file descriptor
+ *
+ * @param afd an asset file descriptor
+ * @param priority the priority of the sound. Currently has no effect.
+ * @return a sound ID. This value can be used to play or unload the sound.
+ */
public int load(AssetFileDescriptor afd, int priority) {
if (afd != null) {
long len = afd.getLength();
@@ -90,6 +180,19 @@ public class SoundPool
}
}
+ /**
+ * Load the sound from a FileDescriptor
+ *
+ * <p>This version is useful if you store multiple sounds in a single
+ * binary. The offset specifies the offset from the start of the file
+ * and the length specifies the length of the sound within the file.</p>
+ *
+ * @param fd a FileDescriptor object
+ * @param offset offset to the start of the sound
+ * @param length length of the sound
+ * @param priority the priority of the sound. Currently has no effect.
+ * @return a sound ID. This value can be used to play or unload the sound.
+ */
public int load(FileDescriptor fd, long offset, long length, int priority) {
return _load(fd, offset, length, priority);
}
@@ -98,22 +201,107 @@ public class SoundPool
private native final int _load(FileDescriptor fd, long offset, long length, int priority);
+ /**
+ * Unload a sound from a sound ID
+ *
+ * <p>Unloads the sound specified by the soundID. This is the value
+ * returned by the load() function. Returns true if the sound is
+ * successfully unloaded, false if the sound was already unloaded.</p>
+ *
+ * @param soundID a soundID returned by the load() function
+ * @return true if just unloaded, false if previously unloaded
+ */
public native final boolean unload(int soundID);
+ /**
+ * Play a sound from a sound ID
+ *
+ * <p>Play the sound specified by the soundID. This is the value
+ * returned by the load() function. Returns a non-zero streamID
+ * if successful, zero if it fails. The streamID can be used to
+ * further control playback. Note that calling play() may cause
+ * another sound to stop playing if the maximum number of active
+ * streams is exceeded.</p>
+ *
+ * @param soundID a soundID returned by the load() function
+ * @return non-zero streamID if successful, zero if failed
+ */
public native final int play(int soundID, float leftVolume, float rightVolume,
int priority, int loop, float rate);
+ /**
+ * Pause a playback stream
+ *
+ * <p>Pause the stream specified by the streamID. This is the
+ * value returned by the play() function. If the stream is
+ * playing, it will be paused. If the stream is not playing
+ * (e.g. is stopped or was previously paused), calling this
+ * function will have no effect.</p>
+ *
+ * @param streamID a streamID returned by the play() function
+ */
public native final void pause(int streamID);
+ /**
+ * Resume a playback stream
+ *
+ * <p>Resume the stream specified by the streamID. This
+ * is the value returned by the play() function. If the stream
+ * is paused, this will resume playback. If the stream was not
+ * previously paused, calling this function will have no effect.</p>
+ *
+ * @param streamID a streamID returned by the play() function
+ */
public native final void resume(int streamID);
+ /**
+ * Stop a playback stream
+ *
+ * <p>Stop the stream specified by the streamID. This
+ * is the value returned by the play() function. If the stream
+ * is playing, it will be stopped. It also releases any native
+ * resources associated with this stream. If the stream is not
+ * playing, it will have no effect.</p>
+ *
+ * @param streamID a streamID returned by the play() function
+ */
public native final void stop(int streamID);
+ /**
+ * Set stream volume
+ *
+ * <p>Sets the volume on the stream specified by the streamID.
+ * This is the value returned by the play() function. The
+ * value must be in the range of 0.0 to 1.0. If the stream does
+ * not exist, it will have no effect.</p>
+ *
+ * @param streamID a streamID returned by the play() function
+ * @param leftVolume left volume value (range = 0.0 to 1.0)
+ * @param rightVolume right volume value (range = 0.0 to 1.0)
+ */
public native final void setVolume(int streamID,
float leftVolume, float rightVolume);
+ /**
+ * Change stream priority
+ *
+ * <p>Change the priority of the stream specified by the streamID.
+ * This is the value returned by the play() function. Affects the
+ * order in which streams are re-used to play new sounds.
+ *
+ * @param streamID a streamID returned by the play() function
+ */
public native final void setPriority(int streamID, int priority);
+ /**
+ * Change stream priority
+ *
+ * <p>Change the priority of the stream specified by the streamID.
+ * This is the value returned by the play() function. Affects the
+ * order in which streams are re-used to play new sounds.
+ *
+ * @param streamID a streamID returned by the play() function
+ */
public native final void setLoop(int streamID, int loop);
public native final void setRate(int streamID, float rate);
diff --git a/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java b/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java
index 09a17f5eaa42..f9015d92dce2 100644
--- a/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java
+++ b/telephony/java/com/android/internal/telephony/gsm/SIMRecords.java
@@ -1099,14 +1099,9 @@ public final class SIMRecords extends IccRecords {
// Note: Data may include trailing FF's. That's OK; message
// should still parse correctly.
- byte[] nba = new byte[n - 1];
- System.arraycopy(ba, 1, nba, 0, n - 1);
-
- String pdu = IccUtils.bytesToHexString(nba);
- // XXX first line is bogus
- SmsMessage message = SmsMessage.newFromCMT(
- new String[] { "", pdu });
-
+ byte[] pdu = new byte[n - 1];
+ System.arraycopy(ba, 1, pdu, 0, n - 1);
+ SmsMessage message = SmsMessage.createFromPdu(pdu);
((GSMPhone) phone).mSMS.dispatchMessage(message);
}
@@ -1130,14 +1125,9 @@ public final class SIMRecords extends IccRecords {
// Note: Data may include trailing FF's. That's OK; message
// should still parse correctly.
- byte[] nba = new byte[n - 1];
- System.arraycopy(ba, 1, nba, 0, n - 1);
-
- String pdu = IccUtils.bytesToHexString(nba);
- // XXX first line is bogus
- SmsMessage message = SmsMessage.newFromCMT(
- new String[] { "", pdu });
-
+ byte[] pdu = new byte[n - 1];
+ System.arraycopy(ba, 1, pdu, 0, n - 1);
+ SmsMessage message = SmsMessage.createFromPdu(pdu);
((GSMPhone) phone).mSMS.dispatchMessage(message);
@@ -1499,6 +1489,3 @@ public final class SIMRecords extends IccRecords {
}
}
-
-
-
diff --git a/tests/AndroidTests/src/com/android/unit_tests/BitwiseStreamsTest.java b/tests/AndroidTests/src/com/android/unit_tests/BitwiseStreamsTest.java
index 2c9075c0265c..a93524776d21 100644
--- a/tests/AndroidTests/src/com/android/unit_tests/BitwiseStreamsTest.java
+++ b/tests/AndroidTests/src/com/android/unit_tests/BitwiseStreamsTest.java
@@ -23,6 +23,8 @@ import com.android.internal.util.HexDump;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
+import android.util.Log;
+
public class BitwiseStreamsTest extends AndroidTestCase {
private final static String LOG_TAG = "BitwiseStreamsTest";
@@ -85,4 +87,27 @@ public class BitwiseStreamsTest extends AndroidTestCase {
for (int i = 0; i < inBufDup.length; i++) inBufDup[i] = inStream.read(8);
assertEquals(HexDump.toHexString(inBuf), HexDump.toHexString(inBufDup));
}
+
+ @SmallTest
+ public void testFive() throws Exception {
+ int num_runs = 10;
+ long start = android.os.SystemClock.elapsedRealtime();
+ for (int run = 0; run < num_runs; run++) {
+ int offset = run % 8;
+ byte[] inBuf = HexDump.hexStringToByteArray("00031040900112488ea794e0");
+ BitwiseOutputStream outStream = new BitwiseOutputStream(30);
+ outStream.skip(offset);
+ for (int i = 0; i < inBuf.length; i++) {
+ outStream.write(5, inBuf[i] >>> 3);
+ outStream.write(3, inBuf[i] & 0x07);
+ }
+ BitwiseInputStream inStream = new BitwiseInputStream(outStream.toByteArray());
+ inStream.skip(offset);
+ byte[] inBufDup = new byte[inBuf.length];
+ for (int i = 0; i < inBufDup.length; i++) inBufDup[i] = inStream.read(8);
+ assertEquals(HexDump.toHexString(inBuf), HexDump.toHexString(inBufDup));
+ }
+ long end = android.os.SystemClock.elapsedRealtime();
+ Log.d(LOG_TAG, "repeated encode-decode took " + (end - start) + " ms");
+ }
}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeCanvas.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeCanvas.java
index 70c26a7ee7f0..47106912e467 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeCanvas.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeCanvas.java
@@ -650,12 +650,12 @@ public class BridgeCanvas extends Canvas {
int arcHeight = (int)(ry * 2);
if (style == Style.FILL || style == Style.FILL_AND_STROKE) {
- g.fillRoundRect((int)rect.left, (int)rect.right, (int)rect.width(), (int)rect.height(),
+ g.fillRoundRect((int)rect.left, (int)rect.top, (int)rect.width(), (int)rect.height(),
arcWidth, arcHeight);
}
if (style == Style.STROKE || style == Style.FILL_AND_STROKE) {
- g.drawRoundRect((int)rect.left, (int)rect.right, (int)rect.width(), (int)rect.height(),
+ g.drawRoundRect((int)rect.left, (int)rect.top, (int)rect.width(), (int)rect.height(),
arcWidth, arcHeight);
}