Add Ability to Check if Cursor is Blinking

adds a method for returning whether the cursor is blinking based on the
current value of the mCancelled property in the Blink class.  This
method is only inteded to be used for testing purposes.

Bug: 228354442
Test: manual, method is called in CtsWidgetTestCases:EditTextTest#
      testSuspendAndResumeBlinkingCursor,
      testCursorBlinkingOnNewActivity_WithFocus,
      testCursorNotBlinkingOnNewActivity_WithoutFocus
Change-Id: I02849f6e105cbfe7af78dfb34ffbf1ebbb4a82ae
This commit is contained in:
Steven Terrell
2022-09-14 18:22:42 +00:00
parent 4ec6dfc389
commit d2acc476d0

View File

@@ -2869,6 +2869,17 @@ public class Editor {
}
}
/**
*
* @return whether the Blink runnable is blinking or not, if null return false.
* @hide
*/
@VisibleForTesting
public boolean isBlinking() {
if (mBlink == null) return false;
return !mBlink.mCancelled;
}
private class Blink implements Runnable {
private boolean mCancelled;