In what ways can mandating access to smartphone source codes for security purposes affect user privacy and national security?

The government is proposing that smartphone makers provide source code access for security reasons. I want to understand the balance between enhancing security and protecting user privacy in such situations.