WifiServiceImpl: use context to check network settings

Instead of using the ActivityManager to check the NETWORK_SETTINGS
permission by uid, use the context.  This will allow the shell
to pass the permission check.

To limit the scope of this change, the check is fixed locally in
WifiServiceImpl.  WifiConfigManager also uses the WifiPermissionsUtil
helper method that checks the permission via the ActivityManager.
Switching the helper method will be a much bigger change since it would
involve plumbing the pid through several layers of calls and it is not
triggered via a shell command, so the existing permission check will
work as is.

Bug: 64683466
Test: manually verified wifi can be toggled when airplane mode is active
Change-Id: I198b364fcc9c08f4f0dc6f89141b55c9a668bb75
2 files changed