Register Ime consumer only when insets are enabled.

As of today we register Ime consumer in IMM onWindowGainedFocus().
However, it does nothing functionally when ViewRootImpl#sNewInsetsMode is disabled.
This CL adds a check to not register consumer at the first place.

This may also be causing a leak. Added a TODO to revisit that before we
enable the flag.

Bug: 131181940
Test: atest ViewRootImpl
Test: atest InsetsController
Change-Id: I6b2b62d10670d63edafeb1b24c25b26c7721f3ad
1 file changed