Sometimes clearAnimation() is called on the search widget when it has no parent, e.g. when it being removed from the home screen. This caused an NPE, because clearAnimation() called invalidate() on the parent. This is a partial fix for: http://b/issue?id=2246760