Don't performPendingDeferredStart on fragments that aren't added
Don't performPendingDeferredStart on fragments that aren't added

When setting a user visibility hint on a fragment it was possible to
have a FragmentManager already set due to a transaction being composed
but before the commit, so only checking that we have one isn't
sufficient for determining whether we should perform a pending
deferred start. This could happen easily with ViewPager adapters. Use
isAdded() instead.

Also fix a bug where we could set our internal tracking of fragments
that need a deferred start incorrectly.

Bug 27814550

Change-Id: If288720d998ecfa69d5e18aad5ce33075013754e

androidx/androidx,AndroidX/androidx,AndroidX/androidx,AndroidX/androidx,AndroidX/androidx,androidx/androidx,androidx/androidx,aosp-mirror/platform_frameworks_support,androidx/androidx,androidx/androidx,AndroidX/androidx,androidx/androidx,AndroidX/androidx,aosp-mirror/platform_frameworks_support,androidx/androidx,androidx/androidx,androidx/androidx,AndroidX/androidx,aosp-mirror/platform_frameworks_support,AndroidX/androidx,aosp-mirror/platform_frameworks_support,AndroidX/androidx,AndroidX/androidx,androidx/androidx,aosp-mirror/platform_frameworks_support