Fixes IllegalStateException caused by child already having parent

Detaches custom clock during onDetachFromWindow. This removes the
custom clock view from the keyguard during configuration changes.

The root cause for this issue is that the clock plugins remain in
memory after ag/6576777. There needs to be a way to communicate
to the clock plugin that it is done being used (something like
an onDestroyViews method). I'm leaving this work for a follow up
change.

Fixes: 127289716
Test: IllegalStateException not seen in logcat when performing repro
steps.

Change-Id: I184c52b25cb61325a920067dfc415b163f6a6b6d
1 file changed