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

Commit 2f6a0185 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Fix bug 2183276: Synchronize all mManagedCursors accesses.

parent 469888fe
Loading
Loading
Loading
Loading
+25 −19
Original line number Diff line number Diff line
@@ -1308,6 +1308,7 @@ public class Activity extends ContextThemeWrapper
        }

        // close any cursors we are managing.
        synchronized (mManagedCursors) {
            int numCursors = mManagedCursors.size();
            for (int i = 0; i < numCursors; i++) {
                ManagedCursor c = mManagedCursors.get(i);
@@ -1317,6 +1318,7 @@ public class Activity extends ContextThemeWrapper
            }
            mManagedCursors.clear();
        }
    }

    /**
     * Called by the system when the device configuration changes while your
@@ -3778,6 +3780,7 @@ public class Activity extends ContextThemeWrapper
    }
    
    final void performRestart() {
        synchronized (mManagedCursors) {
            final int N = mManagedCursors.size();
            for (int i=0; i<N; i++) {
                ManagedCursor mc = mManagedCursors.get(i);
@@ -3787,6 +3790,7 @@ public class Activity extends ContextThemeWrapper
                    mc.mUpdated = false;
                }
            }
        }

        if (mStopped) {
            mStopped = false;
@@ -3850,6 +3854,7 @@ public class Activity extends ContextThemeWrapper
                    " did not call through to super.onStop()");
            }
    
            synchronized (mManagedCursors) {
                final int N = mManagedCursors.size();
                for (int i=0; i<N; i++) {
                    ManagedCursor mc = mManagedCursors.get(i);
@@ -3858,6 +3863,7 @@ public class Activity extends ContextThemeWrapper
                        mc.mReleased = true;
                    }
                }
            }
    
            mStopped = true;
        }