cbb2c1d52a
This is a partial revert of http://ag/738523 , but not a full revert because M apps that have gone through the WRITE_SETTINGS route to obtain permission to change network state should continue to have permission to do so. Specifically: 1. Change the protection level of CHANGE_NETWORK_STATE back from "signature|preinstalled|appop|pre23" to "normal". This allows apps that declare CHANGE_NETWORK_STATE in their manifest to acquire it, even if they target the M SDK or above. 2. Change the ConnectivityManager permission checks so that they first check CHANGE_NETWORK_STATE, and then ask Settings if the app has the WRITE_SETTINGS runtime permission. 3. Slightly simplify the code in the Settings provider code that deals specifically with the ability to change network state. 4. Make the ConnectivityService permissions checks use the ConnectivityManager code to avoid code duplication. 5. Update the ConnectivityManager public Javadoc to list both CHANGE_NETWORK_STATE and WRITE_SETTINGS. Bug: 21588539 Bug: 23597341 Change-Id: Ic06a26517c95f9ad94183f6d126fd0de45de346e