Merge "Remove InterruptedException from NsdService#create"

This commit is contained in:
Paul Hu
2022-04-11 09:49:09 +00:00
committed by Gerrit Code Review
2 changed files with 3 additions and 7 deletions

View File

@@ -123,12 +123,8 @@ public final class ConnectivityServiceInitializer extends SystemService {
/** Return NsdService instance or null if current SDK is lower than T */
private NsdService createNsdService(final Context context) {
if (!SdkLevel.isAtLeastT()) return null;
try {
return NsdService.create(context);
} catch (InterruptedException e) {
Log.d(TAG, "Unable to get NSD service", e);
return null;
}
}
/** Return Nearby service instance or null if current SDK is lower than T */

View File

@@ -600,7 +600,7 @@ public class NsdService extends INsdManager.Stub {
mMDnsEventCallback = new MDnsEventCallback(mNsdStateMachine);
}
public static NsdService create(Context context) throws InterruptedException {
public static NsdService create(Context context) {
HandlerThread thread = new HandlerThread(TAG);
thread.start();
Handler handler = new Handler(thread.getLooper());