diff options
author | Xiao Ma <xiaom@google.com> | 2019-03-25 15:12:49 +0900 |
---|---|---|
committer | Xiao Ma <xiaom@google.com> | 2019-05-09 10:39:50 +0900 |
commit | 5562cf3d9c24c7979018f918ac6598122297b3af (patch) | |
tree | 33fb5db7d389a0729cbdf097436048e965307669 | |
parent | 88ddd882ad28e5c069b8f0fd4c0474cc9f0c1827 (diff) |
adopt non-blocking method to obtain the IpMemoryStore service.
Test: atest FrameworksNetTests
Change-Id: I7de4f23370bdf9c9df5e74ed074c794080d93d95
-rw-r--r-- | src/android/net/NetworkStackIpMemoryStore.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/android/net/NetworkStackIpMemoryStore.java b/src/android/net/NetworkStackIpMemoryStore.java index 475f826..41715b2 100644 --- a/src/android/net/NetworkStackIpMemoryStore.java +++ b/src/android/net/NetworkStackIpMemoryStore.java @@ -19,6 +19,9 @@ package android.net; import android.annotation.NonNull; import android.content.Context; +import java.util.concurrent.ExecutionException; +import java.util.function.Consumer; + /** * service used to communicate with the ip memory store service in network stack, * which is running in the same module. @@ -35,8 +38,7 @@ public class NetworkStackIpMemoryStore extends IpMemoryStoreClient { } @Override - @NonNull - protected IIpMemoryStore getService() { - return mService; + protected void runWhenServiceReady(Consumer<IIpMemoryStore> cb) throws ExecutionException { + cb.accept(mService); } } |