am dddd6b15: am 185e3e24: Fix when managed cursors are required.

* commit 'dddd6b15d5274a6138facec9f553336fac5f6de6':
  Fix when managed cursors are required.
This commit is contained in:
Dianne Hackborn
2011-06-03 16:27:36 -07:00
committed by Android Git Automerger

View File

@ -4421,6 +4421,12 @@ public class Activity extends ContextThemeWrapper
final void performRestart() { final void performRestart() {
mFragments.noteStateNotSaved(); mFragments.noteStateNotSaved();
if (mStopped) {
mStopped = false;
if (mToken != null && mParent == null) {
WindowManagerImpl.getDefault().setStoppedState(mToken, false);
}
synchronized (mManagedCursors) { synchronized (mManagedCursors) {
final int N = mManagedCursors.size(); final int N = mManagedCursors.size();
for (int i=0; i<N; i++) { for (int i=0; i<N; i++) {
@ -4428,7 +4434,8 @@ public class Activity extends ContextThemeWrapper
if (mc.mReleased || mc.mUpdated) { if (mc.mReleased || mc.mUpdated) {
if (!mc.mCursor.requery()) { if (!mc.mCursor.requery()) {
throw new IllegalStateException( throw new IllegalStateException(
"trying to requery an already closed cursor"); "trying to requery an already closed cursor "
+ mc.mCursor);
} }
mc.mReleased = false; mc.mReleased = false;
mc.mUpdated = false; mc.mUpdated = false;
@ -4436,12 +4443,7 @@ public class Activity extends ContextThemeWrapper
} }
} }
if (mStopped) {
mStopped = false;
mCalled = false; mCalled = false;
if (mToken != null && mParent == null) {
WindowManagerImpl.getDefault().setStoppedState(mToken, false);
}
mInstrumentation.callActivityOnRestart(this); mInstrumentation.callActivityOnRestart(this);
if (!mCalled) { if (!mCalled) {
throw new SuperNotCalledException( throw new SuperNotCalledException(