summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/java/android/view/HardwareRenderer.java2
-rw-r--r--core/java/android/view/View.java6
-rw-r--r--core/java/android/view/ViewRootImpl.java3
-rw-r--r--core/jni/android_database_SQLiteCommon.cpp22
-rw-r--r--core/jni/android_database_SQLiteConnection.cpp4
-rw-r--r--libs/hwui/OpenGLRenderer.cpp7
-rw-r--r--services/java/com/android/server/accessibility/TouchExplorer.java6
-rw-r--r--services/java/com/android/server/wm/WindowAnimator.java6
-rwxr-xr-xservices/java/com/android/server/wm/WindowManagerService.java2
-rw-r--r--services/java/com/android/server/wm/WindowStateAnimator.java5
10 files changed, 42 insertions, 21 deletions
diff --git a/core/java/android/view/HardwareRenderer.java b/core/java/android/view/HardwareRenderer.java
index 7e86ea3a542e..c0d76cf32582 100644
--- a/core/java/android/view/HardwareRenderer.java
+++ b/core/java/android/view/HardwareRenderer.java
@@ -1229,7 +1229,7 @@ public abstract class HardwareRenderer {
void detachFunctor(int functor) {
if (mCanvas != null) {
mCanvas.detachFunctor(functor);
- }
+ } else Log.e(LOG_TAG, "can't detachFunctor, have no canvas");
}
@Override
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 48819a115c03..7c6a7c520b52 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -3457,7 +3457,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
}
break;
case com.android.internal.R.styleable.View_contentDescription:
- mContentDescription = a.getString(attr);
+ setContentDescription(a.getString(attr));
break;
case com.android.internal.R.styleable.View_soundEffectsEnabled:
if (!a.getBoolean(attr, true)) {
@@ -5048,6 +5048,10 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
@RemotableViewMethod
public void setContentDescription(CharSequence contentDescription) {
mContentDescription = contentDescription;
+ final boolean nonEmptyDesc = contentDescription != null && contentDescription.length() > 0;
+ if (nonEmptyDesc && getImportantForAccessibility() == IMPORTANT_FOR_ACCESSIBILITY_AUTO) {
+ setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
+ }
}
/**
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 3138692deb5c..6c24b865880d 100644
--- a/core/java/android/view/ViewRootImpl.java
+++ b/core/java/android/view/ViewRootImpl.java
@@ -678,6 +678,9 @@ public final class ViewRootImpl implements ViewParent,
}
public void detachFunctor(int functor) {
+ Log.e(HardwareRenderer.LOG_TAG, String.format("detachFunctor, mHarwareRenderer==null %b, enabled %b",
+ mAttachInfo.mHardwareRenderer == null,
+ mAttachInfo.mHardwareRenderer == null ? false : mAttachInfo.mHardwareRenderer.isEnabled()));
if (mAttachInfo.mHardwareRenderer != null && mAttachInfo.mHardwareRenderer.isEnabled()) {
mAttachInfo.mHardwareRenderer.detachFunctor(functor);
}
diff --git a/core/jni/android_database_SQLiteCommon.cpp b/core/jni/android_database_SQLiteCommon.cpp
index 06bff19ce42a..46009bde75a8 100644
--- a/core/jni/android_database_SQLiteCommon.cpp
+++ b/core/jni/android_database_SQLiteCommon.cpp
@@ -33,8 +33,11 @@ void throw_sqlite3_exception(JNIEnv* env, const char* message) {
*/
void throw_sqlite3_exception(JNIEnv* env, sqlite3* handle, const char* message) {
if (handle) {
- throw_sqlite3_exception(env, sqlite3_errcode(handle),
- sqlite3_errmsg(handle), message);
+ // get the error code and message from the SQLite connection
+ // the error message may contain more information than the error code
+ // because it is based on the extended error code rather than the simplified
+ // error code that SQLite normally returns.
+ throw_sqlite3_exception(env, sqlite3_errcode(handle), sqlite3_errmsg(handle), message);
} else {
// we use SQLITE_OK so that a generic SQLiteException is thrown;
// any code not specified in the switch statement below would do.
@@ -42,15 +45,13 @@ void throw_sqlite3_exception(JNIEnv* env, sqlite3* handle, const char* message)
}
}
-/* throw a SQLiteException for a given error code */
+/* throw a SQLiteException for a given error code
+ * should only be used when the database connection is not available because the
+ * error information will not be quite as rich */
void throw_sqlite3_exception_errcode(JNIEnv* env, int errcode, const char* message) {
- if (errcode == SQLITE_DONE) {
- throw_sqlite3_exception(env, errcode, NULL, message);
- } else {
- char temp[21];
- sprintf(temp, "error code %d", errcode);
- throw_sqlite3_exception(env, errcode, temp, message);
- }
+ char temp[21];
+ sprintf(temp, "error code %d", errcode);
+ throw_sqlite3_exception(env, errcode, temp, message);
}
/* throw a SQLiteException for a given error code, sqlite3message, and
@@ -75,6 +76,7 @@ void throw_sqlite3_exception(JNIEnv* env, int errcode,
break;
case SQLITE_DONE:
exceptionClass = "android/database/sqlite/SQLiteDoneException";
+ sqlite3Message = NULL; // SQLite error message is irrelevant in this case
break;
case SQLITE_FULL:
exceptionClass = "android/database/sqlite/SQLiteFullException";
diff --git a/core/jni/android_database_SQLiteConnection.cpp b/core/jni/android_database_SQLiteConnection.cpp
index 3bbb8bf819b5..c9cf2fa9c282 100644
--- a/core/jni/android_database_SQLiteConnection.cpp
+++ b/core/jni/android_database_SQLiteConnection.cpp
@@ -444,7 +444,7 @@ static int executeNonQuery(JNIEnv* env, SQLiteConnection* connection, sqlite3_st
throw_sqlite3_exception(env,
"Queries can be performed using SQLiteDatabase query or rawQuery methods only.");
} else if (err != SQLITE_DONE) {
- throw_sqlite3_exception_errcode(env, err, sqlite3_errmsg(connection->db));
+ throw_sqlite3_exception(env, connection->db);
}
return err;
}
@@ -479,7 +479,7 @@ static jlong nativeExecuteForLastInsertedRowId(JNIEnv* env, jclass clazz,
static int executeOneRowQuery(JNIEnv* env, SQLiteConnection* connection, sqlite3_stmt* statement) {
int err = sqlite3_step(statement);
if (err != SQLITE_ROW) {
- throw_sqlite3_exception_errcode(env, err, sqlite3_errmsg(connection->db));
+ throw_sqlite3_exception(env, connection->db);
}
return err;
}
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 2dc9726ab9ca..c5fedba97a41 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -262,7 +262,10 @@ void OpenGLRenderer::resume() {
}
void OpenGLRenderer::detachFunctor(Functor* functor) {
- mFunctors.remove(functor);
+ int size = mFunctors.size();
+ int remove = mFunctors.remove(functor);
+ ALOGD("OGLR %p detachFunctor %p, removed at index %d of %d",
+ this, functor, remove, size);
}
void OpenGLRenderer::attachFunctor(Functor* functor) {
@@ -309,7 +312,7 @@ status_t OpenGLRenderer::invokeFunctors(Rect& dirty) {
status_t OpenGLRenderer::callDrawGLFunction(Functor* functor, Rect& dirty) {
interrupt();
- detachFunctor(functor);
+ mFunctors.remove(functor);
if (mDirtyClip) {
setScissorFromClip();
diff --git a/services/java/com/android/server/accessibility/TouchExplorer.java b/services/java/com/android/server/accessibility/TouchExplorer.java
index d97b022381ef..7e8837383a7c 100644
--- a/services/java/com/android/server/accessibility/TouchExplorer.java
+++ b/services/java/com/android/server/accessibility/TouchExplorer.java
@@ -100,6 +100,9 @@ public class TouchExplorer {
// Temporary array for storing pointer IDs.
private final int[] mTempPointerIds = new int[MAX_POINTER_COUNT];
+ // Timeout before trying to decide what the user is trying to do.
+ private final int mDetermineUserIntentTimeout;
+
// Timeout within which we try to detect a tap.
private final int mTapTimeout;
@@ -199,6 +202,7 @@ public class TouchExplorer {
mInjectedPointerTracker = new InjectedPointerTracker();
mInputFilter = inputFilter;
mTapTimeout = ViewConfiguration.getTapTimeout();
+ mDetermineUserIntentTimeout = (int) (mTapTimeout * 1.5f);
mDoubleTapTimeout = ViewConfiguration.getDoubleTapTimeout();
mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
mDoubleTapSlop = ViewConfiguration.get(context).getScaledDoubleTapSlop();
@@ -1332,7 +1336,7 @@ public class TouchExplorer {
mPrototype = MotionEvent.obtain(prototype);
mPointerIdBits = pointerIdBits;
mPolicyFlags = policyFlags;
- mHandler.postDelayed(this, mTapTimeout);
+ mHandler.postDelayed(this, mDetermineUserIntentTimeout);
}
public float getX() {
diff --git a/services/java/com/android/server/wm/WindowAnimator.java b/services/java/com/android/server/wm/WindowAnimator.java
index d6954a5ed270..d25a96078031 100644
--- a/services/java/com/android/server/wm/WindowAnimator.java
+++ b/services/java/com/android/server/wm/WindowAnimator.java
@@ -489,7 +489,11 @@ public class WindowAnimator {
final int N = mWinAnimators.size();
for (int i = 0; i < N; i++) {
- mWinAnimators.get(i).prepareSurfaceLocked(true);
+ final WindowStateAnimator winAnimator = mWinAnimators.get(i);
+ if (winAnimator.mWin.mIsWallpaper && mService.mWallpaperTarget == null) {
+ continue;
+ }
+ winAnimator.prepareSurfaceLocked(true);
}
if (mDimParams != null) {
diff --git a/services/java/com/android/server/wm/WindowManagerService.java b/services/java/com/android/server/wm/WindowManagerService.java
index 9257028f0f37..5f63934aa057 100755
--- a/services/java/com/android/server/wm/WindowManagerService.java
+++ b/services/java/com/android/server/wm/WindowManagerService.java
@@ -8553,7 +8553,7 @@ public class WindowManagerService extends IWindowManager.Stub
handleNotObscuredLocked(w, currentTime, innerDw, innerDh);
}
- if (obscuredChanged && mWallpaperTarget == w) {
+ if (obscuredChanged && (mWallpaperTarget == w) && w.isVisibleLw()) {
// This is the wallpaper target and its obscured state
// changed... make sure the current wallaper's visibility
// has been updated accordingly.
diff --git a/services/java/com/android/server/wm/WindowStateAnimator.java b/services/java/com/android/server/wm/WindowStateAnimator.java
index affe5d49abb0..485f4a773c7a 100644
--- a/services/java/com/android/server/wm/WindowStateAnimator.java
+++ b/services/java/com/android/server/wm/WindowStateAnimator.java
@@ -381,6 +381,7 @@ class WindowStateAnimator {
}
if (mService.mWallpaperTarget == mWin && mService.mLowerWallpaperTarget == null) {
mAnimator.hideWallpapersLocked();
+ mAnimator.mPendingLayoutChanges |= WindowManagerPolicy.FINISH_LAYOUT_REDO_WALLPAPER;
}
}
@@ -1105,8 +1106,8 @@ class WindowStateAnimator {
try {
mSurfaceAlpha = mShownAlpha;
mSurface.setAlpha(mShownAlpha);
- mSurfaceLayer = w.mWinAnimator.mAnimLayer;
- mSurface.setLayer(w.mWinAnimator.mAnimLayer);
+ mSurfaceLayer = mAnimLayer;
+ mSurface.setLayer(mAnimLayer);
mSurface.setMatrix(
mDsDx*w.mHScale, mDtDx*w.mVScale,
mDsDy*w.mHScale, mDtDy*w.mVScale);