It is not by you uploading your data to the government. It’s not like that. There is a tool developed by the civil society called Pandemic.Events that download your location history from Google, for example, and compare it on your phone with the Diamond Princess travel history. The result is kept strictly on your phone and not shared to anybody else.