Since 2015, immigration authorities in Germany, for example, have been allowed to search the devices of people who are required to leave the country in order to establish their identity and country of origin. This often happens during official visits. Therefore, leave your device at home or get a burner phone.