Merge "Copy user info from PackageSetting as well" into honeycomb
diff --git a/api/current.xml b/api/current.xml
index 48240b5..f80701b 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -19985,6 +19985,42 @@
</parameter>
</method>
</class>
+<class name="ArgbEvaluator"
+ extends="java.lang.Object"
+ abstract="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<implements name="android.animation.TypeEvaluator">
+</implements>
+<constructor name="ArgbEvaluator"
+ type="android.animation.ArgbEvaluator"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</constructor>
+<method name="evaluate"
+ return="java.lang.Object"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+<parameter name="fraction" type="float">
+</parameter>
+<parameter name="startValue" type="java.lang.Object">
+</parameter>
+<parameter name="endValue" type="java.lang.Object">
+</parameter>
+</method>
+</class>
<class name="DoubleEvaluator"
extends="java.lang.Object"
abstract="false"
@@ -20951,42 +20987,6 @@
</parameter>
</method>
</class>
-<class name="RGBEvaluator"
- extends="java.lang.Object"
- abstract="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<implements name="android.animation.TypeEvaluator">
-</implements>
-<constructor name="RGBEvaluator"
- type="android.animation.RGBEvaluator"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-</constructor>
-<method name="evaluate"
- return="java.lang.Object"
- abstract="false"
- native="false"
- synchronized="false"
- static="false"
- final="false"
- deprecated="not deprecated"
- visibility="public"
->
-<parameter name="fraction" type="float">
-</parameter>
-<parameter name="startValue" type="java.lang.Object">
-</parameter>
-<parameter name="endValue" type="java.lang.Object">
-</parameter>
-</method>
-</class>
<interface name="TimeInterpolator"
abstract="true"
static="false"
diff --git a/core/java/android/animation/AnimatorInflater.java b/core/java/android/animation/AnimatorInflater.java
index 6e589e4..bcab66e 100644
--- a/core/java/android/animation/AnimatorInflater.java
+++ b/core/java/android/animation/AnimatorInflater.java
@@ -215,7 +215,7 @@
(toType <= TypedValue.TYPE_LAST_COLOR_INT))) {
// special case for colors: ignore valueType and get ints
getFloats = false;
- anim.setEvaluator(new RGBEvaluator());
+ anim.setEvaluator(new ArgbEvaluator());
}
if (getFloats) {
diff --git a/core/java/android/animation/RGBEvaluator.java b/core/java/android/animation/ArgbEvaluator.java
similarity index 97%
rename from core/java/android/animation/RGBEvaluator.java
rename to core/java/android/animation/ArgbEvaluator.java
index bae0af0..c3875be 100644
--- a/core/java/android/animation/RGBEvaluator.java
+++ b/core/java/android/animation/ArgbEvaluator.java
@@ -20,7 +20,7 @@
* This evaluator can be used to perform type interpolation between integer
* values that represent ARGB colors.
*/
-public class RGBEvaluator implements TypeEvaluator {
+public class ArgbEvaluator implements TypeEvaluator {
/**
* This function returns the calculated in-between value for a color
diff --git a/core/java/android/animation/ValueAnimator.java b/core/java/android/animation/ValueAnimator.java
index cfecec1..f884473 100755
--- a/core/java/android/animation/ValueAnimator.java
+++ b/core/java/android/animation/ValueAnimator.java
@@ -862,7 +862,7 @@
* of <code>startValue</code> and <code>endValue</code> in the constructor. But if these values
* are not one of these primitive types, or if different evaluation is desired (such as is
* necessary with int values that represent colors), a custom evaluator needs to be assigned.
- * For example, when running an animation on color values, the {@link RGBEvaluator}
+ * For example, when running an animation on color values, the {@link ArgbEvaluator}
* should be used to get correct RGB color interpolation.
*
* <p>If this ValueAnimator has only one set of values being animated between, this evaluator
diff --git a/core/java/android/content/SyncManager.java b/core/java/android/content/SyncManager.java
index 0bce748..2fa2834 100644
--- a/core/java/android/content/SyncManager.java
+++ b/core/java/android/content/SyncManager.java
@@ -1377,8 +1377,8 @@
// to have the most recent value used.
try {
waitUntilReadyToRun();
- NetworkInfo info = getConnectivityManager().getActiveNetworkInfo();
- mDataConnectionIsConnected = (info != null) && info.isConnected();
+ NetworkInfo networkInfo = getConnectivityManager().getActiveNetworkInfo();
+ mDataConnectionIsConnected = (networkInfo != null) && networkInfo.isConnected();
mSyncManagerWakeLock.acquire();
// Always do this first so that we be sure that any periodic syncs that
// are ready to run have been converted into pending syncs. This allows the
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java
index e8283a6..4a9e441 100644
--- a/core/java/android/webkit/WebView.java
+++ b/core/java/android/webkit/WebView.java
@@ -2618,10 +2618,6 @@
private int computeRealHorizontalScrollRange() {
if (mDrawHistory) {
return mHistoryWidth;
- } else if (mHorizontalScrollBarMode == SCROLLBAR_ALWAYSOFF
- && !mZoomManager.canZoomOut()) {
- // only honor the scrollbar mode when it is at minimum zoom level
- return computeHorizontalScrollExtent();
} else {
// to avoid rounding error caused unnecessary scrollbar, use floor
return (int) Math.floor(mContentWidth * mZoomManager.getScale());
@@ -2652,10 +2648,6 @@
private int computeRealVerticalScrollRange() {
if (mDrawHistory) {
return mHistoryHeight;
- } else if (mVerticalScrollBarMode == SCROLLBAR_ALWAYSOFF
- && !mZoomManager.canZoomOut()) {
- // only honor the scrollbar mode when it is at minimum zoom level
- return computeVerticalScrollExtent();
} else {
// to avoid rounding error caused unnecessary scrollbar, use floor
return (int) Math.floor(mContentHeight * mZoomManager.getScale());
diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java
index c874160..8d5e71a 100644
--- a/core/java/android/webkit/WebViewCore.java
+++ b/core/java/android/webkit/WebViewCore.java
@@ -115,8 +115,8 @@
*/
private int mViewportDensityDpi = -1;
- private int mRestoredScale = 0;
- private int mRestoredTextWrapScale = 0;
+ private float mRestoredScale = 0;
+ private float mRestoredTextWrapScale = 0;
private int mRestoredX = 0;
private int mRestoredY = 0;
@@ -2245,8 +2245,8 @@
}
// reset the scroll position, the restored offset and scales
- mWebkitScrollX = mWebkitScrollY = mRestoredX = mRestoredY
- = mRestoredScale = mRestoredTextWrapScale = 0;
+ mWebkitScrollX = mWebkitScrollY = mRestoredX = mRestoredY = 0;
+ mRestoredScale = mRestoredTextWrapScale = 0;
}
// called by JNI
@@ -2352,9 +2352,9 @@
mInitialViewState.mMobileSite = (0 == mViewportWidth);
if (mRestoredScale > 0) {
mInitialViewState.mIsRestored = true;
- mInitialViewState.mViewScale = mRestoredScale / 100.0f;
+ mInitialViewState.mViewScale = mRestoredScale;
if (mRestoredTextWrapScale > 0) {
- mInitialViewState.mTextWrapScale = mRestoredTextWrapScale / 100.0f;
+ mInitialViewState.mTextWrapScale = mRestoredTextWrapScale;
} else {
mInitialViewState.mTextWrapScale = mInitialViewState.mViewScale;
}
@@ -2411,7 +2411,7 @@
// know the exact scale. If mRestoredScale is non-zero, use it;
// otherwise just use mTextWrapScale as the initial scale.
data.mScale = mInitialViewState.mViewScale == 0
- ? (mRestoredScale > 0 ? mRestoredScale / 100.0f
+ ? (mRestoredScale > 0 ? mRestoredScale
: mInitialViewState.mTextWrapScale)
: mInitialViewState.mViewScale;
if (DebugFlags.WEB_VIEW_CORE) {
@@ -2444,7 +2444,7 @@
}
// called by JNI
- private void restoreScale(int scale, int textWrapScale) {
+ private void restoreScale(float scale, float textWrapScale) {
if (mBrowserFrame.firstLayoutDone() == false) {
mRestoredScale = scale;
if (mSettings.getUseWideViewPort()) {
diff --git a/core/java/android/webkit/WebViewDatabase.java b/core/java/android/webkit/WebViewDatabase.java
index 7b9def0..e1392ae 100644
--- a/core/java/android/webkit/WebViewDatabase.java
+++ b/core/java/android/webkit/WebViewDatabase.java
@@ -223,6 +223,7 @@
null);
}
}
+ mDatabase.enableWriteAheadLogging();
// mDatabase should not be null,
// the only case is RequestAPI test has problem to create db
@@ -233,7 +234,7 @@
}
if (mDatabase.getVersion() != DATABASE_VERSION) {
- mDatabase.beginTransaction();
+ mDatabase.beginTransactionNonExclusive();
try {
upgradeDatabase();
mDatabase.setTransactionSuccessful();
@@ -261,6 +262,7 @@
CACHE_DATABASE_FILE, 0, null);
}
}
+ mCacheDatabase.enableWriteAheadLogging();
// mCacheDatabase should not be null,
// the only case is RequestAPI test has problem to create db
@@ -271,7 +273,7 @@
}
if (mCacheDatabase.getVersion() != CACHE_DATABASE_VERSION) {
- mCacheDatabase.beginTransaction();
+ mCacheDatabase.beginTransactionNonExclusive();
try {
upgradeCacheDatabase();
bootstrapCacheDatabase();
@@ -648,7 +650,7 @@
+ "WebViewWorkerThread instead of from "
+ Thread.currentThread().getName());
}
- mCacheDatabase.beginTransaction();
+ mCacheDatabase.beginTransactionNonExclusive();
return true;
}
return false;
diff --git a/media/libstagefright/CameraSourceTimeLapse.cpp b/media/libstagefright/CameraSourceTimeLapse.cpp
index 9677838..31b6ec9 100644
--- a/media/libstagefright/CameraSourceTimeLapse.cpp
+++ b/media/libstagefright/CameraSourceTimeLapse.cpp
@@ -347,7 +347,8 @@
}
void CameraSourceTimeLapse::releaseRecordingFrame(const sp<IMemory>& frame) {
- if (!mUseStillCameraForTimeLapse) {
+ if (!mUseStillCameraForTimeLapse &&
+ mCamera != NULL) {
mCamera->releaseRecordingFrame(frame);
}
}
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 7750a9d..e516cb4 100644
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -3923,6 +3923,8 @@
if (!mIsEncoder) {
OMX_CONFIG_RECTTYPE rect;
+ InitOMXParams(&rect);
+ rect.nPortIndex = kPortIndexOutput;
status_t err =
mOMX->getConfig(
mNode, OMX_IndexConfigCommonOutputCrop,
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index 6e2bfdb..f8809d7 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -262,11 +262,8 @@
// Watch for external modifications to the database file,
// keeping our cache in sync.
- // It's kinda lame to call mOpenHelper.getReadableDatabase()
- // during onCreate(), but since ensureAndroidIdIsSet has
- // already done it above and initialized/upgraded the
- // database, might as well just use it...
- SQLiteDatabase db = mOpenHelper.getReadableDatabase();
+ SQLiteDatabase db = mOpenHelper.getWritableDatabase();
+ db.enableWriteAheadLogging();
sObserverInstance = new SettingsFileObserver(db.getPath());
sObserverInstance.startWatching();
startAsyncCachePopulation();
diff --git a/services/java/com/android/server/AccessibilityManagerService.java b/services/java/com/android/server/AccessibilityManagerService.java
index 393beda..63be030 100644
--- a/services/java/com/android/server/AccessibilityManagerService.java
+++ b/services/java/com/android/server/AccessibilityManagerService.java
@@ -532,7 +532,10 @@
for (int i = 0, count = services.size(); i < count; i++) {
Service service = services.get(i);
- service.unbind();
+ if (service.unbind()) {
+ i--;
+ count--;
+ }
}
}
@@ -575,7 +578,6 @@
Set<ComponentName> enabledServices) {
Map<ComponentName, Service> componentNameToServiceMap = mComponentNameToServiceMap;
- List<Service> services = mServices;
boolean isEnabled = mIsEnabled;
for (int i = 0, count = installedServices.size(); i < count; i++) {
@@ -665,23 +667,30 @@
/**
* Binds to the accessibility service.
+ *
+ * @return True if binding is successful.
*/
- public void bind() {
+ public boolean bind() {
if (mService == null) {
- mContext.bindService(mIntent, this, Context.BIND_AUTO_CREATE);
+ return mContext.bindService(mIntent, this, Context.BIND_AUTO_CREATE);
}
+ return false;
}
/**
* Unbinds form the accessibility service and removes it from the data
* structures for service management.
+ *
+ * @return True if unbinding is successful.
*/
- public void unbind() {
+ public boolean unbind() {
if (mService != null) {
mContext.unbindService(this);
mComponentNameToServiceMap.remove(mComponentName);
mServices.remove(this);
+ return true;
}
+ return false;
}
/**
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeConstants.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeConstants.java
index 791e53b..596cbfc 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeConstants.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/BridgeConstants.java
@@ -48,6 +48,8 @@
public final static String PREFIX_ANDROID = "android:";
+ public final static String RES_ANIM = "anim";
+ public final static String RES_ANIMATOR = "animator";
public final static String RES_STYLE = "style";
public final static String RES_ATTR = "attr";
public final static String RES_DIMEN = "dimen";
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
index b0eea4c..fb79473 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeContext.java
@@ -493,12 +493,12 @@
/**
* Resolves the value of a resource, if the value references a theme or resource value.
* <p/>
- * This method ensures that it returns a {@link IResourceValue} object that does not
+ * This method ensures that it returns a {@link ResourceValue} object that does not
* reference another resource.
* If the resource cannot be resolved, it returns <code>null</code>.
* <p/>
* If a value that does not need to be resolved is given, the method will return a new
- * instance of IResourceValue that contains the input value.
+ * instance of {@link ResourceValue} that contains the input value.
*
* @param type the type of the resource
* @param name the name of the attribute containing this value.
@@ -510,11 +510,11 @@
return null;
}
- // get the IResourceValue referenced by this value
+ // get the ResourceValue referenced by this value
ResourceValue resValue = findResValue(value, false /*forceFrameworkOnly*/);
// if resValue is null, but value is not null, this means it was not a reference.
- // we return the name/value wrapper in a IResourceValue. the isFramework flag doesn't
+ // we return the name/value wrapper in a ResourceValue. the isFramework flag doesn't
// matter.
if (resValue == null) {
return new ResourceValue(type, name, value, false /*isFramework*/);
@@ -525,9 +525,9 @@
}
/**
- * Returns the {@link IResourceValue} referenced by the value of <var>value</var>.
+ * Returns the {@link ResourceValue} referenced by the value of <var>value</var>.
* <p/>
- * This method ensures that it returns a {@link IResourceValue} object that does not
+ * This method ensures that it returns a {@link ResourceValue} object that does not
* reference another resource.
* If the resource cannot be resolved, it returns <code>null</code>.
* <p/>
@@ -535,7 +535,7 @@
* value.
*
* @param value the value containing the reference to resolve.
- * @return a {@link IResourceValue} object or <code>null</code>
+ * @return a {@link ResourceValue} object or <code>null</code>
*/
public ResourceValue resolveResValue(ResourceValue value) {
if (value == null) {
@@ -547,7 +547,7 @@
return value;
}
- // else attempt to find another IResourceValue referenced by this one.
+ // else attempt to find another ResourceValue referenced by this one.
ResourceValue resolvedValue = findResValue(value.getValue(), value.isFramework());
// if the value did not reference anything, then we simply return the input value
@@ -560,7 +560,7 @@
}
/**
- * Searches for, and returns a {@link IResourceValue} by its reference.
+ * Searches for, and returns a {@link ResourceValue} by its reference.
* <p/>
* The reference format can be:
* <pre>@resType/resName</pre>
@@ -577,7 +577,7 @@
* @param reference the resource reference to search for.
* @param forceFrameworkOnly if true all references are considered to be toward framework
* resource even if the reference does not include the android: prefix.
- * @return a {@link IResourceValue} or <code>null</code>.
+ * @return a {@link ResourceValue} or <code>null</code>.
*/
ResourceValue findResValue(String reference, boolean forceFrameworkOnly) {
if (reference == null) {
@@ -670,7 +670,7 @@
}
/**
- * Searches for, and returns a {@link IResourceValue} by its name, and type.
+ * Searches for, and returns a {@link ResourceValue} by its name, and type.
* @param resType the type of the resource
* @param resName the name of the resource
* @param frameworkOnly if <code>true</code>, the method does not search in the
@@ -746,11 +746,11 @@
}
/**
- * Returns the {@link IResourceValue} matching a given name in a given style. If the
+ * Returns the {@link ResourceValue} matching a given name in a given style. If the
* item is not directly available in the style, the method looks in its parent style.
* @param style the style to search in
* @param itemName the name of the item to search for.
- * @return the {@link IResourceValue} object or <code>null</code>
+ * @return the {@link ResourceValue} object or <code>null</code>
*/
public ResourceValue findItemInStyle(StyleResourceValue style, String itemName) {
ResourceValue item = style.findValue(itemName);
@@ -878,8 +878,8 @@
return null;
}
- int getFrameworkIdValue(String idName, int defValue) {
- Integer value = Bridge.getResourceValue(BridgeConstants.RES_ID, idName);
+ int getFrameworkResourceValue(String resType, String resName, int defValue) {
+ Integer value = Bridge.getResourceValue(resType, resName);
if (value != null) {
return value.intValue();
}
@@ -887,9 +887,9 @@
return defValue;
}
- int getProjectIdValue(String idName, int defValue) {
+ int getProjectResourceValue(String resType, String resName, int defValue) {
if (mProjectCallback != null) {
- Integer value = mProjectCallback.getResourceValue(BridgeConstants.RES_ID, idName);
+ Integer value = mProjectCallback.getResourceValue(resType, resName);
if (value != null) {
return value.intValue();
}
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java
index 2ea5281..215c5f93 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeResources.java
@@ -294,7 +294,6 @@
return null;
}
-
@Override
public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
return mContext.obtainStyledAttributes(set, attrs);
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java
index 4fb280d..d36846b 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/android/BridgeTypedArray.java
@@ -577,19 +577,21 @@
return mContext.getDynamicIdByStyle((StyleResourceValue)resValue);
}
- // if the attribute was a reference to an id, and not a declaration of an id (@+id), then
- // the xml attribute value was "resolved" which leads us to a ResourceValue with
- // getType() returning "id" and getName() returning the id name
+ // if the attribute was a reference to a resource, and not a declaration of an id (@+id),
+ // then the xml attribute value was "resolved" which leads us to a ResourceValue with a
+ // valid getType() and getName() returning a resource name.
// (and getValue() returning null!). We need to handle this!
- if (resValue.getType() != null && resValue.getType().equals(BridgeConstants.RES_ID)) {
+ if (resValue.getType() != null && resValue.getType().startsWith("@+") == false) {
// if this is a framework id
if (mPlatformFile || resValue.isFramework()) {
// look for idName in the android R classes
- return mContext.getFrameworkIdValue(resValue.getName(), defValue);
+ return mContext.getFrameworkResourceValue(
+ resValue.getType(), resValue.getName(), defValue);
}
// look for idName in the project R class.
- return mContext.getProjectIdValue(resValue.getName(), defValue);
+ return mContext.getProjectResourceValue(
+ resValue.getType(), resValue.getName(), defValue);
}
// else, try to get the value, and resolve it somehow.
@@ -626,11 +628,11 @@
// if this is a framework id
if (mPlatformFile || value.startsWith("@android") || value.startsWith("@+android")) {
// look for idName in the android R classes
- return mContext.getFrameworkIdValue(idName, defValue);
+ return mContext.getFrameworkResourceValue(BridgeConstants.RES_ID, idName, defValue);
}
// look for idName in the project R class.
- return mContext.getProjectIdValue(idName, defValue);
+ return mContext.getProjectResourceValue(BridgeConstants.RES_ID, idName, defValue);
}
// not a direct id valid reference? resolve it
diff --git a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
index 55a5bc0..d2fef5e 100644
--- a/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
+++ b/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
@@ -505,14 +505,18 @@
ResourceValue animationResource = null;
int animationId = 0;
if (isFrameworkAnimation) {
- animationResource = mContext.getFrameworkResource("anim", animationName);
+ animationResource = mContext.getFrameworkResource(BridgeConstants.RES_ANIM,
+ animationName);
if (animationResource != null) {
- animationId = Bridge.getResourceValue("anim", animationName);
+ animationId = Bridge.getResourceValue(BridgeConstants.RES_ANIM,
+ animationName);
}
} else {
- animationResource = mContext.getProjectResource("anim", animationName);
+ animationResource = mContext.getProjectResource(BridgeConstants.RES_ANIM,
+ animationName);
if (animationResource != null) {
- animationId = mContext.getProjectCallback().getResourceValue("anim", animationName);
+ animationId = mContext.getProjectCallback().getResourceValue(
+ BridgeConstants.RES_ANIM, animationName);
}
}