WifiServiceImpl: setWifiEnabled permission check

Instead of using the package name to determine if the caller of
setWifiEnabled is from settings or sysui, switch over to use the
NETWORK_SETTINGS permission.  This permission check will be done to
avoid stopping softap mode by third-party apps.

Bug: 38163947
Test: frameworks/base/wifi/tests/runtests.sh
Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: manually tested attempting to enable wifi from settings, quick
settings and quick quick settings when wifi tethering was active
Test: cts-tradefed run cts-dev --module CtsNetTestCases -t
android.net.wifi.cts.WifiManagerTest#testSetWifiEnabledByAppDoesNotStopHotspot

Merged-In: I05a3cab6bc2b4b725badcbb7416f3f5bcd0dc3e9

Change-Id: I05a3cab6bc2b4b725badcbb7416f3f5bcd0dc3e9
2 files changed
tree: be41b05a571d8221c26982575649c8a62160f069
  1. service/
  2. PREUPLOAD.cfg