Merge "Fix AnalogClock rendering" into lmp-dev
diff --git a/Android.mk b/Android.mk
index 75e32c1..da98b19 100644
--- a/Android.mk
+++ b/Android.mk
@@ -727,7 +727,8 @@
# Whitelist of valid groups, used for default TOC grouping. Each sample must
# belong to one (and only one) group. Assign samples to groups by setting
# a sample.group var to one of these groups in the sample's _index.jd.
-sample_groups := -samplegroup Background \
+sample_groups := -samplegroup Admin \
+ -samplegroup Background \
-samplegroup Connectivity \
-samplegroup Content \
-samplegroup Input \
diff --git a/core/java/android/hardware/Sensor.java b/core/java/android/hardware/Sensor.java
index f514e42..cf6a779 100644
--- a/core/java/android/hardware/Sensor.java
+++ b/core/java/android/hardware/Sensor.java
@@ -329,7 +329,11 @@
* A sensor of this type triggers an event each time a step is taken by the user. The only
* allowed value to return is 1.0 and an event is generated for each step. Like with any other
* event, the timestamp indicates when the event (here the step) occurred, this corresponds to
- * when the foot hit the ground, generating a high variation in acceleration.
+ * when the foot hit the ground, generating a high variation in acceleration. This sensor is
+ * only for detecting every individual step as soon as it is taken, for example to perform dead
+ * reckoning. If you only need aggregate number of steps taken over a period of time, register
+ * for {@link #TYPE_STEP_COUNTER} instead. It is defined as a
+ * {@link Sensor#REPORTING_MODE_SPECIAL_TRIGGER} sensor.
* <p>
* See {@link android.hardware.SensorEvent#values SensorEvent.values} for more details.
*/
@@ -349,7 +353,12 @@
* while activated. The value is returned as a float (with the fractional part set to zero) and
* is reset to zero only on a system reboot. The timestamp of the event is set to the time when
* the last step for that event was taken. This sensor is implemented in hardware and is
- * expected to be low power.
+ * expected to be low power. If you want to continuously track the number of steps over a long
+ * period of time, do NOT unregister for this sensor, so that it keeps counting steps in the
+ * background even when the AP is in suspend mode and report the aggregate count when the AP
+ * is awake. Application needs to stay registered for this sensor because step counter does not
+ * count steps if it is not activated. This sensor is ideal for fitness tracking applications.
+ * It is defined as an {@link Sensor#REPORTING_MODE_ON_CHANGE} sensor.
* <p>
* See {@link android.hardware.SensorEvent#values SensorEvent.values} for more details.
*/
@@ -750,31 +759,41 @@
}
/**
- * Returns whether this sensor is a wake-up sensor.
+ * Returns true if the sensor is a wake-up sensor.
* <p>
- * Wake up sensors wake the application processor up when they have events to deliver. When a
- * wake up sensor is registered to without batching enabled, each event will wake the
- * application processor up.
+ * <b>Application Processor Power modes</b> <p>
+ * Application Processor(AP), is the processor on which applications run. When no wake lock is held
+ * and the user is not interacting with the device, this processor can enter a “Suspend” mode,
+ * reducing the power consumption by 10 times or more.
+ * </p>
* <p>
- * When a wake up sensor is registered to with batching enabled, it
- * wakes the application processor up when maxReportingLatency has elapsed or when the hardware
- * FIFO storing the events from wake up sensors is getting full.
+ * <b>Non-wake-up sensors</b> <p>
+ * Non-wake-up sensors are sensors that do not wake the AP out of suspend to report data. While
+ * the AP is in suspend mode, the sensors continue to function and generate events, which are
+ * put in a hardware FIFO. The events in the FIFO are delivered to the application when the AP
+ * wakes up. If the FIFO was too small to store all events generated while the AP was in
+ * suspend mode, the older events are lost: the oldest data is dropped to accommodate the newer
+ * data. In the extreme case where the FIFO is non-existent {@code maxFifoEventCount() == 0},
+ * all events generated while the AP was in suspend mode are lost. Applications using
+ * non-wake-up sensors should usually:
+ * <ul>
+ * <li>Either unregister from the sensors when they do not need them, usually in the activity’s
+ * {@code onPause} method. This is the most common case.
+ * <li>Or realize that the sensors are consuming some power while the AP is in suspend mode and
+ * that even then, some events might be lost.
+ * </ul>
+ * </p>
* <p>
- * Non-wake up sensors never wake the application processor up. Their events are only reported
- * when the application processor is awake, for example because the application holds a wake
- * lock, or another source woke the application processor up.
- * <p>
- * When a non-wake up sensor is registered to without batching enabled, the measurements made
- * while the application processor is asleep might be lost and never returned.
- * <p>
- * When a non-wake up sensor is registered to with batching enabled, the measurements made while
- * the application processor is asleep are stored in the hardware FIFO for non-wake up sensors.
- * When this FIFO gets full, new events start overwriting older events. When the application
- * then wakes up, the latest events are returned, and some old events might be lost. The number
- * of events actually returned depends on the hardware FIFO size, as well as on what other
- * sensors are activated. If losing sensor events is not acceptable during batching, you must
- * use the wake-up version of the sensor.
- * @return true if this is a wake up sensor, false otherwise.
+ * <b>Wake-up sensors</b> <p>
+ * In opposition to non-wake-up sensors, wake-up sensors ensure that their data is delivered
+ * independently of the state of the AP. While the AP is awake, the wake-up sensors behave
+ * like non-wake-up-sensors. When the AP is asleep, wake-up sensors wake up the AP to deliver
+ * events. That is, the AP will wake up and the sensor will deliver the events before the
+ * maximum reporting latency is elapsed or the hardware FIFO gets full. See {@link
+ * SensorManager#registerListener(SensorEventListener, Sensor, int, int)} for more details.
+ * </p>
+ *
+ * @return <code>true</code> if this is a wake-up sensor, <code>false</code> otherwise.
*/
public boolean isWakeUpSensor() {
return (mFlags & SENSOR_FLAG_WAKE_UP_SENSOR) != 0;
diff --git a/core/java/android/hardware/SensorEventListener2.java b/core/java/android/hardware/SensorEventListener2.java
index 70eff08..fd3e62b 100644
--- a/core/java/android/hardware/SensorEventListener2.java
+++ b/core/java/android/hardware/SensorEventListener2.java
@@ -21,15 +21,16 @@
*/
public interface SensorEventListener2 extends SensorEventListener {
/**
- * Called after flush() is completed. All the events in the batch at the point when
- * the flush was called have been delivered to the applications registered for those
- * sensor events. Flush Complete Events are sent ONLY to the application that has
- * explicitly called flush(). If the hardware FIFO is flushed due to some other
- * application calling flush(), flush complete event is not delivered to this application.
+ * Called after flush() is completed. All the events in the batch at the point when the flush
+ * was called have been delivered to the applications registered for those sensor events. In
+ * {@link android.os.Build.VERSION_CODES#KITKAT}, applications may receive flush complete events
+ * even if some other application has called flush() on the same sensor. Starting with
+ * {@link android.os.Build.VERSION_CODES#LOLLIPOP}, flush Complete events are sent ONLY to the
+ * application that has explicitly called flush(). If the hardware FIFO is flushed due to some
+ * other application calling flush(), flush complete event is not delivered to this application.
* <p>
*
* @param sensor The {@link android.hardware.Sensor Sensor} on which flush was called.
- *
* @see android.hardware.SensorManager#flush(SensorEventListener)
*/
public void onFlushCompleted(Sensor sensor);
diff --git a/core/java/android/hardware/SensorManager.java b/core/java/android/hardware/SensorManager.java
index cccd624..e4e5a8c 100644
--- a/core/java/android/hardware/SensorManager.java
+++ b/core/java/android/hardware/SensorManager.java
@@ -626,73 +626,90 @@
protected abstract void unregisterListenerImpl(SensorEventListener listener, Sensor sensor);
/**
- * Registers a {@link android.hardware.SensorEventListener
- * SensorEventListener} for the given sensor.
- *
- * <p class="note"></p>
- * Note: Don't use this method with a one shot trigger sensor such as
- * {@link Sensor#TYPE_SIGNIFICANT_MOTION}.
- * Use {@link #requestTriggerSensor(TriggerEventListener, Sensor)} instead.
+ * Registers a {@link android.hardware.SensorEventListener SensorEventListener} for the given
+ * sensor at the given sampling frequency.
+ * <p>
+ * The events will be delivered to the provided {@code SensorEventListener} as soon as they are
+ * available. To reduce the power consumption, applications can use
+ * {@link #registerListener(SensorEventListener, Sensor, int, int)} instead and specify a
+ * positive non-zero maximum reporting latency.
+ * </p>
+ * <p>
+ * In the case of non-wake-up sensors, the events are only delivered while the Application
+ * Processor (AP) is not in suspend mode. See {@link Sensor#isWakeUpSensor()} for more details.
+ * To ensure delivery of events from non-wake-up sensors even when the screen is OFF, the
+ * application registering to the sensor must hold a partial wake-lock to keep the AP awake,
+ * otherwise some events might be lost while the AP is asleep. Note that although events might
+ * be lost while the AP is asleep, the sensor will still consume power if it is not explicitly
+ * deactivated by the application. Applications must unregister their {@code
+ * SensorEventListener}s in their activity's {@code onPause()} method to avoid consuming power
+ * while the device is inactive. See {@link #registerListener(SensorEventListener, Sensor, int,
+ * int)} for more details on hardware FIFO (queueing) capabilities and when some sensor events
+ * might be lost.
+ * </p>
+ * <p>
+ * In the case of wake-up sensors, each event generated by the sensor will cause the AP to
+ * wake-up, ensuring that each event can be delivered. Because of this, registering to a wake-up
+ * sensor has very significant power implications. Call {@link Sensor#isWakeUpSensor()} to check
+ * whether a sensor is a wake-up sensor. See
+ * {@link #registerListener(SensorEventListener, Sensor, int, int)} for information on how to
+ * reduce the power impact of registering to wake-up sensors.
+ * </p>
+ * <p class="note">
+ * Note: Don't use this method with one-shot trigger sensors such as
+ * {@link Sensor#TYPE_SIGNIFICANT_MOTION}. Use
+ * {@link #requestTriggerSensor(TriggerEventListener, Sensor)} instead. Use
+ * {@link Sensor#getReportingMode()} to obtain the reporting mode of a given sensor.
* </p>
*
- * @param listener
- * A {@link android.hardware.SensorEventListener SensorEventListener}
- * object.
- *
- * @param sensor
- * The {@link android.hardware.Sensor Sensor} to register to.
- *
- * @param rateUs
- * The rate {@link android.hardware.SensorEvent sensor events} are
- * delivered at. This is only a hint to the system. Events may be
- * received faster or slower than the specified rate. Usually events
- * are received faster. The value must be one of
- * {@link #SENSOR_DELAY_NORMAL}, {@link #SENSOR_DELAY_UI},
- * {@link #SENSOR_DELAY_GAME}, or {@link #SENSOR_DELAY_FASTEST}
- * or, the desired delay between events in microseconds.
- * Specifying the delay in microseconds only works from Android
- * 2.3 (API level 9) onwards. For earlier releases, you must use
- * one of the {@code SENSOR_DELAY_*} constants.
- *
- * @return <code>true</code> if the sensor is supported and successfully
- * enabled.
- *
+ * @param listener A {@link android.hardware.SensorEventListener SensorEventListener} object.
+ * @param sensor The {@link android.hardware.Sensor Sensor} to register to.
+ * @param samplingPeriodUs The rate {@link android.hardware.SensorEvent sensor events} are
+ * delivered at. This is only a hint to the system. Events may be received faster or
+ * slower than the specified rate. Usually events are received faster. The value must
+ * be one of {@link #SENSOR_DELAY_NORMAL}, {@link #SENSOR_DELAY_UI},
+ * {@link #SENSOR_DELAY_GAME}, or {@link #SENSOR_DELAY_FASTEST} or, the desired delay
+ * between events in microseconds. Specifying the delay in microseconds only works
+ * from Android 2.3 (API level 9) onwards. For earlier releases, you must use one of
+ * the {@code SENSOR_DELAY_*} constants.
+ * @return <code>true</code> if the sensor is supported and successfully enabled.
* @see #registerListener(SensorEventListener, Sensor, int, Handler)
* @see #unregisterListener(SensorEventListener)
* @see #unregisterListener(SensorEventListener, Sensor)
- *
*/
- public boolean registerListener(SensorEventListener listener, Sensor sensor, int rateUs) {
- return registerListener(listener, sensor, rateUs, null);
+ public boolean registerListener(SensorEventListener listener, Sensor sensor,
+ int samplingPeriodUs) {
+ return registerListener(listener, sensor, samplingPeriodUs, null);
}
/**
- * Enables batch mode for a sensor with the given rate and maxBatchReportLatency. If the
- * underlying hardware does not support batch mode, this defaults to
- * {@link #registerListener(SensorEventListener, Sensor, int)} and other parameters are
- * ignored. In non-batch mode, all sensor events must be reported as soon as they are detected.
- * While in batch mode, sensor events do not need to be reported as soon as they are detected.
- * They can be temporarily stored in batches and reported in batches, as long as no event is
- * delayed by more than "maxBatchReportLatency" microseconds. That is, all events since the
- * previous batch are recorded and returned all at once. This allows to reduce the amount of
- * interrupts sent to the SoC, and allows the SoC to switch to a lower power state (Idle) while
- * the sensor is capturing and batching data.
+ * Registers a {@link android.hardware.SensorEventListener SensorEventListener} for the given
+ * sensor at the given sampling frequency and the given maximum reporting latency.
* <p>
- * Registering to a sensor in batch mode will not prevent the SoC from going to suspend mode. In
- * this case, the sensor will continue to gather events and store it in a hardware FIFO. If the
- * FIFO gets full before the AP wakes up again, some events will be lost, as the older events
- * get overwritten by new events in the hardware FIFO. This can be avoided by holding a wake
- * lock. If the application holds a wake lock, the SoC will not go to suspend mode, so no events
- * will be lost, as the events will be reported before the FIFO gets full.
- * </p>
- * <p>
- * Batching is always best effort. If a different application requests updates in continuous
- * mode, this application will also get events in continuous mode. Batch mode updates can be
- * unregistered by calling {@link #unregisterListener(SensorEventListener)}.
+ * This function is similar to {@link #registerListener(SensorEventListener, Sensor, int)} but
+ * it allows events to stay temporarily in the hardware FIFO (queue) before being delivered. The
+ * events can be stored in the hardware FIFO up to {@code maxReportLatencyUs} microseconds. Once
+ * one of the events in the FIFO needs to be reported, all of the events in the FIFO are
+ * reported sequentially. This means that some events will be reported before the maximum
+ * reporting latency has elapsed.
+ * </p><p>
+ * When {@code maxReportLatencyUs} is 0, the call is equivalent to a call to
+ * {@link #registerListener(SensorEventListener, Sensor, int)}, as it requires the events to be
+ * delivered as soon as possible.
+ * </p><p>
+ * When {@code sensor.maxFifoEventCount()} is 0, the sensor does not use a FIFO, so the call
+ * will also be equivalent to {@link #registerListener(SensorEventListener, Sensor, int)}.
+ * </p><p>
+ * Setting {@code maxReportLatencyUs} to a positive value allows to reduce the number of
+ * interrupts the AP (Application Processor) receives, hence reducing power consumption, as the
+ * AP can switch to a lower power state while the sensor is capturing the data. This is
+ * especially important when registering to wake-up sensors, for which each interrupt causes the
+ * AP to wake up if it was in suspend mode. See {@link Sensor#isWakeUpSensor()} for more
+ * information on wake-up sensors.
* </p>
* <p class="note">
* </p>
- * Note: Don't use this method with a one shot trigger sensor such as
+ * Note: Don't use this method with one-shot trigger sensors such as
* {@link Sensor#TYPE_SIGNIFICANT_MOTION}. Use
* {@link #requestTriggerSensor(TriggerEventListener, Sensor)} instead. </p>
*
@@ -701,118 +718,104 @@
* flush complete notifications, it should register with
* {@link android.hardware.SensorEventListener SensorEventListener2} instead.
* @param sensor The {@link android.hardware.Sensor Sensor} to register to.
- * @param rateUs The desired delay between two consecutive events in microseconds. This is only
- * a hint to the system. Events may be received faster or slower than the specified
- * rate. Usually events are received faster. Can be one of
+ * @param samplingPeriodUs The desired delay between two consecutive events in microseconds.
+ * This is only a hint to the system. Events may be received faster or slower than
+ * the specified rate. Usually events are received faster. Can be one of
* {@link #SENSOR_DELAY_NORMAL}, {@link #SENSOR_DELAY_UI},
* {@link #SENSOR_DELAY_GAME}, {@link #SENSOR_DELAY_FASTEST} or the delay in
* microseconds.
- * @param maxBatchReportLatencyUs An event in the batch can be delayed by at most
- * maxBatchReportLatency microseconds. More events can be batched if this value is
- * large. If this is set to zero, batch mode is disabled and events are delivered in
- * continuous mode as soon as they are available which is equivalent to calling
+ * @param maxReportLatencyUs Maximum time in microseconds that events can be delayed before
+ * being reported to the application. A large value allows reducing the power
+ * consumption associated with the sensor. If maxReportLatencyUs is set to zero,
+ * events are delivered as soon as they are available, which is equivalent to calling
* {@link #registerListener(SensorEventListener, Sensor, int)}.
- * @return <code>true</code> if batch mode is successfully enabled for this sensor,
- * <code>false</code> otherwise.
+ * @return <code>true</code> if the sensor is supported and successfully enabled.
* @see #registerListener(SensorEventListener, Sensor, int)
* @see #unregisterListener(SensorEventListener)
* @see #flush(SensorEventListener)
*/
- public boolean registerListener(SensorEventListener listener, Sensor sensor, int rateUs,
- int maxBatchReportLatencyUs) {
- int delay = getDelay(rateUs);
- return registerListenerImpl(listener, sensor, delay, null, maxBatchReportLatencyUs, 0);
+ public boolean registerListener(SensorEventListener listener, Sensor sensor,
+ int samplingPeriodUs, int maxReportLatencyUs) {
+ int delay = getDelay(samplingPeriodUs);
+ return registerListenerImpl(listener, sensor, delay, null, maxReportLatencyUs, 0);
}
/**
* Registers a {@link android.hardware.SensorEventListener SensorEventListener} for the given
* sensor. Events are delivered in continuous mode as soon as they are available. To reduce the
- * battery usage, use {@link #registerListener(SensorEventListener, Sensor, int, int)} which
- * enables batch mode for the sensor.
- *
- * <p class="note"></p>
- * Note: Don't use this method with a one shot trigger sensor such as
- * {@link Sensor#TYPE_SIGNIFICANT_MOTION}.
- * Use {@link #requestTriggerSensor(TriggerEventListener, Sensor)} instead.
+ * power consumption, applications can use
+ * {@link #registerListener(SensorEventListener, Sensor, int, int)} instead and specify a
+ * positive non-zero maximum reporting latency.
+ * <p class="note">
* </p>
+ * Note: Don't use this method with a one shot trigger sensor such as
+ * {@link Sensor#TYPE_SIGNIFICANT_MOTION}. Use
+ * {@link #requestTriggerSensor(TriggerEventListener, Sensor)} instead. </p>
*
- * @param listener
- * A {@link android.hardware.SensorEventListener SensorEventListener}
- * object.
- *
- * @param sensor
- * The {@link android.hardware.Sensor Sensor} to register to.
- *
- * @param rateUs
- * The rate {@link android.hardware.SensorEvent sensor events} are
- * delivered at. This is only a hint to the system. Events may be
- * received faster or slower than the specified rate. Usually events
- * are received faster. The value must be one of
- * {@link #SENSOR_DELAY_NORMAL}, {@link #SENSOR_DELAY_UI},
- * {@link #SENSOR_DELAY_GAME}, or {@link #SENSOR_DELAY_FASTEST}.
- * or, the desired delay between events in microseconds.
- * Specifying the delay in microseconds only works from Android
- * 2.3 (API level 9) onwards. For earlier releases, you must use
- * one of the {@code SENSOR_DELAY_*} constants.
- *
- * @param handler
- * The {@link android.os.Handler Handler} the
- * {@link android.hardware.SensorEvent sensor events} will be
- * delivered to.
- *
+ * @param listener A {@link android.hardware.SensorEventListener SensorEventListener} object.
+ * @param sensor The {@link android.hardware.Sensor Sensor} to register to.
+ * @param samplingPeriodUs The rate {@link android.hardware.SensorEvent sensor events} are
+ * delivered at. This is only a hint to the system. Events may be received faster or
+ * slower than the specified rate. Usually events are received faster. The value must
+ * be one of {@link #SENSOR_DELAY_NORMAL}, {@link #SENSOR_DELAY_UI},
+ * {@link #SENSOR_DELAY_GAME}, or {@link #SENSOR_DELAY_FASTEST} or, the desired
+ * delay between events in microseconds. Specifying the delay in microseconds only
+ * works from Android 2.3 (API level 9) onwards. For earlier releases, you must use
+ * one of the {@code SENSOR_DELAY_*} constants.
+ * @param handler The {@link android.os.Handler Handler} the {@link android.hardware.SensorEvent
+ * sensor events} will be delivered to.
* @return <code>true</code> if the sensor is supported and successfully enabled.
- *
* @see #registerListener(SensorEventListener, Sensor, int)
* @see #unregisterListener(SensorEventListener)
* @see #unregisterListener(SensorEventListener, Sensor)
*/
- public boolean registerListener(SensorEventListener listener, Sensor sensor, int rateUs,
- Handler handler) {
- int delay = getDelay(rateUs);
+ public boolean registerListener(SensorEventListener listener, Sensor sensor,
+ int samplingPeriodUs, Handler handler) {
+ int delay = getDelay(samplingPeriodUs);
return registerListenerImpl(listener, sensor, delay, handler, 0, 0);
}
/**
- * Enables batch mode for a sensor with the given rate and maxBatchReportLatency.
+ * Registers a {@link android.hardware.SensorEventListener SensorEventListener} for the given
+ * sensor at the given sampling frequency and the given maximum reporting latency.
+ *
* @param listener A {@link android.hardware.SensorEventListener SensorEventListener} object
* that will receive the sensor events. If the application is interested in receiving
* flush complete notifications, it should register with
* {@link android.hardware.SensorEventListener SensorEventListener2} instead.
* @param sensor The {@link android.hardware.Sensor Sensor} to register to.
- * @param rateUs The desired delay between two consecutive events in microseconds. This is only
- * a hint to the system. Events may be received faster or slower than the specified
- * rate. Usually events are received faster. Can be one of
+ * @param samplingPeriodUs The desired delay between two consecutive events in microseconds.
+ * This is only a hint to the system. Events may be received faster or slower than
+ * the specified rate. Usually events are received faster. Can be one of
* {@link #SENSOR_DELAY_NORMAL}, {@link #SENSOR_DELAY_UI},
* {@link #SENSOR_DELAY_GAME}, {@link #SENSOR_DELAY_FASTEST} or the delay in
* microseconds.
- * @param maxBatchReportLatencyUs An event in the batch can be delayed by at most
- * maxBatchReportLatency microseconds. More events can be batched if this value is
- * large. If this is set to zero, batch mode is disabled and events are delivered in
- * continuous mode as soon as they are available which is equivalent to calling
+ * @param maxReportLatencyUs Maximum time in microseconds that events can be delayed before
+ * being reported to the application. A large value allows reducing the power
+ * consumption associated with the sensor. If maxReportLatencyUs is set to zero,
+ * events are delivered as soon as they are available, which is equivalent to calling
* {@link #registerListener(SensorEventListener, Sensor, int)}.
- * @param handler The {@link android.os.Handler Handler} the
- * {@link android.hardware.SensorEvent sensor events} will be delivered to.
- *
- * @return <code>true</code> if batch mode is successfully enabled for this sensor,
- * <code>false</code> otherwise.
+ * @param handler The {@link android.os.Handler Handler} the {@link android.hardware.SensorEvent
+ * sensor events} will be delivered to.
+ * @return <code>true</code> if the sensor is supported and successfully enabled.
* @see #registerListener(SensorEventListener, Sensor, int, int)
*/
- public boolean registerListener(SensorEventListener listener, Sensor sensor, int rateUs,
- int maxBatchReportLatencyUs, Handler handler) {
- int delayUs = getDelay(rateUs);
- return registerListenerImpl(listener, sensor, delayUs, handler, maxBatchReportLatencyUs, 0);
+ public boolean registerListener(SensorEventListener listener, Sensor sensor, int samplingPeriodUs,
+ int maxReportLatencyUs, Handler handler) {
+ int delayUs = getDelay(samplingPeriodUs);
+ return registerListenerImpl(listener, sensor, delayUs, handler, maxReportLatencyUs, 0);
}
/** @hide */
protected abstract boolean registerListenerImpl(SensorEventListener listener, Sensor sensor,
- int delayUs, Handler handler, int maxBatchReportLatencyUs, int reservedFlags);
+ int delayUs, Handler handler, int maxReportLatencyUs, int reservedFlags);
/**
- * Flushes the batch FIFO of all the sensors registered for this listener. If there are events
- * in the FIFO of the sensor, they are returned as if the batch timeout in the FIFO of the
- * sensors had expired. Events are returned in the usual way through the SensorEventListener.
- * This call doesn't affect the batch timeout for this sensor. This call is asynchronous and
+ * Flushes the FIFO of all the sensors registered for this listener. If there are events
+ * in the FIFO of the sensor, they are returned as if the maxReportLantecy of the FIFO has
+ * expired. Events are returned in the usual way through the SensorEventListener.
+ * This call doesn't affect the maxReportLantecy for this sensor. This call is asynchronous and
* returns immediately.
* {@link android.hardware.SensorEventListener2#onFlushCompleted onFlushCompleted} is called
* after all the events in the batch at the time of calling this method have been delivered
diff --git a/core/java/android/os/storage/IMountService.java b/core/java/android/os/storage/IMountService.java
index cf407f4..116110e 100644
--- a/core/java/android/os/storage/IMountService.java
+++ b/core/java/android/os/storage/IMountService.java
@@ -856,6 +856,38 @@
}
return _result;
}
+
+ @Override
+ public long lastMaintenance() throws RemoteException {
+ Parcel _data = Parcel.obtain();
+ Parcel _reply = Parcel.obtain();
+ long _result;
+ try {
+ _data.writeInterfaceToken(DESCRIPTOR);
+ mRemote.transact(Stub.TRANSACTION_lastMaintenance, _data, _reply, 0);
+ _reply.readException();
+ _result = _reply.readLong();
+ } finally {
+ _reply.recycle();
+ _data.recycle();
+ }
+ return _result;
+ }
+
+ @Override
+ public void runMaintenance() throws RemoteException {
+ Parcel _data = Parcel.obtain();
+ Parcel _reply = Parcel.obtain();
+ try {
+ _data.writeInterfaceToken(DESCRIPTOR);
+ mRemote.transact(Stub.TRANSACTION_runMaintenance, _data, _reply, 0);
+ _reply.readException();
+ } finally {
+ _reply.recycle();
+ _data.recycle();
+ }
+ return;
+ }
}
private static final String DESCRIPTOR = "IMountService";
@@ -942,6 +974,10 @@
static final int TRANSACTION_resizeSecureContainer = IBinder.FIRST_CALL_TRANSACTION + 40;
+ static final int TRANSACTION_lastMaintenance = IBinder.FIRST_CALL_TRANSACTION + 41;
+
+ static final int TRANSACTION_runMaintenance = IBinder.FIRST_CALL_TRANSACTION + 42;
+
/**
* Cast an IBinder object into an IMountService interface, generating a
* proxy if needed.
@@ -1347,6 +1383,19 @@
reply.writeInt(resultCode);
return true;
}
+ case TRANSACTION_lastMaintenance: {
+ data.enforceInterface(DESCRIPTOR);
+ long lastMaintenance = lastMaintenance();
+ reply.writeNoException();
+ reply.writeLong(lastMaintenance);
+ return true;
+ }
+ case TRANSACTION_runMaintenance: {
+ data.enforceInterface(DESCRIPTOR);
+ runMaintenance();
+ reply.writeNoException();
+ return true;
+ }
}
return super.onTransact(code, data, reply, flags);
}
@@ -1617,4 +1666,18 @@
public String getField(String field) throws RemoteException;
public int resizeSecureContainer(String id, int sizeMb, String key) throws RemoteException;
+
+ /**
+ * Report the time of the last maintenance operation such as fstrim.
+ * @return Timestamp of the last maintenance operation, in the
+ * System.currentTimeMillis() time base
+ * @throws RemoteException
+ */
+ public long lastMaintenance() throws RemoteException;
+
+ /**
+ * Kick off an immediate maintenance operation
+ * @throws RemoteException
+ */
+ public void runMaintenance() throws RemoteException;
}
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 79e84d9..73c7cc3 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -5544,6 +5544,13 @@
public static final String PACKAGE_VERIFIER_INCLUDE_ADB = "verifier_verify_adb_installs";
/**
+ * Time since last fstrim (milliseconds) after which we force one to happen
+ * during device startup. If unset, the default is 3 days.
+ * @hide
+ */
+ public static final String FSTRIM_MANDATORY_INTERVAL = "fstrim_mandatory_interval";
+
+ /**
* The interval in milliseconds at which to check packet counts on the
* mobile data interface when screen is on, to detect possible data
* connection problems.
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index c156887..ab97e17 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -3508,6 +3508,9 @@
<!-- [CHAR LIMIT=40] Title of dialog that is shown when performing a system upgrade. -->
<string name="android_upgrading_title">Android is upgrading\u2026</string>
+ <!-- [CHAR LIMIT=NONE] Message shown in upgrading dialog when doing an fstrim. -->
+ <string name="android_upgrading_fstrim">Optimizing storage.</string>
+
<!-- [CHAR LIMIT=NONE] Message shown in upgrading dialog for each .apk that is optimized. -->
<string name="android_upgrading_apk">Optimizing app
<xliff:g id="number" example="123">%1$d</xliff:g> of
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 2dcbefe..3078722 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1644,6 +1644,7 @@
<java-symbol type="string" name="aerr_application" />
<java-symbol type="string" name="aerr_process" />
<java-symbol type="string" name="aerr_title" />
+ <java-symbol type="string" name="android_upgrading_fstrim" />
<java-symbol type="string" name="android_upgrading_apk" />
<java-symbol type="string" name="android_upgrading_complete" />
<java-symbol type="string" name="android_upgrading_starting_apps" />
diff --git a/docs/html-intl/intl/zh-cn/about/versions/android-5.0.jd b/docs/html-intl/intl/zh-cn/about/versions/android-5.0.jd
index b4ce560..9c3dd5c 100644
--- a/docs/html-intl/intl/zh-cn/about/versions/android-5.0.jd
+++ b/docs/html-intl/intl/zh-cn/about/versions/android-5.0.jd
@@ -8,322 +8,320 @@
<div id="qv-wrapper">
<div id="qv">
-<h2>このドキュメントの内容 <a href="#" onclick="hideNestedItems('#toc44',this);return false;" class="header-toggle"> <span class="more">詳細を表示</span> <span class="less" style="display:none">詳細を隠す</span></a></h2>
+<h2>在本文档中 <a href="#" onclick="hideNestedItems('#toc44',this);return false;" class="header-toggle"> <span class="more">展开</span><span class="less" style="display:none">合拢</span></a></h2>
<ol id="toc44" class="hide-nested">
- <li><a href="#ApiLevel">対象 API レベルの更新</a></li>
- <li><a href="#Behaviors">動作に関する重要な変更</a>
+ <li><a href="#ApiLevel">更新目标 API 级别</a></li>
+ <li><a href="#Behaviors">重要的行为变更</a>
<ol>
- <li><a href="#ART">まだ新しい Android Runtime(ART)に対してアプリをテストしていない場合</a></li>
- <li><a href="#BehaviorNotifications">アプリで通知を実装する場合</a></li>
- <li><a href="#BehaviorMediaControl">アプリで RemoteControlClient を使用する場合</a></li>
-<li><a href="#BehaviorGetRecentTasks">アプリで getRecentTasks() を使用する場合</a></li>
-<li><a href="#64BitSupport">Android Native Development Kit(NDK)を使用している場合</a></li>
-<li><a href="#BindService">アプリからサービスにバインドする場合</a></li>
-<li><a href="#BehaviorWebView">アプリで WebView を使用する場合</a></li>
+ <li><a href="#ART">如果您尚未针对新的 Android 运行时 (ART) 测试您的应用…</a></li>
+ <li><a href="#BehaviorNotifications">如果您的应用实施通知…</a></li>
+ <li><a href="#BehaviorMediaControl">如果您的应用使用 RemoteControlClient…</a></li>
+<li><a href="#BehaviorGetRecentTasks">如果您的应用使用 getRecentTasks()…</a></li>
+<li><a href="#64BitSupport">如果您使用的是 Android 原生开发工具包 (NDK)…</a></li>
+<li><a href="#BindService">如果您的应用绑定到某项服务…</a></li>
+<li><a href="#BehaviorWebView">如果您的应用使用 WebView…</a></li>
</ol>
</li>
- <li><a href="#UI">ユーザー インターフェース</a>
+ <li><a href="#UI">界面</a>
<ol>
- <li><a href="#MaterialDesign">Material Design のサポート</a></li>
- <li><a href="#Recents">最近使ったアプリ画面に表示される同時実行中のドキュメント / アクティビティ</a></li>
- <li><a href="#WebView">WebView の更新</a></li>
- <li><a href="#ScreenCapture">画面のキャプチャと共有</a></li>
+ <li><a href="#MaterialDesign">Material Design 设计支持</a></li>
+ <li><a href="#Recents">“最近用过”屏幕中的并行文档和活动</a></li>
+ <li><a href="#WebView">WebView 更新</a></li>
+ <li><a href="#ScreenCapture">屏幕截图和共享</a></li>
</ol>
</li>
<li><a href="#Notifications">通知</a>
<ol>
- <li><a href="#LockscreenNotifications">ロック画面の通知</a></li>
- <li><a href="#NotificationsMetadata">通知メタデータ</a></li>
+ <li><a href="#LockscreenNotifications">锁定屏幕通知</a></li>
+ <li><a href="#NotificationsMetadata">通知元数据</a></li>
</ol>
</li>
- <li><a href="#Graphics">グラフィック</a>
+ <li><a href="#Graphics">图形</a>
<ol>
- <li><a href="#OpenGLES-3-1">OpenGL ES 3.1 のサポート</a></li>
- <li><a href="#AndroidExtensionPack">Android Extension Pack</a></li>
+ <li><a href="#OpenGLES-3-1">支持 OpenGL ES 3.1</a></li>
+ <li><a href="#AndroidExtensionPack">Android 扩展程序包</a></li>
</ol>
</li>
- <li><a href="#Media">メディア</a>
+ <li><a href="#Media">媒体</a>
<ol>
- <li><a href="#Camera-v2">高度なカメラ機能に対応した Camera API</a></li>
- <li><a href="#AudioPlayback">音声の再生</a></li>
- <li><a href="#MediaPlaybackControl">メディア再生コントロール</a></li>
- <li><a href="#MediaBrowsing">メディアの参照</a></li>
+ <li><a href="#Camera-v2">提供高级摄像头功能的摄像头 API</a></li>
+ <li><a href="#AudioPlayback">音频播放</a></li>
+ <li><a href="#MediaPlaybackControl">媒体播放控件</a></li>
+ <li><a href="#MediaBrowsing">媒体浏览</a></li>
</ol>
</li>
- <li><a href="#Storage">ストレージ</a>
+ <li><a href="#Storage">存储</a>
<ol>
- <li><a href="#DirectorySelection">ディレクトリの選択</a></li>
+ <li><a href="#DirectorySelection">目录选择</a></li>
</ol>
</li>
- <li><a href="#Wireless">ワイヤレスと接続</a>
+ <li><a href="#Wireless">无线和连接</a>
<ol>
- <li><a href="#Multinetwork">マルチネットワーク接続</a></li>
- <li><a href="#BluetoothBroadcasting">Bluetooth によるブロードキャスト</a></li>
- <li><a href="#NFCEnhancements">NFC の機能強化</a></li>
+ <li><a href="#Multinetwork">多个网络连接</a></li>
+ <li><a href="#BluetoothBroadcasting">蓝牙广播</a></li>
+ <li><a href="#NFCEnhancements">NFC 增强功能</a></li>
</ol>
</li>
<li><a href="#Power">Project Volta</a>
<ol>
- <li><a href="#JobScheduler">ジョブのスケジューリング</a></li>
- <li><a href="#PowerMeasurementTools">電池の使用統計情報を提供するデベロッパー向けツール</a>
+ <li><a href="#JobScheduler">安排作业</a></li>
+ <li><a href="#PowerMeasurementTools">用于查询耗电信息的开发者工具</a>
</ol>
</li>
- <li><a href="#Enterprise">職場向けや教育向けの Android</a>
+ <li><a href="#Enterprise">Android 在办公和教育中的应用</a>
<ol>
- <li><a href="#ManagedProvisioning">管理対象プロビジョニング</a></li>
- <li><a href="#DeviceOwner">端末所有者</a></li>
- <li><a href="#ScreenPinning">画面の固定</a></li>
+ <li><a href="#ManagedProvisioning">托管配置</a></li>
+ <li><a href="#DeviceOwner">设备所有者</a></li>
+ <li><a href="#ScreenPinning">固定屏幕</a></li>
</ol>
</li>
- <li><a href="#System">システム</a>
+ <li><a href="#System">系统</a>
<ol>
- <li><a href="#AppUsageStatistics">アプリの使用統計情報</a></li>
+ <li><a href="#AppUsageStatistics">应用使用情况统计信息</a></li>
</ol>
</li>
- <li><a href="#Printing">印刷フレームワーク</a>
+ <li><a href="#Printing">打印框架</a>
<ol>
- <li><a href="#PDFRender">PDF をビットマップとしてレンダリング</a></li>
+ <li><a href="#PDFRender">使用位图来呈现 PDF 文件</a></li>
</ol>
</li>
- <li><a href="#TestingA11y">テストとユーザー補助</a>
+ <li><a href="#TestingA11y">测试和辅助功能</a>
<ol>
- <li><a href="#TestingA11yImprovements">テストとユーザー補助の向上</a></li>
+ <li><a href="#TestingA11yImprovements">测试和辅助功能改进</a></li>
</ol>
</li>
<li><a href="#IME">IME</a>
<ol>
- <li><a href="#Switching">入力言語の切り替えやすさの向上</a></li>
+ <li><a href="#Switching">更轻松地切换输入语言</a></li>
</ol>
</li>
- <li><a href="#Manifest">マニフェスト宣言</a>
+ <li><a href="#Manifest">清单声明</a>
<ol>
- <li><a href="#ManifestFeatures">宣言可能な必須機能</a></li>
- <li><a href="#Permissions">ユーザー権限</a></li>
+ <li><a href="#ManifestFeatures">应声明的必需功能</a></li>
+ <li><a href="#Permissions">用户权限</a></li>
</ol>
</li>
</ol>
-<h2>API の変更内容</h2>
+<h2>API 区别</h2>
<ol>
-<li><a href="{@docRoot}sdk/api_diff/21/changes.html">API レベル: 20 から 21 へ »</a> </li>
-<li><a href="{@docRoot}sdk/api_diff/preview-21/changes.html">レベル: デベロッパー プレビューから 21 へ »</a> </li>
+<li><a href="{@docRoot}sdk/api_diff/21/changes.html">API 级别 20 对比 21 »</a> </li>
+<li><a href="{@docRoot}sdk/api_diff/preview-21/changes.html">L Developer Preview 对比级别 21 »</a> </li>
</ol>
</div>
</div>
-<p>API レベル: {@sdkPlatformApiLevel}</p>
+<p>API 级别:{@sdkPlatformApiLevel}</p>
-<p>Android 5.0(<a href="{@docRoot}reference/android/os/Build.VERSION_CODES.html#LOLLIPOP">Lollipop</a>)は、ユーザーとアプリ デベロッパーに新しい機能を提供します。このドキュメントでは、最も重要な新しい API を紹介しています。</p>
+<p>Android 5.0 (<a href="{@docRoot}reference/android/os/Build.VERSION_CODES.html#LOLLIPOP">LOLLIPOP</a>) 为用户和应用开发者提供了新的功能。本文档介绍了最值得注意的新 API。</p>
-<p>新しいプラットフォーム機能の概要について詳しくは、<a href="{@docRoot}about/versions/lollipop.html">Android Lollipop の特長</a>をご覧ください。</p>
+<p>有关新平台功能的扼要介绍,另请参阅 <a href="{@docRoot}about/versions/lollipop.html">Android Lollipop 集锦</a>。</p>
-<h3 id="Start">開発の開始</h3>
+<h3 id="Start">开始开发</h3>
-<p>Android 5.0 対応アプリの開発を始めるには、最初に <a href="{@docRoot}sdk/index.html">Android SDK を入手する</a>必要があります。次に、<a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a> を使用して Android 5.0 SDK プラットフォームとシステム イメージをダウンロードします。</p>
-
-<p style=" padding: 10px; background: #eee; width: 445px; border: 1px solid #ccc; margin-top: 20px;">アプリを実機でテストするには、<br><a href="/preview/index.html#Start"><b>Android プレビュー システム イメージ</b></a>を使用して Nexus 5 または Nexus 7 のフラッシュに書き込みます。</p>
+<p>要构建 Android 5.0 版应用,您必须先<a href="{@docRoot}sdk/index.html">下载 Android SDK</a>,然后使用 <a href="{@docRoot}tools/help/sdk-manager.html">SDK 管理器</a>下载 Android 5.0 SDK 平台和系统映像。</p>
-<h3 id="ApiLevel">対象 API レベルの更新</h3>
+<h3 id="ApiLevel">更新您的目标 API 级别</h3>
-<p>Android {@sdkPlatformVersion} 搭載端末向けにアプリの最適化を向上させるには、<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> を <code>"{@sdkPlatformApiLevel}"</code> に設定し、Android {@sdkPlatformVersion} システム イメージにアプリをインストールした後、この変更を加えた更新済みのアプリを公開します。</p>
+<p>要进一步针对运行 Android {@sdkPlatformVersion} 的设备优化您的应用,请将 <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#target">{@code targetSdkVersion}</a> 设置为 <code>"{@sdkPlatformApiLevel}"</code>,在 Android {@sdkPlatformVersion} 系统映像上安装该应用并予以测试,然后将更改后的新版应用发布出去。</p>
-<p>Android {@sdkPlatformVersion} API を使用しながら旧バージョンも同時にサポートするには、<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> でサポートされていない API を実行する前に、システムの API レベルをチェックする条件をコードに追加します。下位互換性の維持について詳しくは、<a href="{@docRoot}training/basics/supporting-devices/platforms.html">複数のプラットフォーム バージョンへの対応</a>をご覧ください。</p>
+<p>您既可以使用 {@sdkPlatformVersion} API,也可以支持旧版本,方法是在代码中构建条件,确保先检查系统 API 级别再执行 <a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#min">{@code minSdkVersion}</a> 不支持的 API。要详细了解有关保持向后兼容的信息,请参阅<a href="{@docRoot}training/basics/supporting-devices/platforms.html">支持不同平台版本</a>。</p>
-<p>API レベルの仕組みについて詳しくは、<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">API レベルとは</a>をご覧ください。</p>
+<p>要详细了解有关各个 API 级别运行方式的信息,请参阅<a href="{@docRoot}guide/topics/manifest/uses-sdk-element.html#ApiLevels">什么是 API 级别?</a></p>
-<h2 id="Behaviors">動作に関する重要な変更</h2>
+<h2 id="Behaviors">重要的行为变更</h2>
-<p>以前に Android 対応アプリを公開したことがある場合は、アプリが Android 5.0 の変更による影響を受ける可能性があることに注意してください。</p>
+<p>请注意,如果您之前发布了 Android 版应用,那么您的应用可能会受到 Android 5.0 变化的影响。</p>
-<h3 id="ART">まだ新しい Android Runtime(ART)に対してアプリをテストしていない場合</h3>
+<h3 id="ART">如果您尚未针对新的 Android 运行时 (ART) 测试您的应用…</h3>
-<p>リリース 4.4 では新しい Android ランタイムである ART が試験的に導入されていました。4.4 では、ART はオプションで、デフォルトのランタイムは Dalvik のままでした。Android 5.0 では、ART がデフォルトのランタイムになりました。</p>
+<p>第 4.4 版引入了一个全新的实验性功能,即 Android 运行时 (ART)。在第 4.4 版中,ART 是可选的,默认运行时仍为 Dalvik。对于 Android 5.0,默认运行时现在是 ART。</p>
-<p>ART の新機能の概要について詳しくは、<a href="https://source.android.com/devices/tech/dalvik/art.html">ART の紹介</a>をご覧ください。主に次のような新機能があります。</p>
+<p>有关 ART 新功能的概述,请参阅 <a href="https://source.android.com/devices/tech/dalvik/art.html">ART 简介</a>。主要包括下面的一些新功能:</p>
<ul>
- <li>AOT(Ahead-of-time、事前)コンパイル</li>
- <li>ガベージ コレクション(GC)の向上</li>
- <li>デバッグ サポートの向上</li>
+ <li>预先 (AOT) 编译</li>
+ <li>经过改进的垃圾回收 (GC)</li>
+ <li>经过改进的调试支持</li>
</ul>
-<p>ほとんどの Android アプリは変更を加えなくても ART で問題なく動作します。ただし、Dalvik で動作する一部の技術が ART で動作しません。特に重要な問題について詳しくは、<a href="{@docRoot}guide/practices/verifying-apps-art.html">Android Runtime(ART)でアプリの動作を検証する</a>をご覧ください。特に次の点にご注意ください。</p>
+<p>大多数 Android 应用应该不用做出任何更改即可直接在 ART 下运行。不过,Dalvik 上运行的部分技术在 ART 上无法运行。要了解最重要的问题,请参阅<a href="{@docRoot}guide/practices/verifying-apps-art.html">在 Android 运行时 (ART) 上验证应用行为</a>。请特别注意以下情况:</p>
<ul>
- <li>アプリで C/C++ のコードを実行する場合は Java Native Interface(JNI)を使用します。</li>
- <li>非標準のコードを生成する開発ツール(難読化ツールなど)を使用します。</li>
- <li>ガベージ コレクションのコンパクションと互換性のない技術を使用します(ART では現在 GC のコンパクションは実装されていませんが、Android オープンソース プロジェクトで GC のコンパクションの開発が進められています)。</li>
+ <li>您的应用使用 Java 原生接口 (JNI) 运行 C/C++ 代码。</li>
+ <li>您使用的开发工具可生成非标准代码(例如某些混淆代码)。</li>
+ <li>您使用的技术与垃圾回收压缩不兼容。(虽然 ART 当前没有实施垃圾回收压缩,但在 Android 开放源代码项目中,垃圾回收压缩正处于开发阶段)。</li>
</ul>
-<h3 id="BehaviorNotifications">アプリで通知を実装する場合</h3>
+<h3 id="BehaviorNotifications">如果您的应用实施通知…</h3>
-<p>通知を実装する際は、Android 5.0 での変更点について必ず考慮してください。Android 5.0 以降に対応した通知の設計について詳しくは、<a href="{@docRoot}design/patterns/notifications.html">通知の設計に関するガイド</a>をご覧ください。
+<p>请确保您的通知能够反映出 Android 5.0 的这些变化。要详细了解如何设计适用于 Android 5.0 及更高版本的通知,请参阅<a href="{@docRoot}design/patterns/notifications.html">通知设计指南</a>。
</p>
-<h4 id="NotificationsMaterialDesignStyle">Material Design スタイル</h4>
-<p>通知は、新しい Material Design ウィジェットに合わせて、白色(または非常に明るい色)の背景の上に暗い色のテキストで描かれます。すべての通知が新しい配色で見やすくなるようにしてください。通知が見にくい場合は、次の方法で修正してください。</p>
+<h4 id="NotificationsMaterialDesignStyle">Material Design 设计样式</h4>
+<p>通知是在白色(或颜色非常浅的)背景上绘制的深色文本,以便与新的 Material Design 设计小部件协调一致。请确保所有通知在新的配色方案下都能够正常显示。如果通知无法正常显示,请予以修复:</p>
<ul>
- <li>{@link android.app.Notification.Builder#setColor(int) setColor()} を使用してアクセントのある色を設定し、その色でアイコン イメージの背後に円を描きます。 </li>
- <li>色を伴うアセットを更新または削除します。操作アイコンとメインの通知アイコンでは、非アルファ チャンネルはすべて無視されます。これらのアイコンはアルファのみとなることを前提としてください。通知アイコンは白で、操作アイコンは濃いグレーで、それぞれ描かれます。</li>
+ <li>使用 {@link android.app.Notification.Builder#setColor(int) setColor()} 在图标图片后面的圆圈中设置一种强调色彩。 </li>
+ <li>更新或移除有颜色的资源。系统会忽略操作图标和主通知图标中的所有非 Alpha 通道。您应当假定这些图标仅包含 Alpha 通道。系统会用白色来绘制通知图标,而用深灰色来绘制操作图标。</li>
</ul>
-<h4 id="NotificationsSoundVibration">音声とバイブレーション</h4>
-<p>現在 {@link android.media.Ringtone}、{@link android.media.MediaPlayer}、または {@link android.os.Vibrator} クラスを使用して音声やバイブレーションを通知に追加している場合は、システムが「優先」<em></em>モードで通知を正しく表示できるように、それらのコードを削除してください。代わりに {@link android.app.Notification.Builder} のメソッドを使用して音声やバイブレーションを追加してください。</p>
+<h4 id="NotificationsSoundVibration">声音和振动</h4>
+<p>如果您当前在使用 {@link android.media.Ringtone}、{@link android.media.MediaPlayer} 或 {@link android.os.Vibrator} 类为通知添加声音和振动,请移除该代码,这样系统才能以优先模式正常呈现通知。<em></em>若要添加声音和振动,请改用 {@link android.app.Notification.Builder} 方法。</p>
-<p>端末を {@link android.media.AudioManager#RINGER_MODE_SILENT RINGER_MODE_SILENT} に設定すると端末が新しい優先モードになります。端末を {@link android.media.AudioManager#RINGER_MODE_NORMAL RINGER_MODE_NORMAL} または {@link android.media.AudioManager#RINGER_MODE_NORMAL RINGER_MODE_VIBRATE} に設定すると端末の優先モードが終了します。</p>
+<p>将设备设置为 {@link android.media.AudioManager#RINGER_MODE_SILENT RINGER_MODE_SILENT} 会导致它进入新的优先模式。如果将设备设置为 {@link android.media.AudioManager#RINGER_MODE_NORMAL RINGER_MODE_NORMAL} 或 {@link android.media.AudioManager#RINGER_MODE_NORMAL RINGER_MODE_VIBRATE},则会使其退出优先模式。</p>
-<p>従来、Android ではタブレット端末のボリュームをコントロールするために {@link android.media.AudioManager#STREAM_MUSIC STREAM_MUSIC} をマスター ストリームとして使用していました。Android 5.0 では、携帯電話とタブレット端末の両方のマスター ボリューム ストリームが統合され、{@link android.media.AudioManager#STREAM_RING STREAM_RING} または {@link android.media.AudioManager#STREAM_NOTIFICATION STREAM_NOTIFICATION} によってコントロールされるようになりました。</p>
+<p>以前,Android 将 {@link android.media.AudioManager#STREAM_MUSIC STREAM_MUSIC} 用作主音量流,以此来控制平板电脑设备的音量。在 Android 5.0 中,手机和平板电脑设备的主音量流现已统一,均由 {@link android.media.AudioManager#STREAM_RING STREAM_RING} 或 {@link android.media.AudioManager#STREAM_NOTIFICATION STREAM_NOTIFICATION} 控制。</p>
-<h4 id="NotificationsLockscreenVisibility">ロック画面の表示</h4>
-<p>Android 5.0 ではデフォルトでユーザーのロック画面に通知が表示されるようになりました。ユーザーは機密情報の表示を防ぐことを選択できます。その場合は通知に表示されるテキストが自動的に編集されます。編集される通知をカスタマイズする場合は、{@link android.app.Notification.Builder#setPublicVersion(android.app.Notification) setPublicVersion()} を使用してください。</p>
-<p>通知に個人情報が含まれていない場合や、通知にメディア再生コントロールを表示できるようにしたい場合は、{@link android.app.Notification.Builder#setVisibility(int) setVisibility()} メソッドを呼び出して通知の表示レベルを {@link android.app.Notification#VISIBILITY_PUBLIC VISIBILITY_PUBLIC} に設定してください。
+<h4 id="NotificationsLockscreenVisibility">通知在锁定屏幕上的公开程度</h4>
+<p>在 Android 5.0 中,通知现在默认显示在用户的锁定屏幕上。用户可以选择不公开敏感信息,这样的话系统会自动修改通知显示文本。要自定义这种经过修改的通知,请使用 {@link android.app.Notification.Builder#setPublicVersion(android.app.Notification) setPublicVersion()}。</p>
+<p>如果通知不包含个人信息,或者您希望在通知中显示媒体播放控件,请调用 {@link android.app.Notification.Builder#setVisibility(int) setVisibility()} 方法,并将通知的公开程度的级别设置为 {@link android.app.Notification#VISIBILITY_PUBLIC VISIBILITY_PUBLIC}。
</p>
-<h4 id="NotificationsMediaPlayback">メディアの再生</h4>
-<p>メディアの再生状態やトランスポート コントロールを表示する通知を実装する場合は、カスタムの {@link android.widget.RemoteViews.RemoteView} オブジェクトに代わって新しい {@link android.app.Notification.MediaStyle} テンプレートを使用することをおすすめします。どちらのアプローチの場合でも、必ず通知の表示を {@link android.app.Notification#VISIBILITY_PUBLIC VISIBILITY_PUBLIC} に設定して、ロック画面からコントロールにアクセスできるようにしてください。Android 5.0 以降では、ロック画面に {@link android.media.RemoteControlClient} オブジェクトが表示されなくなりました。詳しくは、<a href="#BehaviorMediaControl">アプリで RemoteControlClient を使用する場合</a>をご覧ください。</p>
+<h4 id="NotificationsMediaPlayback">媒体播放</h4>
+<p>如果您要实施可呈现媒体播放状态或传输控件的通知,请考虑使用新的 {@link android.app.Notification.MediaStyle} 模板,而不是自定义 {@link android.widget.RemoteViews.RemoteView} 对象。无论您选择使用哪种方法,请务必将通知的公开程度设置为 {@link android.app.Notification#VISIBILITY_PUBLIC VISIBILITY_PUBLIC},以便用户可以在锁定屏幕中使用您的控件。请注意,从 Android 5.0 开始,系统不再在锁定屏幕中显示 {@link android.media.RemoteControlClient} 对象。有关详情,请参阅<a href="#BehaviorMediaControl">如果您的应用使用 RemoteControlClient</a>。</p>
-<h4 id="NotificationsHeadsup">警告通知</h4>
-<p>必要に応じて、端末がアクティブのとき(端末のロックが解除されていて画面が表示されているとき)に通知が小さいフローティング ウィンドウ(警告通知ともいいます)に表示されるようになりました。これらの通知の外観はデベロッパーによる簡易形式の通知に似ていますが、警告通知には操作ボタンも表示されます。ユーザーは、現在のアプリから離れることなく警告通知に応答したり、警告通知を拒否したりできます。</p>
+<h4 id="NotificationsHeadsup">提醒通知</h4>
+<p>现在,当设备处于活动状态(即设备未锁定且屏幕亮起)时,通知可以显示在小型浮动窗口中(也称为提醒通知)。此类通知采用的显示形式与紧凑型通知采用的形式类似,不同的是提醒通知还会显示操作按钮。用户无需退出当前应用,即可根据提醒通知执行操作或关闭提醒通知。</p>
-<p>たとえば次のような条件の場合に警告通知が起動されることがあります。</p>
+<p>可以触发提醒通知的情景示例包括:</p>
<ul>
- <li>ユーザーのアクティビティが全画面表示モードになっている(アプリで {@link android.app.Notification#fullScreenIntent} を使用している)</li>
- <li>通知の優先順位が高く、着信音やバイブレーションを使用している</li>
+ <li>用户在全屏模式下执行操作(应用使用 {@link android.app.Notification#fullScreenIntent})</li>
+ <li>通知的优先级较高,并且使用铃声或振动</li>
</ul>
-<p>こうした条件の下でアプリで通知を実装する場合は、必ず警告通知が正しく表示されるようにしてください。</p>
+<p>如果您的应用在上述任意一种情景下实施通知,请确保提醒通知能够正常呈现。</p>
-<h3 id="BehaviorMediaControl">アプリで RemoteControlClient を使用する場合</h3>
-<p>{@link android.media.RemoteControlClient} クラスは非推奨になりました。できるだけ速やかに新しい {@link android.media.session.MediaSession} API に切り替えてください。</p>
+<h3 id="BehaviorMediaControl">如果您的应用使用 RemoteControlClient…</h3>
+<p>{@link android.media.RemoteControlClient} 类现已被弃用。请尽快改用全新的 {@link android.media.session.MediaSession} API。</p>
-<p>Android 5.0 のロック画面には {@link android.media.session.MediaSession} または {@link android.media.RemoteControlClient} に対応したトランスポート コントロールは表示されません。アプリでは代わりに、通知を通してロック画面からメディア再生コントロールを提供することができます。これにより、メディアボタンの表示をより詳細にコントロールできるようになると同時に、端末のロック時とロック解除時で一貫したユーザー エクスペリエンスが提供されます。</p>
+<p>对于 {@link android.media.session.MediaSession} 或 {@link android.media.RemoteControlClient},Android 5.0 中的锁定屏幕不会显示传输控件。相反,您的应用可以通过通知在锁定屏幕中提供媒体播放控件。这样,您的应用就能够更好地控制媒体按钮的展现方式,同时还能让用户无论在设备处于锁定还是解锁状态下都可以执行同样的操作。</p>
-<p>この目的のために、Android 5.0 では新しい {@link android.app.Notification.MediaStyle} テンプレートが導入されています。{@link android.app.Notification.MediaStyle} は、{@link android.app.Notification.Builder#addAction(int, java.lang.CharSequence, android.app.PendingIntent) Notification.Builder.addAction()} で追加した通知操作をコンパクトなボタンに変換し、アプリのメディア再生通知に埋め込みます。セッション トークンを {@link android.app.Notification.MediaStyle#setMediaSession(android.media.session.MediaSession.Token) setSession()} メソッドに渡し、この通知によって以後のメディア セッションがコントロールされることをシステムに伝えます。</p>
+<p>为此,Android 5.0 引入了一个新的 {@link android.app.Notification.MediaStyle} 模板。{@link android.app.Notification.MediaStyle} 将您通过 {@link android.app.Notification.Builder#addAction(int, java.lang.CharSequence, android.app.PendingIntent) Notification.Builder.addAction()} 添加的通知操作转换到在您应用的媒体播放通知中内嵌的紧凑型按钮中。将会话令牌传递到 {@link android.app.Notification.MediaStyle#setMediaSession(android.media.session.MediaSession.Token) setSession()} 方法,指示系统此通知控制正在进行的媒体会话。</p>
-<p>必ず通知の表示を {@link android.app.Notification#VISIBILITY_PUBLIC VISIBILITY_PUBLIC} に設定し、どのようなロック画面でも安全に表示できる(それ以外の場合はセキュリティで保護される)ものとしてマークします。詳しくは、<a href="#LockscreenNotifications">ロック画面の通知</a>をご覧ください。</p>
+<p>请务必将通知的公开程度设置为 {@link android.app.Notification#VISIBILITY_PUBLIC VISIBILITY_PUBLIC},将通知标为安全通知,以便在任何锁定屏幕(安全屏幕或其他屏幕)上显示。有关详情,请参阅<a href="#LockscreenNotifications">在锁定屏幕上显示通知</a>。</p>
-<p>アプリを Android <a href="{@docRoot}tv/index.html">TV</a> または <a href="{@docRoot}wear/index.html">Wear</a> プラットフォームで実行する場合、メディア再生コントロールを表示するには {@link android.media.session.MediaSession} クラスを実装してください。アプリで Android 端末のメディアボタン イベントを受信する必要がある場合は、{@link android.media.session.MediaSession} も実装してください。</p>
+<p>如果您的应用是在 Android <a href="{@docRoot}tv/index.html">TV</a> 或 <a href="{@docRoot}wear/index.html">Wear</a> 平台上运行,请通过实施 {@link android.media.session.MediaSession} 类来显示媒体播放控件。如果您的应用需要在 Android 设备上接收媒体按钮事件,您还应当实施 {@link android.media.session.MediaSession}。</p>
-<h3 id="BehaviorGetRecentTasks">アプリで getRecentTasks() を使用する場合</h3>
+<h3 id="BehaviorGetRecentTasks">如果您的应用使用 getRecentTasks()…</h3>
-<p>Android 5.0 で新しい「同時実行中のドキュメント / アクティビティ タスク」<em></em>機能が導入されたことに伴い(下記の<a href="#Recents">最近使ったアプリ画面に表示される同時実行中のドキュメント / アクティビティ</a>をご覧ください)、ユーザーのプライバシーを向上させるために {@link android.app.ActivityManager#getRecentTasks ActivityManager.getRecentTasks()} メソッドは非推奨になりました。下位互換性の目的から、このメソッドは引き続きデータの小さなサブセット(呼び出し側アプリの独自のタスクや、他の機密でないタスク(たとえばホーム)など)を返します。アプリで独自のタスクを取得するためにこのメソッドを使用している場合は、代わりに {@link android.app.ActivityManager#getAppTasks() getAppTasks()} を使用してその情報を取得してください。</p>
+<p><em></em>由于 Android 5.0 中引入了并行文档和活动任务这一新功能(请参阅下文中的<a href="#Recents">“最近用过”屏幕中的并行文档和活动</a>),{@link android.app.ActivityManager#getRecentTasks ActivityManager.getRecentTasks()} 方法现已被弃用,以更好地保护用户隐私。为了实现向后兼容性,此方法仍会返回它的一小部分数据,包括调用应用自身的任务,同时还可能包括其他一些非敏感任务(例如“首页”)。如果您的应用在使用此方法检索它自身的任务,请改用 {@link android.app.ActivityManager#getAppTasks() getAppTasks()} 检索该信息。</p>
-<h3 id="64BitSupport">Android Native Development Kit(NDK)を使用している場合</h3>
+<h3 id="64BitSupport">如果您使用的是 Android 原生开发工具包 (NDK)…</h3>
-<p>Android 5.0 では 64 ビット システムのサポートが導入されています。64 ビットへの拡大によってアドレス空間が増加し、パフォーマンスが向上します。一方で、既存の 32 ビット アプリについても引き続き完全にサポートされます。また、64 ビットのサポートによって OpenSSL の暗号化のパフォーマンスも向上します。さらに、今回のリリースではネイティブの OpenGL ES(GLES)3.1 のサポートに加えて、新しいネイティブのメディア NDK API も導入されています。</p>
+<p>Android 5.0 支持 64 位系统。64 位增强功能增加了寻址空间并提高了性能,同时仍能全面支持现有的 32 位应用。64 位支持还提高了 OpenSSL 的加密性能。另外,此版本还引入了新的原生媒体 NDK API 以及原生 OpenGL ES (GLES) 3.1 支持。</p>
-<p>Android 5.0 で提供される 64 ビットのサポートを利用するには、<a href="{@docRoot}tools/sdk/ndk/index.html">Android NDK のページ</a>から NDK Revision 10c をダウンロードしてインストールしてください。NDK の重要な変更点とバグ修正について詳しくは、Revision 10c の<a href="{@docRoot}tools/sdk/ndk/index.html#Revisions">リリースノート</a>をご覧ください。</p>
+<p>要利用 Android 5.0 中提供的 64 位支持,请从 <a href="{@docRoot}tools/sdk/ndk/index.html">Android NDK 页面</a>下载并安装 NDK 10c 版。要详细了解 NDK 的重要变化和错误修复,请参阅 10c 版<a href="{@docRoot}tools/sdk/ndk/index.html#Revisions">版本说明</a>。</p>
-<h3 id="BindService">アプリからサービスにバインドする場合</h3>
+<h3 id="BindService">如果您的应用绑定到某项服务…</h3>
-<p>{@link android.content.Context#bindService(android.content.Intent, android.content.ServiceConnection, int) Context.bindService()} メソッドについて、明示的な {@link android.content.Intent} の指定が必須となり、暗黙的なインテントを指定した場合は例外をスローするようになりました。アプリが確実にセキュリティで保護されるように、{@link android.app.Service} の起動やバインドの際は明示的なインテントを使用し、サービスに対してインテント フィルタを宣言しないでください。</p>
+<p>{@link android.content.Context#bindService(android.content.Intent, android.content.ServiceConnection, int) Context.bindService()} 方法现在要求获取显式 {@link android.content.Intent};如果获取的是隐式 intent,则会引发异常。为了确保您的应用是安全的,请在启动或绑定 {@link android.app.Service} 时使用显式 intent,并且不要为此服务声明 intent 过滤器。</p>
-<h3 id="BehaviorWebView">アプリが WebView を使用している場合</h3>
+<h3 id="BehaviorWebView">如果您的应用使用 WebView…</h3>
-<p>Android 5.0 ではアプリのデフォルトの動作が変更されています。</p>
+<p>Android 5.0 会更改您应用的默认行为。</p>
<ul>
-<li><strong>アプリの対象が API レベル 21 以降の場合:</strong>
+<li><strong>如果您的应用的目标 API 级别不低于 21</strong>:
<ul>
- <li><a href="https://developer.mozilla.org/en-US/docs/Security/MixedContent" class="external-link">混合コンテンツ</a>とサードパーティの Cookie がデフォルトでブロックされます。混合コンテンツとサードパーティの Cookie を許可するには、それぞれ {@link android.webkit.WebSettings#setMixedContentMode(int) setMixedContentMode()} メソッドと {@link android.webkit.CookieManager#setAcceptThirdPartyCookies(android.webkit.WebView, boolean) setAcceptThirdPartyCookies()} メソッドを使用します。</li>
- <li>描画する HTML ドキュメントの部分が適切に選択されるようになりました。この新しいデフォルトの動作は、メモリ量の減少とパフォーマンスの向上につながります。ドキュメント全体を一度に表示したい場合は、{@link android.webkit.WebView#enableSlowWholeDocumentDraw()} を呼び出してこの最適化を無効にしてください。</li>
+ <li>默认情况下,系统会屏蔽<a href="https://developer.mozilla.org/en-US/docs/Security/MixedContent" class="external-link">混合内容</a>和第三方 Cookie。要让系统不屏蔽混合内容和第三方 Cookie,请分别使用 {@link android.webkit.WebSettings#setMixedContentMode(int) setMixedContentMode()} 和 {@link android.webkit.CookieManager#setAcceptThirdPartyCookies(android.webkit.WebView, boolean) setAcceptThirdPartyCookies()} 方法。</li>
+ <li>系统现在可以智能选择要绘制的 HTML 文档部分。这一新的默认行为有助于降低内存占用量并提高性能。如果您要一次性呈现整个文档,请调用 {@link android.webkit.WebView#enableSlowWholeDocumentDraw()} 停用此优化行为。</li>
</ul>
</li>
-<li><strong>アプリの対象が API レベル 21 よりも前の場合:</strong> 混合コンテンツとサードパーティの Cookie が許可され、常にドキュメント全体が一度に表示されます。</li>
+<li><strong>如果您的应用的目标 API 级别低于 21</strong>:系统不会屏蔽混合内容和第三方 Cookie,并且始终会一次性呈现整个文档。</li>
</ul>
-<h2 id="UI">ユーザー インターフェース</h2>
+<h2 id="UI">界面</h2>
-<h3 id="MaterialDesign">Material Design のサポート</h3>
+<h3 id="MaterialDesign">Material Design 设计支持</h3>
-<p>次期リリースでは、Android の新しい「Material Design」<em></em>スタイルが新たにサポートされます。Material Design を使うと、外観が動的に変化し、ユーザーが UI 要素の切り替えを自然だと感じるようなアプリを作成できます。このサポートには以下が含まれます。</p>
+<p><em></em>即将发布的版本新增了对 Android 新 Material Design 设计样式的支持。您可以借助 Material Design 设计样式创建应用,使其呈现动态的视觉效果并为用户提供自然的界面元素过渡效果。此支持包括:</p>
<ul>
- <li>マテリアル テーマ</li>
- <li>ビューシャドウ</li>
- <li>{@link android.support.v7.widget.RecyclerView} ウィジェット</li>
- <li>描画可能なアニメーションとスタイル効果</li>
- <li>Material Design によるアニメーションとアクティビティ遷移効果</li>
- <li>ビューの状態に基づいてビューのプロパティを決めるアニメータ</li>
- <li>カスタマイズ可能な UI ウィジェットと、カラーパレットをコントロールできるアプリバー</li>
- <li>XML ベクター グラフィックをベースとするアニメーション drawable と非アニメーション drawable</li>
+ <li>素材主题背景</li>
+ <li>视图阴影</li>
+ <li>{@link android.support.v7.widget.RecyclerView} 小部件</li>
+ <li>可绘制的动画和样式效果</li>
+ <li>Material Design 设计动画和活动过渡效果</li>
+ <li>基于视图状态的视图属性动画生成器</li>
+ <li>可自定义的界面小部件和应用栏(含您可以控制的调色板)</li>
+ <li>基于 XML 矢量图形的动画和非动画图形内容</li>
</ul>
-<p>アプリに Material Design の機能を追加する方法について詳しくは、<a href="{@docRoot}training/material/index.html">Material Design</a> をご覧ください。</p>
+<p>要详细了解如何向您的应用添加 Material Design 设计功能,请参阅 <a href="{@docRoot}training/material/index.html">Material Design 设计</a>。</p>
-<h3 id="Recents">最近使ったアプリ画面に表示される同時実行中のドキュメント / アクティビティ</h3>
+<h3 id="Recents">“最近用过”屏幕中的并行文档和活动</h3>
-<p>以前のリリースでは、<a href="{@docRoot}guide/components/recents.html">最近使ったアプリ画面</a>には、ユーザーが最近操作したアプリごとにタスクを 1 つずつしか表示できませんでした。今後は、ドキュメント用の同時実行中のアクティビティが追加される場合、必要に応じて複数のタスクをアプリで開けるようになります。この機能により、ユーザーは最近使ったアプリ画面から個々のアクティビティやドキュメントをすばやく切り替えられるようになります。すべてのアプリにわたって一貫した切り替え操作になるので、マルチタスクの操作がしやすくなります。こうした同時実行中のタスクの例としては、ウェブブラウザ アプリで複数のタブを開く、生産性向上アプリで複数のドキュメントを開く、ゲームで複数の試合を同時に実行する、メッセージ アプリで複数のチャットを実行する、などが考えられます。アプリのタスクは {@link android.app.ActivityManager.AppTask} クラスを使って管理できます。</p>
+<p>在以前的版本中,对于用户最近与之互动的每个应用,<a href="{@docRoot}guide/components/recents.html">“最近用过”屏幕</a>都只能显示一个任务。现在,您的应用可以视需要针对其他并行活动或文档打开多个任务。通过此功能,用户可以在“最近用过”屏幕中快速切换各个活动和文档,并能在所有应用之间获得一致的切换体验,从而实现多任务处理。此类并行任务示例可能包括:网络浏览器应用中打开的标签页、效率类应用中的文档、游戏中的并行对局或信息应用中的聊天。您的应用可以通过 {@link android.app.ActivityManager.AppTask} 类管理任务。</p>
-<p>論理的な切れ目を挿入してアクティビティが新しいタスクとして扱われるようにするには、{@link android.app.Activity#startActivity(android.content.Intent) startActivity()} を使用してアクティビティを起動するときに {@link android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT} を使用します。または、マニフェストで <a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a> 要素の {@code documentLaunchMode} 属性を {@code "intoExisting"} または {@code "always"} に設定しても、この動作を実現できます。</p>
+<p>要插入逻辑中断,以便系统能够将您的活动视为一个新任务,请在通过 {@link android.app.Activity#startActivity(android.content.Intent) startActivity()} 启动活动时使用 {@link android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT}。您还可以在清单中将 <a href="{@docRoot}guide/topics/manifest/activity-element.html"><activity></a> 元素的 {@code documentLaunchMode} 属性设置为 {@code "intoExisting"} 或 {@code "always"},从而实现该行为。</p>
-<p>最近使ったアプリ画面が適切に整理されるように、最近使ったアプリ画面に表示できるタスクの最大数をアプリから設定することができます。それには、<a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a> 属性 {@link android.R.attr#maxRecents android:maxRecents} を設定します。指定できる現在の最大タスク数はユーザーあたり 50 個(RAM が不足している端末の場合は 25 個)です。</a></p>
+<p>为了避免“最近用过”屏幕过于混乱,您可以设置应用能够在该屏幕中显示的任务数上限。为此,请设置 <a href="{@docRoot}guide/topics/manifest/application-element.html"><application></a> 的 {@link android.R.attr#maxRecents android:maxRecents} 属性。目前可以指定的上限为,每个用户 50 个任务(对于 RAM 较小的设备,则为每个用户 25 个任务)。</a></p>
-<p>最近使ったアプリ画面に表示されるタスクが再起動後も持続されるように設定することができます。この持続動作をコントロールするには <a href="{@docRoot}reference/android/R.attr.html#persistableMode">android:persistableMode</a> 属性を使用します。また、{@link android.app.Activity#setTaskDescription(android.app.ActivityManager.TaskDescription) setTaskDescription()} メソッドを呼び出して、最近使ったアプリ画面に表示されるアクティビティの表示プロパティ(アクティビティの色、ラベル、アイコンなど)を変更することもできます。</p>
+<p>您可以将“最近用过”屏幕中的任务设置为在重新启动过程中保持不变。要控制这一持续行为,请使用 <a href="{@docRoot}reference/android/R.attr.html#persistableMode">android:persistableMode</a> 属性。您也可以通过调用 {@link android.app.Activity#setTaskDescription(android.app.ActivityManager.TaskDescription) setTaskDescription()} 方法,来更改“最近用过”屏幕中活动的视觉属性,如活动的颜色、标签和图标。</p>
-<h3 id="WebView">WebView の更新</h3>
-<p>Android 5.0 では Chromium M37 に対する {@link android.webkit.WebView} の実装が更新され、セキュリティと安定性が強化されているほか、バグが修正されています。Android 5.0 で実行される {@link android.webkit.WebView} のデフォルトのユーザーエージェント文字列が更新され、バージョン番号として 37.0.0.0 が組み込まれています。</p>
+<h3 id="WebView">WebView 更新</h3>
+<p>Android 5.0 将 {@link android.webkit.WebView} 实施更新为 Chromium M37,不仅提高了安全性和稳定性,还修复了多项错误。Android 5.0 上运行的 {@link android.webkit.WebView} 的默认用户代理字符串已更新为采用 37.0.0.0 作为版本号。</p>
-<p>今回のリリースでは {@link android.webkit.PermissionRequest} クラスが導入されています。アプリでこのクラスを使用することで、<a href="https://developer.mozilla.org/en-US/docs/NavigatorUserMedia.getUserMedia" class="external-link">getUserMedia()</a> などのウェブ API を通じてカメラやマイクなどの保護リソースにアクセスするための権限を {@link android.webkit.WebView} に許可できます。{@link android.webkit.WebView} に権限を許可するためには、これらのリソースに対する適切な Android 権限をアプリに持たせる必要があります。</p>
+<p>此版本引入了 {@link android.webkit.PermissionRequest} 类,该类允许您的应用 <a href="https://developer.mozilla.org/en-US/docs/NavigatorUserMedia.getUserMedia" class="external-link">getUserMedia()</a> 之类的 Web API 向 {@link android.webkit.WebView} 授予对受保护资源(例如摄像头和麦克风)的访问权限。您的应用必须拥有对这些资源的相应 Android 权限,才能向 {@link android.webkit.WebView} 授予权限。</p>
-<p>新しい <code><a href="{@docRoot}reference/android/webkit/WebChromeClient.html#onShowFileChooser(android.webkit.WebView, android.webkit.ValueCallback<android.net.Uri[]>, android.webkit.WebChromeClient.FileChooserParams)">onShowFileChooser()</a></code> メソッドでは、{@link android.webkit.WebView} で入力フォーム項目を使用できるようになり、ファイル選択機能を起動して Android 端末から画像やファイルを選択できるようになりました。</p>
+<p>借助新的 <code><a href="{@docRoot}reference/android/webkit/WebChromeClient.html#onShowFileChooser(android.webkit.WebView, android.webkit.ValueCallback<android.net.Uri[]>, android.webkit.WebChromeClient.FileChooserParams)">onShowFileChooser()</a></code> 方法,您现在不但可以在 {@link android.webkit.WebView} 中使用输入表单字段,而且可以启动文件选择器从 Android 设备中选择图片和文件。</p>
-<p>さらに、今回のリリースでは <a href="http://webaudio.github.io/web-audio-api/" class="external-link">WebAudio</a>、<a href="https://www.khronos.org/webgl/" class="external-link">WebGL</a>、<a href="http://www.webrtc.org/" class="external-link">WebRTC</a> の各オープン規格もサポートされるようになります。今回のリリースに含まれる新機能について詳しくは、<a href="https://developer.chrome.com/multidevice/webview/overview" class="external-link">Android 用 WebView</a> をご覧ください。</p>
+<p>另外,此版本还支持 <a href="http://webaudio.github.io/web-audio-api/" class="external-link">WebAudio</a>、<a href="https://www.khronos.org/webgl/" class="external-link">WebGL</a> 和 <a href="http://www.webrtc.org/" class="external-link">WebRTC</a> 等开放标准。要详细了解此版本中的新增功能,请参阅 <a href="https://developer.chrome.com/multidevice/webview/overview" class="external-link">Android 版 WebView</a>。</p>
-<h3 id="ScreenCapture">画面のキャプチャと共有</h3>
-<p>Android 5.0 では、新しい {@link android.media.projection} API を使用して画面キャプチャ機能や画面共有機能をアプリに追加できます。この機能は、たとえばビデオ会議アプリで画面の共有を有効にしたい場合などに便利です。</p>
+<h3 id="ScreenCapture">屏幕截图和共享</h3>
+<p>通过 Android 5.0,您可以使用新的 {@link android.media.projection} API 向您的应用添加屏幕截图和屏幕共享功能。例如,如果您希望在视频会议应用中启用屏幕共享,则会发现此功能非常实用。</p>
-<p>アプリで新しい {@link android.media.projection.MediaProjection#createVirtualDisplay(java.lang.String, int, int, int, int, android.view.Surface, android.hardware.display.VirtualDisplay.Callback, android.os.Handler) createVirtualDisplay()} メソッドを使用すると、メイン画面(デフォルトの表示)の内容をキャプチャして {@link android.view.Surface} オブジェクトに取り込み、アプリからネットワーク経由で送信することができます。API では、セキュリティで保護されていない画面内容のキャプチャのみ可能であり、システム音声のキャプチャはできません。アプリで画面のキャプチャを開始するには、最初に {@link android.media.projection.MediaProjectionManager#createScreenCaptureIntent()} メソッドを通じて取得した {@link android.content.Intent} を使用して画面キャプチャ用のダイアログを起動し、ユーザーの許可をリクエストする必要があります。</p>
+<p>通过新的 {@link android.media.projection.MediaProjection#createVirtualDisplay(java.lang.String, int, int, int, int, android.view.Surface, android.hardware.display.VirtualDisplay.Callback, android.os.Handler) createVirtualDisplay()} 方法,您的应用可以将主屏幕内容(默认显示屏)捕获到 {@link android.view.Surface} 对象中,然后通过网络发送该对象。该 API 仅允许捕获非安全的屏幕内容,不允许捕获系统音频。要开始屏幕截图,您的应用必须先使用通过 {@link android.media.projection.MediaProjectionManager#createScreenCaptureIntent()} 方法获取的 {@link android.content.Intent} 启动屏幕截图对话框,来请求用户向其授予相应权限。</p>
-<p>新しい API の使用例については、サンプル プロジェクトの {@code MediaProjectionDemo} クラスをご覧ください。</p>
+<p>有关新 API 的使用示例,请参阅示例项目中的 {@code MediaProjectionDemo} 类。</p>
<h2 id="Notifications">通知</h2>
-<h3 id="LockscreenNotifications">ロック画面の通知</h3>
-<p>Android 5.0 のロック画面には通知を表示する機能が組み込まれています。ユーザーは [設定]<em></em> を通じて、機密性のある通知内容をセキュリティで保護されたロック画面に表示できるようにするかどうかを選択できます。</p>
+<h3 id="LockscreenNotifications">锁定屏幕通知</h3>
+<p>Android 5.0 中的锁定屏幕能够呈现通知。<em></em>用户可以通过“设置”来选择是否允许在安全的锁定屏幕上显示敏感的通知内容。</p>
-<p>アプリでは、セキュリティで保護されたロック画面にアプリの通知が表示されるときの表示の詳細レベルをコントロールできます。表示レベルをコントロールするには、{@link android.app.Notification.Builder#setVisibility(int) setVisibility()} を呼び出して次のいずれかの値を指定します。</p>
+<p>您的应用可以控制其通知在安全的锁定屏幕上显示时的具体公开程度。要控制公开程度的级别,请调用 {@link android.app.Notification.Builder#setVisibility(int) setVisibility()} 并指定下列值之一:</p>
<ul>
-<li>{@link android.app.Notification#VISIBILITY_PRIVATE VISIBILITY_PRIVATE}: 通知のアイコンなどの基本的な情報は表示しますが、通知内容全体は表示しません。</li>
-<li>{@link android.app.Notification#VISIBILITY_PUBLIC VISIBILITY_PUBLIC}: 通知内容全体を表示します。</li>
-<li>{@link android.app.Notification#VISIBILITY_SECRET VISIBILITY_SECRET}: 通知のアイコンも含めて何も表示しません。</li>
+<li>{@link android.app.Notification#VISIBILITY_PRIVATE VISIBILITY_PRIVATE}:显示基本信息(例如通知图标),但隐藏通知的全部内容。</li>
+<li>{@link android.app.Notification#VISIBILITY_PUBLIC VISIBILITY_PUBLIC}:显示通知的全部内容。</li>
+<li>{@link android.app.Notification#VISIBILITY_SECRET VISIBILITY_SECRET}:不显示任何内容,甚至连通知图标也不显示。</li>
</ul>
-<p>表示レベルが {@link android.app.Notification#VISIBILITY_PRIVATE VISIBILITY_PRIVATE} の場合は、詳細な個人情報を隠した編集済みの通知内容を表示することもできます。たとえば SMS アプリで、「3 個の新しいテキスト メッセージがあります」という通知は表示しますが、メッセージの内容や送信者を表示しないようにできます。こうした代わりの通知を表示するには、最初に {@link android.app.Notification.Builder} を使用して代わりとなる通知を作成します。プライベートの通知オブジェクトを作成するときに、{@link android.app.Notification.Builder#setPublicVersion(android.app.Notification) setPublicVersion()} メソッドを使用して代わりの通知をオブジェクトに添付します。</p>
+<p>如果公开程度级别为 {@link android.app.Notification#VISIBILITY_PRIVATE VISIBILITY_PRIVATE},您还可以提供隐藏了个人详细信息的通知内容修改版本。例如,短信应用的通知可能会显示“您有 3 条新短信”,但隐藏短信内容和发送者。要提供此备用通知,请先使用 {@link android.app.Notification.Builder} 创建替代通知。当创建不公开的通知对象时,请通过 {@link android.app.Notification.Builder#setPublicVersion(android.app.Notification) setPublicVersion()} 方法为其附加替代通知。</p>
-<h3 id="NotificationsMetadata">通知メタデータ</h3>
-<p>Android 5.0 では、アプリの通知がよりスマートに並べ替えられるように、通知に関連付けられたメタデータが使用されます。メタデータを設定するには、通知の作成時に {@link android.app.Notification.Builder} で次のメソッドを呼び出します。</p>
+<h3 id="NotificationsMetadata">通知元数据</h3>
+<p>Android 5.0 使用与您的应用通知关联的元数据更智能地对通知进行排序。要设置元数据,请在构建通知时调用 {@link android.app.Notification.Builder} 中的以下方法:</p>
<ul>
-<li>{@link android.app.Notification.Builder#setCategory(java.lang.String) setCategory()}: 端末が「優先」<em></em>モードのとき(通知が電話の着信、インスタント メッセージ、またはアラームを表している場合など)のアプリでの通知の処理方法をシステムに指示します。
-<li>{@link android.app.Notification.Builder#setPriority(int) setPriority()}: 対象の通知について、通常の通知と比べて重要度が高いことまたは低いことをマークします。優先項目が {@link android.app.Notification#PRIORITY_MAX PRIORITY_MAX} または {@link android.app.Notification#PRIORITY_HIGH PRIORITY_HIGH} に設定された通知は、通知に音声やバイブレーションが付いている場合に、小さいフローティング ウィンドウに表示されます。</li>
-<li>{@link android.app.Notification.Builder#addPerson(java.lang.String) addPerson()}: 通知への関連性がある人を 1 人以上追加できるようにします。アプリでこうしたメソッドを使用することで、指定した人からの通知をグループにまとめる必要があることや、それらの人からの通知をより重要なものとしてランク付けする必要があることを、システムに知らせることができます。</li>
+<li>{@link android.app.Notification.Builder#setCategory(java.lang.String) setCategory()}:告诉系统当设备处于“优先”<em></em>模式时如何处理您的应用通知(例如,当通知表示来电、即时消息或警报时)。
+<li>{@link android.app.Notification.Builder#setPriority(int) setPriority()}:将通知标记为重要性高于或低于普通通知。如果还带有声音或振动,则优先级字段设置为 {@link android.app.Notification#PRIORITY_MAX PRIORITY_MAX} 或 {@link android.app.Notification#PRIORITY_HIGH PRIORITY_HIGH} 的通知将出现在一个小的浮动窗口中。</li>
+<li>{@link android.app.Notification.Builder#addPerson(java.lang.String) addPerson()}:允许您向通知添加一个或多个相关的人员。利用此方法,您的应用可指示系统将来自指定人员的通知归成一组,或者将来自这些人员的通知归类为重要性高于普通通知。</li>
</ul>
-<h2 id="Graphics">グラフィック</h2>
+<h2 id="Graphics">显卡</h2>
-<h3 id="OpenGLES-3-1">OpenGL ES 3.1 のサポート</h3>
-<p>Android 5.0 では、OpenGL ES 3.1 のネイティブ サポートとそれに対応した Java インターフェースが追加されています。OpenGL ES 3.1 では主に次の新機能が提供されています。</p>
+<h3 id="OpenGLES-3-1">支持 OpenGL ES 3.1</h3>
+<p>Android 5.0 针对 OpenGL ES 3.1 添加了 Java 接口和原生支持。OpenGL ES 3.1 中提供的主要新功能包括:</p>
<ul>
-<li>コンピュート シェーダ
-<li>個別のシェーダ オブジェクト
-<li>間接描画コマンド
-<li>マルチサンプル テクスチャとステンシル テクスチャ
-<li>シェーディング言語の向上
-<li>高度なブレンドモードとデバッグに対応した拡張機能
-<li>OpenGL ES 2.0 / 3.0 との下位互換性
+<li>对着色器进行计算
+<li>单独的着色器对象
+<li>间接绘图命令
+<li>多样本和模版纹理
+<li>对着色语言的改进
+<li>用于高级混合模式和调试的扩展
+<li>对 OpenGL ES 2.0 和 3.0 的向后兼容性
</ul>
-<p>Android での OpenGL ES 3.1 の Java インターフェースは {@link android.opengl.GLES31} で提供されます。OpenGL ES 3.1 を使用する場合は、必ずマニフェスト ファイルで <a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a> タグと {@code android:glEsVersion} 属性を使用して宣言してください。次に例を示します。</p>
+<p>Android 上 OpenGL ES 3.1 的 Java 接口是通过 {@link android.opengl.GLES31} 提供的。当使用 OpenGL ES 3.1 时,请务必在您的清单文件中使用 <a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a> 标记和 {@code android:glEsVersion} 属性声明它。例如:</p>
<pre>
<manifest>
@@ -332,23 +330,23 @@
</manifest>
</pre>
-<p>端末でサポートされている OpenGL ES のバージョンを実行時にチェックする方法など、OpenGL ES の使い方について詳しくは、<a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL ES API ガイド</a>をご覧ください。</p>
+<p>有关使用 OpenGL ES 的更多信息,包括如何在运行时检查设备支持的 OpenGL ES 版本,请参阅 <a href="{@docRoot}guide/topics/graphics/opengl.html">OpenGL ES API 指南</a>。</p>
-<h3 id="AndroidExtensionPack">Android Extension Pack</h3>
+<h3 id="AndroidExtensionPack">Android 扩展程序包</h3>
-<p>OpenGL ES 3.1 に加えて、今回のリリースでは、高度なグラフィック機能のネイティブ サポートとそれに対応した Java インターフェースを実現する拡張パックが提供されています。これらの拡張機能は Android で 1 つのパッケージとして扱われます({@code ANDROID_extension_pack_es31a} 拡張機能が存在する場合、アプリではパッケージ内のすべての拡張機能が存在すると見なして、1 つの {@code #extension} ステートメントでシェーディング言語機能を有効にすることができます)。</p>
+<p>除了 OpenGL ES 3.1 之外,本版本还提供了一个扩展程序包,该程序包具有适用于高级显卡功能的 Java 接口和原生支持。Android 将这些扩展程序视为一个程序包。(如果存在 {@code ANDROID_extension_pack_es31a} 扩展程序,则您的应用可以假定该程序包中的所有扩展都存在,并可通过单个 {@code #extension} 语句启用着色语言功能。)</p>
-<p>拡張パックは以下をサポートします。</p>
+<p>该扩展程序包支持:</p>
<ul>
-<li>保証されたフラグメント シェーダによる、シェーダ保存バッファ、イメージ、アトミックのサポート(OpenGL ES 3.1 ではフラグメント シェーダのサポートはオプションです)</li>
-<li>テッセレーション シェーダとジオメトリ シェーダ</li>
-<li>ASTC(LDR)テクスチャ圧縮形式</li>
-<li>サンプル単位の補間とシェーディング</li>
-<li>フレーム バッファ内の各カラー アタッチメントに対応した各種のブレンドモード</li>
+<li>对着色器存储缓冲区、图片和原子的有保证片段着色器支持(片段着色器支持在 OpenGL ES 3.1 中是可选的。)</li>
+<li>曲面细分和几何着色器</li>
+<li>ASTC (LDR) 纹理压缩格式</li>
+<li>按样本插值和着色</li>
+<li>为帧缓冲区中的每个颜色附件使用不同的混合模式</li>
</ul>
-<p>拡張パックの Java インターフェースは {@link android.opengl.GLES31Ext} で提供されます。アプリのマニフェストで、拡張パックをサポートしている端末にのみアプリをインストールする必要があることを宣言できます。次に例を示します。</p>
+<p>该扩展程序包的 Java 接口是通过 {@link android.opengl.GLES31Ext} 提供的。在您的应用清单中,您可以声明您的应用必须仅安装在支持该扩展程序包的设备上。例如:</p>
<pre>
<manifest>
@@ -358,117 +356,117 @@
</manifest>
</pre>
-<h2 id="Media">メディア</h2>
+<h2 id="Media">媒体</h2>
-<h3 id="Camera-v2">高度なカメラ機能に対応した Camera API</h3>
+<h3 id="Camera-v2">用于高级摄像头功能的摄像头 API</h3>
-<p>Android 5.0 では、写真のキャプチャや画像処理をきめ細かく行えるように、新しい <a href="{@docRoot}reference/android/hardware/camera2/package-summary.html">android.hardware.camera2</a> API が導入されています。プログラムから、{@link android.hardware.camera2.CameraManager#getCameraIdList() getCameraIdList()} を通じてシステムで使用できるカメラデバイスにアクセスし、{@link android.hardware.camera2.CameraManager#openCamera(java.lang.String, android.hardware.camera2.CameraDevice.StateCallback, android.os.Handler) openCamera()} を通じて特定のデバイスに接続できるようになりました。画像のキャプチャを開始するには、{@link android.hardware.camera2.CameraCaptureSession} を作成し、キャプチャした画像を送信するための {@link android.view.Surface} オブジェクトを指定します。{@link android.hardware.camera2.CameraCaptureSession} を設定して、1 枚のショットを撮影するようにしたり、一度に複数の画像を撮影するようにしたりできます。</p>
+<p>Android 5.0 引入了新的 <a href="{@docRoot}reference/android/hardware/camera2/package-summary.html">android.hardware.camera2</a> API 来帮助执行精细的照片拍摄和图片处理。您现在可以通过 {@link android.hardware.camera2.CameraManager#getCameraIdList() getCameraIdList()} 以编程方式访问可供系统使用的摄像头设备,并通过 {@link android.hardware.camera2.CameraManager#openCamera(java.lang.String, android.hardware.camera2.CameraDevice.StateCallback, android.os.Handler) openCamera()} 连接到特定设备。要开始拍摄图片,请创建一个 {@link android.hardware.camera2.CameraCaptureSession} 并指定 {@link android.view.Surface} 对象来发送所拍摄的图片。您可以将 {@link android.hardware.camera2.CameraCaptureSession} 配置为单拍或连拍。</p>
-<p>新しい画像がキャプチャされたときに通知を受けるには、{@link android.hardware.camera2.CameraCaptureSession.CaptureCallback} リスナを実装してキャプチャ リクエストで設定します。画像キャプチャ リクエストが完了すると、{@link android.hardware.camera2.CameraCaptureSession.CaptureCallback} リスナが {@link android.hardware.camera2.CameraCaptureSession.CaptureCallback#onCaptureCompleted(android.hardware.camera2.CameraCaptureSession, android.hardware.camera2.CaptureRequest, android.hardware.camera2.TotalCaptureResult) onCaptureCompleted()} への呼び出しを受信し、{@link android.hardware.camera2.CaptureResult} に画像キャプチャ メタデータが設定されます。</p>
+<p>要想在拍摄了新图片时收到通知,请实施 {@link android.hardware.camera2.CameraCaptureSession.CaptureCallback} 监听器并将其设置在您的拍摄请求中。现在,当系统完成图片拍摄请求时,您的 {@link android.hardware.camera2.CameraCaptureSession.CaptureCallback} 监听器将收到对 {@link android.hardware.camera2.CameraCaptureSession.CaptureCallback#onCaptureCompleted(android.hardware.camera2.CameraCaptureSession, android.hardware.camera2.CaptureRequest, android.hardware.camera2.TotalCaptureResult) onCaptureCompleted()} 的调用,在 {@link android.hardware.camera2.CaptureResult} 中向您提供图片拍摄元数据。</p>
-<p>アプリで {@link android.hardware.camera2.CameraCharacteristics} クラスを使用すると、端末でどのカメラ機能が使用できるのかを検出できます。オブジェクトの {@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL INFO_SUPPORTED_HARDWARE_LEVEL} プロパティは、カメラの機能レベルを表します。</p>
+<p>{@link android.hardware.camera2.CameraCharacteristics} 类允许您的应用检测设备上有哪些摄像头功能可用。对象的 {@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL INFO_SUPPORTED_HARDWARE_LEVEL} 属性表示摄像头的功能级别。</p>
<ul>
- <li>すべてのデバイスは少なくとも {@link android.hardware.camera2.CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY} のハードウェア レベルをサポートしています。このレベルは、非推奨となった {@link android.hardware.Camera} API のレベルにほぼ相当する機能を備えています。</li>
- <li>{@link android.hardware.camera2.CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_FULL INFO_SUPPORTED_HARDWARE_LEVEL_FULL} のハードウェア レベルをサポートしているデバイスは、キャプチャとポストプロセスを手動でコントロールする機能と、高いフレームレートで高解像度画像をキャプチャする機能を備えています。</li>
+ <li>所有设备都至少支持 {@link android.hardware.camera2.CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY} 硬件级别,该级别的功能大致等同于已弃用的 {@link android.hardware.Camera} API 的功能。</li>
+ <li>支持 {@link android.hardware.camera2.CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_FULL INFO_SUPPORTED_HARDWARE_LEVEL_FULL} 硬件级别的设备不仅能让用户手动控制拍摄和后期处理,而且能够以高帧速率拍摄高分辨率图片。</li>
</ul>
-<p>最新の <a href="{@docRoot}reference/android/hardware/camera2/package-summary.html">Camera</a> API の使い方について詳しくは、このリリースに付属している {@code Camera2Basic} と {@code Camera2Video} の実装サンプルをご覧ください。</p>
+<p>要了解如何使用更新后的<a href="{@docRoot}reference/android/hardware/camera2/package-summary.html">摄像头</a> API,请参考本版本中的 {@code Camera2Basic} 和 {@code Camera2Video} 实施样本。</p>
-<h3 id="AudioPlayback">音声の再生</h3>
-<p>今回のリリースでは {@link android.media.AudioTrack} に次の変更が加えられています。</p>
+<h3 id="AudioPlayback">音频播放</h3>
+<p>此版本对 {@link android.media.AudioTrack} 进行了以下更改:</p>
<ul>
- <li>アプリから音声データを浮動小数点形式({@link android.media.AudioFormat#ENCODING_PCM_FLOAT ENCODING_PCM_FLOAT})で提供できるようになりました。これにより、ダイナミック レンジの向上、一貫性のある精度の向上、ヘッドルームの向上が可能になります。浮動小数点による計算は、特に中間計算の実行時に便利です。再生のエンドポイントでは、音声データに整数形式が使用され、ビット深度がより少なくなります(Android 5.0 では内部パイプラインの一部がまだ浮動小数点になっていません)。
- <li>アプリから音声データを {@link java.nio.ByteBuffer} として、{@link android.media.MediaCodec} で提供されるものと同じ形式で提供できるようになりました。
- <li>一部のアプリでは、{@link android.media.AudioTrack#WRITE_NON_BLOCKING WRITE_NON_BLOCKING} オプションを使用することでバッファ処理とマルチスレッド処理を簡素化できます。
+ <li>您的应用现在能够以浮点格式 ({@link android.media.AudioFormat#ENCODING_PCM_FLOAT ENCODING_PCM_FLOAT}) 提供音频数据。这允许更大的动态范围、更一致的精度以及更大的动态余量。浮点算法在中间计算期间尤其有用。播放端点为音频数据使用整数格式,并且具有较低的位深度。(在 Android 5.0 中,内部管线的某些部分尚未采用浮点格式。)
+ <li>您的应用现在可以将音频数据提供为 {@link java.nio.ByteBuffer},所用格式与 {@link android.media.MediaCodec} 提供的格式相同。
+ <li>{@link android.media.AudioTrack#WRITE_NON_BLOCKING WRITE_NON_BLOCKING} 选项可以简化某些应用的缓冲和多线程处理。
</ul>
-<h3 id="MediaPlaybackControl">メディア再生コントロール</h3>
-<p>メディアの再生についての情報をシステム UI に知らせ、アルバムアートの抽出と表示ができるように、新しい通知 / メディア API を使用してください。UI とサービスにまたがるメディアの再生のコントロールが、新しい {@link android.media.session.MediaSession} クラスと {@link android.media.session.MediaController} クラスを使用して、より簡単に行えるようになりました。</p>
+<h3 id="MediaPlaybackControl">媒体播放控件</h3>
+<p>使用新的通知和媒体 API,可确保系统界面能够了解您的媒体播放并提取和显示专辑封面。而借助新的 {@link android.media.session.MediaSession} 和 {@link android.media.session.MediaController} 类,您现在则可更轻松地跨界面和服务控制媒体播放。</p>
-<p>新しい {@link android.media.session.MediaSession} クラスは非推奨となった {@link android.media.RemoteControlClient} クラスの代わりとなるもので、トランスポート コントロールとメディアボタンを処理するための単一のコールバック メソッド セットを提供します。アプリでメディアの再生を提供して Android <a href="{@docRoot}tv/index.html">TV</a> または <a href="{@docRoot}wear/index.html">Wear</a> プラットフォームで実行する場合は、{@link android.media.session.MediaSession} クラスを使用し、同じコールバック メソッドを通じてトランスポート コントロールを処理してください。</p>
+<p>新的 {@link android.media.session.MediaSession} 类替代了被弃用的 {@link android.media.RemoteControlClient} 类,并且提供了一组用于处理传输控件和媒体按钮的回调方法。如果您的应用提供媒体播放并且在 Android <a href="{@docRoot}tv/index.html">TV</a> 或 <a href="{@docRoot}wear/index.html">Wear</a> 平台上运行,请使用 {@link android.media.session.MediaSession} 类和相同的回调方法来处理您的传输控件。</p>
-<p>新しい {@link android.media.session.MediaController} クラスを使用して独自のメディア コントローラ アプリを作成できるようになりました。このクラスは、アプリの UI プロセスからスレッドセーフな方法でメディアの再生を監視しコントロールするための手段を提供します。コントローラの作成時に {@link android.media.session.MediaSession.Token} オブジェクトを指定し、指定した {@link android.media.session.MediaSession} をアプリから操作できるようにします。{@link android.media.session.MediaController.TransportControls} のメソッドを使用すると、そのセッションで {@link android.media.session.MediaController.TransportControls#play() play()}、{@link android.media.session.MediaController.TransportControls#stop() stop()}、{@link android.media.session.MediaController.TransportControls#skipToNext() skipToNext()}、{@link android.media.session.MediaController.TransportControls#setRating(android.media.Rating) setRating()} などのコマンドを送信してメディアの再生をコントロールできます。また、コントローラで {@link android.media.session.MediaController.Callback} オブジェクトを登録し、そのセッションでメタデータや状態変更がないかをリッスンできます。</p>
+<p>您现在可以通过新的 {@link android.media.session.MediaController} 类构建您自己的媒体控制器应用。此类提供了一种线程安全方法,可让您通过自己的应用界面流程来监控媒体播放。在创建控制器时,请指定一个 {@link android.media.session.MediaSession.Token} 对象,以便您的应用可以与给定的 {@link android.media.session.MediaSession} 进行互动。通过使用 {@link android.media.session.MediaController.TransportControls} 方法,您可以发送诸如 {@link android.media.session.MediaController.TransportControls#play() play()}、{@link android.media.session.MediaController.TransportControls#stop() stop()}、{@link android.media.session.MediaController.TransportControls#skipToNext() skipToNext()} 和 {@link android.media.session.MediaController.TransportControls#setRating(android.media.Rating) setRating()} 之类的命令来控制该会话中的媒体播放。创建好控制器之后,您还可以注册一个 {@link android.media.session.MediaController.Callback} 对象来监听该会话中的元数据和状态更改。</p>
-<p>さらに、新しい {@link android.app.Notification.MediaStyle} クラスを使用して、再生コントロールをメディア セッションに結び付けることができる高機能な通知を作成できます。</p>
+<p>此外,您还可以通过新的 {@link android.app.Notification.MediaStyle} 类创建允许将播放控件关联到媒体会话的丰富通知。</p>
-<h3 id="MediaBrowsing">メディアの参照</h3>
-<p>Android 5.0 では、新しい <a href="{@docRoot}reference/android/media/browse/package-summary.html">android.media.browse</a> API を通じて、あるアプリから別のアプリのメディア コンテンツ ライブラリを参照する機能が導入されています。アプリのメディア コンテンツを公開するには、{@link android.service.media.MediaBrowserService} クラスを拡張します。{@link android.service.media.MediaBrowserService} の実装で {@link android.media.session.MediaSession.Token} へのアクセスを提供することで、別のアプリがそのサービスを通じて提供されるメディア コンテンツを再生できるようになります。</p>
-<p>メディア ブラウザ サービスを操作するには、{@link android.media.browse.MediaBrowser} クラスを使用します。{@link android.media.browse.MediaBrowser} インスタンスの作成時に、{@link android.media.session.MediaSession} のコンポーネント名を指定します。その後、アプリからブラウザ インスタンスを使用して、関連付けられたサービスに接続し、{@link android.media.session.MediaSession.Token} オブジェクトを取得して、そのサービスを通じて公開されたコンテンツを再生できます。</p>
+<h3 id="MediaBrowsing">媒体浏览</h3>
+<p>Android 5.0 通过新的 <a href="{@docRoot}reference/android/media/browse/package-summary.html">android.media.browse</a> API 引入了允许应用浏览其他应用的媒体内容库的功能。要公开您的应用中的媒体内容,请扩展 {@link android.service.media.MediaBrowserService} 类。您的 {@link android.service.media.MediaBrowserService} 实施应当提供对 {@link android.media.session.MediaSession.Token} 的访问权限,以便应用可以播放通过您的服务提供的媒体内容。</p>
+<p>要与媒体浏览器服务进行互动,请使用 {@link android.media.browse.MediaBrowser} 类。在创建 {@link android.media.browse.MediaBrowser} 实例时,请为 {@link android.media.session.MediaSession} 指定组件名称。然后,您的应用可以使用该浏览器实例连接到关联的服务,并获取 {@link android.media.session.MediaSession.Token} 对象来播放通过该服务公开的内容。</p>
-<h2 id="Storage">ストレージ</h2>
+<h2 id="Storage">存储</h2>
-<h3 id="DirectorySelection">ディレクトリの選択</h3>
+<h3 id="DirectorySelection">目录选择</h3>
-<p>Android 5.0 では<a href="{@docRoot}guide/topics/providers/document-provider.html">ストレージ アクセス フレームワーク</a>が拡張され、ユーザーがディレクトリのサブツリー全体を選択し、それぞれのアイテムについてユーザーの確認を必要とせずに、含まれているすべてのドキュメントへの読み取り / 書き込みアクセス権をアプリに与えることができるようになります。</p>
+<p>Android 5.0 对<a href="{@docRoot}guide/topics/providers/document-provider.html">存储访问框架</a>进行了扩展,允许用户选择整个目录子树,并向应用授予对其中包含的所有文档的读/写访问权限(无需请求用户逐项确认)。</p>
-<p>ディレクトリのサブツリーを選択するには、{@link android.content.Intent#ACTION_OPEN_DOCUMENT_TREE OPEN_DOCUMENT_TREE} インテントを作成して送信します。サブツリーの選択をサポートしているすべての {@link android.provider.DocumentsProvider} インスタンスが表示され、ユーザーがディレクトリを参照して選択することができます。返される URI は、選択されたサブツリーへのアクセス手段を表します。その後、{@link android.provider.DocumentsContract#buildChildDocumentsUriUsingTree(android.net.Uri, java.lang.String) buildChildDocumentsUriUsingTree()} と {@link android.provider.DocumentsContract#buildDocumentUriUsingTree(android.net.Uri, java.lang.String) buildDocumentUriUsingTree()} を {@link android.content.ContentResolver#query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String) query()} と一緒に使用することでサブツリーを探索できます。</p>
+<p>要选择目录子树,请构建并发送 {@link android.content.Intent#ACTION_OPEN_DOCUMENT_TREE OPEN_DOCUMENT_TREE} intent。系统将显示支持子树选择的所有 {@link android.provider.DocumentsProvider} 实例,允许用户进行浏览并选择目录。返回的 URI 表示对所选子树的访问权限。然后,您可以使用 {@link android.provider.DocumentsContract#buildChildDocumentsUriUsingTree(android.net.Uri, java.lang.String) buildChildDocumentsUriUsingTree()} 和 {@link android.provider.DocumentsContract#buildDocumentUriUsingTree(android.net.Uri, java.lang.String) buildDocumentUriUsingTree()} 以及 {@link android.content.ContentResolver#query(android.net.Uri, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String) query()} 来深入了解此子树。</p>
-<p>新しい {@link android.provider.DocumentsContract#createDocument(android.content.ContentResolver, android.net.Uri, java.lang.String, java.lang.String) createDocument()} メソッドを使用すると、サブツリーの配下に新しいドキュメントやディレクトリを作成できます。既存のドキュメントを管理するには、{@link android.provider.DocumentsContract#renameDocument(android.content.ContentResolver, android.net.Uri, java.lang.String) renameDocument()} と {@link android.provider.DocumentsProvider#deleteDocument(java.lang.String) deleteDocument()} を使用します。これらの呼び出しを実行する前に、{@link android.provider.DocumentsContract.Document#COLUMN_FLAGS COLUMN_FLAGS} をチェックして、提供側が呼び出しをサポートしているかどうかを確認してください。</p>
+<p>新的 {@link android.provider.DocumentsContract#createDocument(android.content.ContentResolver, android.net.Uri, java.lang.String, java.lang.String) createDocument()} 方法允许您在子树下的任何位置创建新的文档或目录。要管理现有文档,请使用 {@link android.provider.DocumentsContract#renameDocument(android.content.ContentResolver, android.net.Uri, java.lang.String) renameDocument()} 和 {@link android.provider.DocumentsProvider#deleteDocument(java.lang.String) deleteDocument()}。在发出这些调用之前,请检查 {@link android.provider.DocumentsContract.Document#COLUMN_FLAGS COLUMN_FLAGS} 以验证服务提供方是否支持这些调用。</p>
-<p>{@link android.provider.DocumentsProvider} を実装しようとしていて、サブツリーの選択をサポートしたい場合は、{@link android.provider.DocumentsProvider#isChildDocument(java.lang.String, java.lang.String) isChildDocument()} を実装し、{@link android.provider.DocumentsContract.Root#FLAG_SUPPORTS_IS_CHILD FLAG_SUPPORTS_IS_CHILD} を {@link android.provider.DocumentsContract.Root#COLUMN_FLAGS COLUMN_FLAGS} に追加します。</p>
+<p>如果您在实施 {@link android.provider.DocumentsProvider} 并希望支持子树选择,请实施 {@link android.provider.DocumentsProvider#isChildDocument(java.lang.String, java.lang.String) isChildDocument()} 并在您的 {@link android.provider.DocumentsContract.Root#COLUMN_FLAGS COLUMN_FLAGS} 中添加 {@link android.provider.DocumentsContract.Root#FLAG_SUPPORTS_IS_CHILD FLAG_SUPPORTS_IS_CHILD}。</p>
-<p>Android 5.0 ではまた、共有ストレージ上の新しいパッケージ固有ディレクトリが導入されており、{@link android.provider.MediaStore} に含めることでアプリからメディア ファイルを配置することができます。新しい {@link android.content.Context#getExternalMediaDirs()} は、すべての共有ストレージ デバイスにあるこれらのディレクトリへのパスを返します。{@link android.content.Context#getExternalFilesDir(java.lang.String) getExternalFilesDir()} と同様に、アプリから追加の権限がなくても、返されるパスにアクセスできます。これらのディレクトリはプラットフォームによって定期的にスキャンされ、新しいメディアがないかが調べられますが、{@link android.media.MediaScannerConnection} を使用して明示的にスキャンし、新しいコンテンツがないかを調べることもできます。</p>
+<p>Android 5.0 还在共享的存储空间内引入了程序包专用的新目录,您的应用可将要添加到 {@link android.provider.MediaStore} 中的媒体文件放置在这些目录中。新的 {@link android.content.Context#getExternalMediaDirs()} 将返回这些目录在所有共享的存储设备上的路径。与 {@link android.content.Context#getExternalFilesDir(java.lang.String) getExternalFilesDir()} 类似,您的应用不需要额外的权限即可访问所返回的路径。平台将定期扫描这些目录中的新媒体,但您也可使用 {@link android.media.MediaScannerConnection} 对新内容进行显式扫描。</p>
-<h2 id="Wireless">ワイヤレスと接続</h2>
+<h2 id="Wireless">无线和连接</h2>
-<h3 id="Multinetwork">マルチネットワーク接続</h3>
-<p>Android 5.0 では新しいマルチネットワーク API が導入されています。これらの API を通じてアプリで動的にスキャンを実行し、特定の機能を持つネットワークが使用できないかを調べて、それらへの接続を確立することができます。この機能は、アプリで SUPL、MMS、キャリア課金ネットワークなどの特殊なネットワークを必要とする場合や、特定のタイプのトランスポート コントロールを使用してデータを送信したい場合に便利です。</p>
+<h3 id="Multinetwork">多个网络连接</h3>
+<p>Android 5.0 提供了新的多网络 API,它们允许您的应用动态扫描具有特定功能的可用网络,然后与这些网络建立连接。如果您的应用需要一个专用网络(例如 SUPL、MMS 或运营商计费的网络),或者如果您希望使用某种特定类型的传输协议来发送数据,则此功能非常有用。</p>
-<p>アプリでネットワークを動的に選択して接続する手順は次のとおりです。</p>
+<p>要从您的应用动态选择并连接到某个网络,请执行以下步骤:</p>
<ol>
- <li>{@link android.net.ConnectivityManager} を作成します。</li>
- <li>{@link android.net.NetworkRequest.Builder} クラスを使用して {@link android.net.NetworkRequest} オブジェクトを作成し、アプリで必要なネットワーク機能とトランスポート タイプを指定します。</li>
-<li>適切なネットワークがないかどうかをスキャンして調べるには、{@link android.net.ConnectivityManager#requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback) requestNetwork()} または {@link android.net.ConnectivityManager#registerNetworkCallback(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback) registerNetworkCallback()} を呼び出し、{@link android.net.NetworkRequest} オブジェクトと、{@link android.net.ConnectivityManager.NetworkCallback} の実装を渡します。検出した適切なネットワークに積極的に切り替えたい場合は、{@link android.net.ConnectivityManager#requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback) requestNetwork()} メソッドを使用します。スキャンしたネットワークに積極的に切り替えずに通知のみを受信するには、代わりに {@link android.net.ConnectivityManager#registerNetworkCallback(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback) registerNetworkCallback()} メソッドを使用します。</li>
+ <li>创建一个 {@link android.net.ConnectivityManager}。</li>
+ <li>使用 {@link android.net.NetworkRequest.Builder} 类创建一个 {@link android.net.NetworkRequest} 对象并指定您的应用感兴趣的网络功能和传输类型。</li>
+<li>要扫描合适的网络,请调用 {@link android.net.ConnectivityManager#requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback) requestNetwork()} 或 {@link android.net.ConnectivityManager#registerNetworkCallback(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback) registerNetworkCallback()},并传入 {@link android.net.NetworkRequest} 对象和一个 {@link android.net.ConnectivityManager.NetworkCallback} 实施。如果希望在检测到合适的网络后主动切换到该网络,请使用 {@link android.net.ConnectivityManager#requestNetwork(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback) requestNetwork()} 方法;如果希望仅接收网络扫描结果通知而不主动切换,请使用 {@link android.net.ConnectivityManager#registerNetworkCallback(android.net.NetworkRequest, android.net.ConnectivityManager.NetworkCallback) registerNetworkCallback()} 方法。</li>
</ol>
-<p>適切なネットワークが検出されると、システムはそのネットワークに接続し、{@link android.net.ConnectivityManager.NetworkCallback#onAvailable(android.net.Network) onAvailable()} コールバックを呼び出します。このコールバックの {@link android.net.Network} オブジェクトを使用して、ネットワークに関する詳細な情報を取得したり、選択されたネットワークを使用するようにトラフィックを設定したりできます。</p>
+<p>当系统检测到合适的网络时,它将连接到该网络并调用 {@link android.net.ConnectivityManager.NetworkCallback#onAvailable(android.net.Network) onAvailable()} 回调。您可以在回调中使用 {@link android.net.Network} 对象来获取关于该网络的更多信息,或者指示通信使用选定的网络。</p>
-<h3 id="BluetoothBroadcasting">Bluetooth Low Energy</h3>
-<p>Android 4.3 では、<a href="{@docRoot}guide/topics/connectivity/bluetooth-le.html">Bluetooth Low Energy</a>(<em>Bluetooth LE</em>)がプラットフォームでサポートされ、中央の役割として導入されました。Android 5.0 では、Android 搭載デバイスが Bluetooth LE の「周辺デバイス」<em></em>として機能できるようになりました。アプリからこの機能を使用することで、アプリの存在を付近のデバイスに知らせることができます。たとえば、デバイスを歩数計や健康管理機器として機能させるアプリを作成して、それらのデータを他の Bluetooth LE 対応デバイスとやり取りすることができます。</p>
-<p>新しい {@link android.bluetooth.le} API を使用すると、アプリからアドバタイズをブロードキャストしたり、応答の有無をスキャンして調べたり、付近の Bluetooth LE 対応デバイスとの接続を確立したりできます。新しいアドバタイズ機能やスキャン機能を使用するには、{@link android.Manifest.permission#BLUETOOTH_ADMIN BLUETOOTH_ADMIN} 権限をマニフェストに追加します。ユーザーは、Play ストアでアプリを更新またはダウンロードするときに、「Bluetooth接続情報: Bluetoothの制御(付近のBluetoothデバイスへの送信、詳細情報の取得など)をアプリに許可します」という権限をアプリに許可するかどうかたずねられます。</p>
+<h3 id="BluetoothBroadcasting">低功耗蓝牙</h3>
+<p>Android 4.3 中作为重头戏引入了对<a href="{@docRoot}guide/topics/connectivity/bluetooth-le.html">低功耗蓝牙</a>(“低功耗蓝牙”<em></em>)的平台支持。在 Android 5.0 中,Android 设备现在可以用作低功耗蓝牙<em>外围设备</em>。应用可以使用此功能使附近的设备知道它的存在。例如,您可以构建相应的应用来允许设备用作计步器或健康检测器并与另一低功耗蓝牙设备交换其数据。</p>
+<p>新的 {@link android.bluetooth.le} API 允许您的应用对公告进行广播,扫描响应,以及与附近的低功能蓝牙设备建立连接。要使用新的公告和扫描功能,请在您的清单中添加 {@link android.Manifest.permission#BLUETOOTH_ADMIN BLUETOOTH_ADMIN} 权限。当用户从 Play 商店更新或下载您的应用时,会要求他们向您的应用授予以下权限:“蓝牙连接信息:允许应用控制蓝牙,包括向附近的蓝牙设备进行广播以及获取关于这些设备的信息。”</p>
-<p>他のデバイスがアプリを検出できるように Bluetooth LE によるアドバタイズを開始するには、{@link android.bluetooth.le.BluetoothLeAdvertiser#startAdvertising(android.bluetooth.le.AdvertiseSettings, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseCallback) startAdvertising()} を呼び出し、{@link android.bluetooth.le.AdvertiseCallback} クラスの実装を渡します。このコールバック オブジェクトは、アドバタイズ操作の成否を知らせる通知を受信します。</p>
+<p>要开始低功耗蓝牙公告以便其他设备可以发现您的应用,请调用 {@link android.bluetooth.le.BluetoothLeAdvertiser#startAdvertising(android.bluetooth.le.AdvertiseSettings, android.bluetooth.le.AdvertiseData, android.bluetooth.le.AdvertiseCallback) startAdvertising()} 并传入 {@link android.bluetooth.le.AdvertiseCallback} 类的一个实施。回调对象将收到关于公告操作成功或失败的报告。</p>
-<p> Android 5.0 で導入された {@link android.bluetooth.le.ScanFilter} クラスをアプリで使用すると、必要な特定のタイプのデバイスのみを探すスキャンを実行できます。Bluetooth LE デバイスを探すためのスキャンを開始するには、{@link android.bluetooth.le.BluetoothLeScanner#startScan(android.bluetooth.le.ScanCallback) startScan()} を呼び出し、フィルタのリストを渡します。このメソッド呼び出しでは、{@link android.bluetooth.le.ScanCallback} の実装を渡し、Bluetooth LE のアドバタイズが検出されたときにそれを知らせるようにする必要もあります。 </p>
+<p> Android 5.0 引入了 {@link android.bluetooth.le.ScanFilter} 类,以便您的应用可以仅扫描它感兴趣的特定类型的设备。要开始扫描低功耗蓝牙设备,请调用 {@link android.bluetooth.le.BluetoothLeScanner#startScan(android.bluetooth.le.ScanCallback) startScan()} 并传入一个过滤器列表。在该方法调用中,您还必须提供 {@link android.bluetooth.le.ScanCallback} 的一个实施以便在发现低功耗蓝牙公告时进行报告。 </p>
-<h3 id="NFCEnhancements">NFC の機能強化</h3>
-<p>Android 5.0 では、NFC をより幅広く柔軟に利用できるように、次の機能強化が追加されています。</p>
+<h3 id="NFCEnhancements">NFC 增强功能</h3>
+<p>Android 5.0 添加了以下增强功能以实现更广泛和更灵活的 NFC 使用:</p>
<ul>
-<li>Android Beam が「共有」<em></em>メニューで使用できるようになりました。</li>
-<li>ユーザーの端末でアプリから Android Beam を起動し、{@link android.nfc.NfcAdapter#invokeBeam(android.app.Activity) invokeBeam()} を呼び出してデータを共有することができます。これにより、ユーザーが手動で端末をタップして別の NFC 対応端末へのデータ転送を実行する必要がなくなります。</li>
-<li>新しい {@link android.nfc.NdefRecord#createTextRecord(java.lang.String, java.lang.String) createTextRecord()} メソッドを使用して、UTF-8 テキストデータを含む NDEF レコードを作成できます。</li>
-<li>支払い機能を備えるアプリを開発している場合、<code><a href="{@docRoot}reference/android/nfc/cardemulation/CardEmulation.html#registerAidsForService(android.content.ComponentName, java.lang.String, java.util.List<java.lang.String>)">registerAidsForService()</a></code> を呼び出して NFC アプリケーション ID(AID)を動的に登録できるようになりました。また、{@link android.nfc.cardemulation.CardEmulation#setPreferredService(android.app.Activity, android.content.ComponentName) setPreferredService()} を使用して、特定のアクティビティがフォアグラウンドに存在するときに使用する優先のカード エミュレーション サービスを設定できます。</li>
+<li>“分享”<em></em>菜单中现在提供了 Android Beam。</li>
+<li>您的应用可以通过调用 {@link android.nfc.NfcAdapter#invokeBeam(android.app.Activity) invokeBeam()} 在用户的设备上调用 Android Beam 来分享数据。这不需要用户对着另一个具有 NFC 功能的设备手动点按设备即可完成数据传输。</li>
+<li>您可以使用新的 {@link android.nfc.NdefRecord#createTextRecord(java.lang.String, java.lang.String) createTextRecord()} 方法来创建包含 UTF-8 文本数据的 NDEF 记录。</li>
+<li>如果您在开发支付应用,则您现在能够通过调用 <code><a href="{@docRoot}reference/android/nfc/cardemulation/CardEmulation.html#registerAidsForService(android.content.ComponentName, java.lang.String, java.util.List<java.lang.String>)">registerAidsForService()</a></code> 动态注册 NFC 应用 ID (AID)。您还可以使用 {@link android.nfc.cardemulation.CardEmulation#setPreferredService(android.app.Activity, android.content.ComponentName) setPreferredService()} 设置当某个特定的活动处于前台时应当使用的首选卡仿真服务。</li>
</ul>
<h2 id="Power">Project Volta</h2>
-<p>新機能に加えて、Android 5.0 では特に電池寿命が向上しています。新しい API やツールを使用して、アプリの消費電力に関する情報の取得や消費電力の最適化を行ってください。</p>
+<p>除了新功能之前,Android 5.0 还重点对电池寿命进行了改进。可以使用新的 API 和工具来了解并优化您的应用的功耗。</p>
-<h3 id="JobScheduler">ジョブのスケジューリング</h3>
-<p>Android 5.0 で提供される新しい {@link android.app.job.JobScheduler} API を使用すると、システムが後で、または指定の条件(端末の充電時など)の下で、非同期に実行するジョブを定義することによって、電池寿命を最適化できます。ジョブ スケジューリングは、アプリで次のような状況を処理する場合に便利です。</p>
+<h3 id="JobScheduler">调度作业</h3>
+<p>Android 5.0 提供了一个新的 {@link android.app.job.JobScheduler} API,它允许您通过为系统定义要在以后的某个时间或在指定的条件下(例如,当设备在充电时)异步运行的作业来优化电池寿命。作业调度在下列情况下非常有用:</p>
<ul>
- <li>現在ユーザーが関与していない作業の実行を遅らせることができる場合。</li>
- <li>実行を遅らせた作業を、ユニットが電源に接続されたときに実行する場合。</li>
- <li>ネットワーク アクセスや Wi-Fi 接続を必要とするタスクがある場合。</li>
- <li>定期的なスケジュールで一括して実行したいタスクが複数ある場合。</li>
+ <li>应用具有您可以推迟的非面向用户的工作。</li>
+ <li>应用具有当插入设备时您希望优先执行的工作。</li>
+ <li>应用具有需要访问网络或 Wi-Fi 连接的任务。</li>
+ <li>应用具有您希望作为一个批次定期运行的许多任务。</li>
</ul>
-<p>作業ユニットは {@link android.app.job.JobInfo} オブジェクトによってカプセル化されます。このオブジェクトでスケジューリング条件を指定します。</p>
+<p>工作单元由一个 {@link android.app.job.JobInfo} 对象进行封装。此对象指定了调度条件。</p>
-<p>スケジューリング済みのタスクをどのように実行するのかを設定するには、{@link android.app.job.JobInfo.Builder} クラスを使用します。タスクが次のような特定の条件下で実行されるようにスケジューリングできます。</p>
+<p>使用 {@link android.app.job.JobInfo.Builder} 类配置调度的任务应当如何运行。您可以将任务调度为在特定的条件下运行,例如:</p>
<ul>
- <li>端末の充電時に開始する</li>
- <li>端末が定額制ネットワークに接続されたときに開始する</li>
- <li>端末がアイドル状態のときに開始する</li>
- <li>特定の期限が過ぎる前に完了する、または最小限の遅延で完了する</li>
+ <li>当设备充电时启动</li>
+ <li>当设备连接到不限流量网络时启动</li>
+ <li>当设备空闲时启动</li>
+ <li>在特定的截止期限之前或以最小的延迟完成</li>
</ul>
-<p>たとえば、次のようなコードを追加すると、タスクを定額制ネットワーク上で実行できます。</p>
+<p>例如,您可以添加如下代码以在不限流量网络上运行您的任务:</p>
<pre>
JobInfo uploadTask = new JobInfo.Builder(mJobId,
@@ -480,130 +478,130 @@
jobScheduler.schedule(uploadTask);
</pre>
-<p>端末の電力が安定している場合(つまり、端末が 2 分以上電源に接続されていて、電池が<a href="{@docRoot}reference/android/content/Intent.html#ACTION_BATTERY_OKAY">正常レベル</a>にある場合)には、ジョブがまだ期限切れになっていなくても、実行の準備ができているスケジューリング済みのジョブがすべて実行されます。</p>
+<p>如果设备具有稳定的电源(也就是说,它已插入了 2 分钟以上并且电池处于<a href="{@docRoot}reference/android/content/Intent.html#ACTION_BATTERY_OKAY">健康水平</a>),则系统将运行任何已就绪可运行的已调度作业,即使作业的截止期限尚未到期也是如此。</p>
-<p>{@link android.app.job.JobScheduler} API の使用例については、このリリースに付属している {@code JobSchedulerSample} の実装サンプルをご覧ください。</p>
+<p>要查看有关如何使用 {@link android.app.job.JobScheduler} API 的示例,请参考本版本中的 {@code JobSchedulerSample} 实施样本。</p>
-<h3 id="PowerMeasurementTools">電池の使用統計情報を提供するデベロッパー向けツール</h3>
+<h3 id="PowerMeasurementTools">用于查询耗电量信息的开发者工具</h3>
-<p>新しい {@code dumpsys batterystats} コマンドでは、端末での電池の使用に関して役立つ統計データが、一意のユーザー ID(UID)別に整理されて生成されます。次のような統計情報が生成されます。</p>
+<p>新的 {@code dumpsys batterystats} 命令将生成关于设备上耗电量信息的有趣统计数据,该数据按唯一用户 ID (UID) 进行组织。该统计信息包括:</p>
<ul>
-<li>電池関連のイベントの履歴
-<li>端末の全体的な統計情報
-<li>UID 別やシステム コンポーネント別の推定電力使用量
-<li>アプリ別のパケットあたりのモバイル ミリ秒
-<li>システム UID 別に集計される統計情報
-<li>アプリ UID 別に集計される統計情報
+<li>与电池相关的事件的历史记录
+<li>设备的全局统计信息
+<li>每个 UID 和系统组件的大致用电量
+<li>每个数据包的每个手机应用毫秒数
+<li>系统 UID 汇总统计信息
+<li>应用 UID 汇总统计信息
</ul>
-<p>出力をカスタマイズするための各種オプションについて調べるには、{@code --help} オプションを使用します。たとえば対象のアプリ パッケージについて、端末が最後に充電されてから現在までの電池の使用統計情報を出力するには、次のコマンドを実行します。
+<p>可使用 {@code --help} 选项了解用于对输出进行自定义的各种选项。例如,要输出自设备上次充电后给定应用包的耗电量统计信息,请运行以下命令:
<pre>
$ adb shell dumpsys batterystats --charged <package-name>
</pre>
-<p>{@code dumpsys} コマンドの出力に対して<a href="https://github.com/google/battery-historian" class="external-link">電池履歴</a>ツールを使用すると、電力に関するイベントをログから取得して視覚的に表現する HTML を生成できます。これらの情報を利用することで、電池に関連した問題の把握や診断がしやすくなります。</p>
+<p>您可以对 {@code dumpsys} 命令的输出使用 <a href="https://github.com/google/battery-historian" class="external-link">Battery Historian</a> 工具从日志中生成与电量相关的事件的 HTML 可视形式。此信息使您可以更轻松地了解和诊断任何与电池相关的问题。</p>
-<h2 id="Enterprise">職場向けや教育向けの Android</h2>
-<h3 id="ManagedProvisioning">管理対象プロビジョニング</h3>
+<h2 id="Enterprise">办公场所和教育环境中的 Android</h2>
+<h3 id="ManagedProvisioning">托管配置</h3>
-<p>Android 5.0 では社内環境の中でアプリを実行するための新機能が提供されています。<a href="{@docRoot}guide/topics/admin/device-admin.html">端末管理者</a>は、ユーザーが既存の個人用アカウントを持っている場合に、管理対象プロビジョニングのプロセスを開始して、同時かつ別々に存在する「管理対象プロフィール」<em></em>を端末に追加することができます。管理対象プロフィールに関連付けられたアプリは、管理対象外のアプリと一緒に、ユーザーのランチャー、最近使ったアプリ画面、通知に表示されます。</p>
+<p>Android 5.0 提供了用于在企业环境内运行应用的新功能。如果用户具有现有的个人帐户,则<a href="{@docRoot}guide/topics/admin/device-admin.html">设备管理员</a>可以启动托管配置流程来向设备添加一个共存但单独的“托管配置文件”<em></em>。与托管配置文件关联的应用将与非托管应用一起出现在用户的启动器、“最近用过”屏幕以及通知中。</p>
-<p>管理対象プロビジョニングのプロセスを開始するには、{@link android.content.Intent} で {@link android.app.admin.DevicePolicyManager#ACTION_PROVISION_MANAGED_PROFILE ACTION_PROVISION_MANAGED_PROFILE} を送信します。呼び出しが成功すると、システムから {@link android.app.admin.DeviceAdminReceiver#onProfileProvisioningComplete(android.content.Context, android.content.Intent) onProfileProvisioningComplete()} コールバックが起動されます。その後、{@link android.app.admin.DevicePolicyManager#setProfileEnabled(android.content.ComponentName) setProfileEnabled()} を呼び出してこの管理対象プロフィールを有効にすることができます。</p>
+<p>要启动托管配置流程,请在 {@link android.content.Intent} 中发送 {@link android.app.admin.DevicePolicyManager#ACTION_PROVISION_MANAGED_PROFILE ACTION_PROVISION_MANAGED_PROFILE}。如果调用成功,则系统将触发 {@link android.app.admin.DeviceAdminReceiver#onProfileProvisioningComplete(android.content.Context, android.content.Intent) onProfileProvisioningComplete()} 回调。然后,您可以调用 {@link android.app.admin.DevicePolicyManager#setProfileEnabled(android.content.ComponentName) setProfileEnabled()} 来启用此托管配置文件。</p>
-<p>デフォルトでは、一部の少数のアプリのみが管理対象プロフィールで有効になります。管理対象プロフィールで追加のアプリをインストールするには、{@link android.app.admin.DevicePolicyManager#enableSystemApp(android.content.ComponentName, android.content.Intent) enableSystemApp()} を呼び出します。</p>
+<p>默认情况下,在托管配置文件中只会启用一小部分应用。您可以通过调用 {@link android.app.admin.DevicePolicyManager#enableSystemApp(android.content.ComponentName, android.content.Intent) enableSystemApp()} 在托管配置文件中安装额外的应用。</p>
-<p>ランチャー アプリを開発している場合は、新しい {@link android.content.pm.LauncherApps} クラスを使用して、現在のユーザーの起動可能なアクティビティのリストや、関連するすべての管理対象プロフィールを取得できます。ランチャーでアイコン drawable に作業バッジを付けると、管理対象アプリを視覚的に目立たせることができます。バッジ付きのアイコンを取得するには {@link android.content.pm.PackageManager#getUserBadgedIcon(android.graphics.drawable.Drawable, android.os.UserHandle) getUserBadgedIcon()} を呼び出します。</p>
+<p>如果您在开发启动器应用,则可以使用新的 {@link android.content.pm.LauncherApps} 类来获取当前用户的可启动活动的列表以及任何关联的托管配置文件。您的启动器可以通过向图标绘图添加一个工作标记,使托管应用更加惹人注目。要检索带标记的图标,请调用 {@link android.content.pm.PackageManager#getUserBadgedIcon(android.graphics.drawable.Drawable, android.os.UserHandle) getUserBadgedIcon()}。</p>
-<p>新機能の使い方については、このリリースに付属している {@code BasicManagedProfile} の実装サンプルをご覧ください。</p>
+<p>要查看如何使用此新功能,请参考本版本中的 {@code BasicManagedProfile} 实施样本。</p>
-<h3 id="DeviceOwner">端末所有者</h3>
-<p>Android 5.0 では、端末所有者アプリの展開機能が導入されています。<em></em>「端末所有者」は特殊なタイプの<a href="{@docRoot}guide/topics/admin/device-admin.html">端末管理者</a>で、第 2 ユーザーの作成や削除、端末全体の設定について、さらに詳細な操作を実行できます。端末管理者アプリでは {@link android.app.admin.DevicePolicyManager} クラスのメソッドを使用して、管理対象端末の設定、セキュリティ、アプリをきめ細かくコントロールできます。端末で有効にできる端末管理者は一度に 1 つだけです。</p>
+<h3 id="DeviceOwner">设备所有者</h3>
+<p>Android 5.0 引入了部署设备所有者应用的功能。“设备所有者”<em></em>是一类特殊的<a href="{@docRoot}guide/topics/admin/device-admin.html">设备管理员</a>,具有在设备上创建和移除辅助用户以及配置全局设置的额外能力。您的设备所有者应用可以使用 {@link android.app.admin.DevicePolicyManager} 类中的方法来对托管设备上的配置、安全性和应用进行精细控制。一个设备在任一时刻只能有一个处于活动状态的设备所有者。</p>
-<p>端末管理者を展開して有効にするには、端末がプロビジョニングされていない状態となっている間に、プログラミング アプリから端末への NFC データ転送を実行する必要があります。このデータ転送では、<a href="#ManagedProvisioning">管理対象プロビジョニング</a>で説明しているインテントのプロビジョニングの場合と同じ情報が送信されます。</p>
+<p>要部署并激活设备所有者,您必须在设备处于未配置状态时执行从编程应用到设备的 NFC 数据传输。此数据传输发送的信息与<a href="#ManagedProvisioning">托管配置</a>中描述的配置 intent 中的信息相同。</p>
-<h3 id="ScreenPinning">画面の固定</h3>
+<h3 id="ScreenPinning">屏幕固定</h3>
-<p>Android 5.0 では、新しい画面固定 API が導入されています。これを使用すると、ユーザーがタスクから離れる操作や通知による割り込みを一時的に制限することができます。たとえば Android で、重要度の高い評価要件に対応した教育向けアプリや、単一用途のアプリ、またはキオスクアプリを開発している場合などに役立ちます。アプリで画面の固定を有効にすると、そのモードを終了するまで、ユーザーは通知を表示することも、他のアプリにアクセスすることも、ホーム画面に戻ることもできなくなります。</p>
+<p>Android 5.0 引入了一个新的屏幕固定 API,它允许您暂时防止用户离开您的任务或被通知打扰。例如,如果您在开发一个教育应用以在 Android 或单用途或资讯服务应用上支持高风险评估需求,则可以使用此功能。一旦您的应用激活了屏幕固定,则用户将无法看到通知、访问其他应用或者返回到主屏幕,直到您的应用退出该模式。</p>
-<p>次の 2 つの方法で画面の固定を有効にすることができます。</p>
+<p>有两种方法用来激活屏幕固定:</p>
<ul>
-<li><strong>手動による方法:</strong> ユーザーは [設定] > [セキュリティ] > [画面の固定]<em></em> で画面の固定を有効にすることができ、最近使ったアプリ画面に表示される緑色のピンアイコンをタップすることで、固定したいタスクを選択できます。</li> <li><strong>プログラミングによる方法:</strong> プログラムから画面の固定を有効にするには、アプリで {@link android.app.Activity#startLockTask() startLockTask()} を呼び出します。リクエストする側のアプリが端末所有者でない場合は、確認のメッセージがユーザーに表示されます。端末所有者アプリから {@link android.app.admin.DevicePolicyManager#setLockTaskPackages(android.content.ComponentName, java.lang.String[]) setLockTaskPackages()} メソッドを呼び出すと、ユーザーの確認手順なしでアプリの固定を有効にすることができます。</li>
+<li><strong>手动</strong>:用户可以在“设置”>“安全性”>“屏幕固定”<em></em>中启用屏幕固定,并通过在“最近用过”屏幕上点触屏幕固定图标来选择他们要固定的任务。</li> <li><strong>以编程方式</strong>:要以编程方式激活屏幕固定,请在您的应用中调用 {@link android.app.Activity#startLockTask() startLockTask()}。如果请求方应用不是设备所有者,则会提示用户确认。设备所有者应用可以调用 {@link android.app.admin.DevicePolicyManager#setLockTaskPackages(android.content.ComponentName, java.lang.String[]) setLockTaskPackages()} 方法来使应用成为可固定的,不需要经历用户确认步骤。</li>
</ul>
-<p>タスクのロックが有効になると、次のような動作になります。</p>
+<p>当任务锁定处于活动状态时,会发生以下行为:</p>
<ul>
-<li>ステータスバーが空になり、ユーザーの通知やステータス情報が表示されません。</li>
-<li>ホームボタンと最近使ったアプリボタンが表示されません。</li>
-<li>他のアプリから新しいアクティビティを起動できません。</li>
-<li>現在のアプリからは、新しいタスクが作成されない限り、新しいアクティビティを起動できます。</li>
-<li>画面の固定が端末所有者によって開始されている場合は、アプリから {@link android.app.Activity#stopLockTask() stopLockTask()} を呼び出すまで、ユーザーは引き続きアプリにロックされます。</li>
-<li>画面の固定が端末所有者でない別のアプリによって、またはユーザーによって直接、有効にされている場合には、ユーザーは戻るボタンと最近使ったアプリボタンを同時に押すことで画面の固定を終了できます。</li>
+<li>状态栏为空,并且用户通知和状态信息被隐藏。</li>
+<li>首页和“最近的应用”按钮被隐藏。</li>
+<li>其他应用无法启动新活动。</li>
+<li>当前应用可以启动新活动,只要这样做不会创建新任务即可。</li>
+<li>当屏幕固定是由设备所有者调用的时,用户将保持锁定到您的应用,直到该应用调用 {@link android.app.Activity#stopLockTask() stopLockTask()}。</li>
+<li>如果屏幕固定是由设备所有者之外另一应用或者是由用户直接调用的活动时,用户可以通过同时按住“返回”和“最近”按钮退出。</li>
</ul>
-<h2 id="Printing">印刷フレームワーク</h2>
+<h2 id="Printing">打印框架</h2>
-<h3 id="PDFRender">PDF をビットマップとしてレンダリング</h3>
-<p>新しい {@link android.graphics.pdf.PdfRenderer} クラスを使用して、PDF ドキュメントのページを印刷用のビットマップ画像にレンダリングできるようになりました。印刷可能なコンテンツの書き込み先となる、シーク可能な(つまり、コンテンツへのランダム アクセスが可能な){@link android.os.ParcelFileDescriptor} を指定する必要があります。アプリでは、{@link android.graphics.pdf.PdfRenderer#openPage(int) openPage()} でレンダリング用のページを取得した後、{@link android.graphics.pdf.PdfRenderer.Page#render(android.graphics.Bitmap, android.graphics.Rect, android.graphics.Matrix, int) render()} を呼び出して、開いている {@link android.graphics.pdf.PdfRenderer.Page} をビットマップに変換できます。また、ドキュメントの一部分だけをビットマップ画像に変換したい場合は追加のパラメータを設定できます(たとえば、ドキュメントを拡大するために<a href="http://en.wikipedia.org/wiki/Tiled_rendering" class="external-link">タイル レンダリング</a>を実装する場合など)。</p>
+<h3 id="PDFRender">使用位图来呈现 PDF 文件</h3>
+<p>您现在可以使用新的 {@link android.graphics.pdf.PdfRenderer} 类将 PDF 文档页呈现为位图图片以便打印。您必须指定系统将可打印内容写入其中的一个可查找的(也就是说,可以随机访问内容){@link android.os.ParcelFileDescriptor}。您的应用可以通过 {@link android.graphics.pdf.PdfRenderer#openPage(int) openPage()} 获取页面进行呈现,然后调用 {@link android.graphics.pdf.PdfRenderer.Page#render(android.graphics.Bitmap, android.graphics.Rect, android.graphics.Matrix, int) render()} 将已打开的 {@link android.graphics.pdf.PdfRenderer.Page} 转变为位图。如果您只希望将文档的一部分转变为位图图片(例如,要实施<a href="http://en.wikipedia.org/wiki/Tiled_rendering" class="external-link">平铺渲染</a>以放大文档),则还可以设置其他参数。</p>
-<p>新しいアプリの使用例については、{@code PdfRendererBasic} のサンプルをご覧ください。</p>
+<p>有关如何使用新 API 的示例,请参阅 {@code PdfRendererBasic} 样本。</p>
-<h2 id="System">システム</h2>
-<h3 id="AppUsageStatistics">アプリの使用統計情報</h3>
-<p>新しい {@link android.app.usage} API を使用して Android 端末のアプリ使用履歴にアクセスできるようになりました。この API では、非推奨となった {@link android.app.ActivityManager#getRecentTasks(int, int) getRecentTasks()} メソッドよりも詳細な使用統計情報が提供されます。この API を使用するには、最初にマニフェストで {@code "android.permission.PACKAGE_USAGE_STATS"} 権限を宣言する必要があります。また、ユーザーも [設定] > [セキュリティ] > [アプリ]<em></em> を通じてこのアプリの使用アクセス権を有効にする必要があります。</p>
+<h2 id="System">系统</h2>
+<h3 id="AppUsageStatistics">应用使用情况统计信息</h3>
+<p>您现在可以通过新的 {@link android.app.usage} API 访问 Android 设备上的应用使用情况历史记录。此 API 提供了比被弃用的 {@link android.app.ActivityManager#getRecentTasks(int, int) getRecentTasks()} 方法更详细的使用情况信息。要使用此 API,必须先在您的清单中声明 {@code "android.permission.PACKAGE_USAGE_STATS"} 权限。用户还必须通过“设置”>“安全性”>“应用”<em></em>使用“使用情况访问”启用对此应用的访问权限。</p>
-<p>使用統計データはアプリ単位で収集され、毎日、毎週、毎月、毎年の各期間でデータが集計されます。データの最長保持期間は次のとおりです。</p>
+<p>系统将以每个应用为单位收集使用情况数据,并按每天、每周、每月和每年时间间隔对数据进行汇总。系统保留此数据的最大持续时间如下所述:</p>
<ul>
- <li>毎日のデータ: 7 日間</li>
- <li>毎週のデータ: 4 週間</li>
- <li>毎月のデータ: 6 か月</li>
- <li>毎年のデータ: 2 年</li>
+ <li>每天数据:7 天</li>
+ <li>每周数据:4 周</li>
+ <li>每月数据:6 个月</li>
+ <li>每年数据:2 年</li>
</ul>
-<p>各アプリについて次のデータが記録されます。</p>
+<p>对于每个应用,系统将记录以下数据:</p>
<ul>
-<li>アプリが最後に使用された時間</li>
-<li>対象期間(1 日、1 週間、1 か月、または 1 年)にアプリがフォアグラウンドに存在した合計時間</li>
-<li>1 日の間にコンポーネント(パッケージとアクティビティ名により識別される)がフォアグラウンドからバックグラウンドに移動したときに取得されるタイムスタンプ</li>
-<li>端末の設定が変更されたとき(回転の結果端末の向きが変化したときなど)に取得されるタイムスタンプ</li>
+<li>上次使用应用的时间</li>
+<li>应用在该时间间隔内(按天、周、月或年)处于前台的总时间长度</li>
+<li>组件(由程序包和活动名称予以标识)在一天中移动到前台或后台时的时间戳捕获</li>
+<li>设备配置更改时(例如当设备配置因为旋转而更改时)的时间戳捕获</li>
</ul>
-<h2 id="TestingA11y">テストとユーザー補助 </h2>
+<h2 id="TestingA11y">测试和辅助功能 </h2>
-<h3 id="TestingA11yImprovements">テストとユーザー補助の向上</h3>
-<p>Android 5.0 ではテストとユーザー補助に関する次のサポートが追加されています。</p>
+<h3 id="TestingA11yImprovements">测试和辅助功能改进</h3>
+<p>Android 5.0 对测试和辅助功能增加了以下支持:</p>
<ul>
-<li>新しい {@link android.app.UiAutomation#getWindowAnimationFrameStats() getWindowAnimationFrameStats()} メソッドと {@link android.app.UiAutomation#getWindowContentFrameStats(int) getWindowContentFrameStats()} メソッドは、ウィンドウのアニメーションとコンテンツに関するフレーム統計情報を取得します。これらのメソッドを使用して計測テストを記述すれば、アプリがスムーズなユーザー エクスペリエンスを提供するのに十分な更新頻度でフレームを描画しているかどうかを評価できます。</li>
+<li>新的 {@link android.app.UiAutomation#getWindowAnimationFrameStats() getWindowAnimationFrameStats()} 和 {@link android.app.UiAutomation#getWindowContentFrameStats(int) getWindowContentFrameStats()} 方法将捕获窗口动画和内容的帧统计信息。这些方法允许您编写仪器测试来评估某个应用是否在以足够的刷新频率来呈现帧以提供流畅的用户体验。</li>
-<li>新しい {@link android.app.UiAutomation#executeShellCommand(java.lang.String) executeShellCommand()} メソッドを使用すると、計測テストからシェルコマンドを実行できます。コマンドの実行は端末に接続されたホストから {@code adb shell} を実行するのと同様に行え、{@code dumpsys}、{@code am}、{@code content}、{@code pm} などのシェルベースのツールを使用できます。</li>
+<li>新的 {@link android.app.UiAutomation#executeShellCommand(java.lang.String) executeShellCommand()} 方法允许您通过仪器测试执行 shell 命令。命令执行类似于从连接到设备的主机运行 {@code adb shell},允许您使用基于 shell 的工具,例如 {@code dumpsys}、{@code am} {@code content} 和 {@code pm}。</li>
-<li>ユーザー補助 API(<a href="{@docRoot}tools/help/uiautomator/index.html">{@code UiAutomator}</a> など)を使用するユーザー補助のサービスやテストツールで、視覚に障がいのないユーザーが操作できる画面上のウィンドウについて、そのプロパティに関する詳細情報を取得できるようになりました。{@link android.view.accessibility.AccessibilityWindowInfo} オブジェクトのリストを取得するには、新しい {@link android.accessibilityservice.AccessibilityService#getWindows() getWindows()} メソッドを呼び出します。</li>
+<li>使用辅助功能 API(例如 <a href="{@docRoot}tools/help/uiautomator/index.html">{@code UiAutomator}</a>)的辅助服务和测试工具现在可以检索有视力的用户可以与之进行互动的屏幕上窗口的属性的详细信息。要检索 {@link android.view.accessibility.AccessibilityWindowInfo} 对象的列表,请调用新的 {@link android.accessibilityservice.AccessibilityService#getWindows() getWindows()} 方法。</li>
-<li>新しい {@link android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction} クラスを使用すると、{@link android.view.accessibility.AccessibilityNodeInfo} で実行する標準の操作やカスタマイズされた操作を定義できます。新しい {@link android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction} クラスは、従来 {@link android.view.accessibility.AccessibilityNodeInfo} に存在した操作関連の API の代わりとなるものです。</li>
+<li>新的 {@link android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction} 类允许您定义可以对 {@link android.view.accessibility.AccessibilityNodeInfo} 执行的标准或自定义操作。新的 {@link android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction} 类替换了以前在 {@link android.view.accessibility.AccessibilityNodeInfo} 中提供的与操作相关的 API。</li>
-<li>Android 5.0 では、音声合成をよりきめ細かくアプリでコントロールできます。アプリで新しい {@link android.speech.tts.Voice} クラスを使用すると、特定の言語、音質、レイテンシ速度に関連付けられた音声プロフィールや、音声合成エンジン固有のパラメータを使用できます。</li>
+<li>Android 5.0 对您的应用中的文本到语音合成提供了更细粒度的控制。新的 {@link android.speech.tts.Voice} 类允许您的应用使用与特定区域设置、质量和延迟评级以及特定于文本到语音引擎的参数关联的语音配置文件。</li>
</ul>
<h2 id="IME">IME</h2>
-<h3 id="Switching">入力言語の切り替えやすさの向上</h3>
+<h3 id="Switching">更轻松地在输入语言之间切换</h3>
-<p>Android 5.0 以降、ユーザーはプラットフォームでサポートされているすべての<a href="{@docRoot}guide/topics/text/creating-input-method.html">インプット メソッド エディタ(IME)</a>を簡単に切り替えられるようになります。指定された切り替え操作(通常はソフト キーボード上の地球アイコンのタップ)を行うと、それらの IME のすべてが循環して切り替わります。この動作変更は {@link android.view.inputmethod.InputMethodManager#shouldOfferSwitchingToNextInputMethod(android.os.IBinder) shouldOfferSwitchingToNextInputMethod()} メソッドによって実装されます。</p>
+<p>从 Android 5.0 开始,用户可以更轻松地在该平台支持的所有<a href="{@docRoot}guide/topics/text/creating-input-method.html">输入法编辑器 (IME)</a> 之间进行切换。执行指定的切换操作(通常是触摸软键盘上的一个地球图标)将循环经过所有此类 IME。此行为更改是由 {@link android.view.inputmethod.InputMethodManager#shouldOfferSwitchingToNextInputMethod(android.os.IBinder) shouldOfferSwitchingToNextInputMethod()} 方法实施的。</p>
-<p>また、次の IME に切り替え機能が組み込まれているかどうか(つまり、対象の IME が次に続く IME への切り替えをサポートしているかどうか)がチェックされるようになりました。切り替え機能のある IME から切り替え機能のない IME への循環切り替えは行われません。この動作変更は {@link android.view.inputmethod.InputMethodManager#switchToNextInputMethod(android.os.IBinder, boolean) switchToNextInputMethod()} メソッドによって実装されます。
+<p>此外,框架现在还将检查下一个 IME 究竟是否包括切换机制(并因此检查该 IME 是否支持切换到它之后的 IME)。具有切换机制的 IME 不会切换到没有切换机制的 IME。此行为更改是由 {@link android.view.inputmethod.InputMethodManager#switchToNextInputMethod(android.os.IBinder, boolean) switchToNextInputMethod()} 方法实施的。
-<p>最新の IME 切り替え API の使用例については、このリリースに付属している最新のソフト キーボードの実装サンプルをご覧ください。IME の切り替えを実装する方法について詳しくは、<a href="{@docRoot}guide/topics/text/creating-input-method.html">入力方法の作成</a>をご覧ください。
+<p>要查看有关如何使用更新的 IME 切换 API 的示例,请参考本版本中更新的软键盘实施样本。要详细了解如何实施 IME 切换,请参阅<a href="{@docRoot}guide/topics/text/creating-input-method.html">创建输入法</a>。
</p>
-<h2 id="Manifest">マニフェスト宣言</h2>
+<h2 id="Manifest">清单声明</h2>
-<h3 id="ManifestFeatures">宣言可能な必須機能</h3>
-<p>次の値が <a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a> 要素でサポートされるようになりました。これにより、アプリで必要としている機能を備えている端末にのみアプリをインストールできるようになります。</p>
+<h3 id="ManifestFeatures">声明必需的功能</h3>
+<p><a href="{@docRoot}guide/topics/manifest/uses-feature-element.html">{@code <uses-feature>}</a> 元素中现在支持下列值,因此,您可以确保您的应用仅安装在提供了您的应用所需功能的设备上。</p>
<ul>
<li>{@link android.content.pm.PackageManager#FEATURE_AUDIO_OUTPUT}</li>
@@ -624,10 +622,10 @@
<li>{@link android.content.pm.PackageManager#FEATURE_WEBVIEW}</li>
</ul>
-<h3 id="Permissions">ユーザー権限</h3>
+<h3 id="Permissions">用户权限</h3>
-<p>次の権限が <a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">{@code <uses-permission>}</a> 要素でサポートされ、アプリで特定の API へのアクセスに必要な権限を宣言できるようになりました。</p>
+<p><a href="{@docRoot}guide/topics/manifest/uses-permission-element.html">{@code <uses-permission>}</a> 元素中现在支持以下权限来声明您的应用访问特定 API 时所需的权限。</p>
<ul>
-<li>{@link android.Manifest.permission#BIND_DREAM_SERVICE}: API レベル 21 以降を対象とする場合は、システムによるバインドのみが可能となるようにするため、<a href="{@docRoot}about/versions/android-4.2.html#Daydream">Daydream</a> サービスでこの権限が必要になります。</li>
+<li>{@link android.Manifest.permission#BIND_DREAM_SERVICE}:当针对 API 级别 21 和更高级别时,<a href="{@docRoot}about/versions/android-4.2.html#Daydream">Daydream</a> 服务需要此权限来确保只有系统可以绑定到它。</li>
</ul>
\ No newline at end of file
diff --git a/docs/html-intl/intl/zh-cn/about/versions/lollipop.jd b/docs/html-intl/intl/zh-cn/about/versions/lollipop.jd
index a63c56e..3403630 100644
--- a/docs/html-intl/intl/zh-cn/about/versions/lollipop.jd
+++ b/docs/html-intl/intl/zh-cn/about/versions/lollipop.jd
@@ -1,5 +1,4 @@
-page.title=Android Lollipop
-
+page.title=Android Lollipop
@jd:body
@@ -9,31 +8,29 @@
-
-
<div style="padding:0px 0px 0px 20px;float:right;margin:0 -10px 0 0">
<img src="{@docRoot}images/home/l-hero_2x.png" srcset="{@docRoot}images/home/l-hero.png 1x, {@docRoot}images/home/l-hero_2x.png 2x" width="460" height="300" >
</div>
<div class="landing-docs" style="float:right;clear:both;margin:68px 0 2em 3em;">
<div class="col-4 normal-links highlights" style="font-size:12px;">
- <h3 id="thisd" >主なデベロッパー機能</h3>
+ <h3 id="thisd" >面向开发者的主要功能</h3>
<ul style="list-style-type:none;">
- <li><a href="#Material">Material Design</a></li>
- <li><a href="#Perf">パフォーマンス重視</a></li>
+ <li><a href="#Material">Material Design 设计</a></li>
+ <li><a href="#Perf">注重性能</a></li>
<li><a href="#Notifications">通知</a></li>
- <li><a href="#TV">アプリを大画面で</a></li>
- <li><a href="#Documents">アプリのドキュメント化</a></li>
- <li><a href="#Connectivity">進化した接続性</a></li>
- <li><a href="#Graphics">高性能グラフィックス</a></li>
- <li><a href="#Audio">さらに強化された音声</a></li>
- <li><a href="#Camera">カメラと動画の拡張</a></li>
- <li><a href="#Work">職場での Android</a></li>
- <li><a href="#ScreenCapture">画面のキャプチャと共有</a></li>
- <li><a href="#Sensors">新しいタイプのセンサー</a></li>
+ <li><a href="#TV">以大屏幕呈现</a></li>
+ <li><a href="#Documents">以文档为中心</a></li>
+ <li><a href="#Connectivity">连接性能再上一级</a></li>
+ <li><a href="#Graphics">高性能图形</a></li>
+ <li><a href="#Audio">音频处理功能更强</a></li>
+ <li><a href="#Camera">摄像头和视频处理进一步完善</a></li>
+ <li><a href="#Work">Android 在办公中的应用</a></li>
+ <li><a href="#ScreenCapture">屏幕截图和共享</a></li>
+ <li><a href="#Sensors">新型传感器</a></li>
<li><a href="#WebView">Chromium WebView</a></li>
- <li><a href="#Accessibility">ユーザー補助機能と入力</a></li>
- <li><a href="#Battery">省電力アプリ用のツール</a></li>
+ <li><a href="#Accessibility">辅助功能和输入</a></li>
+ <li><a href="#Battery">构建低电耗应用</a></li>
</ul>
</div>
</div>
@@ -44,27 +41,24 @@
-<p>Android 5.0 Lollipop は、これまでの Android の中で最も大きく刷新された意欲的なリリースです。</p>
+<p>欢迎使用 Android 5.0 Lollipop,这是迄今为止规模最大最为雄心勃勃的 Android 版本!</p>
-<p>このリリースには、ユーザー向けの新しい機能だけでなく、デベロッパー向けに数多くの API が追加されています。これらの API を使用することで、携帯電話、タブレット、ウェアラブルに加え、テレビや自動車用にも Android を拡張できます。</p>
+<p>此版本为用户推出了各种崭新的新功能,为开发者则提供了数千个新的 API。不仅如此,它将 Android 的疆土扩展得更远,小到手机、平板电脑和穿戴式设备,大到电视和汽车,都可以是它活跃的领地。</p>
-<p>新しいデベロッパー向け API の概要については、<a href="{@docRoot}about/versions/android-5.0.html">Android 5.0 API</a> をご覧ください。Android 5.0 のユーザー向けの新機能については <a href="http://www.android.com/versions/lollipop-5-0/">www.android.com</a> をご覧ください。</p>
+<p>要深入了解面向开发者的新 API,请参阅 <a href="{@docRoot}about/versions/android-5.0.html">Android 5.0 API 概述</a>。有关适合消费者阅读的更多 Android 5.0 内容,请访问 <a href="http://www.android.com/versions/lollipop-5-0/">www.android.com</a>。</p>
-<p style=" padding: 10px; background: #eee; width: 250px; border: 1px solid #ccc; margin-top: 20px;">アプリを実機でテストするには、<br><a href="/preview/index.html#Start"><b>Android プレビュー システム イメージ</b></a>を使用して Nexus 5 または Nexus 7 のフラッシュに書き込みます。</p>
+<h2 id="Material">Material design 设计</h2>
-
-<h2 id="Material">Material Design</h2>
-
-<p>Android 5.0 では新たに <a href="http://www.google.com/design/spec">Material Design</a> が導入され、拡張 UI ツールキットを使用することで新しいデザイン パターンをアプリに簡単に統合できるようになりました。 </p>
+<p>Android 5.0 将 <a href="http://www.google.com/design/spec">Material design 设计</a>引入 Android 系统,它自带一个扩展的界面工具包,可以让您轻松地将新的设计图案集成到自己的应用中。 </p>
-<p>新しい <strong>3D ビュー</strong>機能では、z レベルを設定することでビュー階層から要素を持ち上げることができるようになりました。また、<strong>リアルタイム シャドウ</strong>機能により、要素が移動しても影を追随させることができます。</p>
+<p>在新的 <strong>3D 视图</strong>中,您可以设置 z 轴让元素从视图层面上“站”起来,甚至可以随着元素的移动投下<strong>实时阴影</strong>。</p>
-<p><strong>アクティビティ遷移</strong>機能が組み込まれたことで、美しいアニメーションを使って次の状態へスムーズに遷移できるようになりました。マテリアル テーマを使用すると、アクティビティの遷移がさらにスムーズになります。たとえば、アクティビティ間で<strong>共有視覚要素</strong>を使用できるようになりました。</p>
+<p>内置的 <strong>Activity Transitions</strong> API 可以通过优美的动画天衣无缝地让用户从一种状态切换到另一种状态。素材主题为您的活动提供了各种过渡方式,包括在各个活动中使用<strong>共享的可视化元素</strong>功能。</p>
@@ -77,151 +71,151 @@
</video>
</div>
<div style="font-size:10pt;margin-left:20px;margin-bottom:30px">
- <em></em>端末画面をクリックすると動作が再現されます
+ <em>要重播影片,请单击设备屏幕</em>
</div>
</div>
-<p>アプリ内のタップ コントロール(ボタン、チェックボックスなど)にリップル アニメーションを適用できます。
+<p>您可以对按钮、复选框以及应用中的其他触摸控件加上涟漪动画。
-<p>XML でベクター ドローアブルを定義して、さまざまな方法でアニメーション化することも可能です。ベクター ドローアブルは定義を変更することなく拡大縮小できるため、単色のアプリ内アイコンに最適です。</p>
+<p>您还可以在 XML 文件中定义可动的矢量图,让它们展现出各种不同的动画效果。矢量图在自由缩放的同时不会失真,非常适合用作应用中的纯色图标。</p>
-<p>システム管理の処理スレッドとして <strong>RenderThread</strong> が追加されており、メインの UI スレッドに遅延が発生してもアニメーションをスムーズに再生できます。 </p>
+<p><strong>RenderThread</strong> 则是新推出的由系统管理的渲染线程,即使主界面线程出现延迟,它也能保持动画运行流畅。 </p>
-<h2 id="Perf">パフォーマンス重視</h2>
+<h2 id="Perf">注重性能</h2>
-<p>Android 5.0 では、より高速でスムーズな演算処理が実現します。</p>
+<p>Android 5.0 为用户带来更快、更流畅、更强大的计算体验。</p>
-<p>新しい <strong>ART ランタイム</strong>に完全に移行しました。ART は基礎から徹底的に再構築したランタイムで、AOT(ahead-of-time)、JIT(just-in-time)、インタプリタ型のコードをまとめて処理できます。ARM、x86、MIPS アーキテクチャに対応した 64 ビット完全互換のランタイムです。</p>
+<p>Android 现在完全运行在全新构建的 <strong>ART 运行时</strong>上,支持混合使用预先编译 (AOT)、即时编译 (JIT) 和编译好的代码。它可以在 ARM、x86 和 MIPS 架构上正常运行,并且完全兼容 64 位。</p>
-<p>ART は、アプリのパフォーマンスと応答性を改善します。ガベージ コレクションを効率的することで、GC イベントによる一時停止の回数や時間を減らしました。垂直同期の期間にうまく適合するようになったことで、アプリがフレームをスキップすることもなくなります。また、メモリを動的に移動してフォアグラウンドのパフォーマンスも最適化しています。 </p>
+<p>ART 改进了应用性能和响应能力。它采用高效的垃圾回收方式,减少了垃圾回收事件的次数和暂停时间,贴合搭配垂直同步窗口,因此您的应用不会出现掉帧现象。ART 还会动态移动内存,针对前台使用情况优化内存。 </p>
-<p>Android 5.0 では、Nexus 9 の NVIDIA Tegra K1 で採用されている<strong>64 ビット アーキテクチャ</strong>のプラットフォーム サポートを導入しています。最適化によって広いアドレス空間が提供され、特定の演算負荷の処理能力が向上しました。Java で記述されているアプリは、修正なしで自動的に 64 ビット アプリとして実行されます。ネイティブ コードを使用するアプリのためには、ARM v8、x86-64、MIPS-64 用の新しい ABI をサポートするため NDK を拡張しました。</p>
+<p>Android 5.0 引入了对 <strong>64 位架构</strong>(已应用于 Nexus 9 的 NVIDIA Tegra K1)的平台支持,经过优化后提供更大的寻址空间,提升了针对特定的计算工作负载的性能。以 Java 编写的应用可自动作为 64 位应用运行,无需任何修改。如果您的应用使用原生代码,也不用担心。我们扩展了 NDK,可支持适用于 ARM v8、x86-64 和 MIPS-64 的新 ABI。</p>
-<p>Android 5.0 では、パフォーマンスをさらに向上させるため、A/V 同期についても改善に取り組みました。音声と映像のパイプラインを搭載したことでタイムスタンプの正確性が向上し、動画アプリやゲームのコンテンツの同期がスムーズに行われるようになりました。</p>
+<p>Android 一如既往注重实现更流畅的性能,并在 5.0 中改进了声音/视频同步方式。音频和图形管道都经过调校,时间戳更为精准,因此视频应用和游戏都能显示流畅的同步内容。</p>
<h2 id="Notifications">通知</h2>
-<p>Android 5.0 の通知は、より見やすく、アクセスしやすく、カスタマイズしやすくなりました。 </p>
+<p>在 Android 5.0 中,用户可以更加方便地查看、使用和配置通知。 </p>
<img src="{@docRoot}images/versions/notification-headsup.png" style="float:right; margin:0 0 40px 60px" width="300" height="224" />
-<p>さまざまな通知の詳細を<strong>ロック画面</strong>に表示できるようになり、通知内容をすべて表示するか、一部だけ表示するか、表示しないかをユーザーが選択できます。 </p>
+<p>用户可以根据需在<strong>锁屏上</strong>显示不同的通知详细信息,例如,他们可以选择在安全锁屏上完全不显示通知,也可以选择显示部分或全部通知。 </p>
-<p>着信などの重要な通知は<strong>警告通知</strong>と呼ばれるフローティング ウィンドウに表示されるため、使用中のアプリを表示したまま応答したり破棄したりできます。</p>
+<p>像来电这样的重要通知警报会显示在<strong>浮动通知</strong>中,这是一个浮在上方显示的小窗口,方便用户无需退出当前应用就能响应或关闭通知。</p>
-<p>Android 5.0 では、通知に<strong>新しいメタデータ</strong>を追加して、関連付けられている連絡先(ランク付け用)、カテゴリ、優先度を収集できるようになりました。</p>
+<p>您现在可以在通知中通过<strong>新的元数据</strong>来收集相关的联系人(用于评级)、类别和优先级。</p>
-<p>新たに追加されたメディア通知テンプレートを使用すると、最大 6 つの操作ボタンを使用して、一貫性のあるメディア コントロール(例: 「いいね」や「+1」)を通知に追加できます。RemoteViews はもう必要ありません。</p>
+<p>内置新的媒体通知模板可以设置多达 6 个控制按钮(包括“翘拇指”之类的自定义控件),以通知方式实现一致的媒体控制,再也用不着 RemoteViews 了!</p>
-<h2 id="TV">アプリを大画面で</h2>
+<h2 id="TV">以大屏幕呈现</h2>
-<p><a href="http://developer.android.com/tv/index.html">Android TV</a> は、アプリを大画面で楽しむためのテレビ用プラットフォームを提供します。シンプルなホーム画面をベースに構成されており、ユーザーへのおすすめや音声検索によってコンテンツを簡単に見つけることができます。</p>
+<p><a href="http://developer.android.com/tv/index.html">Android TV</a> 打造了一个完整的电视平台,让您的应用在大屏幕上驰骋。它以简洁的主屏幕体验为核心,提供个性化推荐和语音搜索功能,方便客户轻松发现内容。</p>
-<p>Android TV なら、アプリやゲームを<strong>迫力の大画面</strong>で楽しむことができ、ゲーム コントローラなどの入力デバイスにも対応しています。Android では <a href="{@docRoot}tools/support-library/features.html#v17-leanback">v17 サポート ライブラリ</a>に <strong>Leanback UI フレームワーク</strong>が用意されており、離れた場所からでも操作しやすい 10 フィート UI を簡単に実現できます。</p>
+<p>有了 Android TV,您现在可以为应用或游戏内容<strong>营造宏大且引人入胜的氛围</strong>,并支持与游戏控制器和其他输入设备互动。Android 还在 <a href="{@docRoot}tools/support-library/features.html#v17-leanback">v17 支持库</a>中提供了 <strong>Leanback 界面框架</strong>,帮助您构建在 10 英尺处观看的电视界面,给用户一种恍若看电影的感觉。</p>
-<p><strong>Android TV Input Framework</strong>(TIF)を使用すると、HDMI 入力、テレビチューナー、IPTV 対応受信機などからの動画ストリームを TV アプリで処理できます。TV Input が公開しているメタデータを使用することで、放送中のテレビ番組を検索できるようにしたり、ユーザーへのおすすめを表示したりできます。また、HDMI-CEC コントロール サービスを使用して、複数のデバイスを 1 つのリモコンで操作できるようにすることも可能です。 </p>
+<p><strong>Android TV 输入框架</strong> (TIF) 能够让电视应用处理来自 HDMI 输入、电视调谐器和 IPTV 接收器等等的视频流。它还通过 TV 输入框架发布的元数据支持直播电视搜索和推荐功能,并且内置 HDMI-CEC 控制服务,可以让用户通过单独一个遥控器操控多个设备。 </p>
-<p>TV Input フレームワークを使用すると、さまざまな入力ソースからのテレビ番組をまとめ、ユーザーが 1 つのインターフェースで閲覧したり視聴したりできるようにすることができます。提供するコンテンツの TV Input サービスを作成することで、ユーザーが TV デバイスでコンテンツを視聴する可能性を高めることができます。</p>
+<p>TV 输入框架能够让您广泛使用大量直播电视输入来源,并将它们汇总在同一个界面中供用户浏览、查看和欣赏内容。如果您为内容构建电视输入服务,用户就能更便利地在电视设备上观看这些内容。</p>
<img src="{@docRoot}images/versions/recents_screen_2x.png" srcset="{@docRoot}images/versions/recents_screen.png 1x, {@docRoot}images/versions/recents_screen_2x.png 2x" style="float:right; margin:0 0 40px 60px" width="300" height="521" />
-<h2 id="Documents">アプリのドキュメント化</h2>
+<h2 id="Documents">以文档为中心</h2>
-<p>Android 5.0 では、[概要](以前は [最近])のスペースをデザインしなおして用途を広げ、マルチタスクにも使えるようにしました。</p>
+<p>Android 5.0 引入了重新设计的“概览”空间(以前称为“最近事项”),在多任务处理上更为强大,用途更加广泛。</p>
-<p>新しい API を使用することで、アプリ内の各アクティビティを個別のドキュメントとして、他の最近の画面と並べて表示できます。</p>
+<p>新的 API 让应用中的活动化身成为独立的文档,与其他最近活动的屏幕并排显示,</p>
-<p>これにより、ユーザーがコンテンツやサービスにすばやくアクセスできるようになります。たとえば、生産性アプリのファイル、ゲームでのプレーヤーの組み合わせ、メッセージ アプリのチャットなどを、別々のドキュメントにして同時に表示できます。 </p>
+<p>这样您可以充分利用并行文档,让用户即时访问您的更多内容或服务。例如,您可以使用并行文档展现工作提效应用中的文件、游戏中的玩家比赛,或者即时消息应用的聊天。 </p>
-<h2 id="Connectivity">進化した接続性</h2>
+<h2 id="Connectivity">连接性能更上一级</h2>
-<p>Android 5.0 に追加された新しい API を使用すると、アプリと <strong>BLE</strong>(Bluetooth Low Energy)の同時処理が可能になり、スキャン(セントラル モード)とアドバタイズ(ペリフェラル モード)の両方を行うことができます。</p>
+<p>Android 5.0 新开放的 API 可以让应用与<strong>低功耗蓝牙</strong> (BLE) 的扫描(內围模式)和广告(外围模式)实现并行操作。</p>
-<p>新しい<strong>マルチネットワーキング</strong>機能により、アプリから特定の機能を利用できるネットワーク(Wi-Fi、モバイル、従量制、特定のネットワーク機能を提供するネットワークなど)を探せるようになりました。ネットワークが見つかったら、アプリから接続を要求したり、切断やネットワーク変更に対して応答したりできます。</p>
+<p>新的<strong>多重联网</strong>功能允许应用查询可用网络来查找可用功能,例如它们是 Wi-Fi 网络、蜂窝网络还是不限流量网络,以及它们是否提供了特定的网络功能。然后,应用可以请求联网,并在连接断开或出现其他的网络变动时做出响应。</p>
-<p><strong>NFC</strong> API では、アプリから NFC AID(Application ID)を動的に登録できるようになりました。また、アクティブなサービスごとに望ましいカード エミュレーション サービスを設定したり、UTF-8 テキストデータを格納する NDEF レコードを作成したりすることも可能になりました。</p>
+<p><strong>NFC</strong> API 现在允许应用动态注册 NFC 应用 ID (AID)。它们还可以根据活动状态下的服务设置首选的卡仿真服务并创建 NDEF 记录(采用 UTF-8 文本数据)。</p>
-<h2 id="Graphics">高性能グラフィックス</h2>
+<h2 id="Graphics">高性能图形</h2>
-<p><strong><a href="http://www.khronos.org/opengles/3_X/">Khronos OpenGL ES 3.1</a></strong> をサポートしたことで、対応デバイスで実行するゲームやアプリに高性能な 2D / 3D グラフィックス機能を利用できるようになりました。 </p>
+<p>现已支持 <strong><a href="http://www.khronos.org/opengles/3_X/">Khronos OpenGL ES 3.1</a></strong>,因此您可以在受支持的设备上为游戏和其他应用采用最高性能的 2D 和 3D 图形功能。 </p>
-<p>OpenGL ES 3.1 により、コンピュート シェーダー、ステンシル テクスチャ、アクセラレータによる視覚効果、高品質 ETC2/EAC テクスチャ圧縮、高度なテクスチャ レンダリング、標準化されたテクスチャ サイズ、レンダー バッファ フォーマットなど、さまざまな機能が追加されました。</p>
+<p>OpenGL ES 3.1 增加了计算着色器、模版纹理、加速的视觉效果、优质 ETC2/EAC 纹理压缩、高级纹理渲染、标准化纹理尺寸以及渲染缓冲区格式等功能。</p>
<div class="figure" style="width:350px; margin:0 0 0 60px">
<img src="{@docRoot}images/versions/rivalknights.png" style="float:right;" width="350" height="525" />
-<p class="img-caption">Gameloft の Rival Knights では、AEP の ASTC(Adaptive Scalable Texture Compression)と ES 3.1 のコンピュート シェーダーを使用して、ハイ ダイナミック レンジ(HDR)によるブルーム効果や詳細なグラフィックスを実現しています。</p>
+<p class="img-caption">Gameloft 开发的《骑士对决》采用了 AEP 中的 ASTC(自适应可伸缩纹理压缩)和 ES 3.1 中的计算着色器,不仅打造出 HDR(高动态范围)泛光效果,而且图形细节更加清楚。</p>
</div>
-<p>Android 5.0 には OpenGL ES 拡張をまとめた <strong>Android Extension Pack</strong>(AEP)も追加されており、テッセレーション シェーダー、ジオメトリ シェーダー、ASTC テクスチャ圧縮、サンプル単位での補間とシェーディングなど、高度なレンダリング機能を使用できます。AEP を使用することで、GPU を無駄なく利用して高性能なグラフィックスを実現できます。</p>
+<p>Android 5.0 还引入了 <strong>Android 扩展程序包</strong> (AEP),这是一组 OpenGL ES 扩展程序,可让您使用镶嵌图案着色器、几何图形着色器、ASTC 纹理压缩、按样本插入和着色以及其他高级渲染功能。有了 AEP,您就可以通过一系列 GPU 运用高性能图形。</p>
-<h2 id="Audio">さらに強化された音声</h2>
+<h2 id="Audio">音频处理功能更强</h2>
-<p>新しい音声キャプチャ デザインにより、<strong>音声入力の待ち時間が短縮</strong>されました。新しいデザインには、ブロックが読み込み中にしか発生しない高速キャプチャ スレッド、ネイティブ サンプル レートでの高速トラック キャプチャ クライアント、チャンネル カウント、ビット深度、リサンプリングを提供する通常のキャプチャ クライアント、チャンネルのアップミックスとダウンミックス、ビット深度の調整などが含まれています。</p>
+<p>采用全新的音频捕捉设计,提供<strong>低延迟音频输入</strong>功能。在此设计中,快速音频捕捉线程只要不是读取则永远不会阻塞,高速客户端采用本地取样频率、通道数和位深度;普通客户端具备重新采样、上/下行通道混合以及上/下位深度的特点。</p>
-<p>マルチチャンネルの<strong>音声ストリーム ミキシング</strong>を使うと、5.1 や 7.1 を含め最大 8 つのチャンネルをミキシングできる本格的なオーディオ アプリを実現できます。</p>
+<p>借助多通道<strong>音频流混合</strong>,专业音频应用可以混音多达八个通道,包括 5.1 和 7.1 通道在内。</p>
-<p>アプリでは、メディア コンテンツを公開したり、他のアプリが公開している<strong>メディアを閲覧</strong>したり、その再生をリクエストしたりできます。コンテンツはクエリ可能なインターフェースで公開されるため、端末に保持する必要はありません。</p>
+<p>应用现在可以公开自己的媒体内容,并<strong>浏览其他应用的媒体</strong>,然后请求播放。内容通过具有查询功能的界面公开,不需要驻留在设备上。</p>
-<p>また、特定のロケール、音質、レイテンシ速度に関連付けられた音声プロフィールを使うことで、<strong>合成音声によるテキスト読み上げ</strong>をきめ細かくコントロールできます。新しい API では、合成エラーチェック、ネットワーク合成、言語検出、ネットワーク フォールバックなどへの対応も進めました。</p>
+<p>应用可以通过与特定区域设置、质量和延迟评级关联的语音配置文件精准控制<strong>从文本到语音的合成</strong>。新的 API 还增强了对合成错误检查、网络合成、语言搜索和网络回退的支持。</p>
-<p>Android が標準の <strong>USB オーディオ</strong>機器にも対応したことで、USB ヘッドセット、スピーカー、マイクなどの高性能デジタル機器も使用できるようになりました。Android 5.0 には、<strong>Opus</strong> 音声コーデックのサポートも追加されています。</p>
+<p>Android 现在支持标准 <strong>USB 音频</strong>外设,因此用户可以连接 USB 耳机、扬声器、麦克风和其他高性能数字外设。Android 5.0 更是支持 <strong>Opus</strong> 音频编解码器。</p>
-<p>メディア再生をコントロールするための新しい <strong>{@link android.media.session.MediaSession}</strong> API を使用することで、複数の画面にわたって一貫性のあるメディア コントロールや各種コントローラを簡単に表示できるようになりました。</p>
+<p>在媒体播放控制领域内新开放的 <strong>{@link android.media.session.MediaSession}</strong> API,能够在不同屏幕和不同控制器之间保持一致的媒体控制。</p>
-<h2 id="Camera">カメラと動画の拡張</h2>
+<h2 id="Camera">摄像头和视频处理进一步完善</h2>
-<p>Android 5.0 では<strong>カメラ用の API</strong> が一新されており、YUV、Bayer RAW などの未加工フォーマットのキャプチャや、露出時間、ISO 感度、フレーム単位のフレーム持続時間などのパラメータ調整が可能です。カメラ パイプラインが完全に同期するようになったことで、対応デバイスを使えば未圧縮のフル解像度 YUV イメージを 30 FPS でキャプチャできます。</p>
+<p>Android 5.0 引入了<strong>全新的摄像头 API</strong>,支持您以 YUV 和 Bayer RAW 等原始格式拍照,并针对每个独立帧控制曝光时间、ISO 感光度和帧持续时间。新的完全同步的摄像头管道允许您在受支持的设备上以每秒 30 帧的速率捕获未压缩的全分辨率 YUV 图片。</p>
-<p>イメージと一緒に、ノイズモデルや光情報などのメタデータをカメラからキャプチャすることもできます。</p>
+<p>除了图片之外,您还可以通过摄像头捕获元数据,例如噪声模型和光学信息。</p>
-<p>ネットワーク経由で動画ストリームを送信するアプリでは、H.265 <strong>HEVC(High Efficiency Video Coding)</strong>を利用して動画データのエンコードとデコードを最適化できるようになりました。 </p>
+<p>视频如果是通过网络发送视频流,则现在可以利用 H.265 <strong>高效视频编码 (HEVC)</strong> 实现视频数据的最佳编码和解码。 </p>
-<p>Android 5.0 には<strong>マルチメディア トンネリング</strong>のサポートも追加されており、超高解像度(4K)のコンテンツを楽しむための最適な環境を提供するほか、圧縮された音声データと動画データを一緒に再生することも可能です。 </p>
+<p>Android 5.0 还新支持<strong>多媒体隧道</strong>,以便针对超高清 (4K) 内容提供最佳体验,并且能够将压缩的音频和视频数据一起播放。 </p>
<div class="figure" style="width:320px; margin:1em 0 0 20px;padding-left:2em;">
<img style="float:right; margin:0 1em 1em 2em" src="{@docRoot}images/android-5.0/managed_apps_launcher@2x.png" srcset="{@docRoot}images/android-5.0/managed_apps_launcher@2x.png 2x" alt="" width="300" />
-<p class="img-caption">個人用と仕事用のアプリをまとめて表示し、バッジで簡単に識別できます。</p>
+<p class="img-caption">用户可以通过一致的方式查看其个人应用和工作应用,这些应用带有标记,可以轻松识别。</p>
</div>
-<h2 id="Work">職場での Android</h2>
+<h2 id="Work">工作场所中的 Android</h2>
-<p>企業環境において BYOD(Bring-Your-Own-Device)を実現するには、<a href="{@docRoot}about/versions/android-5.0.html#Enterprise">管理されたプロビジョニング手続き</a>によって端末の安全なワーク プロフィールを作成する必要があります。ランチャー内のアプリにワークバッジが表示されている場合は、そのアプリがワーク プロフィール内で IT 管理者によって管理されていることを表します。</p>
+<p>为了在企业环境中实现自带设备办公,开发者可以借助全新的<a href="{@docRoot}about/versions/android-5.0.html#Enterprise">托管配置流程</a>在设备上创建安全的工作配置文件。在启动器中,应用如果带有工作标记,则表示该应用及其数据是由 IT 管理员在工作配置文件内管理的。</p>
-<p>通知の表示は個人プロフィールとワーク プロフィールが 1 つに統合されていますが、データはプロフィール別に分けて管理されます。同じアプリを両方のプロフィールで使用しても、それぞれのデータは別々に保管されます。</p>
+<p>针对个人配置文件和工作配置文件的通知都显示在一个统一视图中。每个配置文件的数据始终彼此分开,即使当两个配置文件使用同一应用时也是如此。</p>
-<p>会社所有の端末は、IT 管理者が新しい端末として登録して<a href="{@docRoot}about/versions/android-5.0.html#DeviceOwner">端末所有者</a>を設定します。会社所有の端末にグローバル端末設定を定義する端末所有者アプリをインストールすることで、従業員はその端末を持ち出すことができるようになります。</p>
+<p>对于公司自有的设备,IT 管理员可以通过<a href="{@docRoot}about/versions/android-5.0.html#DeviceOwner">设备所有者</a>着手处理新设备并予以配置。雇主可以针对已安装并可配置全局设备设置的设备所有者应用发放这些设备。</p>
-<h2 id="ScreenCapture">画面のキャプチャと共有</h2>
+<h2 id="ScreenCapture">屏幕截图和共享</h2>
-<p>Android 5.0 では、アプリに画面キャプチャや画面共有の機能を追加できます。 </p>
+<p>Android 5.0 允许您在应用中使用屏幕捕获和屏幕共享功能。 </p>
-<p>ユーザーの承諾が得られれば、画面から安全性の低い動画をキャプチャしてネットワークに配信することも可能です。</p>
+<p>只要拥有用户权限,您就可以从显示屏捕获非安全视频,并可以选择通过网络发送。</p>
-<h2 id="Sensors">新しいタイプのセンサー</h2>
+<h2 id="Sensors">新型传感器</h2>
-<p>Android 5.0 には、新たに<strong>傾き検出</strong>センサーが追加され、対応デバイスでの操作の認識精度が向上しました。また、<strong>心拍数センサー</strong>も追加され、デバイスに接触している人の心拍数を記録できるようになりました。 </p>
+<p>在 Android 5.0 中,新的<strong>倾斜检测</strong>传感器能够帮助改善受支持设备上对活动的识别情况,<strong>心率传感器</strong>则可报告触摸设备的人员的心率。 </p>
-<p>新しい<strong>操作複合センサー</strong>を使用すると、「ウェイクアップ」(オンにする)ジェスチャー、「ピックアップ」(手に取る)ジェスチャー、「グランス」(ちらりと見る)ジェスチャーなどの特殊な操作を検出できます。<em></em><em></em><em></em></p>
+<p>新的<strong>互动复合传感器</strong>现在可用来检测特殊互动,例如“唤醒”<em></em>手势、<em></em>“拾取”手势和<em></em>“扫视”手势。</p>
@@ -231,29 +225,29 @@
<img src="/images/kk-chromium-icon.png" alt="" height="160" style="margin-bottom:0em;">
</div>
-<p>Android 5.0 の初期リリースには、Chromium M37 リリースをベースとした Chromium for {@link android.webkit.WebView} が含まれており、これにより <strong>WebRTC</strong>、<strong>WebAudio</strong>、<strong>WebGL</strong> がサポートされます。 </p>
+<p>Android 5.0 的初始版本包括一个适用于 {@link android.webkit.WebView} 的 Chromium 版本,该版本基于 Chromium M37 版本,增加了对 <strong>WebRTC</strong>、<strong>WebAudio</strong> 和 <strong>WebGL</strong> 的支持。 </p>
-<p>Chromium M37 には、すべての <strong>Web Components</strong> 仕様(Custom Elements、Shadow DOM、HTML Imports、Templates)のネイティブ サポートも含まれています。つまり、<a href="http://polymer-project.org/">Polymer</a> とその <a href="https://www.polymer-project.org/docs/elements/material.html">Material Design 要素</a>を WebView で、Polyfill なしで使用できるということです。</p>
+<p>Chromium M37 还包括对所有 <strong>Web 组件</strong>规范的原生支持:定制元素、Shadow DOM、HTML 导入以及模板。也就是说,您可以在 WebView 中使用 <a href="http://polymer-project.org/">Polymer</a> 及其<a href="https://www.polymer-project.org/docs/elements/material.html">Material design 设计元素</a>,无需 polyfills。</p>
-<p>Android 4.4 以降の WebView は Chromium をベースにしていますが、Chromium レイヤは今後は Google Play から更新できるようになります。</p>
+<p>虽然自 Android 4.4 以来 WebView 已基于 Chromium ,但现在可以从 Google Play 更新 Chromium 层。</p>
-<p>Chromium の新バージョンがリリースされたとき、Android 5.0 以上で WebView を使用しているアプリのウェブ API の更新やバグ修正がある場合は、ユーザーが Google Play から更新することで WebView の最新の拡張とバグ修正を確実に適用できます。</p>
+<p>当有新的 Chromium 版本可用时,用户可以从 Google Play 进行更新以确保获得针对 WebView 的最新增强功能和错误修复,以便为在 Android 5.0 和更高版本上使用 WebView 的应用提供最新的 Web API 和错误修复。</p>
-<h2 id="Accessibility">ユーザー補助機能と入力</h2>
+<h2 id="Accessibility">辅助功能和输入</h2>
-<p>新しいユーザー補助機能 API を使用すると、視覚に障がいのないユーザーが操作できる画面上のウィンドウのプロパティに関する詳しい情報を取得し、UI 要素の標準入力操作とカスタム入力操作を定義できます。</p>
+<p>新的辅助功能 API 可以检索屏幕(普通用户可见并可与之互动)上窗口的属性的详细信息,并且可以为界面元素定义标准或定制的输入操作。</p>
-<p>新しい IME(Input Method Editor)API を使用すると、入力方法から直接他の IME に切り替えることができます。</p>
+<p>新的输入法编辑器 (IME) API 支持从输入法更快地直接切换到其他 IME。</p>
-<h2 id="Battery">省電力アプリ用のツール</h2>
+<h2 id="Battery">可构建低电耗应用</h2>
-<p>新しい<strong>ジョブ スケジューリング</strong> API を使用すると、システムのジョブの実行を延期することで電池消費量を最適化できます。延期したジョブは、後で実行するように指定したり、特定の条件(充電中、Wi-Fi 接続時など)を満たしたときに実行したりできます。</p>
+<p>新的<strong>作业调度</strong> API 支持您将系统作业推迟到后期或特定情况(例如,设备在充电或已连接到 Wi-Fi),从而最大延长电池寿命。</p>
-<p>新たに追加された <code>dumpsys batterystats</code> コマンドで<strong>電池の使用統計情報</strong>を生成すると、システム全体での電池使用状況や、アプリが電池使用量にどの程度影響しているかを理解できます。電池が消費されたイベントの履歴、UID やシステム コンポーネントごとのおおよその消費電力量なども把握できます。</p>
+<p>新的 <code>dumpsys batterystats</code> 命令会生成<strong>耗电量统计信息</strong>,方便您了解整个系统的用电情况以及应用对设备电池的影响。您可以查看电源事件的历史记录、每个 UID 和系统组件的大致用电量,等等。</p>
<img src="{@docRoot}images/versions/battery_historian.png" srcset="{@docRoot}images/versions/battery_historian@2x.png 2x" alt="" width="760" height="462" />
-<p class="img-caption">新しい電池履歴ツールを使用すると、<code>dumpsys batterystats</code> で生成した統計情報を視覚化でき、電池関連のデバッグに便利です。このツールは <a href="https://github.com/google/battery-historian">https://github.com/google/battery-historian</a> から入手できます。</p>
+<p class="img-caption">Battery Historian 是一个新工具,可以将 <code>dumpsys batterystats</code> 的统计信息转成直观的信息,方便就电池进行调试。该工具位于 <a href="https://github.com/google/battery-historian">https://github.com/google/battery-historian</a>。</p>
diff --git a/docs/html-intl/intl/zh-cn/resources.jd b/docs/html-intl/intl/zh-cn/resources.jd
index 3c2abd3..ac63901 100644
--- a/docs/html-intl/intl/zh-cn/resources.jd
+++ b/docs/html-intl/intl/zh-cn/resources.jd
@@ -8,12 +8,6 @@
@jd:body
- <div class="jd-descr" itemprop="articleBody">
- <div class="resource-widget resource-carousel-layout col-16"
- style="height:420px;margin-top:0px;padding-top:0"
- data-query="collection:overview/carousel/zhcn"
- data-sortOdrder="-timestamp"
- data-maxResults="4"></div>
<div class="dynamic-grid">
diff --git a/docs/html/about/dashboards/index.jd b/docs/html/about/dashboards/index.jd
index 448dcda..063084d 100644
--- a/docs/html/about/dashboards/index.jd
+++ b/docs/html/about/dashboards/index.jd
@@ -57,7 +57,7 @@
</div>
-<p style="clear:both"><em>Data collected during a 7-day period ending on November 3, 2014.
+<p style="clear:both"><em>Data collected during a 7-day period ending on December 1, 2014.
<br/>Any versions with less than 0.1% distribution are not shown.</em>
</p>
@@ -88,7 +88,7 @@
</div>
-<p style="clear:both"><em>Data collected during a 7-day period ending on November 3, 2014.
+<p style="clear:both"><em>Data collected during a 7-day period ending on December 1, 2014.
<br/>Any screen configurations with less than 0.1% distribution are not shown.</em></p>
@@ -108,7 +108,8 @@
<img alt="" style="float:right"
-src="//chart.googleapis.com/chart?chl=GL%202.0%7CGL%203.0&chd=t%3A74.7%2C25.3&chf=bg%2Cs%2C00000000&chco=c4df9b%2C6fad0c&cht=p&chs=400x250" />
+src="//chart.googleapis.com/chart?chl=GL%202.0%7CGL%203.0&chf=bg%2Cs%2C00000000&chd=t%3A72.2%2C27.8&chco=c4df9b%2C6fad0c&cht=p&chs=400x250" />
+
<p>To declare which version of OpenGL ES your application requires, you should use the {@code
android:glEsVersion} attribute of the <a
@@ -126,17 +127,17 @@
</tr>
<tr>
<td>2.0</td>
-<td>74.7%</td>
+<td>72.2%</td>
</tr>
<tr>
<td>3.0</td>
-<td>25.3%</td>
+<td>27.8%</td>
</tr>
</table>
-<p style="clear:both"><em>Data collected during a 7-day period ending on November 3, 2014</em></p>
+<p style="clear:both"><em>Data collected during a 7-day period ending on December 1, 2014</em></p>
@@ -154,42 +155,42 @@
var VERSION_DATA =
[
{
- "chart": "//chart.googleapis.com/chart?chl=Froyo%7CGingerbread%7CIce%20Cream%20Sandwich%7CJelly%20Bean%7CKitKat&chd=t%3A0.6%2C9.8%2C8.5%2C50.9%2C30.2&chf=bg%2Cs%2C00000000&chco=c4df9b%2C6fad0c&cht=p&chs=500x250",
+ "chart": "//chart.googleapis.com/chart?chl=Froyo%7CGingerbread%7CIce%20Cream%20Sandwich%7CJelly%20Bean%7CKitKat&chf=bg%2Cs%2C00000000&chd=t%3A0.5%2C9.1%2C7.8%2C48.7%2C33.9&chco=c4df9b%2C6fad0c&cht=p&chs=500x250",
"data": [
{
"api": 8,
"name": "Froyo",
- "perc": "0.6"
+ "perc": "0.5"
},
{
"api": 10,
"name": "Gingerbread",
- "perc": "9.8"
+ "perc": "9.1"
},
{
"api": 15,
"name": "Ice Cream Sandwich",
- "perc": "8.5"
+ "perc": "7.8"
},
{
"api": 16,
"name": "Jelly Bean",
- "perc": "22.8"
+ "perc": "21.3"
},
{
"api": 17,
"name": "Jelly Bean",
- "perc": "20.8"
+ "perc": "20.4"
},
{
"api": 18,
"name": "Jelly Bean",
- "perc": "7.3"
+ "perc": "7.0"
},
{
"api": 19,
"name": "KitKat",
- "perc": "30.2"
+ "perc": "33.9"
}
]
}
@@ -203,27 +204,28 @@
"Large": {
"hdpi": "0.6",
"ldpi": "0.5",
- "mdpi": "4.5",
- "tvdpi": "1.9",
+ "mdpi": "4.6",
+ "tvdpi": "2.0",
"xhdpi": "0.6"
},
"Normal": {
- "hdpi": "36.6",
- "mdpi": "9.9",
- "xhdpi": "18.9",
- "xxhdpi": "16.0"
+ "hdpi": "36.9",
+ "mdpi": "9.4",
+ "tvdpi": "0.2",
+ "xhdpi": "18.8",
+ "xxhdpi": "16.3"
},
"Small": {
- "ldpi": "5.8"
+ "ldpi": "5.4"
},
"Xlarge": {
"hdpi": "0.3",
- "mdpi": "3.9",
- "xhdpi": "0.5"
+ "mdpi": "3.8",
+ "xhdpi": "0.6"
}
},
- "densitychart": "//chart.googleapis.com/chart?chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi&chd=t%3A6.3%2C18.3%2C1.9%2C37.5%2C20.0%2C16.0&chf=bg%2Cs%2C00000000&chco=c4df9b%2C6fad0c&cht=p&chs=400x250",
- "layoutchart": "//chart.googleapis.com/chart?chl=Xlarge%7CLarge%7CNormal%7CSmall&chd=t%3A4.7%2C8.1%2C81.4%2C5.8&chf=bg%2Cs%2C00000000&chco=c4df9b%2C6fad0c&cht=p&chs=400x250"
+ "densitychart": "//chart.googleapis.com/chart?chl=ldpi%7Cmdpi%7Ctvdpi%7Chdpi%7Cxhdpi%7Cxxhdpi&chf=bg%2Cs%2C00000000&chd=t%3A5.9%2C17.8%2C2.2%2C37.8%2C20.0%2C16.3&chco=c4df9b%2C6fad0c&cht=p&chs=400x250",
+ "layoutchart": "//chart.googleapis.com/chart?chl=Xlarge%7CLarge%7CNormal%7CSmall&chf=bg%2Cs%2C00000000&chd=t%3A4.7%2C8.3%2C81.6%2C5.4&chco=c4df9b%2C6fad0c&cht=p&chs=400x250"
}
];
diff --git a/docs/html/auto/index.jd b/docs/html/auto/index.jd
index 129478a..d113a7d 100644
--- a/docs/html/auto/index.jd
+++ b/docs/html/auto/index.jd
@@ -65,6 +65,9 @@
</style>
+
+
+
<div class="landing-body-content">
<div class="landing-hero-container">
@@ -78,7 +81,7 @@
<div class="landing-section-header">
<div class="landing-h1 hero">Android Auto</div>
<div class="landing-subhead hero">Audio entertainment and
- messaging services in the car</div>
+ messaging services in the car.</div>
<div class="landing-hero-description">
<p style="width:450px">Let drivers listen to and control
content in your music and other audio apps. Allow drivers to
@@ -86,12 +89,15 @@
car's controls and screen.</p>
</div>
- <div class="landing-body">
+ <div class="landing-body" style="margin-top:40px;">
<a href="{@docRoot}training/auto/index.html"
- class="landing-button landing-primary"
- style="margin-top:40px;">
+ class="landing-button landing-primary">
Get Started
</a>
+ <a href="https://www.youtube.com/watch?v=ctiaVxgclsg" class="video-shadowbox-button white"
+ style="margin-left:40px">
+ Watch the Intro Video
+ </a>
</div>
</div>
</div>
@@ -110,7 +116,7 @@
<div class="landing-section landing-gray-background" id="android-in-car">
<div class="wrap">
- <div class="landing-section-h1">
+ <div class="landing-section-header">
<div class="landing-h1">Extending Android to Cars</div>
<div class="landing-subhead">Android Auto brings the Android
platform into the car with a user interface that's optimized for driving.</div>
@@ -131,10 +137,6 @@
</div>
</div>
</div>
- <p>Before you start building, check out the
- <a href="http://youtu.be/ctiaVxgclsg" class="external-link">Introduction to Android Auto</a> video to understand how
- users see and interact with your app in Android Auto.
- </p>
</div>
</div> <!-- end .wrap -->
</div> <!-- end .landing-section -->
diff --git a/docs/html/design/design_toc.cs b/docs/html/design/design_toc.cs
index 416a93d..2cbdacd 100644
--- a/docs/html/design/design_toc.cs
+++ b/docs/html/design/design_toc.cs
@@ -23,6 +23,7 @@
<li><a href="<?cs var:toroot ?>design/wear/creative-vision.html">Creative Vision</a></li>
<li><a href="<?cs var:toroot ?>design/wear/principles.html">Design Principles</a></li>
<li><a href="<?cs var:toroot ?>design/wear/structure.html">App Structure</a></li>
+ <li><a href="<?cs var:toroot ?>design/wear/context.html">Context Awareness</a></li>
<li><a href="<?cs var:toroot ?>design/wear/patterns.html">UI Patterns</a></li>
<li><a href="<?cs var:toroot ?>design/wear/style.html">Style</a></li>
</ul>
diff --git a/docs/html/design/media/wear/ContextualExample.005.png b/docs/html/design/media/wear/ContextualExample.005.png
new file mode 100644
index 0000000..a01d941
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.005.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.005_2x.png b/docs/html/design/media/wear/ContextualExample.005_2x.png
new file mode 100644
index 0000000..caea8f3
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.005_2x.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.006.png b/docs/html/design/media/wear/ContextualExample.006.png
new file mode 100644
index 0000000..e680afb
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.006.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.006_2x.png b/docs/html/design/media/wear/ContextualExample.006_2x.png
new file mode 100644
index 0000000..ee4087e
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.006_2x.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.007.png b/docs/html/design/media/wear/ContextualExample.007.png
new file mode 100644
index 0000000..9d79e41
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.007.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.007_2x.png b/docs/html/design/media/wear/ContextualExample.007_2x.png
new file mode 100644
index 0000000..06e425b
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.007_2x.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.008.png b/docs/html/design/media/wear/ContextualExample.008.png
new file mode 100644
index 0000000..331d77e2
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.008.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.008_2x.png b/docs/html/design/media/wear/ContextualExample.008_2x.png
new file mode 100644
index 0000000..a6854e8
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.008_2x.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.009.png b/docs/html/design/media/wear/ContextualExample.009.png
new file mode 100644
index 0000000..67c80ad
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.009.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.009_2x.png b/docs/html/design/media/wear/ContextualExample.009_2x.png
new file mode 100644
index 0000000..ca5248d
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.009_2x.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.010.png b/docs/html/design/media/wear/ContextualExample.010.png
new file mode 100644
index 0000000..e9c6ed8
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.010.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.010_2x.png b/docs/html/design/media/wear/ContextualExample.010_2x.png
new file mode 100644
index 0000000..ddae792
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.010_2x.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.011.png b/docs/html/design/media/wear/ContextualExample.011.png
new file mode 100644
index 0000000..ddafd65
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.011.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.011_2x.png b/docs/html/design/media/wear/ContextualExample.011_2x.png
new file mode 100644
index 0000000..46934e4
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.011_2x.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.012.png b/docs/html/design/media/wear/ContextualExample.012.png
new file mode 100644
index 0000000..05c72d3
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.012.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.012_2x.png b/docs/html/design/media/wear/ContextualExample.012_2x.png
new file mode 100644
index 0000000..c86bda5
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.012_2x.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.013.png b/docs/html/design/media/wear/ContextualExample.013.png
new file mode 100644
index 0000000..0c8d3da
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.013.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.013_2x.png b/docs/html/design/media/wear/ContextualExample.013_2x.png
new file mode 100644
index 0000000..efbbf87
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.013_2x.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.014.png b/docs/html/design/media/wear/ContextualExample.014.png
new file mode 100644
index 0000000..b8d87e8
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.014.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.014_2x.png b/docs/html/design/media/wear/ContextualExample.014_2x.png
new file mode 100644
index 0000000..a89199f
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.014_2x.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.015.png b/docs/html/design/media/wear/ContextualExample.015.png
new file mode 100644
index 0000000..aa00b1f
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.015.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.015_2x.png b/docs/html/design/media/wear/ContextualExample.015_2x.png
new file mode 100644
index 0000000..7e6421c
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.015_2x.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.016.png b/docs/html/design/media/wear/ContextualExample.016.png
new file mode 100644
index 0000000..8d50799
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.016.png
Binary files differ
diff --git a/docs/html/design/media/wear/ContextualExample.016_2x.png b/docs/html/design/media/wear/ContextualExample.016_2x.png
new file mode 100644
index 0000000..e67cdee
--- /dev/null
+++ b/docs/html/design/media/wear/ContextualExample.016_2x.png
Binary files differ
diff --git a/docs/html/design/wear/context.jd b/docs/html/design/wear/context.jd
new file mode 100644
index 0000000..688806f
--- /dev/null
+++ b/docs/html/design/wear/context.jd
@@ -0,0 +1,152 @@
+page.title=Context Awareness on Android Wear
+@jd:body
+
+<style>
+div.slide-wrapper {
+ width:780px;
+ overflow:visible;
+}
+div.slide {
+ width:370px;
+ float:left;
+ margin:0 20px 0 0;
+}
+div.slide p {
+ height:40px;
+}
+div.slide img {
+ height: 208px;
+}
+</style>
+
+
+<p>Some of the most powerful user experiences with Android Wear are based on context-aware
+notifications and actions. By using device sensors and other contextual cues, your app can reveal
+information and functionality precisely when the user needs it, at a glance.</p>
+
+<p>For example, if you’re building a social app for restaurants, you can recommend popular menu
+items when your app recognizes that the user is at a restaurant. More examples below provide basic
+ideas about what you can do with a notification and action confirmation in your Android Wear
+app.</p>
+
+
+<div class="slide-wrapper">
+
+<div class="slide">
+<h2>Pinterest</h2>
+<p>Displays a notification when one of your geo-tagged pins is within walking distance.</p>
+<img src="{@docRoot}design/media/wear/ContextualExample.005.png" alt=""
+ srcset="{@docRoot}design/media/wear/ContextualExample.005.png 1x,
+ {@docRoot}design/media/wear/ContextualExample.005_2x.png 2x" />
+</div>
+
+<div class="slide">
+<h2>Trulia</h2>
+<p>Displays property details and contact options when you are near a new home.</p>
+<img src="{@docRoot}design/media/wear/ContextualExample.006.png" alt=""
+ srcset="{@docRoot}design/media/wear/ContextualExample.006.png 1x,
+ {@docRoot}design/media/wear/ContextualExample.006_2x.png 2x" />
+</div>
+
+
+
+<div class="slide">
+<h2>Ski Conditions</h2>
+<p>Displays lift status and slope conditions when you arrive at a ski resort.</p>
+<img src="{@docRoot}design/media/wear/ContextualExample.008.png" alt=""
+ srcset="{@docRoot}design/media/wear/ContextualExample.008.png 1x,
+ {@docRoot}design/media/wear/ContextualExample.008_2x.png 2x" />
+</div>
+
+<div class="slide">
+<h2>Thermostat</h2>
+<p>Controls automatically appear when you are at home.
+</p>
+<img src="{@docRoot}design/media/wear/ContextualExample.007.png" alt=""
+ srcset="{@docRoot}design/media/wear/ContextualExample.007.png 1x,
+ {@docRoot}design/media/wear/ContextualExample.007_2x.png 2x" />
+</div>
+
+
+
+<div class="slide">
+<h2>Airport</h2>
+<p>Displays air miles while you are waiting at the gate.
+</p>
+<img src="{@docRoot}design/media/wear/ContextualExample.009.png" alt=""
+ srcset="{@docRoot}design/media/wear/ContextualExample.009.png 1x,
+ {@docRoot}design/media/wear/ContextualExample.009_2x.png 2x" />
+</div>
+
+<div class="slide">
+<h2>Hotel</h2>
+<p>Displays late check out option on the morning of your departure.
+</p>
+<img src="{@docRoot}design/media/wear/ContextualExample.010.png" alt=""
+ srcset="{@docRoot}design/media/wear/ContextualExample.010.png 1x,
+ {@docRoot}design/media/wear/ContextualExample.010_2x.png 2x" />
+</div>
+
+
+
+<div class="slide">
+<h2>Conference</h2>
+<p>Shows which of your friends are also attending the conference.
+</p>
+<img src="{@docRoot}design/media/wear/ContextualExample.011.png" alt=""
+ srcset="{@docRoot}design/media/wear/ContextualExample.011.png 1x,
+ {@docRoot}design/media/wear/ContextualExample.011_2x.png 2x" />
+</div>
+
+<div class="slide">
+<h2>Restaurant</h2>
+<p>Provides suggestions for the healthiest items on the menu when in a restaurant.
+</p>
+<img src="{@docRoot}design/media/wear/ContextualExample.012.png" alt=""
+ srcset="{@docRoot}design/media/wear/ContextualExample.012.png 1x,
+ {@docRoot}design/media/wear/ContextualExample.012_2x.png 2x" />
+</div>
+
+
+
+<div class="slide">
+<h2>Oil Change</h2>
+<p>Offers to set a reminder to change the oil again in six months while waiting at the garage.
+</p>
+<img src="{@docRoot}design/media/wear/ContextualExample.013.png" alt=""
+ srcset="{@docRoot}design/media/wear/ContextualExample.013.png 1x,
+ {@docRoot}design/media/wear/ContextualExample.013_2x.png 2x" />
+</div>
+
+<div class="slide">
+<h2>Car Sharing</h2>
+<p>Unlocks the car as you approach it.
+</p>
+<img src="{@docRoot}design/media/wear/ContextualExample.016.png" alt=""
+ srcset="{@docRoot}design/media/wear/ContextualExample.016.png 1x,
+ {@docRoot}design/media/wear/ContextualExample.016_2x.png 2x" />
+</div>
+
+
+
+<div class="slide">
+<h2>Zoo</h2>
+<p>Notifies visitors when the penguins are going to be fed.
+</p>
+<img src="{@docRoot}design/media/wear/ContextualExample.014.png" alt=""
+ srcset="{@docRoot}design/media/wear/ContextualExample.014.png 1x,
+ {@docRoot}design/media/wear/ContextualExample.014_2x.png 2x" />
+</div>
+
+<div class="slide">
+<h2>Location-based Query</h2>
+<p>Ask things like, "Are there any picnic tables free at the park?" and get answers from
+people who are there.</p>
+<img src="{@docRoot}design/media/wear/ContextualExample.015.png" alt=""
+ srcset="{@docRoot}design/media/wear/ContextualExample.015.png 1x,
+ {@docRoot}design/media/wear/ContextualExample.015_2x.png 2x" />
+</div>
+
+
+
+</div>
\ No newline at end of file
diff --git a/docs/html/google/play-services/setup.jd b/docs/html/google/play-services/setup.jd
index 180730d..d886454 100644
--- a/docs/html/google/play-services/setup.jd
+++ b/docs/html/google/play-services/setup.jd
@@ -60,7 +60,8 @@
<a href="{@docRoot}sdk/installing/studio-build.html">Building Your Project with
Gradle</a> for more information about Gradle.</p></li>
<li>Add a new build rule under <code>dependencies</code> for the latest version of
-<code>play-services</code>. For example:
+ <code>play-services</code>.
+ <p>For example, for mobile modules:</p>
<pre class="no-pretty-print">
apply plugin: 'android'
...
@@ -70,7 +71,16 @@
<strong>compile 'com.google.android.gms:play-services:6.1.+'</strong>
}
</pre>
-<p>Be sure you update this version number each time Google Play services is updated.</p>
+ <p>For wearable modules:</p>
+<pre class="no-pretty-print">
+apply plugin: 'android'
+...
+
+dependencies {
+ <strong>compile 'com.google.android.gms:play-services-wearable:6.1.+'</strong>
+}
+</pre>
+ <p>Be sure you update this version number each time Google Play services is updated.</p>
</li>
<li>Save the changes and click <strong>Sync Project with Gradle Files</strong>
<img src="{@docRoot}images/tools/sync-project.png" style="vertical-align:bottom;margin:0;height:19px" />
diff --git a/docs/html/guide/topics/graphics/hardware-accel.jd b/docs/html/guide/topics/graphics/hardware-accel.jd
index 7c957b8..3d1935a 100644
--- a/docs/html/guide/topics/graphics/hardware-accel.jd
+++ b/docs/html/guide/topics/graphics/hardware-accel.jd
@@ -327,6 +327,30 @@
<td class="value_pos">18</td>
</tr>
<tr>
+ <td class="label_pos">drawArc()</td>
+ <td class="value_pos">21</td>
+ </tr>
+ <tr>
+ <td class="label_pos">drawRoundRect()</td>
+ <td class="value_pos">21</td>
+ </tr>
+ <tr>
+ <td class="label_pos">saveLayer() with RectF dimensions</td>
+ <td class="value_pos">21</td>
+ </tr>
+ <tr>
+ <td class="label_pos">saveLayer() with float dimensions</td>
+ <td class="value_pos">21</td>
+ </tr>
+ <tr>
+ <td class="label_pos">saveLayerAlpha() with RectF dimensions</td>
+ <td class="value_pos">21</td>
+ </tr>
+ <tr>
+ <td class="label_pos">saveLayerAlpha() with float dimensions</td>
+ <td class="value_pos">21</td>
+ </tr>
+ <tr>
<td colspan="5" class="s5">Paint</td>
</tr>
<tr>
@@ -374,6 +398,26 @@
<td class="value_neg">✗</td>
</tr>
<tr>
+ <td class="label_pos">getFontFeatureSettings()</td>
+ <td class="value_pos">21</td>
+ </tr>
+ <tr>
+ <td class="label_pos">isElegantTextHeight()</td>
+ <td class="value_pos">21</td>
+ </tr>
+ <tr>
+ <td class="label_pos">isElegantTextHeight()</td>
+ <td class="value_pos">21</td>
+ </tr>
+ <tr>
+ <td class="label_pos">setFontFeatureSettings()</td>
+ <td class="value_pos">21</td>
+ </tr>
+ <tr>
+ <td class="label_pos">setLetterSpacing()</td>
+ <td class="value_pos">21</td>
+ </tr>
+ <tr>
<td colspan="5" class="s5">Xfermode</td>
</tr>
<tr>
diff --git a/docs/html/images/studio-avdmgr-configavd.png b/docs/html/images/studio-avdmgr-configavd.png
new file mode 100644
index 0000000..9b54896
--- /dev/null
+++ b/docs/html/images/studio-avdmgr-configavd.png
Binary files differ
diff --git a/docs/html/images/studio-avdmgr-confighardwareprof.png b/docs/html/images/studio-avdmgr-confighardwareprof.png
new file mode 100644
index 0000000..2bf1783
--- /dev/null
+++ b/docs/html/images/studio-avdmgr-confighardwareprof.png
Binary files differ
diff --git a/docs/html/images/studio-avdmgr-firstscreen.png b/docs/html/images/studio-avdmgr-firstscreen.png
new file mode 100644
index 0000000..5da5c6c
--- /dev/null
+++ b/docs/html/images/studio-avdmgr-firstscreen.png
Binary files differ
diff --git a/docs/html/images/studio-avdmgr-selecthdwr.png b/docs/html/images/studio-avdmgr-selecthdwr.png
new file mode 100644
index 0000000..015833a
--- /dev/null
+++ b/docs/html/images/studio-avdmgr-selecthdwr.png
Binary files differ
diff --git a/docs/html/images/studio-avdmgr-systemimage.png b/docs/html/images/studio-avdmgr-systemimage.png
new file mode 100644
index 0000000..3b0663f
--- /dev/null
+++ b/docs/html/images/studio-avdmgr-systemimage.png
Binary files differ
diff --git a/docs/html/images/studio-avdmgr-yrvirtualdevices-new.png b/docs/html/images/studio-avdmgr-yrvirtualdevices-new.png
new file mode 100644
index 0000000..798c77d
--- /dev/null
+++ b/docs/html/images/studio-avdmgr-yrvirtualdevices-new.png
Binary files differ
diff --git a/docs/html/images/studio-avdmgr-yrvirtualdevices.png b/docs/html/images/studio-avdmgr-yrvirtualdevices.png
new file mode 100644
index 0000000..77a44a4
--- /dev/null
+++ b/docs/html/images/studio-avdmgr-yrvirtualdevices.png
Binary files differ
diff --git a/docs/html/images/studio-memory-monitor.png b/docs/html/images/studio-memory-monitor.png
new file mode 100644
index 0000000..796daf0
--- /dev/null
+++ b/docs/html/images/studio-memory-monitor.png
Binary files differ
diff --git a/docs/html/images/tools/studio-advmgr-action-icon.png b/docs/html/images/tools/studio-advmgr-action-icon.png
new file mode 100644
index 0000000..5dfa1a9
--- /dev/null
+++ b/docs/html/images/tools/studio-advmgr-action-icon.png
Binary files differ
diff --git a/docs/html/images/tools/studio-advmgr-actions-dropdown-icon.png b/docs/html/images/tools/studio-advmgr-actions-dropdown-icon.png
new file mode 100644
index 0000000..9dbb07a
--- /dev/null
+++ b/docs/html/images/tools/studio-advmgr-actions-dropdown-icon.png
Binary files differ
diff --git a/docs/html/images/tools/studio-advmgr-actions-edit-icon.png b/docs/html/images/tools/studio-advmgr-actions-edit-icon.png
new file mode 100644
index 0000000..ea85dd5
--- /dev/null
+++ b/docs/html/images/tools/studio-advmgr-actions-edit-icon.png
Binary files differ
diff --git a/docs/html/images/ui/studio-avdmgr-icon.png b/docs/html/images/ui/studio-avdmgr-icon.png
new file mode 100644
index 0000000..c90b73e
--- /dev/null
+++ b/docs/html/images/ui/studio-avdmgr-icon.png
Binary files differ
diff --git a/docs/html/samples/admin.jd b/docs/html/samples/admin.jd
new file mode 100644
index 0000000..c6637d8
--- /dev/null
+++ b/docs/html/samples/admin.jd
@@ -0,0 +1,11 @@
+page.title=Admin
+@jd:body
+
+
+<div id="samples" class="admin">
+</div>
+
+
+<script>
+ $(document).ready(showSamples);
+</script>
diff --git a/docs/html/samples/new/index.jd b/docs/html/samples/new/index.jd
index ba75072..279b910 100644
--- a/docs/html/samples/new/index.jd
+++ b/docs/html/samples/new/index.jd
@@ -2,19 +2,18 @@
@jd:body
-<p>The following code samples were recently published for the L Developer Preview. You can
+<p>The following code samples were recently published. You can
download them in the Android SDK Manager under the <b>SDK Samples</b> component
-for the L Developer Preview.</p>
+for API 21.</p>
<p class="note">
- <strong>Note:</strong> At this time, the downloadable projects are designed
+ <strong>Note:</strong> The downloadable projects are designed
for use with Gradle and Android Studio.
</p>
-
<!-- NOTE TO EDITORS: add most recent samples first -->
-<h3 id="MediaBrowserService">Media Browser Service</h3>
+<h3 id="MediaBrowserService"><a href="/samples/MediaBrowserService/index.html">Media Browser Service</a></h3>
<p>
This sample is a simple audio media app that exposes its media
@@ -29,10 +28,8 @@
href="http://android.com/auto">Android Auto</a>.
</p>
-<p><a href="http://github.com/googlesamples/android-MediaBrowserService">Get it on GitHub</a></p>
-
-<h3 id="MessagingService">Messaging Service</h3>
+<h3 id="MessagingService"><a href="/samples/MessagingService/index.html">Messaging Service</a></h3>
<p>
This sample shows a simple service that sends notifications using
@@ -46,10 +43,8 @@
href="http://android.com/auto">Android Auto</a>.
</p>
-<p><a href="http://github.com/googlesamples/android-MessagingService">Get it on GitHub</a></p>
-
-<h3 id="SpeedTracker">Speed Tracker (Wear)</h3>
+<h3 id="SpeedTracker"><a href="/samples/SpeedTracker/index.html">Speed Tracker (Wear)</a></h3>
<p>
This sample uses the FusedLocation APIs of Google Play Services on Android Wear
@@ -62,10 +57,8 @@
made of those coordinates on a map on the phone.
</p>
-<p><a href="http://github.com/googlesamples/android-SpeedTracker">Get it on GitHub</a></p>
-
-<h3 id="AppRestrictionSchema">AppRestrictionSchema</h3>
+<h3 id="AppRestrictionSchema"><a href="/samples/AppRestrictionSchema/index.html">AppRestrictionSchema</a></h3>
<p>
This sample shows how to use app restrictions. This application has one boolean
@@ -74,29 +67,23 @@
AppRestrictionEnforcer sample to toggle the restriction.
</p>
-<p><a href="http://github.com/googlesamples/android-AppRestrictionSchema">Get it on GitHub</a></p>
-
-<h3 id="AppRestrictionEnforcer">AppRestrictionEnforcer</h3>
+<h3 id="AppRestrictionEnforcer"><a href="/samples/AppRestrictionEnforcer/index.html">AppRestrictionEnforcer</a></h3>
<p>
This sample demonstrates how to set restrictions to other apps as a profile owner.
Use AppRestrictionSchema sample as a app with available restrictions.
</p>
-<p><a href="http://github.com/googlesamples/android-AppRestrictionEnforcer">Get it on GitHub</a></p>
-
-<h3 id="DocumentCentricRelinquishIdentity">DocumentCentricRelinquishIdentity</h3>
+<h3 id="DocumentCentricRelinquishIdentity"><a href="/samples/DocumentCentricRelinquishIdentity/index.html">DocumentCentricRelinquishIdentity</a></h3>
<p>
This sample shows how to relinquish identity to activities above it in the task stack.
</p>
-<p><a href="http://github.com/googlesamples/android-DocumentCentricRelinquishIdentity">Get it on GitHub</a></p>
-
-<h3 id="DocumentCentricApps">DocumentCentricApps</h3>
+<h3 id="DocumentCentricApps"><a href="/samples/DocumentCentricApps/index.html">DocumentCentricApps</a></h3>
<p>
This sample shows the basic usage of the new "Document Centric Apps" API.
@@ -105,10 +92,8 @@
created for every new document in the overview menu.
</p>
-<p><a href="http://github.com/googlesamples/android-DocumentCentricApps">Get it on GitHub</a></p>
-
-<h3 id="HdrViewfinder">HdrViewfinder</h3>
+<h3 id="HdrViewfinder"><a href="/samples/HdrViewfinder/index.html">HdrViewfinder</a></h3>
<p>
This demo implements a real-time high-dynamic-range camera viewfinder, by alternating
@@ -116,10 +101,8 @@
compositing together the latest two frames whenever a new frame is captured.
</p>
-<p><a href="http://github.com/googlesamples/android-HdrViewfinder">Get it on GitHub</a></p>
-
-<h3 id="Interpolator">Interpolator</h3>
+<h3 id="Interpolator"><a href="/samples/Interpolator/index.html">Interpolator</a></h3>
<p>
This sample demonstrates the use of animation interpolators and path animations for
@@ -127,10 +110,8 @@
view (scale X and Y) along a path.
</p>
-<p><a href="http://github.com/googlesamples/android-Interpolator">Get it on GitHub</a></p>
-
-<h3 id="DrawableTinting">DrawableTinting</h3>
+<h3 id="DrawableTinting"><a href="/samples/DrawableTinting/index.html">DrawableTinting</a></h3>
<p>Sample that shows applying tinting and color filters to Drawables both programmatically
and as Drawable resources in XML.</p>
@@ -141,54 +122,43 @@
with a reference to a color and a PorterDuff blend mode. The color and blend mode can be
changed from the UI to see the effect of different options.</p>
-<p><a href="http://github.com/googlesamples/android-DrawableTinting">Get it on GitHub</a></p>
-
-<h3 id="LNotifications">LNotifications</h3>
+<h3 id="LNotifications"><a href="/samples/LNotifications/index.html">LNotifications</a></h3>
<p>
This sample demonstrates how new features for notifications introduced in Android 5.0
are used such as Heads-Up notifications, visibility, people, category and priority
metadata. </p>
-<p><a href="http://github.com/googlesamples/android-LNotifications">Get it on GitHub</a></p>
-<h3 id="CardView">CardView</h3>
+<h3 id="CardView"><a href="/samples/CardView/index.html">CardView</a></h3>
<p>
This sample demonstrates how to use the CardView UI widget introduced in Android 5.0, using the support library for backward compatibility.
</p>
-<p><a href="http://github.com/googlesamples/android-CardView">Get it on GitHub</a></p>
-
-<h3 id="RecyclerView">RecyclerView</h3>
+<h3 id="RecyclerView"><a href="/samples/RecyclerView/index.html">RecyclerView</a></h3>
<p>
Demonstration of using RecyclerView with a LayoutManager to create a vertical ListView.
</p>
-<p><a href="http://github.com/googlesamples/android-RecyclerView">Get it on GitHub</a></p>
-
-<h3 id="RevealEffectBasic">RevealEffectBasic</h3>
+<h3 id="RevealEffectBasic"><a href="/samples/RevealEffectBasic/index.html">RevealEffectBasic</a></h3>
<p>
A sample demonstrating how to perform a reveal effect for UI elements within the Material Design framework.
</p>
-<p><a href="http://github.com/googlesamples/android-RevealEffectBasic">Get it on GitHub</a></p>
-
-<h3 id="FloatingActionButtonBasic">FloatingActionButtonBasic</h3>
+<h3 id="FloatingActionButtonBasic"><a href="/samples/FloatingActionButtonBasic/index.html">FloatingActionButtonBasic</a></h3>
<p>
This sample shows the two sizes of Floating Action Buttons and how to interact with
them.
</p>
-<p><a href="http://github.com/googlesamples/android-FloatingActionButtonBasic">Get it on GitHub</a></p>
-
<!--
<h3 id="">SampleName</h3>
@@ -205,36 +175,15 @@
</p>
-->
-
-<h3 id="NavigationDrawerSample">NavigationDrawerSample</h3>
-<!--
-<div class="figure" style="width:220px">
- <img src="" srcset="@2x.png 2x" alt="" height="375" />
- <p class="img-caption">
- <strong>Figure n.</strong> Single sentence summarizing the figure.
- </p>
-</div>
--->
-
-<p>
-This sample illustrates a common usage of the Android support library's
-{@link android.support.v4.widget.DrawerLayout} widget.
-</p>
-
-<p><a href="http://github.com/googlesamples/android-NavigationDrawer">Get it on GitHub</a></p>
-
-
-<h3 id="JobSchedulerSample">JobSchedulerSample</h3>
+<h3 id="JobSchedulerSample"><a href="/samples/JobScheduler/index.html">JobScheduler</a></h3>
<p>
This sample app allows the user to schedule jobs through the UI, and shows
visual cues when the jobs are executed.
</p>
-<p><a href="http://github.com/googlesamples/android-JobScheduler">Get it on GitHub</a></p>
-
-<h3 id="AndroidTVLeanbackSample">AndroidTVLeanbackSample</h3>
+<h3 id="AndroidTVLeanbackSample"><a href="https://github.com/googlesamples/androidtv-leanback">AndroidTVLeanbackSample</a></h3>
<!--
<div class="figure" style="width:220px">
<img src="" srcset="@2x.png 2x" alt="" height="375" />
@@ -248,10 +197,7 @@
This sample demonstrates use of the Android TV Leanback Support Library.
</p>
-<p><a href="http://github.com/googlesamples/androidtv-Leanback">Get it on GitHub</a></p>
-
-
-<h3 id="Visual-Game-Controller">Visual-Game-Controller</h3>
+<h3 id="Visual-Game-Controller"><a href="https://github.com/googlesamples/androidtv-VisualGameController">Visual-Game-Controller</a></h3>
<!--
<div class="figure" style="width:220px">
<img src="" srcset="@2x.png 2x" alt="" height="375" />
@@ -265,10 +211,8 @@
This sample displays events received from a game controller shown on the screen.
</p>
-<p><a href="http://github.com/googlesamples/androidtv-VisualGameController">Get it on GitHub</a></p>
-
-<h3 id="GameControllerSample">GameControllerSample</h3>
+<h3 id="GameControllerSample"><a href="https://github.com/googlesamples/androidtv-GameController/">GameControllerSample</a></h3>
<!--
<div class="figure" style="width:220px">
<img src="" srcset="@2x.png 2x" alt="" height="375" />
@@ -283,10 +227,8 @@
handling.
</p>
-<p><a href="http://github.com/googlesamples/androidtv-GameController">Get it on GitHub</a></p>
-
-<h3 id="ClippingBasic">ClippingBasic</h3>
+<h3 id="ClippingBasic"><a href="/samples/ClippingBasic/index.html">ClippingBasic</a></h3>
<!--
<div class="figure" style="width:220px">
<img src="" srcset="@2x.png 2x" alt="" height="375" />
@@ -300,19 +242,17 @@
This sample demonstrates clipping on a {@link android.view.View}.
</p>
-<p><a href="http://github.com/googlesamples/android-ClippingBasic">Get it on GitHub</a></p>
-
<div class="figure" style="width:220px">
<img src="{@docRoot}samples/images/JobSchedulerSample.png"
srcset="{@docRoot}samples/images/JobSchedulerSample@2x.png 2x"
alt="" height="375" />
<p class="img-caption">
- <strong>Figure 3.</strong> The JobSchedulerSample sample app.
+ <strong>Figure 1.</strong> The JobSchedulerSample sample app.
</p>
</div>
-<h3 id="ElevationDrag">ElevationDrag</h3>
+<h3 id="ElevationDrag"><a href="/samples/ElevationDrag/index.html">ElevationDrag</a></h3>
<!--
<div class="figure" style="width:220px">
<img src="" srcset="@2x.png 2x" alt="" height="375" />
@@ -326,10 +266,8 @@
Elevation and z-translation are used to render the shadows. The views are
clipped using different outlines.</p>
-<p><a href="http://github.com/googlesamples/android-ElevationDrag">Get it on GitHub</a></p>
-
-<h3 id="ElevationBasic">ElevationBasic</h3>
+<h3 id="ElevationBasic"><a href="/samples/ElevationBasic/index.html">ElevationBasic</a></h3>
<!--
<div class="figure" style="width:220px">
<img src="" srcset="@2x.png 2x" alt="" height="375" />
@@ -348,10 +286,8 @@
<code>setTranslationZ()</code>.</li>
</ul>
-<p><a href="http://github.com/googlesamples/android-ElevationBasic">Get it on GitHub</a></p>
-
-<h3 id="ActivitySceneTransitionBasic">ActivitySceneTransitionBasic</h3>
+<h3 id="ActivitySceneTransitionBasic"><a href="/samples/ActivitySceneTransitionBasic/index.html">ActivitySceneTransitionBasic</a></h3>
<div class="figure" style="width:220px">
<img src="{@docRoot}samples/images/ActivitySceneTransitionBasic.png"
srcset="{@docRoot}samples/images/ActivitySceneTransitionBasic@2x.png 2x"
@@ -366,10 +302,8 @@
of <code>moveImage</code> and <code>changeBounds</code> to nicely transition
from a grid of images to an activity with a large image and detail text. </p>
-<p><a href="http://github.com/googlesamples/android-ActivitySceneTransition">Get it on GitHub</a></p>
-
-<h3 id="Camera2Video">Camera2Video</h3>
+<h3 id="Camera2Video"><a href="/samples/Camera2Video/index.html">Camera2Video</a></h3>
<!--
<div class="figure" style="width:220px">
<img src="" srcset="@2x.png 2x" alt="" height="375" />
@@ -381,10 +315,8 @@
<p>This sample demonstrates how to record video using the Camera2 API.</p>
-<p><a href="http://github.com/googlesamples/android-Camera2Video">Get it on GitHub</a></p>
-
-<h3 id="Camera2Basic">Camera2Basic</h3>
+<h3 id="Camera2Basic"><a href="/samples/Camera2Basic/index.html">Camera2Basic</a></h3>
<!--
<div class="figure" style="width:220px">
@@ -398,16 +330,14 @@
<p>This sample demonstrates the basic use of the Camera2 API. The sample code
demonstrates how you can display camera preview and take pictures.</p>
-<p><a href="http://github.com/googlesamples/android-Camera2Basic">Get it on GitHub</a></p>
-
-<h3 id="BasicManagedProfile">BasicManagedProfile</h3>
+<h3 id="BasicManagedProfile"><a href="/samples/BasicManagedProfile/index.html">BasicManagedProfile</a></h3>
<div class="figure" style="width:220px">
<img src="{@docRoot}samples/images/BasicManagedProfile.png"
srcset="{@docRoot}samples/images/BasicManagedProfile@2x.png 2x"
alt="" height="375" />
<p class="img-caption">
- <strong>Figure 1.</strong> The BasicManagedProfile sample app.
+ <strong>Figure 3.</strong> The BasicManagedProfile sample app.
</p>
</div>
@@ -422,5 +352,3 @@
<p class="note"><strong>Note:</strong> There can be only one managed profile on
a device at a time.</p>
-<p><a href="http://github.com/googlesamples/android-BasicManagedProfile">Get it on GitHub</a></p>
-
diff --git a/docs/html/tools/devices/managing-avds.jd b/docs/html/tools/devices/managing-avds.jd
index d3bbfdc..9afa88a 100644
--- a/docs/html/tools/devices/managing-avds.jd
+++ b/docs/html/tools/devices/managing-avds.jd
@@ -12,32 +12,23 @@
<ol>
<li><a href="#hardwareopts">Hardware options</a></li>
</ol>
- </li>
+ </li>
</ol>
</div>
</div>
<p>The AVD Manager is an easy to use user interface to manage your AVD (Android Virtual Device)
configurations. An AVD is a device configuration for the Android emulator that allows you to
- model different configurations of Android-powered devices. When you start the AVD Manager in Eclipse
- or navigate to your SDK's {@code tools/} directory and execute
- <code>android avd</code>. You will see the AVD Manager as shown in
- figure 1.</p>
-
- <img src="{@docRoot}images/avd-manager.png">
-
- <p class="img-caption"><strong>Figure 1. </strong>Screenshot of the AVD Manager. </p>
-
- <p>From the main screen, you can create, delete, repair and start AVDs as well as see the details
- of each AVD. </p>
+ model different configurations of Android-powered devices. When you start the AVD Manager in Android
+ Studio or navigate to your SDK's {@code tools/} directory and execute
+ <code>android avd</code>, you will see the AVD Manager main screen with your current virtual
+ devices. You can right-click an existing AVD to perform actions on the AVD, such as delete,
+ duplicate, wipe data, show on disk, and display details. </p>
+
+ <img src="{@docRoot}images/studio-avdmgr-firstscreen.png" alt="">
+ <p class="img-caption"><strong>Figure 1.</strong> AVD Manager.</p>
- <p class="note"><strong>Note:</strong> The emulator system images include experimental
-64-bit system images along with standard 32-bit system images. The 64-bit system images
-require the Intel x86 Emulator Accelerator (HAXM) Rev.5 which can be downloaded from the
-<a href="{@docRoot}tools/help/sdk-manager.html">SDK Manager</a> <em>Extras</em> folder.
- </p>
-
<h2 id="createavd">Creating an AVD</h2>
<p>You can create as many AVDs as you would like to test on. It is recommended that you test your
@@ -49,38 +40,68 @@
<li>Start the AVD Manager:
<ul>
- <li>In Eclipse: select <strong>Window > AVD Manager</strong>, or click
- the AVD Manager icon in the Eclipse toolbar.</li>
+ <li>In Android Studio: select <strong>Tools > Android > AVD Manager</strong>, or click
+ the AVD Manager icon <img src="{@docRoot}images/ui/studio-avdmgr-icon.png"style="vertical-align:bottom;margin:0;height:19px"> in the Android Studio toolbar.</li>
+
<li>In other IDEs: Navigate to your SDK's <code>tools/</code> directory and execute the
<code>android</code> tool with no arguments.</li>
</ul>
</li>
- <li><p>In the <em>Virtual Devices</em> panel, you'll see a list of existing AVDs. Click
- <strong>New</strong> to create a new AVD. The <strong>Create New AVD</strong> dialog appears.</p>
-
- <img src="{@docRoot}images/developing/avd-dialog.png" alt="AVD Dialog">
- <p class="img-caption"><strong>Figure 2.</strong> Screenshot of the Create AVD window</p>
+ <li><p>Click <strong>Create Virtual Device</strong> to create an AVD. The
+ <strong>Select Hardware</strong> dialog appears.</p>
+
+ <img src="{@docRoot}images/studio-avdmgr-selecthdwr.png">
+ <p class="img-caption"><strong>Figure 2.</strong> Select Hardware window.</p>
+ </li>
+
+ <li><p>Select the device category and form factor. Click <strong>Edit Device</strong> to modify
+ an existing AVD, or click <strong>New Hardware Profile</strong> to create a new hardware profile.
+ Click <strong>Next</strong> to continue. </p>
+ <p>The hardware profile includes settings for screen size, camera, memory options,input type,
+ and sensors. For a list of hardware features, see <a href="#hardwareopts">Hardware options</a>.</p>
+
+ <img src="{@docRoot}images/studio-avdmgr-confighardwareprof.png" alt="">
+ <p class="img-caption"><strong>Figure 3.</strong> Configure Hardware window.</p>
+ </li>
+
+ <li>Select the desired system image. Click <strong>Install Latest Version</strong> to download
+ a new system image. Click <strong>Next</strong> to continue.
</li>
<li>Fill in the details for the AVD.
- <p>Give it a name, a platform target, an SD card size, and a skin (HVGA is default). You can
- also add specific hardware features of the emulated device by clicking the
- <strong>New...</strong> button and selecting the feature. For a list of hardware features,
- see <a href="#hardwareopts">Hardware options</a>.</p>
+ <p>Give it a name, device type, platform target, image size, orientation, and emulator
+ performance. Click <strong>Show Advanced Settings</strong> to assign a custom skin to the
+ hardware profile and other advanced settings for the device type.
+ </p>
- <p class="note"><strong>Note:</strong> Be sure to define a target for your AVD that satisfies
+ <p class="note"><strong>Tip:</strong>Store custom skins in an easily accessible directory,
+ such as <em>~/skins</em>. From information about custom skins, see
+ <a href="#skins">Skins</a>. </p>
+
+ <img src="{@docRoot}images/studio-avdmgr-configavd.png" alt="">
+ <p class="img-caption"><strong>Figure 4.</strong> Configure AVD window.</p>
+
+ <p class="note"><strong>Tip:</strong> Be sure to define a target for your AVD that satisfies
your application's Build Target (the AVD platform target must have an API Level equal to or
greater than the API Level that your application compiles against).</p>
</li>
- <li>Click <strong>Create AVD</strong>.</li>
+ <li>Click <strong>Finish</strong>.</li>
</ol>
<p>Your AVD is now ready and you can either close the AVD Manager, create more AVDs, or
- launch an emulator with the AVD by selecting a device and clicking <strong>Start</strong>.</p>
+ manage an emulator with the AVD by clicking an icon in the <strong>Actions</strong> column:
+ </p>
+
+ <ul>
+ <li>Start an AVD <img src="{@docRoot}images/tools/studio-avdmgr-action-icon.png" alt=""></li>
+ <li>Edit an AVD <img src="{@docRoot}images/tools/studio-avdmgr-actions-edit-icon.png" alt=""></li>
+ <li>Perform management actions <img src="{@docRoot}images/tools/studio-avdmgr-actions-dropdown-icon.png" alt=""></li>
+ </ul>
+
<h3 id="hardwareopts">Hardware options</h3>
<p>If you are creating a new AVD, you can specify the following hardware options for the AVD
@@ -242,3 +263,68 @@
</tr>
</table>
+
+<h3 id="skins">Using Custom Emulator Skins</h3>
+<p>A custom Android emulator skin is a collection of files that enable you to customize the visual
+and control elements of an emulator display. Custom emulator skins enable you to define variations
+of emulation properties, such as the use of a trackball or touchscreen, to match your device
+customizations. Each custom emulator skin contains:</p>
+ <ul>
+ <li>A <code>hardware.ini file</code> for initialization settings</li>
+ <li>Layout files for supported orientations (landscape, portrait) and physical configuration</li>
+ <li>Image files for display elements, such as background, keys and buttons</li>
+ </ul>
+<p>To create and use a custom skin:</p>
+ <ol>
+ <li>Create a skin folder in an easily accessible location, such as <em>~/skins</em>. </li>
+ <li>Define the skin orientation and configuration settings in a file called <code>layout</code>
+ in the skin folder.
+<pre>
+parts {
+
+ device {
+ display {
+ width 1080
+ height 1920
+ x 0
+ y 0
+ }
+ }
+
+ portrait {
+ background {
+ image background_port.png
+ }
+
+ buttons {
+ power {
+ image button_vertical.png
+ x 1229
+ y 616
+ }
+ }
+ }
+ ...
+}
+
+</pre></li>
+
+ <li>Creates a <code>hardware.ini</code> file for the skin-specific properties that determine
+ emulator specifications and behavior. For a complete list of emulator properties, see
+ <a href="{@docRoot}tools/devices/managing-avds-cmdline.html">Managing AVDs from the Command
+ Line</a>. For example:</li>
+<pre>
+# skin-specific hardware values
+hw.lcd.density=213
+vm.heapSize=48
+hw.ramSize=1024
+hw.keyboard.lid=no
+hw.mainKeys=no
+</pre>
+ <li>Add the bitmap files of the device images to the skin folder. </li>
+ <li>Archive the files in the skin folder. </li>
+ <li>Create a new AVD and select the archive file as a custom skin. </li>
+ </ol>
+
+<p>You can now run the AVD with a custom skin for testing and viewing your app. </p>
+
diff --git a/docs/html/training/articles/perf-jni.jd b/docs/html/training/articles/perf-jni.jd
index 1a40f62..5a9fa1e 100644
--- a/docs/html/training/articles/perf-jni.jd
+++ b/docs/html/training/articles/perf-jni.jd
@@ -635,20 +635,31 @@
<a name="faq_FindClass" id="faq_FindClass"></a>
<h2>FAQ: Why didn't <code>FindClass</code> find my class?</h2>
+<p>(Most of this advice applies equally well to failures to find methods
+with <code>GetMethodID</code> or <code>GetStaticMethodID</code>, or fields
+with <code>GetFieldID</code> or <code>GetStaticFieldID</code>.)</p>
+
<p>Make sure that the class name string has the correct format. JNI class
names start with the package name and are separated with slashes,
such as <code>java/lang/String</code>. If you're looking up an array class,
you need to start with the appropriate number of square brackets and
must also wrap the class with 'L' and ';', so a one-dimensional array of
-<code>String</code> would be <code>[Ljava/lang/String;</code>.</p>
+<code>String</code> would be <code>[Ljava/lang/String;</code>.
+If you're looking up an inner class, use '$' rather than '.'. In general,
+using <code>javap</code> on the .class file is a good way to find out the
+internal name of your class.</p>
+
+<p>If you're using ProGuard, make sure that
+<a href="{@docRoot}tools/help/proguard.html#configuring">ProGuard didn't
+strip out your class</a>. This can happen if your class/method/field is only
+used from JNI.
<p>If the class name looks right, you could be running into a class loader
issue. <code>FindClass</code> wants to start the class search in the
class loader associated with your code. It examines the call stack,
which will look something like:
<pre> Foo.myfunc(Native Method)
- Foo.main(Foo.java:10)
- dalvik.system.NativeStart.main(Native Method)</pre>
+ Foo.main(Foo.java:10)</pre>
<p>The topmost method is <code>Foo.myfunc</code>. <code>FindClass</code>
finds the <code>ClassLoader</code> object associated with the <code>Foo</code>
@@ -656,12 +667,9 @@
<p>This usually does what you want. You can get into trouble if you
create a thread yourself (perhaps by calling <code>pthread_create</code>
-and then attaching it with <code>AttachCurrentThread</code>).
-Now the stack trace looks like this:</p>
-<pre> dalvik.system.NativeStart.run(Native Method)</pre>
-
-<p>The topmost method is <code>NativeStart.run</code>, which isn't part of
-your application. If you call <code>FindClass</code> from this thread, the
+and then attaching it with <code>AttachCurrentThread</code>). Now there
+are no stack frames from your application.
+If you call <code>FindClass</code> from this thread, the
JavaVM will start in the "system" class loader instead of the one associated
with your application, so attempts to find app-specific classes will fail.</p>
diff --git a/docs/html/training/sync-adapters/running-sync-adapter.jd b/docs/html/training/sync-adapters/running-sync-adapter.jd
index 8fb7e80c..194e94b 100644
--- a/docs/html/training/sync-adapters/running-sync-adapter.jd
+++ b/docs/html/training/sync-adapters/running-sync-adapter.jd
@@ -396,13 +396,11 @@
// Account
public static final String ACCOUNT = "default_account";
// Sync interval constants
- public static final long MILLISECONDS_PER_SECOND = 1000L;
public static final long SECONDS_PER_MINUTE = 60L;
public static final long SYNC_INTERVAL_IN_MINUTES = 60L;
public static final long SYNC_INTERVAL =
SYNC_INTERVAL_IN_MINUTES *
- SECONDS_PER_MINUTE *
- MILLISECONDS_PER_SECOND;
+ SECONDS_PER_MINUTE;
// Global variables
// A content resolver for accessing the provider
ContentResolver mResolver;
@@ -419,7 +417,7 @@
ContentResolver.addPeriodicSync(
ACCOUNT,
AUTHORITY,
- null,
+ Bundle.EMPTY,
SYNC_INTERVAL);
...
}
diff --git a/docs/html/training/wearables/apps/creating.jd b/docs/html/training/wearables/apps/creating.jd
index 018d9f7..683dd31 100644
--- a/docs/html/training/wearables/apps/creating.jd
+++ b/docs/html/training/wearables/apps/creating.jd
@@ -6,6 +6,7 @@
<div id="tb">
<h2>This lesson teaches you to</h2>
<ol>
+ <li><a href="#UpdateSDK">Update Your SDK</a></li>
<li><a href="#SetupEmulator">Set Up an Android Wear Emulator</a></li>
<li><a href="#SetupDevice">Set Up an Android Wear Device</a></li>
<li><a href="#CreateProject">Create a Project</a></li>
@@ -13,7 +14,7 @@
</ol>
<h2>Dependencies and Prerequisites</h2>
<ul>
- <li>Android Studio 0.8 or later and Gradle 0.12 or later</li>
+ <li>Android Studio 0.8.12 or later and Gradle 0.12 or later</li>
</ul>
</div>
</div>
@@ -34,6 +35,24 @@
both your wearable and handheld apps.
</p>
+<h2 id="UpdateSDK">Update Your SDK</h2>
+
+<p>Before you begin building wearable apps, you must:</p>
+
+<ul>
+ <li><strong>Update your SDK tools to version 23.0.0 or higher</strong>
+ <br>
+ The updated SDK tools enable you to build and test wearable apps.
+ </li>
+ <li><strong>Update your SDK with Android 4.4W.2 (API 20) or higher</strong>
+ <br>
+ The updated platform version provides new APIs for wearable apps.
+ </li>
+</ul>
+
+<p>To update your SDK with these components, see
+<a href="{@docRoot}sdk/installing/adding-packages.html#GetTools"> Get the latest SDK tools</a>.</p>
+
<h2 id="SetupEmulator">Set Up an Android Wear Emulator or Device</h2>
<p>We recommend that you develop on real hardware so you can better
@@ -45,29 +64,24 @@
<p>To set up an Android Wear virtual device:</p>
<ol>
<li>Click <b>Tools > Android > AVD Manager</b>.</li>
- <li>Click <b>Create...</b>.</li>
- <li>Fill in the following details for the AVD you want to specify and leave the rest
- of the fields with their default values:
- <ul>
- <li><b>AVD Name</b> - A name for your AVD</li>
- <li><b>Device</b> - Android Wear Round or Square device types</li>
- <li><b>Target</b> - Android 4.4W - API Level 20</li>
- <li><b>CPU/ABI</b> - Android Wear ARM (armeabi-v7a)</li>
- <li><b>Keyboard</b> - Select <b>Hardware keyboard present</b></li>
- <li><b>Skin</b> - AndroidWearRound or AndroidWearSquare depending on the selected device type</li>
- <li><b>Snapshot</b> - Not selected</li>
- <li><b>Use Host GPU</b> - Selected, to support custom activities for wearable notifications</li>
- </ul>
- </li>
- <li>Click <b>OK</b>.</li>
+ <li>Click <b>Create Virtual Device...</b>.</li>
+ <ol>
+ <li>Click <b>Wear</b> in the Category list:</li>
+ <li>Select Android Wear Square or Android Wear Round.</li>
+ <li>Click <b>Next</b>.</li>
+ <li>Select a release name (for example, KitKat Wear).</li>
+ <li>Click <b>Next</b>.</li>
+ <li>(Optional) Change any preferences for your virtual device.</li>
+ <li>Click <b>Finish</b>.</li>
+ </ol>
<li>Start the emulator:
<ol>
<li>Select the virtual device you just created.</li>
- <li>Click <b>Start...</b>, then click <b>Launch</b>.</li>
+ <li>Click the <b>Play</b> button.</li>
<li>Wait until the emulator initializes and shows the Android Wear home screen.</li>
</ol>
</li>
-<li>Pair Your handheld with the emulator:
+<li>Pair your handheld with the emulator:
<ol>
<li>On your handheld, install the Android Wear app from Google Play.</li>
<li>Connect the handheld to your machine through USB.</li>
diff --git a/docs/html/training/wearables/data-layer/accessing.jd b/docs/html/training/wearables/data-layer/accessing.jd
index b7ecf5b..0c0a2d5 100644
--- a/docs/html/training/wearables/data-layer/accessing.jd
+++ b/docs/html/training/wearables/data-layer/accessing.jd
@@ -20,7 +20,7 @@
</div>
</div>
-<p>To call the data layer API, create an instance of
+<p>To call the Data Layer API, create an instance of
<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html"><code>GoogleApiClient</code></a>,
the main entry point for any of the Google Play services APIs.
</p>
@@ -42,7 +42,7 @@
@Override
public void onConnected(Bundle connectionHint) {
Log.d(TAG, "onConnected: " + connectionHint);
- // Now you can use the data layer API
+ // Now you can use the Data Layer API
}
@Override
public void onConnectionSuspended(int cause) {
@@ -71,8 +71,10 @@
href="{@docRoot}google/auth/api-client.html#WearableApi">Access the Wearable API</a>.</p>
<p>Before you use the data layer API, start a connection on your client by calling the
-<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html#connect()">connect()</a>
+<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html#connect()">
+<code>connect()</code></a>
method, as described in
-<a href="{@docRoot}google/auth/api-client.html#Starting">Accessing Google Play services APIs</a>.
-When the system invokes the <code>onConnected()</code> callback for your client, you're ready
-to use the data layer API.</p>
+<a href="{@docRoot}google/auth/api-client.html#Starting">Start a Connection</a>.
+When the system invokes the
+<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.ConnectionCallbacks.html#onConnected(android.os.Bundle)">
+<code>onConnected()</code></a> callback for your client, you're ready to use the Data Layer API.</p>
diff --git a/docs/html/training/wearables/data-layer/assets.jd b/docs/html/training/wearables/data-layer/assets.jd
index 5dc11cb..719ccbc3 100644
--- a/docs/html/training/wearables/data-layer/assets.jd
+++ b/docs/html/training/wearables/data-layer/assets.jd
@@ -16,18 +16,18 @@
<p>
To send large blobs of binary data over the Bluetooth transport, such as images, attach an
-<a href="{@docRoot}reference/com/google/android/gms/wearable/Asset.html">Asset</a> to a
+<a href="{@docRoot}reference/com/google/android/gms/wearable/Asset.html"><code>Asset</code></a> to a
data item and the put the data item into the replicated data store.
</p>
<p>Assets automatically handle caching of data to prevent retransmission and conserve Bluetooth bandwidth.
A common pattern is for a handheld app to download an image, shrink it to an appropriate size
-for display on the wearable, and transmit it to the wearable app as an Asset. The following examples
-demonstrates this pattern.
+for display on the wearable, and transmit it to the wearable app as an asset. The following examples
+demonstrate this pattern.
</p>
-<p class="note"><b>Note:</b> Although the size of data items are limited to 100KB,
-assets can be as large as desired. However, transferring large assets affect the
+<p class="note"><b>Note:</b> Although the size of data items is limited to 100KB,
+assets can be as large as desired. However, transferring large assets affects the
user experience in many cases, so test your apps to ensure that they perform well
if you're transferring large assets.
<p>
@@ -49,7 +49,6 @@
</pre>
<p>When you have an asset, attach it to a data item with the <code>putAsset()</code> method in
-
<a href="{@docRoot}reference/com/google/android/gms/wearable/DataMap.html"><code>DataMap</code></a>
or
<a href="{@docRoot}reference/com/google/android/gms/wearable/PutDataRequest.html"><code>PutDataRequest</code></a>
@@ -77,12 +76,13 @@
.putDataItem(mGoogleApiClient, request);
</pre>
+
<h2 id="ReceiveAsset">Receive assets</h2>
<p>
When an asset is created, you probably want to read and extract
it on other side of the connection. Here's an example of how to implement the
-callback to detect an asset change and extract the Asset:
+callback to detect an asset change and extract the asset:
</p>
<pre>
diff --git a/docs/html/training/wearables/data-layer/data-items.jd b/docs/html/training/wearables/data-layer/data-items.jd
index f843bb67..12babbf 100644
--- a/docs/html/training/wearables/data-layer/data-items.jd
+++ b/docs/html/training/wearables/data-layer/data-items.jd
@@ -15,9 +15,9 @@
</div>
<p>
-A <a href="@{docRoot}reference/com/google/android/gms/wearable/DataItem.html"><code>DataItem</code></a>
+A <a href="{@docRoot}reference/com/google/android/gms/wearable/DataItem.html"><code>DataItem</code></a>
defines the data interface that the system uses to synchronize data between handhelds
-and wearables. A <a href="@{docRoot}reference/com/google/android/gms/wearable/DataItem.html"><code>DataItem</code></a> generally
+and wearables. A <a href="{@docRoot}reference/com/google/android/gms/wearable/DataItem.html"><code>DataItem</code></a> generally
consists of the following items:</p>
<ul>
<li><b>Payload</b> - A byte array, which you can set with whatever data you wish, allowing you
@@ -28,15 +28,15 @@
</ul>
<p>
-You normally don't implement <a href="@{docRoot}reference/com/google/android/gms/wearable/DataItem.html"><code>DataItem</code></a>
+You normally don't implement <a href="{@docRoot}reference/com/google/android/gms/wearable/DataItem.html"><code>DataItem</code></a>
directly. Instead, you:
<ol>
<li>Create a <a href="{@docRoot}reference/com/google/android/gms/wearable/PutDataRequest.html"><code>PutDataRequest</code></a> object,
specifying a string path to uniquely identify the item.
</li>
- <li>Call <a href="{@docRoot}reference/com/google/android/gms/wearable/PutDataRequest.html#setData(byte[])">setData()</a> to set
- the payload.
+ <li>Call <a href="{@docRoot}reference/com/google/android/gms/wearable/PutDataRequest.html#setData(byte[])">
+ <code>setData()</code></a> to set the payload.
</li>
<li>Call <a href="{@docRoot}reference/com/google/android/gms/wearable/DataApi.html#putDataItem(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.wearable.PutDataRequest)"><code>DataApi.putDataItem()</code></a> to request the system to create the data item.
</li>
@@ -51,6 +51,7 @@
a data item in an easy-to-use {@link android.os.Bundle}-like interface.
</p>
+
<h2 id="SyncData">Sync Data with a Data Map</h2>
<p>
When possible, use the <a href="{@docRoot}reference/com/google/android/gms/wearable/DataMap.html"><code>DataMap</code></a> class.
@@ -67,7 +68,7 @@
<p class="note"><b>Note:</b> The path string is a unique identifier for the
data item that allows you to access it from either side of the connection. The path must begin
with a forward slash. If you're using hierarchical data in your
-app, you should create a path scheme that matches the structure of the data.
+app, you should create a path scheme that matches the structure of the data.
</p>
</li>
<li>Call
@@ -82,12 +83,12 @@
<li>Call <a href="{@docRoot}reference/com/google/android/gms/wearable/DataApi.html#putDataItem(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.wearable.PutDataRequest)"><code>DataApi.putDataItem()</code></a> to request the system to create the data item.
<p class="note"><b>Note:</b>
If the handset and wearable devices are disconnected,
- the data is buffered and and synced when the connection is re-established.
+ the data is buffered and synced when the connection is re-established.
</p>
</li>
</ol>
-<p>The following example shows how to create a data map, set data on it, and create it:</p>
+<p>The following example shows how to create a data map and put data on it:</p>
<pre>
PutDataMapRequest dataMap = PutDataMapRequest.create("/count");
@@ -103,7 +104,7 @@
You can do this by implementing a listener for data item events.
<p>For example, here's what a typical callback looks like to carry out certain actions
-when data changes.</p>
+when data changes:</p>
<pre>
@Override
@@ -120,5 +121,6 @@
<p>
This is just a snippet that requires more implementation details. Learn about
how to implement a full listener service or activity in
-<a href="{@docRoot}training/wearables/data-layer/events.html#Listen">Listening for Data Layer Events</a>.
+<a href="{@docRoot}training/wearables/data-layer/events.html#Listen">Listen for Data Layer
+Events</a>.
</p>
\ No newline at end of file
diff --git a/docs/html/training/wearables/data-layer/events.jd b/docs/html/training/wearables/data-layer/events.jd
index 9196a2c..6a3949a 100644
--- a/docs/html/training/wearables/data-layer/events.jd
+++ b/docs/html/training/wearables/data-layer/events.jd
@@ -14,14 +14,14 @@
</div>
</div>
-<p>When you make calls with the data layer, you can receive the status
+<p>When you make calls to the Data Layer API, you can receive the status
of the call when it completes as well as listen for any changes that
the call ends up making with listeners.
</p>
<h2 id="Wait">Wait for the Status of Data Layer Calls</h2>
-<p>You'll notice that calls to the data layer API sometimes return a
+<p>You'll notice that calls to the Data Layer API sometimes return a
<a href="{@docRoot}reference/com/google/android/gms/common/api/PendingResult.html"><code>PendingResult</code></a>,
such as
<a href="{@docRoot}reference/com/google/android/gms/wearable/DataApi.html#putDataItem(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.wearable.PutDataRequest)"><code>putDataItem()</code></a>.
@@ -33,9 +33,9 @@
lets you wait for the result status, either synchronously or asynchronously.
</p>
-<h3 id="async-waiting">Asynchronously waiting</h3>
-<p>If your code is running on the main UI thread, do not making blocking calls
-to the data layer API. You can run the calls asynchronously by adding a callback
+<h3 id="async-waiting">Asynchronous calls</h3>
+<p>If your code is running on the main UI thread, do not make blocking calls
+to the Data Layer API. You can run the calls asynchronously by adding a callback method
to the <a href="{@docRoot}reference/com/google/android/gms/common/api/PendingResult.html"><code>PendingResult</code></a> object,
which fires when the operation is completed:</p>
<pre>
@@ -49,12 +49,14 @@
});
</pre>
-<h3 id="sync-waiting">Synchronously waiting</h3>
+<h3 id="sync-waiting">Synchronous calls</h3>
<p>If your code is running on a separate handler thread in a background service (which is the case
in a <a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html"><code>WearableListenerService</code></a>),
it's fine for the calls to block. In this case, you can call
<a href="{@docRoot}reference/com/google/android/gms/common/api/PendingResult.html#await()"><code>await()</code></a>
-on the PendingResult object, which will block until the request has completed, and return a Result
+on the <a href="{@docRoot}reference/com/google/android/gms/common/api/PendingResult.html"><code>PendingResult</code></a>
+object, which blocks until the request completes and returns a
+<a href="{@docRoot}reference/com/google/android/gms/common/api/Result.html"><code>Result</code></a>
object:
</p>
@@ -82,14 +84,14 @@
</li>
</ul>
-<p>With both these options, you override any of the data event callbacks that you care about
-handling in your implementation.</p>
+<p>With both these options, you override the data event callback methods for the events you
+are interested in handling.</p>
<h3 id="listener-service">With a WearableListenerService</h3>
<p>
You typically create instances of this service in both your wearable and handheld apps. If you
-don't care about data events in one of these apps, then you don't need to implement this
+are not interested in data events in one of these apps, then you don't need to implement this
service in that particular app.</p>
<p>For example, you can have a handheld app that sets and gets data item objects and a wearable app
@@ -107,8 +109,9 @@
- A message sent from one side of a connection triggers this callback on the other side of the connection.</li>
<li><a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html#onMessageReceived(com.google.android.gms.wearable.MessageEvent)"><code>onPeerConnected()</code></a>
and <a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html#onPeerDisconnected(com.google.android.gms.wearable.Node)"><code>onPeerDisconnected()</code></a> -
- Called when connection with the handheld or wearable is connected or disconnected.
- Changes in connection state on one side of the connection triggers these callbacks on both sides of the connection.
+ Called when the connection with the handheld or wearable is connected or disconnected.
+ Changes in connection state on one side of the connection trigger these callbacks on both sides
+ of the connection.
</li>
</ul>
@@ -118,8 +121,8 @@
<li>Create a class that extends
<a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html"><code>WearableListenerService</code></a>.
</li>
- <li>Listen for the events that you care about, such as
- <a href="{@docRoot}/reference/com/google/android/gms/wearable/WearableListenerService.html#onDataChanged(com.google.android.gms.wearable.DataEventBuffer)"><code>onDataChanged()</code></a>.
+ <li>Listen for the events that you're interested in, such as
+ <a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html#onDataChanged(com.google.android.gms.wearable.DataEventBuffer)"><code>onDataChanged()</code></a>.
</li>
<li>Declare an intent filter in your Android manifest to notify the system about your
<a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html"><code>WearableListenerService</code></a>.
@@ -165,7 +168,7 @@
// Get the node id from the host value of the URI
String nodeId = uri.getHost();
- // Set the data of the message to be the bytes of the URI.
+ // Set the data of the message to be the bytes of the URI
byte[] payload = uri.toString().getBytes();
// Send the RPC
@@ -189,7 +192,8 @@
<h4>Permissions within Data Layer Callbacks</h4>
-<p>In order to deliver callbacks to your application for data layer events, Google Play services
+<p>
+To deliver callbacks to your application for data layer events, Google Play services
binds to your <a href="{@docRoot}reference/com/google/android/gms/wearable/WearableListenerService.html"><code>WearableListenerService</code></a>,
and calls your callbacks via IPC. This has the consequence
that your callbacks inherit the permissions of the calling process.</p>
@@ -233,7 +237,7 @@
<li>Implement the desired interfaces.</li>
<li>In {@link android.app.Activity#onCreate}, create an instance of
<a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html"><code>GoogleApiClient</code></a>
-to work with the data layer API.
+to work with the Data Layer API.
<li>
In {@link android.app.Activity#onStart onStart()}, call <a href="{@docRoot}reference/com/google/android/gms/common/api/GoogleApiClient.html#connect()"><code>connect()</code></a> to connect the client to Google Play services.
</li>
@@ -283,7 +287,7 @@
}
}
- @Override
+ @Override
public void onConnected(Bundle connectionHint) {
if (Log.isLoggable(TAG, Log.DEBUG)) {
Log.d(TAG, "Connected to Google Api Service");
@@ -306,8 +310,8 @@
if (event.getType() == DataEvent.TYPE_DELETED) {
Log.d(TAG, "DataItem deleted: " + event.getDataItem().getUri());
} else if (event.getType() == DataEvent.TYPE_CHANGED) {
- Log.d(TAG, "DataItem changed: " + event.getDataItem().getUri());
+ Log.d(TAG, "DataItem changed: " + event.getDataItem().getUri());
}
}
}
-</pre>
\ No newline at end of file
+</pre>
diff --git a/docs/html/training/wearables/data-layer/index.jd b/docs/html/training/wearables/data-layer/index.jd
index 73d9ee5..8d42ae3 100644
--- a/docs/html/training/wearables/data-layer/index.jd
+++ b/docs/html/training/wearables/data-layer/index.jd
@@ -66,7 +66,7 @@
<h2>Lessons</h2>
<dl>
- <dt><a href="{@docRoot}training/wearables/data-layer/data-items.html">Accessing the Wearable Data Layer</a></dt>
+ <dt><a href="{@docRoot}training/wearables/data-layer/accessing.html">Accessing the Wearable Data Layer</a></dt>
<dd>This lesson shows you how to create a client to access the Data Layer APIs.</dd>
<dt><a href="{@docRoot}training/wearables/data-layer/data-items.html">Syncing Data Items</a></dt>
diff --git a/docs/html/training/wearables/data-layer/messages.jd b/docs/html/training/wearables/data-layer/messages.jd
index b3afacb8..822e395 100644
--- a/docs/html/training/wearables/data-layer/messages.jd
+++ b/docs/html/training/wearables/data-layer/messages.jd
@@ -22,20 +22,16 @@
<li>A path that uniquely identifies the message's action</li>
</ul>
<p>
-Unlike data items, there is no syncing between the handheld and wearable apps.
+Unlike with data items, there is no syncing between the handheld and wearable apps.
Messages are a one-way communication mechanism that's good for remote procedure calls (RPC),
-such as sending a message to the wearable
-to start an activity. You can also use messages in request/response model
-where one side of the connection sends a message, does some work,
-and sends back a response message.</p>
+such as sending a message to the wearable to start an activity.</p>
<h2 id="SendMessage">Send a Message</h2>
<p>The following example shows how to send a message that indicates to the other
-side of the connect to start an activity.
-This call is made synchronously, which blocks until the message
-is received or when the request times out:
-</p>
+side of the connection to start an activity.
+This call is synchronous and blocks processing until the message is received or until the request
+times out:</p>
<p class="note"><b>Note:</b> Read more about asynchronous and synchronous calls
to Google Play services and when to use each in
@@ -61,7 +57,7 @@
<pre>
private Collection<String> getNodes() {
- HashSet <String>results= new HashSet<String>();
+ HashSet <String>results = new HashSet<String>();
NodeApi.GetConnectedNodesResult nodes =
Wearable.NodeApi.getConnectedNodes(mGoogleApiClient).await();
for (Node node : nodes.getNodes()) {
@@ -71,14 +67,17 @@
}
</pre>
-<h2 id="ReceiveMessage">Receiving a Message</h2>
+<h2 id="ReceiveMessage">Receive a Message</h2>
<p>
-
-To be notified of received messages, you implement a listener for message events.
-This example shows how you might do this by checking the <code>START_ACTIVITY_PATH</code>
-that the previous example used to send the message. If this condition is <code>true</code>,
-a specific activity is started.
+To be notified of received messages, you implement the
+<a href="{@docRoot}reference/com/google/android/gms/wearable/MessageApi.MessageListener.html">
+<code>MessageListener</code></a> interface to provide a listener for message events. Then you register your
+listener with the
+<a href="{@docRoot}reference/com/google/android/gms/wearable/MessageApi.html#addListener(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.wearable.MessageApi.MessageListener)">
+<code>MessageApi.addListener()</code></a> method. This example shows how you might implement the listener
+to check the <code>START_ACTIVITY_PATH</code> that the previous example used to send the message.
+If this condition is <code>true</code>, a specific activity is started.
</p>
<pre>
@@ -95,5 +94,6 @@
<p>
This is just a snippet that requires more implementation details. Learn about
how to implement a full listener service or activity in
-<a href="{@docRoot}training/wearables/data-layer/events.html#Listen">Listening for Data Layer Events</a>.
+<a href="{@docRoot}training/wearables/data-layer/events.html#Listen">Listening for Data Layer
+Events</a>.
</p>
\ No newline at end of file
diff --git a/docs/html/training/wearables/ui/confirm.jd b/docs/html/training/wearables/ui/confirm.jd
index 36330a6..07a352f 100644
--- a/docs/html/training/wearables/ui/confirm.jd
+++ b/docs/html/training/wearables/ui/confirm.jd
@@ -116,15 +116,14 @@
mDelayedView.start();
</pre>
-
-<h2 id="show-confirmation">Show Confirmation Animations</h2>
-
-<div style="float:right;margin-left:25px;width:200px">
+<div style="float:right;margin-left:25px;width:210px;margin-top:15px">
<img src="{@docRoot}wear/images/08_uilib.png" width="200" height="200" alt=""/>
-<p class="img-caption" style="text-align:center"><strong>Figure 2:</strong>
+<p class="img-caption" style="text-align:center;margin-left:-5px"><strong>Figure 2:</strong>
A confirmation animation.</p>
</div>
+<h2 id="show-confirmation">Show Confirmation Animations</h2>
+
<p>To show a confirmation animation when users complete an action in your app, create an intent
that starts <code>ConfirmationActivity</code> from one of your activities. You can specify
one of the these animations with the <code>EXTRA_ANIMATION_TYPE</code> intent extra:</p>
diff --git a/docs/html/training/wearables/ui/exit.jd b/docs/html/training/wearables/ui/exit.jd
index 84e1e45..6b205a57 100644
--- a/docs/html/training/wearables/ui/exit.jd
+++ b/docs/html/training/wearables/ui/exit.jd
@@ -67,7 +67,7 @@
android:id="@+id/dismiss_overlay"
android:layout_height="match_parent"
android:layout_width="match_parent"/>
-<FrameLayout>
+</FrameLayout>
</pre>
<p>In your activity, obtain the <code>DismissOverlayView</code> element and set some introductory
@@ -100,8 +100,8 @@
// Capture long presses
@Override
- public boolean onTouchEvent(MotionEvent ev) {
- return mDetector.onTouchEvent(ev) || super.onTouchEvent(ev);
+ public boolean dispatchTouchEvent(MotionEvent e) {
+ return mDetector.onTouchEvent(e) || super.dispatchTouchEvent(e);
}
}
</pre>
diff --git a/docs/html/training/wearables/ui/layouts.jd b/docs/html/training/wearables/ui/layouts.jd
index 14b9403..130f1c4 100644
--- a/docs/html/training/wearables/ui/layouts.jd
+++ b/docs/html/training/wearables/ui/layouts.jd
@@ -166,7 +166,7 @@
<h2 id="same-layout">Use a Shape-Aware Layout</h2>
-<div style="float:right;margin-left:25px;width:250px">
+<div style="float:right;margin-left:25px;width:260px">
<img src="{@docRoot}wear/images/02_uilib.png" width="250" height="250" alt=""/>
<p class="img-caption"><strong>Figure 2.</strong> Window insets on a round screen.</p>
</div>
diff --git a/docs/html/training/wearables/ui/lists.jd b/docs/html/training/wearables/ui/lists.jd
index e8aaed4..1d6e8ed 100644
--- a/docs/html/training/wearables/ui/lists.jd
+++ b/docs/html/training/wearables/ui/lists.jd
@@ -36,9 +36,9 @@
<li>Add a <code>WearableListView</code> element to your activity's layout definition.</li>
<li>Create a custom layout implementation for your list items.</li>
<li>Use this implementation to create a layout definition file for your list items.</li>
-<div style="float:right;margin-left:25px;width:215px;margin-top:-20px">
+<div style="float:right;margin-left:25px;width:220px;margin-top:-25px">
<img src="{@docRoot}wear/images/06_uilib.png" width="200" height="200" alt=""/>
-<p class="img-caption" style="text-align:center"><strong>Figure 3:</strong>
+<p class="img-caption" style="text-align:center;margin-left:-10px"><strong>Figure 3:</strong>
A list view on Android Wear.</p>
</div>
<li>Create an adapter to populate the list.</li>
diff --git a/docs/html/wear/index.jd b/docs/html/wear/index.jd
index c372395..27e8098 100644
--- a/docs/html/wear/index.jd
+++ b/docs/html/wear/index.jd
@@ -28,6 +28,8 @@
+
+
<div class="landing-body-content">
<div class="landing-hero-container">
<div class="landing-section wear-hero">
@@ -39,7 +41,7 @@
<div class="col-10">
<div class="landing-section-header">
<div class="landing-h1 hero">Android Wear</div>
- <div class="landing-subhead hero">Information that moves with you</div>
+ <div class="landing-subhead hero">Information that moves with you.</div>
</div>
<div class="landing-hero-description">
@@ -54,6 +56,10 @@
<a href="{@docRoot}training/building-wearables.html" class="landing-button landing-primary" style="margin-top: 40px;">
Get Started
</a>
+ <a href="https://www.youtube.com/watch?v=Bl4Qne-RpcM" class="video-shadowbox-button white"
+ style="margin-left:40px">
+ Watch the Intro Video
+ </a>
</div>
</div>
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java
index 6a6dcaf..b4a248f 100644
--- a/services/core/java/com/android/server/ConnectivityService.java
+++ b/services/core/java/com/android/server/ConnectivityService.java
@@ -2532,7 +2532,7 @@
String exclList = "";
String pacFileUrl = "";
if (proxyProperties != null && (!TextUtils.isEmpty(proxyProperties.getHost()) ||
- (proxyProperties.getPacFileUrl() != null))) {
+ !Uri.EMPTY.equals(proxyProperties.getPacFileUrl()))) {
if (!proxyProperties.isValid()) {
if (DBG)
log("Invalid proxy properties, ignoring: " + proxyProperties.toString());
@@ -2542,7 +2542,7 @@
host = mGlobalProxy.getHost();
port = mGlobalProxy.getPort();
exclList = mGlobalProxy.getExclusionListAsString();
- if (proxyProperties.getPacFileUrl() != null) {
+ if (!Uri.EMPTY.equals(proxyProperties.getPacFileUrl())) {
pacFileUrl = proxyProperties.getPacFileUrl().toString();
}
} else {
@@ -2604,7 +2604,7 @@
private void handleApplyDefaultProxy(ProxyInfo proxy) {
if (proxy != null && TextUtils.isEmpty(proxy.getHost())
- && (proxy.getPacFileUrl() == null)) {
+ && Uri.EMPTY.equals(proxy.getPacFileUrl())) {
proxy = null;
}
synchronized (mProxyLock) {
@@ -2620,7 +2620,8 @@
// global (to get the correct local port), and send a broadcast.
// TODO: Switch PacManager to have its own message to send back rather than
// reusing EVENT_HAS_CHANGED_PROXY and this call to handleApplyDefaultProxy.
- if ((mGlobalProxy != null) && (proxy != null) && (proxy.getPacFileUrl() != null)
+ if ((mGlobalProxy != null) && (proxy != null)
+ && (!Uri.EMPTY.equals(proxy.getPacFileUrl()))
&& proxy.getPacFileUrl().equals(mGlobalProxy.getPacFileUrl())) {
mGlobalProxy = proxy;
sendProxyBroadcast(mGlobalProxy);
diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java
index e400fb6..6c981c0 100644
--- a/services/core/java/com/android/server/MountService.java
+++ b/services/core/java/com/android/server/MountService.java
@@ -83,6 +83,7 @@
import java.io.File;
import java.io.FileDescriptor;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.math.BigInteger;
@@ -90,7 +91,9 @@
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.KeySpec;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -359,6 +362,11 @@
// Used in the ObbActionHandler
private IMediaContainerService mContainerService = null;
+ // Last fstrim operation tracking
+ private static final String LAST_FSTRIM_FILE = "last-fstrim";
+ private final File mLastMaintenanceFile;
+ private long mLastMaintenance;
+
// Handler messages
private static final int H_UNMOUNT_PM_UPDATE = 1;
private static final int H_UNMOUNT_PM_DONE = 2;
@@ -536,6 +544,15 @@
case H_FSTRIM: {
waitForReady();
Slog.i(TAG, "Running fstrim idle maintenance");
+
+ // Remember when we kicked it off
+ try {
+ mLastMaintenance = System.currentTimeMillis();
+ mLastMaintenanceFile.setLastModified(mLastMaintenance);
+ } catch (Exception e) {
+ Slog.e(TAG, "Unable to record last fstrim!");
+ }
+
try {
// This method must be run on the main (handler) thread,
// so it is safe to directly call into vold.
@@ -544,6 +561,7 @@
} catch (NativeDaemonConnectorException ndce) {
Slog.e(TAG, "Failed to run fstrim!");
}
+
// invoke the completion callback, if any
Runnable callback = (Runnable) msg.obj;
if (callback != null) {
@@ -699,6 +717,18 @@
mHandler.sendMessage(mHandler.obtainMessage(H_FSTRIM, callback));
}
+ // Binder entry point for kicking off an immediate fstrim
+ @Override
+ public void runMaintenance() {
+ validatePermission(android.Manifest.permission.MOUNT_UNMOUNT_FILESYSTEMS);
+ runIdleMaintenance(null);
+ }
+
+ @Override
+ public long lastMaintenance() {
+ return mLastMaintenance;
+ }
+
private void doShareUnshareVolume(String path, String method, boolean enable) {
// TODO: Add support for multiple share methods
if (!method.equals("ums")) {
@@ -1477,6 +1507,22 @@
// Add OBB Action Handler to MountService thread.
mObbActionHandler = new ObbActionHandler(IoThread.get().getLooper());
+ // Initialize the last-fstrim tracking if necessary
+ File dataDir = Environment.getDataDirectory();
+ File systemDir = new File(dataDir, "system");
+ mLastMaintenanceFile = new File(systemDir, LAST_FSTRIM_FILE);
+ if (!mLastMaintenanceFile.exists()) {
+ // Not setting mLastMaintenance here means that we will force an
+ // fstrim during reboot following the OTA that installs this code.
+ try {
+ (new FileOutputStream(mLastMaintenanceFile)).close();
+ } catch (IOException e) {
+ Slog.e(TAG, "Unable to create fstrim record " + mLastMaintenanceFile.getPath());
+ }
+ } else {
+ mLastMaintenance = mLastMaintenanceFile.lastModified();
+ }
+
/*
* Create the connection to vold with a maximum queue of twice the
* amount of containers we'd ever expect to have. This keeps an
@@ -3075,6 +3121,12 @@
pw.increaseIndent();
mConnector.dump(fd, pw, args);
pw.decreaseIndent();
+
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+
+ pw.println();
+ pw.print("Last maintenance: ");
+ pw.println(sdf.format(new Date(mLastMaintenance)));
}
/** {@inheritDoc} */
diff --git a/services/core/java/com/android/server/net/IpConfigStore.java b/services/core/java/com/android/server/net/IpConfigStore.java
index 857b9e9..b5a450d 100644
--- a/services/core/java/com/android/server/net/IpConfigStore.java
+++ b/services/core/java/com/android/server/net/IpConfigStore.java
@@ -122,8 +122,10 @@
out.writeUTF(proxyProperties.getHost());
out.writeUTF(PROXY_PORT_KEY);
out.writeInt(proxyProperties.getPort());
- out.writeUTF(EXCLUSION_LIST_KEY);
- out.writeUTF(exclusionList);
+ if (exclusionList != null) {
+ out.writeUTF(EXCLUSION_LIST_KEY);
+ out.writeUTF(exclusionList);
+ }
written = true;
break;
case PAC:
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 3e1647e..73ceea3 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -138,6 +138,7 @@
import android.os.Bundle;
import android.os.Environment;
import android.os.Environment.UserEnvironment;
+import android.os.storage.IMountService;
import android.os.storage.StorageManager;
import android.os.Debug;
import android.os.FileUtils;
@@ -161,6 +162,7 @@
import android.system.Os;
import android.system.StructStat;
import android.text.TextUtils;
+import android.text.format.DateUtils;
import android.util.ArraySet;
import android.util.AtomicFile;
import android.util.DisplayMetrics;
@@ -280,6 +282,18 @@
private static final long WATCHDOG_TIMEOUT = 1000*60*10; // ten minutes
/**
+ * Wall-clock timeout (in milliseconds) after which we *require* that an fstrim
+ * be run on this device. We use the value in the Settings.Global.MANDATORY_FSTRIM_INTERVAL
+ * settings entry if available, otherwise we use the hardcoded default. If it's been
+ * more than this long since the last fstrim, we force one during the boot sequence.
+ *
+ * This backstops other fstrim scheduling: if the device is alive at midnight+idle,
+ * one gets run at the next available charging+idle time. This final mandatory
+ * no-fstrim check kicks in only of the other scheduling criteria is never met.
+ */
+ private static final long DEFAULT_MANDATORY_FSTRIM_INTERVAL = 3 * DateUtils.DAY_IN_MILLIS;
+
+ /**
* Whether verification is enabled by default.
*/
private static final boolean DEFAULT_VERIFY_ENABLE = true;
@@ -4506,6 +4520,37 @@
public void performBootDexOpt() {
enforceSystemOrRoot("Only the system can request dexopt be performed");
+ // Before everything else, see whether we need to fstrim.
+ try {
+ IMountService ms = PackageHelper.getMountService();
+ if (ms != null) {
+ final long interval = android.provider.Settings.Global.getLong(
+ mContext.getContentResolver(),
+ android.provider.Settings.Global.FSTRIM_MANDATORY_INTERVAL,
+ DEFAULT_MANDATORY_FSTRIM_INTERVAL);
+ if (interval > 0) {
+ final long timeSinceLast = System.currentTimeMillis() - ms.lastMaintenance();
+ if (timeSinceLast > interval) {
+ Slog.w(TAG, "No disk maintenance in " + timeSinceLast
+ + "; running immediately");
+ if (!isFirstBoot()) {
+ try {
+ ActivityManagerNative.getDefault().showBootMessage(
+ mContext.getResources().getString(
+ R.string.android_upgrading_fstrim), true);
+ } catch (RemoteException e) {
+ }
+ }
+ ms.runMaintenance();
+ }
+ }
+ } else {
+ Slog.e(TAG, "Mount service unavailable!");
+ }
+ } catch (RemoteException e) {
+ // Can't happen; MountService is local
+ }
+
final HashSet<PackageParser.Package> pkgs;
synchronized (mPackages) {
pkgs = mDeferredDexOpt;
diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java
index 92ad1ad..22f6ca4 100644
--- a/services/java/com/android/server/SystemServer.java
+++ b/services/java/com/android/server/SystemServer.java
@@ -546,20 +546,6 @@
reportWtf("making display ready", e);
}
- try {
- mPackageManagerService.performBootDexOpt();
- } catch (Throwable e) {
- reportWtf("performing boot dexopt", e);
- }
-
- try {
- ActivityManagerNative.getDefault().showBootMessage(
- context.getResources().getText(
- com.android.internal.R.string.android_upgrading_starting_apps),
- false);
- } catch (RemoteException e) {
- }
-
if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
if (!disableStorage &&
!"0".equals(SystemProperties.get("system_init.startmountservice"))) {
@@ -575,7 +561,23 @@
reportWtf("starting Mount Service", e);
}
}
+ }
+ try {
+ mPackageManagerService.performBootDexOpt();
+ } catch (Throwable e) {
+ reportWtf("performing boot dexopt", e);
+ }
+
+ try {
+ ActivityManagerNative.getDefault().showBootMessage(
+ context.getResources().getText(
+ com.android.internal.R.string.android_upgrading_starting_apps),
+ false);
+ } catch (RemoteException e) {
+ }
+
+ if (mFactoryTestMode != FactoryTest.FACTORY_TEST_LOW_LEVEL) {
if (!disableNonCoreServices) {
try {
Slog.i(TAG, "LockSettingsService");