Fix Settings crash issue

- Add conditional checks to avoid UI updates when the fragment is
finishing or destoryed.

- Add conditional checks to avoid UI updates if the fragment resource is
not ready.

Bug: 185756174
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=NetworkProviderSettingsTest

Change-Id: I506ee81985158b8992529440a31d2d5cfe81f441
Merged-In: I506ee81985158b8992529440a31d2d5cfe81f441
(cherry picked from commit 1caaf7447deb43831a2384507b1200f29f6a9aeb)
1 file changed