Merge "Remove InterruptedException from NsdService#create"
This commit is contained in:
@@ -123,12 +123,8 @@ public final class ConnectivityServiceInitializer extends SystemService {
|
|||||||
/** Return NsdService instance or null if current SDK is lower than T */
|
/** Return NsdService instance or null if current SDK is lower than T */
|
||||||
private NsdService createNsdService(final Context context) {
|
private NsdService createNsdService(final Context context) {
|
||||||
if (!SdkLevel.isAtLeastT()) return null;
|
if (!SdkLevel.isAtLeastT()) return null;
|
||||||
try {
|
|
||||||
return NsdService.create(context);
|
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 */
|
/** Return Nearby service instance or null if current SDK is lower than T */
|
||||||
|
|||||||
@@ -600,7 +600,7 @@ public class NsdService extends INsdManager.Stub {
|
|||||||
mMDnsEventCallback = new MDnsEventCallback(mNsdStateMachine);
|
mMDnsEventCallback = new MDnsEventCallback(mNsdStateMachine);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static NsdService create(Context context) throws InterruptedException {
|
public static NsdService create(Context context) {
|
||||||
HandlerThread thread = new HandlerThread(TAG);
|
HandlerThread thread = new HandlerThread(TAG);
|
||||||
thread.start();
|
thread.start();
|
||||||
Handler handler = new Handler(thread.getLooper());
|
Handler handler = new Handler(thread.getLooper());
|
||||||
|
|||||||
Reference in New Issue
Block a user