Welcome to Android Central! Which device do you have? How do you know wi-fi is turning on automatically -- do you see the wi-fi icon appear in the status bar? Or do you see the toggle switch turn on by itself in the system settings or the swipedown Quick Settings? Or are you only seeing the wi-fi bar appear in the battery graph?
Go to Settings>Location and either tap Improve Accuracy or tap the Menu button and look for a Scanning option. Make sure Wi-fi Scanning is turned off.
But i am confused when i dial *#1234# its shows AP, CP G930P. and CSC G930F i think it is converted in F model firmware kindly share me your idea which firmware i use to flash ? i am in pakistan
Right, but it's conceivable that flashing a different firmware in order to get the CSC you need might also introduce some kind of glitch. It might be interesting to see if this problem happens after re-flashing the original firmware intended for that variant.