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

Commit 826fbdf7 authored by Gilles Debunne's avatar Gilles Debunne Committed by Android Git Automerger
Browse files

am 8a6ba494: Merge "All runnable are stopped on detach. DO NOT MERGE." into gingerbread

* commit '8a6ba494':
  All runnable are stopped on detach. DO NOT MERGE.
parents 2f7e9d40 8a6ba494
Loading
Loading
Loading
Loading
+32 −3
Original line number Diff line number Diff line
@@ -3831,6 +3831,18 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
            hideError();
        }

        if (mBlink != null) {
            mBlink.cancel();
        }

        if (mInsertionPointCursorController != null) {
            mInsertionPointCursorController.onDetached();
        }

        if (mSelectionModifierCursorController != null) {
            mSelectionModifierCursorController.onDetached();
        }

        hideControllers();
    }

@@ -7740,6 +7752,13 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
         * @param event The touch event
         */
        public boolean onTouchEvent(MotionEvent event);

        /**
         * Called when the view is detached from window. Perform house keeping task, such as
         * stopping Runnable thread that would otherwise keep a reference on the context, thus
         * preventing the activity to be recycled.
         */
        public void onDetached();
    }

    private class HandleView extends View {
@@ -8017,12 +8036,12 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener

        public void hide() {
            mHandle.hide();
            TextView.this.removeCallbacks(mHider);
            removeCallbacks(mHider);
        }

        private void hideDelayed(int msec) {
            TextView.this.removeCallbacks(mHider);
            TextView.this.postDelayed(mHider, msec);
            removeCallbacks(mHider);
            postDelayed(mHider, msec);
        }

        public boolean isShowing() {
@@ -8062,6 +8081,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                hide();
            }
        }

        @Override
        public void onDetached() {
            removeCallbacks(mHider);
        }
    }

    private class SelectionModifierCursorController implements CursorController {
@@ -8219,6 +8243,11 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                hide();
            }
        }

        @Override
        public void onDetached() {
            removeCallbacks(mHider);
        }
    }

    private void hideInsertionPointCursorController() {