Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 185e3e24 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix when managed cursors are required.

Only do this when we are actually restarting, not when we
are just resuming after a pause.

Change-Id: I32fd263917b03776efca8e096d0343107721398d
parent b4b44bd3
Loading
Loading
Loading
Loading
+18 −16
Original line number Diff line number Diff line
@@ -4421,6 +4421,12 @@ public class Activity extends ContextThemeWrapper
    final void performRestart() {
        mFragments.noteStateNotSaved();

        if (mStopped) {
            mStopped = false;
            if (mToken != null && mParent == null) {
                WindowManagerImpl.getDefault().setStoppedState(mToken, false);
            }

            synchronized (mManagedCursors) {
                final int N = mManagedCursors.size();
                for (int i=0; i<N; i++) {
@@ -4428,7 +4434,8 @@ public class Activity extends ContextThemeWrapper
                    if (mc.mReleased || mc.mUpdated) {
                        if (!mc.mCursor.requery()) {
                            throw new IllegalStateException(
                                "trying to requery an already closed cursor");
                                    "trying to requery an already closed cursor  "
                                    + mc.mCursor);
                        }
                        mc.mReleased = false;
                        mc.mUpdated = false;
@@ -4436,12 +4443,7 @@ public class Activity extends ContextThemeWrapper
                }
            }

        if (mStopped) {
            mStopped = false;
            mCalled = false;
            if (mToken != null && mParent == null) {
                WindowManagerImpl.getDefault().setStoppedState(mToken, false);
            }
            mInstrumentation.callActivityOnRestart(this);
            if (!mCalled) {
                throw new SuperNotCalledException(