Merge "Rename isUserRestricted to isUserLimited" into jb-mr2-dev
diff --git a/api/current.txt b/api/current.txt
index 7989b69..ceccfb7 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -2305,22 +2305,28 @@
package android.animation {
- public abstract class Animator implements java.lang.Cloneable {
+ public abstract interface Animatable {
+ method public abstract long getDuration();
+ method public abstract android.animation.TimeInterpolator getInterpolator();
+ method public abstract long getStartDelay();
+ method public abstract android.animation.Animatable setDuration(long);
+ method public abstract void setInterpolator(android.animation.TimeInterpolator);
+ method public abstract void setStartDelay(long);
+ }
+
+ public abstract class Animator implements android.animation.Animatable java.lang.Cloneable {
ctor public Animator();
method public void addListener(android.animation.Animator.AnimatorListener);
method public void cancel();
method public android.animation.Animator clone();
method public void end();
- method public abstract long getDuration();
+ method public android.animation.TimeInterpolator getInterpolator();
method public java.util.ArrayList<android.animation.Animator.AnimatorListener> getListeners();
- method public abstract long getStartDelay();
method public abstract boolean isRunning();
method public boolean isStarted();
method public void removeAllListeners();
method public void removeListener(android.animation.Animator.AnimatorListener);
method public abstract android.animation.Animator setDuration(long);
- method public abstract void setInterpolator(android.animation.TimeInterpolator);
- method public abstract void setStartDelay(long);
method public void setTarget(java.lang.Object);
method public void setupEndValues();
method public void setupStartValues();
@@ -2511,7 +2517,6 @@
method public long getCurrentPlayTime();
method public long getDuration();
method public static long getFrameDelay();
- method public android.animation.TimeInterpolator getInterpolator();
method public int getRepeatCount();
method public int getRepeatMode();
method public long getStartDelay();
@@ -25332,6 +25337,7 @@
method protected float getBottomFadingEdgeStrength();
method protected int getBottomPaddingOffset();
method public float getCameraDistance();
+ method public android.graphics.Rect getClipBounds();
method public java.lang.CharSequence getContentDescription();
method public final android.content.Context getContext();
method protected android.view.ContextMenu.ContextMenuInfo getContextMenuInfo();
@@ -25586,6 +25592,7 @@
method public final void setBottom(int);
method public void setCameraDistance(float);
method public void setClickable(boolean);
+ method public void setClipBounds(android.graphics.Rect);
method public void setContentDescription(java.lang.CharSequence);
method public void setDrawingCacheBackgroundColor(int);
method public void setDrawingCacheEnabled(boolean);
@@ -26011,6 +26018,7 @@
method public static int getChildMeasureSpec(int, int, int);
method protected boolean getChildStaticTransformation(android.view.View, android.view.animation.Transformation);
method public boolean getChildVisibleRect(android.view.View, android.graphics.Rect, android.graphics.Point);
+ method public boolean getClipChildren();
method public int getDescendantFocusability();
method public android.view.View getFocusedChild();
method public android.view.animation.LayoutAnimationController getLayoutAnimation();
@@ -26172,6 +26180,7 @@
method public android.view.ViewPropertyAnimator alphaBy(float);
method public void cancel();
method public long getDuration();
+ method public android.animation.TimeInterpolator getInterpolator();
method public long getStartDelay();
method public android.view.ViewPropertyAnimator rotation(float);
method public android.view.ViewPropertyAnimator rotationBy(float);
@@ -27637,7 +27646,7 @@
method public void onReceivedTouchIconUrl(android.webkit.WebView, java.lang.String, boolean);
method public void onRequestFocus(android.webkit.WebView);
method public void onShowCustomView(android.view.View, android.webkit.WebChromeClient.CustomViewCallback);
- method public void onShowCustomView(android.view.View, int, android.webkit.WebChromeClient.CustomViewCallback);
+ method public deprecated void onShowCustomView(android.view.View, int, android.webkit.WebChromeClient.CustomViewCallback);
}
public static abstract interface WebChromeClient.CustomViewCallback {
diff --git a/core/java/android/animation/Animatable.java b/core/java/android/animation/Animatable.java
new file mode 100644
index 0000000..f9ccb4d
--- /dev/null
+++ b/core/java/android/animation/Animatable.java
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2013 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.animation;
+
+/**
+ * This interface is implemented by animation-related classes that expose
+ * the ability to set and get duration, startDelay, and interpolators.
+ */
+public interface Animatable {
+
+ /**
+ * The amount of time, in milliseconds, to delay processing the animation
+ * after the animation is started. The {@link #setDuration(long)} of the
+ * animation will not begin to elapse until after the startDelay has elapsed.
+ *
+ * @return the number of milliseconds to delay running the animation
+ */
+ long getStartDelay();
+
+ /**
+ * The amount of time, in milliseconds, to delay processing the animation
+ * after the animation is started. The {@link #setDuration(long)} of the
+ * animation will not begin to elapse until after the startDelay has elapsed.
+
+ * @param startDelay The amount of the delay, in milliseconds
+ */
+ void setStartDelay(long startDelay);
+
+ /**
+ * Sets the length of the animation.
+ *
+ * @param duration The length of the animation, in milliseconds.
+ */
+ Animatable setDuration(long duration);
+
+ /**
+ * Gets the duration of the animation.
+ *
+ * @return The length of the animation, in milliseconds.
+ */
+ long getDuration();
+
+ /**
+ * The time interpolator used in calculating the elapsed fraction of the
+ * animation. The interpolator determines whether the animation runs with
+ * linear or non-linear motion, such as acceleration and deceleration.
+ *
+ * @param value the interpolator to be used by this animation
+ */
+ void setInterpolator(TimeInterpolator value);
+
+ /**
+ * Returns the timing interpolator that this animation uses.
+ *
+ * @return The timing interpolator for this animation.
+ */
+ public TimeInterpolator getInterpolator();
+}
diff --git a/core/java/android/animation/Animator.java b/core/java/android/animation/Animator.java
index 788765d..da97d72 100644
--- a/core/java/android/animation/Animator.java
+++ b/core/java/android/animation/Animator.java
@@ -22,14 +22,21 @@
* This is the superclass for classes which provide basic support for animations which can be
* started, ended, and have <code>AnimatorListeners</code> added to them.
*/
-public abstract class Animator implements Cloneable {
-
+public abstract class Animator implements Cloneable, Animatable {
/**
* The set of listeners to be sent events through the life of an animation.
*/
ArrayList<AnimatorListener> mListeners = null;
+ @Override
+ public abstract Animator setDuration(long duration);
+
+ @Override
+ public TimeInterpolator getInterpolator() {
+ return null;
+ }
+
/**
* Starts this animation. If the animation has a nonzero startDelay, the animation will start
* running after that delay elapses. A non-delayed animation will have its initial
@@ -70,47 +77,6 @@
}
/**
- * The amount of time, in milliseconds, to delay starting the animation after
- * {@link #start()} is called.
- *
- * @return the number of milliseconds to delay running the animation
- */
- public abstract long getStartDelay();
-
- /**
- * The amount of time, in milliseconds, to delay starting the animation after
- * {@link #start()} is called.
-
- * @param startDelay The amount of the delay, in milliseconds
- */
- public abstract void setStartDelay(long startDelay);
-
-
- /**
- * Sets the length of the animation.
- *
- * @param duration The length of the animation, in milliseconds.
- */
- public abstract Animator setDuration(long duration);
-
- /**
- * Gets the length of the animation.
- *
- * @return The length of the animation, in milliseconds.
- */
- public abstract long getDuration();
-
- /**
- * The time interpolator used in calculating the elapsed fraction of this animation. The
- * interpolator determines whether the animation runs with linear or non-linear motion,
- * such as acceleration and deceleration. The default value is
- * {@link android.view.animation.AccelerateDecelerateInterpolator}
- *
- * @param value the interpolator to be used by this animation
- */
- public abstract void setInterpolator(TimeInterpolator value);
-
- /**
* Returns whether this Animator is currently running (having been started and gone past any
* initial startDelay period and not yet ended).
*
diff --git a/core/java/android/animation/AnimatorSet.java b/core/java/android/animation/AnimatorSet.java
index f9fa444..b48853b 100644
--- a/core/java/android/animation/AnimatorSet.java
+++ b/core/java/android/animation/AnimatorSet.java
@@ -120,9 +120,19 @@
// set, it is passed along to the child animations.
private long mDuration = -1;
+ // Records the interpolator for the set. Null value indicates that no interpolator
+ // was set on this AnimatorSet, so it should not be passed down to the children.
+ private TimeInterpolator mInterpolator = null;
+
/**
* Sets up this AnimatorSet to play all of the supplied animations at the same time.
+ * This is equivalent to calling {@link #play(Animator)} with the first animator in the
+ * set and then {@link Builder#with(Animator)} with each of the other animators. Note that
+ * an Animator with a {@link Animator#setStartDelay(long) startDelay} will not actually
+ * start until that delay elapses, which means that if the first animator in the list
+ * supplied to this constructor has a startDelay, none of the other animators will start
+ * until that first animator's startDelay has elapsed.
*
* @param items The animations that will be started simultaneously.
*/
@@ -230,15 +240,21 @@
/**
* Sets the TimeInterpolator for all current {@link #getChildAnimations() child animations}
- * of this AnimatorSet.
+ * of this AnimatorSet. The default value is null, which means that no interpolator
+ * is set on this AnimatorSet. Setting the interpolator to any non-null value
+ * will cause that interpolator to be set on the child animations
+ * when the set is started.
*
* @param interpolator the interpolator to be used by each child animation of this AnimatorSet
*/
@Override
public void setInterpolator(TimeInterpolator interpolator) {
- for (Node node : mNodes) {
- node.animation.setInterpolator(interpolator);
- }
+ mInterpolator = interpolator;
+ }
+
+ @Override
+ public TimeInterpolator getInterpolator() {
+ return mInterpolator;
}
/**
@@ -460,7 +476,12 @@
node.animation.setDuration(mDuration);
}
}
- // First, sort the nodes (if necessary). This will ensure that sortedNodes
+ if (mInterpolator != null) {
+ for (Node node : mNodes) {
+ node.animation.setInterpolator(mInterpolator);
+ }
+ }
+ // First, sort the nodes (if necessary). This will ensure that sortedNodes
// contains the animation nodes in the correct order.
sortNodes();
diff --git a/core/java/android/animation/ValueAnimator.java b/core/java/android/animation/ValueAnimator.java
index ea605b9..cb44264 100644
--- a/core/java/android/animation/ValueAnimator.java
+++ b/core/java/android/animation/ValueAnimator.java
@@ -16,10 +16,8 @@
package android.animation;
-import android.os.Handler;
import android.os.Looper;
-import android.os.Message;
-import android.os.SystemProperties;
+import android.os.Trace;
import android.util.AndroidRuntimeException;
import android.view.Choreographer;
import android.view.animation.AccelerateDecelerateInterpolator;
@@ -48,6 +46,7 @@
* Animation</a> developer guide.</p>
* </div>
*/
+@SuppressWarnings("unchecked")
public class ValueAnimator extends Animator {
/**
@@ -340,7 +339,7 @@
return;
}
if (mValues == null || mValues.length == 0) {
- setValues(new PropertyValuesHolder[]{PropertyValuesHolder.ofInt("", values)});
+ setValues(PropertyValuesHolder.ofInt("", values));
} else {
PropertyValuesHolder valuesHolder = mValues[0];
valuesHolder.setIntValues(values);
@@ -368,7 +367,7 @@
return;
}
if (mValues == null || mValues.length == 0) {
- setValues(new PropertyValuesHolder[]{PropertyValuesHolder.ofFloat("", values)});
+ setValues(PropertyValuesHolder.ofFloat("", values));
} else {
PropertyValuesHolder valuesHolder = mValues[0];
valuesHolder.setFloatValues(values);
@@ -400,8 +399,7 @@
return;
}
if (mValues == null || mValues.length == 0) {
- setValues(new PropertyValuesHolder[]{PropertyValuesHolder.ofObject("",
- (TypeEvaluator)null, values)});
+ setValues(PropertyValuesHolder.ofObject("", null, values));
} else {
PropertyValuesHolder valuesHolder = mValues[0];
valuesHolder.setObjectValues(values);
@@ -423,7 +421,7 @@
mValues = values;
mValuesMap = new HashMap<String, PropertyValuesHolder>(numValues);
for (int i = 0; i < numValues; ++i) {
- PropertyValuesHolder valuesHolder = (PropertyValuesHolder) values[i];
+ PropertyValuesHolder valuesHolder = values[i];
mValuesMap.put(valuesHolder.getPropertyName(), valuesHolder);
}
// New property/values/target should cause re-initialization prior to starting
@@ -537,6 +535,7 @@
*
* @hide
*/
+ @SuppressWarnings("unchecked")
protected static class AnimationHandler implements Runnable {
// The per-thread list of all active animations
/** @hide */
@@ -854,6 +853,7 @@
*
* @return The timing interpolator for this ValueAnimator.
*/
+ @Override
public TimeInterpolator getInterpolator() {
return mInterpolator;
}
@@ -1024,6 +1024,8 @@
mStarted = false;
mStartListenersCalled = false;
mPlayingBackwards = false;
+ Trace.asyncTraceEnd(Trace.TRACE_TAG_VIEW, "animator",
+ System.identityHashCode(this));
}
/**
@@ -1031,6 +1033,8 @@
* called on the UI thread.
*/
private void startAnimation(AnimationHandler handler) {
+ Trace.asyncTraceBegin(Trace.TRACE_TAG_VIEW, "animator",
+ System.identityHashCode(this));
initAnimation();
handler.mAnimations.add(this);
if (mStartDelay > 0 && mListeners != null) {
@@ -1095,7 +1099,7 @@
}
}
if (mRepeatMode == REVERSE) {
- mPlayingBackwards = mPlayingBackwards ? false : true;
+ mPlayingBackwards = !mPlayingBackwards;
}
mCurrentIteration += (int)fraction;
fraction = fraction % 1f;
@@ -1252,7 +1256,7 @@
}
}
- private AnimationHandler getOrCreateAnimationHandler() {
+ private static AnimationHandler getOrCreateAnimationHandler() {
AnimationHandler handler = sAnimationHandler.get();
if (handler == null) {
handler = new AnimationHandler();
diff --git a/core/java/android/os/Trace.java b/core/java/android/os/Trace.java
index 607def7..dde25d56 100644
--- a/core/java/android/os/Trace.java
+++ b/core/java/android/os/Trace.java
@@ -74,6 +74,8 @@
private static native void nativeTraceCounter(long tag, String name, int value);
private static native void nativeTraceBegin(long tag, String name);
private static native void nativeTraceEnd(long tag);
+ private static native void nativeAsyncTraceBegin(long tag, String name, int cookie);
+ private static native void nativeAsyncTraceEnd(long tag, String name, int cookie);
private static native void nativeSetAppTracingAllowed(boolean allowed);
static {
@@ -195,6 +197,42 @@
}
/**
+ * Writes a trace message to indicate that a given section of code has
+ * begun. Must be followed by a call to {@link #asyncTraceEnd} using the same
+ * tag. Unlike {@link #traceBegin(long, String)} and {@link #traceEnd(long)},
+ * asynchronous events do not need to be nested. The name and cookie used to
+ * begin an event must be used to end it.
+ *
+ * @param traceTag The trace tag.
+ * @param methodName The method name to appear in the trace.
+ * @param cookie Unique identifier for distinguishing simultaneous events
+ *
+ * @hide
+ */
+ public static void asyncTraceBegin(long traceTag, String methodName, int cookie) {
+ if (isTagEnabled(traceTag)) {
+ nativeAsyncTraceBegin(traceTag, methodName, cookie);
+ }
+ }
+
+ /**
+ * Writes a trace message to indicate that the current method has ended.
+ * Must be called exactly once for each call to {@link #asyncTraceBegin(long, String, int)}
+ * using the same tag, name and cookie.
+ *
+ * @param traceTag The trace tag.
+ * @param methodName The method name to appear in the trace.
+ * @param cookie Unique identifier for distinguishing simultaneous events
+ *
+ * @hide
+ */
+ public static void asyncTraceEnd(long traceTag, String methodName, int cookie) {
+ if (isTagEnabled(traceTag)) {
+ nativeAsyncTraceEnd(traceTag, methodName, cookie);
+ }
+ }
+
+ /**
* Writes a trace message to indicate that a given section of code has begun. This call must
* be followed by a corresponding call to {@link #endSection()} on the same thread.
*
diff --git a/core/java/android/view/LayoutInflater.java b/core/java/android/view/LayoutInflater.java
index 85695fc..aa43bad 100644
--- a/core/java/android/view/LayoutInflater.java
+++ b/core/java/android/view/LayoutInflater.java
@@ -654,7 +654,7 @@
/**
* Version of {@link #onCreateView(String, AttributeSet)} that also
- * takes the future parent of the view being constructure. The default
+ * takes the future parent of the view being constructed. The default
* implementation simply calls {@link #onCreateView(String, AttributeSet)}.
*
* @param parent The future parent of the returned view. <em>Note that
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 7c82f7e..4fb2431 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -2758,6 +2758,11 @@
TransformationInfo mTransformationInfo;
+ /**
+ * Current clip bounds. to which all drawing of this view are constrained.
+ */
+ private Rect mClipBounds = null;
+
private boolean mLastIsOpaque;
/**
@@ -10103,7 +10108,7 @@
/**
* Offset this view's horizontal location by the specified amount of pixels.
*
- * @param offset the numer of pixels to offset the view by
+ * @param offset the number of pixels to offset the view by
*/
public void offsetLeftAndRight(int offset) {
if (offset != 0) {
@@ -13374,6 +13379,33 @@
}
/**
+ * Sets a rectangular area on this view to which the view will be clipped
+ * it is drawn. Setting the value to null will remove the clip bounds
+ * and the view will draw normally, using its full bounds.
+ *
+ * @param clipBounds The rectangular area, in the local coordinates of
+ * this view, to which future drawing operations will be clipped.
+ */
+ public void setClipBounds(Rect clipBounds) {
+ mClipBounds = clipBounds;
+ if (clipBounds != null) {
+ invalidate(clipBounds);
+ } else {
+ invalidate();
+ }
+ }
+
+ /**
+ * Returns a copy of the current {@link #setClipBounds(Rect) clipBounds}.
+ *
+ * @return A copy of the current clip bounds if clip bounds are set,
+ * otherwise null.
+ */
+ public Rect getClipBounds() {
+ return (mClipBounds != null) ? new Rect(mClipBounds) : null;
+ }
+
+ /**
* Utility function, called by draw(canvas, parent, drawingTime) to handle the less common
* case of an active Animation being run on the view.
*/
@@ -13849,6 +13881,9 @@
* @param canvas The Canvas to which the View is rendered.
*/
public void draw(Canvas canvas) {
+ if (mClipBounds != null) {
+ canvas.clipRect(mClipBounds);
+ }
final int privateFlags = mPrivateFlags;
final boolean dirtyOpaque = (privateFlags & PFLAG_DIRTY_MASK) == PFLAG_DIRTY_OPAQUE &&
(mAttachInfo == null || !mAttachInfo.mIgnoreDirtyState);
diff --git a/core/java/android/view/ViewGroup.java b/core/java/android/view/ViewGroup.java
index 311d1d0..6da4b62 100644
--- a/core/java/android/view/ViewGroup.java
+++ b/core/java/android/view/ViewGroup.java
@@ -3080,6 +3080,18 @@
}
/**
+ * Returns whether ths group's children are clipped to their bounds before drawing.
+ * The default value is true.
+ * @see #setClipChildren(boolean)
+ *
+ * @return True if the group's children will be clipped to their bounds,
+ * false otherwise.
+ */
+ public boolean getClipChildren() {
+ return ((mGroupFlags & FLAG_CLIP_CHILDREN) != 0);
+ }
+
+ /**
* By default, children are clipped to their bounds before drawing. This
* allows view groups to override this behavior for animations, etc.
*
@@ -4525,7 +4537,7 @@
*/
@Override
public final void layout(int l, int t, int r, int b) {
- if (mTransition == null || !mTransition.isChangingLayout()) {
+ if (!mSuppressLayout && (mTransition == null || !mTransition.isChangingLayout())) {
if (mTransition != null) {
mTransition.layoutChange(this);
}
diff --git a/core/java/android/view/ViewPropertyAnimator.java b/core/java/android/view/ViewPropertyAnimator.java
index 22f98b7..98df064 100644
--- a/core/java/android/view/ViewPropertyAnimator.java
+++ b/core/java/android/view/ViewPropertyAnimator.java
@@ -16,6 +16,7 @@
package android.view;
+import android.animation.Animatable;
import android.animation.Animator;
import android.animation.ValueAnimator;
import android.animation.TimeInterpolator;
@@ -323,6 +324,15 @@
}
/**
+ * Returns the timing interpolator that this animation uses.
+ *
+ * @return The timing interpolator for this animation.
+ */
+ public TimeInterpolator getInterpolator() {
+ return null;
+ }
+
+ /**
* Sets a listener for events in the underlying Animators that run the property
* animations.
*
diff --git a/core/java/android/webkit/WebChromeClient.java b/core/java/android/webkit/WebChromeClient.java
index e93db09..21b0578 100644
--- a/core/java/android/webkit/WebChromeClient.java
+++ b/core/java/android/webkit/WebChromeClient.java
@@ -69,7 +69,9 @@
/**
* Notify the host application that the current page would
- * like to show a custom View.
+ * like to show a custom View. This is used for Fullscreen
+ * video playback; see "HTML5 Video support" documentation on
+ * {@link WebView}.
* @param view is the View object to be shown.
* @param callback is the callback to be invoked if and when the view
* is dismissed.
@@ -84,7 +86,10 @@
* {@link ActivityInfo#screenOrientation ActivityInfo.screenOrientation}.
* @param callback is the callback to be invoked if and when the view
* is dismissed.
+ * @deprecated This method supports the obsolete plugin mechanism,
+ * and will not be invoked in future
*/
+ @Deprecated
public void onShowCustomView(View view, int requestedOrientation,
CustomViewCallback callback) {};
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java
index cde6ceb..33fd8ce 100644
--- a/core/java/android/widget/ImageView.java
+++ b/core/java/android/widget/ImageView.java
@@ -348,7 +348,7 @@
* {@link #setImageBitmap(android.graphics.Bitmap)} and
* {@link android.graphics.BitmapFactory} instead.</p>
*
- * @param resId the resource identifier of the the drawable
+ * @param resId the resource identifier of the drawable
*
* @attr ref android.R.styleable#ImageView_src
*/
diff --git a/core/jni/android_os_Trace.cpp b/core/jni/android_os_Trace.cpp
index 00ecd0a..1315291 100644
--- a/core/jni/android_os_Trace.cpp
+++ b/core/jni/android_os_Trace.cpp
@@ -27,6 +27,18 @@
namespace android {
+static void sanitizeString(String8& utf8Chars) {
+ size_t size = utf8Chars.size();
+ char* str = utf8Chars.lockBuffer(size);
+ for (size_t i = 0; i < size; i++) {
+ char c = str[i];
+ if (c == '\0' || c == '\n' || c == '|') {
+ str[i] = ' ';
+ }
+ }
+ utf8Chars.unlockBuffer();
+}
+
static jlong android_os_Trace_nativeGetEnabledTags(JNIEnv* env, jclass clazz) {
return atrace_get_enabled_tags();
}
@@ -41,17 +53,8 @@
jlong tag, jstring nameStr) {
const size_t MAX_SECTION_NAME_LEN = 127;
ScopedStringChars jchars(env, nameStr);
- String8 utf8Chars(reinterpret_cast<const char16_t*>(jchars.get()),
- jchars.size());
- size_t size = utf8Chars.size();
- char* str = utf8Chars.lockBuffer(size);
- for (size_t i = 0; i < size; i++) {
- char c = str[i];
- if (c == '\0' || c == '\n' || c == '|') {
- str[i] = ' ';
- }
- }
- utf8Chars.unlockBuffer();
+ String8 utf8Chars(reinterpret_cast<const char16_t*>(jchars.get()), jchars.size());
+ sanitizeString(utf8Chars);
atrace_begin(tag, utf8Chars.string());
}
@@ -60,6 +63,24 @@
atrace_end(tag);
}
+static void android_os_Trace_nativeAsyncTraceBegin(JNIEnv* env, jclass clazz,
+ jlong tag, jstring nameStr, jint cookie) {
+ const size_t MAX_SECTION_NAME_LEN = 127;
+ ScopedStringChars jchars(env, nameStr);
+ String8 utf8Chars(reinterpret_cast<const char16_t*>(jchars.get()), jchars.size());
+ sanitizeString(utf8Chars);
+ atrace_async_begin(tag, utf8Chars.string(), cookie);
+}
+
+static void android_os_Trace_nativeAsyncTraceEnd(JNIEnv* env, jclass clazz,
+ jlong tag, jstring nameStr, jint cookie) {
+ const size_t MAX_SECTION_NAME_LEN = 127;
+ ScopedStringChars jchars(env, nameStr);
+ String8 utf8Chars(reinterpret_cast<const char16_t*>(jchars.get()), jchars.size());
+ sanitizeString(utf8Chars);
+ atrace_async_end(tag, utf8Chars.string(), cookie);
+}
+
static void android_os_Trace_nativeSetAppTracingAllowed(JNIEnv* env,
jclass clazz, jboolean allowed) {
atrace_set_debuggable(allowed);
@@ -79,6 +100,12 @@
{ "nativeTraceEnd",
"(J)V",
(void*)android_os_Trace_nativeTraceEnd },
+ { "nativeAsyncTraceBegin",
+ "(JLjava/lang/String;I)V",
+ (void*)android_os_Trace_nativeAsyncTraceBegin },
+ { "nativeAsyncTraceEnd",
+ "(JLjava/lang/String;I)V",
+ (void*)android_os_Trace_nativeAsyncTraceEnd },
{ "nativeSetAppTracingAllowed",
"(Z)V",
(void*)android_os_Trace_nativeSetAppTracingAllowed },
diff --git a/docs/html/design/building-blocks/buttons.jd b/docs/html/design/building-blocks/buttons.jd
index 9e82ed4..600ec6c 100644
--- a/docs/html/design/building-blocks/buttons.jd
+++ b/docs/html/design/building-blocks/buttons.jd
@@ -1,5 +1,5 @@
page.title=Buttons
-page.tags="button"
+page.tags="button","input"
@jd:body
<p>A button consists of text and/or an image that clearly communicates what action will occur when the
diff --git a/docs/html/design/building-blocks/grid-lists.jd b/docs/html/design/building-blocks/grid-lists.jd
index 69a43b1..8c82ba9 100644
--- a/docs/html/design/building-blocks/grid-lists.jd
+++ b/docs/html/design/building-blocks/grid-lists.jd
@@ -1,5 +1,5 @@
page.title=Grid Lists
-page.tags="gridview","layout"
+page.tags="gridview","layout","listview"
@jd:body
<img src="{@docRoot}design/media/gridview_overview.png">
diff --git a/docs/html/design/building-blocks/progress.jd b/docs/html/design/building-blocks/progress.jd
index 96cc1af..60ad2ca 100644
--- a/docs/html/design/building-blocks/progress.jd
+++ b/docs/html/design/building-blocks/progress.jd
@@ -1,5 +1,5 @@
page.title=Progress & Activity
-page.tags="progressbar"
+page.tags="progressbar","download","network"
@jd:body
<p>Progress bars and activity indicators signal to users that something is happening that will take a moment.</p>
diff --git a/docs/html/design/building-blocks/spinners.jd b/docs/html/design/building-blocks/spinners.jd
index 8c80b91..3550b0c 100644
--- a/docs/html/design/building-blocks/spinners.jd
+++ b/docs/html/design/building-blocks/spinners.jd
@@ -1,5 +1,5 @@
page.title=Spinners
-page.tags="spinner","drop down"
+page.tags="spinner","dropdown"
@jd:body
<p>Spinners provide a quick way to select one value from a set. In the default state, a spinner shows
diff --git a/docs/html/design/building-blocks/switches.jd b/docs/html/design/building-blocks/switches.jd
index 6386bdf..0b195b9 100644
--- a/docs/html/design/building-blocks/switches.jd
+++ b/docs/html/design/building-blocks/switches.jd
@@ -1,5 +1,5 @@
page.title=Switches
-page.tags="switch","checkbox","radiobutton"
+page.tags="switch","checkbox","radiobutton","button"
@jd:body
<p>Switches allow the user to select options. There are three kinds of switches: checkboxes, radio
diff --git a/docs/html/design/building-blocks/tabs.jd b/docs/html/design/building-blocks/tabs.jd
index 1fe2c62..79cc9c7 100644
--- a/docs/html/design/building-blocks/tabs.jd
+++ b/docs/html/design/building-blocks/tabs.jd
@@ -1,5 +1,5 @@
page.title=Tabs
-page.tags="tabs","action bar","navigation"
+page.tags="tabs","actionbar","navigation","viewpager"
@jd:body
<img src="{@docRoot}design/media/tabs_overview.png">
diff --git a/docs/html/design/building-blocks/text-fields.jd b/docs/html/design/building-blocks/text-fields.jd
index c1bed78..82321f0 100644
--- a/docs/html/design/building-blocks/text-fields.jd
+++ b/docs/html/design/building-blocks/text-fields.jd
@@ -1,5 +1,5 @@
page.title=Text Fields
-page.tags="text","edittext","input",
+page.tags="text","edittext","input"
@jd:body
<p>Text fields allow the user to type text into your app. They can be either single line or multi-line.
diff --git a/docs/html/design/patterns/accessibility.jd b/docs/html/design/patterns/accessibility.jd
index edf3843..5f46082 100644
--- a/docs/html/design/patterns/accessibility.jd
+++ b/docs/html/design/patterns/accessibility.jd
@@ -1,5 +1,5 @@
page.title=Accessibility
-page.tags="accessibility","navigation"
+page.tags="accessibility","navigation","input"
@jd:body
<p>One of Android's missions is to organize the world's information and make it universally accessible and useful. Accessibility is the measure of how successfully a product can be used by people with varying abilities. Our mission applies to all users-including people with disabilities such as visual impairment, color deficiency, hearing loss, and limited dexterity.</p>
diff --git a/docs/html/design/patterns/app-structure.jd b/docs/html/design/patterns/app-structure.jd
index e1bb819..1809ecd 100644
--- a/docs/html/design/patterns/app-structure.jd
+++ b/docs/html/design/patterns/app-structure.jd
@@ -1,5 +1,5 @@
page.title=Application Structure
-page.tags="navigation","layout"
+page.tags="navigation","layout","tablet"
@jd:body
<p>Apps come in many varieties that address very different needs. For example:</p>
diff --git a/docs/html/design/patterns/compatibility.jd b/docs/html/design/patterns/compatibility.jd
index 84ae337..3a56f52 100644
--- a/docs/html/design/patterns/compatibility.jd
+++ b/docs/html/design/patterns/compatibility.jd
@@ -1,4 +1,5 @@
page.title=Backwards Compatibility
+page.tags="support"
@jd:body
<p>Significant changes in Android 3.0 included:</p>
diff --git a/docs/html/design/patterns/confirming-acknowledging.jd b/docs/html/design/patterns/confirming-acknowledging.jd
index f2e88ec..e347231 100644
--- a/docs/html/design/patterns/confirming-acknowledging.jd
+++ b/docs/html/design/patterns/confirming-acknowledging.jd
@@ -1,5 +1,5 @@
page.title=Confirming & Acknowledging
-page.tags="dialog","toast"
+page.tags="dialog","toast","notification"
@jd:body
<p>In some situations, when a user invokes an action in your app, it's a good idea to <em>confirm</em> or <em>acknowledge</em> that action through text.</p>
diff --git a/docs/html/design/patterns/gestures.jd b/docs/html/design/patterns/gestures.jd
index 3ef133d..127a1c8 100644
--- a/docs/html/design/patterns/gestures.jd
+++ b/docs/html/design/patterns/gestures.jd
@@ -1,5 +1,5 @@
page.title=Gestures
-page.tags="gesture","input"
+page.tags="gesture","input","touch"
@jd:body
<p>Gestures allow users to interact with your app by manipulating the screen objects you provide. The
diff --git a/docs/html/design/patterns/help.jd b/docs/html/design/patterns/help.jd
index cdac54d..a32fb25 100644
--- a/docs/html/design/patterns/help.jd
+++ b/docs/html/design/patterns/help.jd
@@ -1,4 +1,5 @@
page.title=Help
+page.tags="settings","preferences"
@jd:body
<p>We wish we could guarantee that if you follow every piece of advice on this website, everyone will be able to learn and use your app without a hitch. Sadly, that's not the case.</p>
diff --git a/docs/html/design/patterns/navigation.jd b/docs/html/design/patterns/navigation.jd
index 36debbe..b717884 100644
--- a/docs/html/design/patterns/navigation.jd
+++ b/docs/html/design/patterns/navigation.jd
@@ -1,5 +1,5 @@
page.title=Navigation with Back and Up
-page.tags="navigation","activity"
+page.tags="navigation","activity","task"
@jd:body
<p>Consistent navigation is an essential component of the overall user experience. Few things frustrate
diff --git a/docs/html/design/patterns/selection.jd b/docs/html/design/patterns/selection.jd
index 682ce56..d16e86c 100644
--- a/docs/html/design/patterns/selection.jd
+++ b/docs/html/design/patterns/selection.jd
@@ -1,5 +1,5 @@
page.title=Selection
-page.tags="actionmode","navigation"
+page.tags="actionmode","navigation","contextual"
@jd:body
<p>Android 3.0 changed the <em>long press</em> gesture—that is, a touch that's held in the same position for a moment—to be the global gesture to select data.. This affects the way you should
diff --git a/docs/html/design/patterns/settings.jd b/docs/html/design/patterns/settings.jd
index f86cd39..4748e48 100644
--- a/docs/html/design/patterns/settings.jd
+++ b/docs/html/design/patterns/settings.jd
@@ -1,5 +1,5 @@
page.title=Settings
-page.tags="settings","preferences"
+page.tags="preferences","sharedpreferences"
@jd:body
<p>Settings is a place in your app where users indicate their preferences for how your app should
diff --git a/docs/html/design/patterns/swipe-views.jd b/docs/html/design/patterns/swipe-views.jd
index b86d990..f18fc63 100644
--- a/docs/html/design/patterns/swipe-views.jd
+++ b/docs/html/design/patterns/swipe-views.jd
@@ -1,5 +1,5 @@
page.title=Swipe Views
-page.tags="viewpager","navigation"
+page.tags="viewpager","navigation","tabs"
@jd:body
<p>Efficient navigation is one of the cornerstones of a well-designed app. While apps are generally
diff --git a/docs/html/design/patterns/widgets.jd b/docs/html/design/patterns/widgets.jd
index f2b0f4a..3152e91 100644
--- a/docs/html/design/patterns/widgets.jd
+++ b/docs/html/design/patterns/widgets.jd
@@ -1,5 +1,5 @@
page.title=Widgets
-page.tags="appwidget"
+page.tags="appwidget","home"
@jd:body
<p>Widgets are an essential aspect of home screen customization. You can imagine them as "at-a-glance" views of an app's most important data and functionality that is accessible right from the user's home screen. Users can move widgets across their home screen panels, and, if supported, resize them to tailor the amount of information within a widget to their preference.</p>
diff --git a/docs/html/design/style/iconography.jd b/docs/html/design/style/iconography.jd
index ce11cf7..1475e5c 100644
--- a/docs/html/design/style/iconography.jd
+++ b/docs/html/design/style/iconography.jd
@@ -1,4 +1,5 @@
page.title=Iconography
+page.tags="icons"
@jd:body
<img src="{@docRoot}design/media/iconography_overview.png">
diff --git a/docs/html/design/style/metrics-grids.jd b/docs/html/design/style/metrics-grids.jd
index e2b9ab5..3116ff6d 100644
--- a/docs/html/design/style/metrics-grids.jd
+++ b/docs/html/design/style/metrics-grids.jd
@@ -1,4 +1,5 @@
page.title=Metrics and Grids
+page.tags="layout","screens"
@jd:body
<p>Devices vary not only in physical size, but also in screen density (<acronym title="Dots per
diff --git a/docs/html/design/style/touch-feedback.jd b/docs/html/design/style/touch-feedback.jd
index 5fe72a7..340a3a4 100644
--- a/docs/html/design/style/touch-feedback.jd
+++ b/docs/html/design/style/touch-feedback.jd
@@ -1,4 +1,5 @@
page.title=Touch Feedback
+page.tags="input","button"
@jd:body
<div class="layout-content-row" style="margin-bottom: -100px">
diff --git a/docs/html/design/style/typography.jd b/docs/html/design/style/typography.jd
index 427b8c6..114d13b 100644
--- a/docs/html/design/style/typography.jd
+++ b/docs/html/design/style/typography.jd
@@ -1,4 +1,5 @@
page.title=Typography
+page.tags="textview","font"
@jd:body
<div class="layout-content-row">
diff --git a/docs/html/design/style/writing.jd b/docs/html/design/style/writing.jd
index 919ea7aa..5358847 100644
--- a/docs/html/design/style/writing.jd
+++ b/docs/html/design/style/writing.jd
@@ -1,4 +1,5 @@
page.title=Writing Style
+page.tags="dialog","toast","notification"
@jd:body
<p>When choosing words for your app:</p>
diff --git a/wifi/java/android/net/wifi/WifiStateMachine.java b/wifi/java/android/net/wifi/WifiStateMachine.java
index 04e7095..a5d98cc 100644
--- a/wifi/java/android/net/wifi/WifiStateMachine.java
+++ b/wifi/java/android/net/wifi/WifiStateMachine.java
@@ -2442,6 +2442,9 @@
if (DBG) log("Already in delayed stop");
break;
}
+ /* disconnect right now, but leave the driver running for a bit */
+ mWifiConfigStore.disableAllNetworks();
+
mInDelayedStop = true;
mDelayedStopCounter++;
if (DBG) log("Delayed stop message " + mDelayedStopCounter);
@@ -2462,6 +2465,9 @@
mDelayedStopCounter++;
mAlarmManager.cancel(mDriverStopIntent);
if (DBG) log("Delayed stop ignored due to start");
+ if (mOperationalMode == CONNECT_MODE) {
+ mWifiConfigStore.enableAllNetworks();
+ }
}
break;
case CMD_DELAYED_STOP_DRIVER: