Skip to content
Commit 21f96258 authored by Ye Jiao's avatar Ye Jiao Committed by Iris Chang
Browse files

Fix getWifiManager exception if phone is encrypted

[Issue Details]
NetworkPolicyManagerService may invoke
dispatchRestrictBackgroundChanged after reboot if settings changed, and
invokes untetherAll in turn, which triggers ServiceNotFoundException
indirectly if the device is under encryption. The cause is that
WifiService is not running if the device is still locked.

[Solution]
In order to avoid ServiceNotFoundException in setWifiTethering, we add
check on return value of getWifiManager. Moreover, check of UsbManager
is also added to prevent potential similar issues of USB tethering.

Bug: 123504004
Test: FrameworksNetTests
  adb shell am instrument -w com.android.frameworks.tests.net
Test: CTS - CtsNetTestCases
  ANDROID_BUILD_droid-cts/tools/cts-tradefed run cts -m CtsNetTestCases
Test: CTS - CtsNetTestCasesLegacyApi22
  ANDROID_BUILD_droid-cts/tools/cts-tradefed run cts -m
  CtsNetTestCasesLegacyApi22
Test: CTS - CtsNetTestCasesLegacyPermission22
  ANDROID_BUILD_droid-cts/tools/cts-tradefed run cts -m
  CtsNetTestCasesLegacyPermission22

Change-Id: I2643188b51900f97ba58c8614c66cb55ebfaa2f6
parent 09e3d8c3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment