If you do not experience unwanted ads when your phone is in this mode, the adware is from your installed apps. Antivirus and anti-malware software can detect and remove adware from your device.