Add WaitForProvisioningCallback am: 111d55658b
am: 13daed9fea
* commit '13daed9fea65c45a7aaeff7224833a87a676a1b4':
Add WaitForProvisioningCallback
This commit is contained in:
@@ -109,6 +109,35 @@ public class IpManager extends StateMachine {
|
|||||||
public void onQuit() {}
|
public void onQuit() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class WaitForProvisioningCallback extends Callback {
|
||||||
|
private LinkProperties mCallbackLinkProperties;
|
||||||
|
|
||||||
|
public LinkProperties waitForProvisioning() {
|
||||||
|
synchronized (this) {
|
||||||
|
try {
|
||||||
|
wait();
|
||||||
|
} catch (InterruptedException e) {}
|
||||||
|
return mCallbackLinkProperties;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onProvisioningSuccess(LinkProperties newLp) {
|
||||||
|
synchronized (this) {
|
||||||
|
mCallbackLinkProperties = newLp;
|
||||||
|
notify();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onProvisioningFailure(LinkProperties newLp) {
|
||||||
|
synchronized (this) {
|
||||||
|
mCallbackLinkProperties = null;
|
||||||
|
notify();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class encapsulates parameters to be passed to
|
* This class encapsulates parameters to be passed to
|
||||||
* IpManager#startProvisioning(). A defensive copy is made by IpManager
|
* IpManager#startProvisioning(). A defensive copy is made by IpManager
|
||||||
|
|||||||
Reference in New Issue
Block a user