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

Commit 5562cf3d authored by Xiao Ma's avatar Xiao Ma
Browse files

adopt non-blocking method to obtain the IpMemoryStore service.

Test: atest FrameworksNetTests
Change-Id: I7de4f23370bdf9c9df5e74ed074c794080d93d95
parent 88ddd882
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;
    }
    }
}
}