Replace runWithScissors with a custom implementation.
This is not any better than the previous code though... But it should behave the same. Test: FrameworksNetTests Change-Id: Ia3d379681cb0f17dd5f86062b7cfe84f1547fadb
This commit is contained in:
@@ -34,6 +34,7 @@ import android.net.IpConfiguration.ProxySettings;
|
||||
import android.net.LinkAddress;
|
||||
import android.net.NetworkCapabilities;
|
||||
import android.net.StaticIpConfiguration;
|
||||
import android.os.ConditionVariable;
|
||||
import android.os.Handler;
|
||||
import android.os.RemoteCallbackList;
|
||||
import android.os.RemoteException;
|
||||
@@ -662,7 +663,13 @@ public class EthernetTracker {
|
||||
}
|
||||
|
||||
private void postAndWaitForRunnable(Runnable r) {
|
||||
mHandler.runWithScissors(r, 2000L /* timeout */);
|
||||
final ConditionVariable cv = new ConditionVariable();
|
||||
if (mHandler.post(() -> {
|
||||
r.run();
|
||||
cv.open();
|
||||
})) {
|
||||
cv.block(2000L);
|
||||
}
|
||||
}
|
||||
|
||||
void dump(FileDescriptor fd, IndentingPrintWriter pw, String[] args) {
|
||||
|
||||
Reference in New Issue
Block a user