Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8586fedf authored by Xiao Ma's avatar Xiao Ma
Browse files

adopt non-blocking method to obtain the IpMemoryStore service.

Bug: 131133347
Test: atest FrameworksNetTests
Merged-In: I7de4f23370bdf9c9df5e74ed074c794080d93d95
Merged-In: If0d43f21710ca31149610d3e6a5f0d7e4acc11a2

Change-Id: If0d43f21710ca31149610d3e6a5f0d7e4acc11a2
(cherry picked from commit c4e4fd7beeda36c84548c7bb4a16312f20bdf188)
parent fdc099fb
Loading
Loading
Loading
Loading
+5 −3
Original line number Original line Diff line number Diff line
@@ -19,6 +19,9 @@ package android.net;
import android.annotation.NonNull;
import android.annotation.NonNull;
import android.content.Context;
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,
 * service used to communicate with the ip memory store service in network stack,
 * which is running in the same module.
 * which is running in the same module.
@@ -35,8 +38,7 @@ public class NetworkStackIpMemoryStore extends IpMemoryStoreClient {
    }
    }


    @Override
    @Override
    @NonNull
    protected void runWhenServiceReady(Consumer<IIpMemoryStore> cb) throws ExecutionException {
    protected IIpMemoryStore getService() {
        cb.accept(mService);
        return mService;
    }
    }
}
}