Revert "Bug 1816066 - replace keyboard visibility check duplicated methods"