Remove try/catch of UnsupportedOperationException
registerLocalOnlyHotspotSoftApCallback implementation is availble in
AOSP, remove unnecessary UnsupportedOperationException catch.
Bug: 240113156
Test: device can boot sucessfully
Change-Id: If010879ddc58285cf01cc8794b4c3ded7d0b0316
diff --git a/Tethering/src/com/android/networkstack/tethering/Tethering.java b/Tethering/src/com/android/networkstack/tethering/Tethering.java
index 1f3fc11..c2cf92c 100644
--- a/Tethering/src/com/android/networkstack/tethering/Tethering.java
+++ b/Tethering/src/com/android/networkstack/tethering/Tethering.java
@@ -477,17 +477,10 @@
wifiManager.registerSoftApCallback(mExecutor, softApCallback);
}
if (SdkLevel.isAtLeastT() && wifiManager != null) {
- try {
- // Although WifiManager#registerLocalOnlyHotspotSoftApCallback document that it need
- // NEARBY_WIFI_DEVICES permission, but actually a caller who have NETWORK_STACK
- // or MAINLINE_NETWORK_STACK permission would also able to use this API.
- wifiManager.registerLocalOnlyHotspotSoftApCallback(mExecutor, softApCallback);
- } catch (UnsupportedOperationException e) {
- // Since wifi module development in internal branch,
- // #registerLocalOnlyHotspotSoftApCallback currently doesn't supported in AOSP
- // before AOSP switch to Android T + 1.
- Log.wtf(TAG, "registerLocalOnlyHotspotSoftApCallback API is not supported");
- }
+ // Although WifiManager#registerLocalOnlyHotspotSoftApCallback document that it need
+ // NEARBY_WIFI_DEVICES permission, but actually a caller who have NETWORK_STACK
+ // or MAINLINE_NETWORK_STACK permission would also able to use this API.
+ wifiManager.registerLocalOnlyHotspotSoftApCallback(mExecutor, softApCallback);
}
startTrackDefaultNetwork();