Update checkOnHandlerThread()

The function is updated to throw IllegalStateException when called off
the handler thread.

Added the check for setEnabledInternal().

Bug: 342286647
Test: presubmit
Change-Id: I378b588af958bf4b913b32b096af1361f179c16e
1 file changed