Does this issue still happen when your phone is in safe mode?
Have you tried clearing the cache partition on your phone?
- Turn off the device.
- Press and hold the Volume Up key and the Bixby / Power key.
- When the Android logo displays, release both keys.
- An 'Installing system update' message may show briefly before the Android Recovery menu options appear.
- Press the Volume down key several times to highlight Wipe cache partition.
- Press Bixby / Power key to select.
- Press the Volume down key to highlight Yes, then press the Bixby / Power key to select.
- When the process is complete, Reboot system now is highlighted.
- Press the Bixby / Power key to restart the device.
I found the solution for my phone. I had enabled 'sensors off' in developer mode (under Quick settings developer tiles) and then later decided against it, so I disabled it. Somehow it stayed on in notifications when it was enabled, and apparently was still on when I removed the button. I went back in and enabled the icon, tapped it off and then camera and mic worked again. Whew!