Merge "Update AMS to wait for network state update if requested by the main thread."