diff options
author | Chalard Jean <jchalard@google.com> | 2019-04-01 11:40:09 +0900 |
---|---|---|
committer | Chalard Jean <jchalard@google.com> | 2019-04-03 14:45:24 +0900 |
commit | 67ba08bef8354f16025d06788df525fc6ad265f7 (patch) | |
tree | d067b8bfe1311600157fae74a44824262174f74b | |
parent | 7da1c005ae579ae742b333b7da30c457a1aba9ea (diff) |
Adjust interface for the simplification in ag/6875453
Bug: None
Test: FrameworksWifiTests
Change-Id: I9592a85aa8bc146c1549a2bead8a41fb30744946
-rw-r--r-- | service/java/com/android/server/wifi/MemoryStoreImpl.java | 12 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/MemoryStoreImplTest.java | 12 |
2 files changed, 9 insertions, 15 deletions
diff --git a/service/java/com/android/server/wifi/MemoryStoreImpl.java b/service/java/com/android/server/wifi/MemoryStoreImpl.java index 38bb4598a..3d9e7626b 100644 --- a/service/java/com/android/server/wifi/MemoryStoreImpl.java +++ b/service/java/com/android/server/wifi/MemoryStoreImpl.java @@ -21,6 +21,7 @@ import android.annotation.Nullable; import android.content.Context; import android.net.IpMemoryStore; import android.net.ipmemorystore.Blob; +import android.net.ipmemorystore.Status; import android.util.Log; import com.android.internal.util.Preconditions; @@ -82,8 +83,7 @@ final class MemoryStoreImpl implements WifiScoreCard.MemoryStore { * */ private static class CatchAFallingBlob - extends android.net.ipmemorystore.IOnBlobRetrievedListener.Default - implements android.net.ipmemorystore.IOnBlobRetrievedListener { + implements android.net.ipmemorystore.OnBlobRetrievedListener { private final String mL2Key; private final WifiScoreCard.BlobListener mBlobListener; @@ -93,13 +93,7 @@ final class MemoryStoreImpl implements WifiScoreCard.MemoryStore { } @Override - public void onBlobRetrieved( - android.net.ipmemorystore.StatusParcelable statusParcelable, - String l2Key, - String name, - Blob data) { - android.net.ipmemorystore.Status status = - new android.net.ipmemorystore.Status(statusParcelable); + public void onBlobRetrieved(Status status, String l2Key, String name, Blob data) { if (!Objects.equals(mL2Key, l2Key)) { throw new IllegalArgumentException("l2Key does not match request"); } diff --git a/tests/wifitests/src/com/android/server/wifi/MemoryStoreImplTest.java b/tests/wifitests/src/com/android/server/wifi/MemoryStoreImplTest.java index d5ffd2717..a4ac1e8c3 100644 --- a/tests/wifitests/src/com/android/server/wifi/MemoryStoreImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/MemoryStoreImplTest.java @@ -112,23 +112,23 @@ public class MemoryStoreImplTest { eq(myL2Key), // String l2Key eq(MemoryStoreImpl.WIFI_FRAMEWORK_IP_MEMORY_STORE_CLIENT_ID), // String clientId eq(MemoryStoreImpl.WIFI_FRAMEWORK_IP_MEMORY_STORE_DATA_NAME), // String name - mIOnBlobRetrievedListenerCaptor.capture()); + mOnBlobRetrievedListenerCaptor.capture()); verifyNoMoreInteractions(mIpMemoryStore, mBlobListener); // Now simulate the completion of the read request final android.net.ipmemorystore.Blob wrappedBlob = new android.net.ipmemorystore.Blob(); wrappedBlob.data = myBlob; - mIOnBlobRetrievedListenerCaptor.getValue() + mOnBlobRetrievedListenerCaptor.getValue() .onBlobRetrieved( - statusSuccess.toParcelable(), + statusSuccess, myL2Key, MemoryStoreImpl.WIFI_FRAMEWORK_IP_MEMORY_STORE_DATA_NAME, wrappedBlob); verify(mBlobListener).onBlobRetrieved(mBytesCaptor.capture()); assertArrayEquals(myBlob, mBytesCaptor.getValue()); } - final ArgumentCaptor<android.net.ipmemorystore.IOnBlobRetrievedListener> - mIOnBlobRetrievedListenerCaptor = - ArgumentCaptor.forClass(android.net.ipmemorystore.IOnBlobRetrievedListener.class); + final ArgumentCaptor<android.net.ipmemorystore.OnBlobRetrievedListener> + mOnBlobRetrievedListenerCaptor = + ArgumentCaptor.forClass(android.net.ipmemorystore.OnBlobRetrievedListener.class); final ArgumentCaptor<byte[]> mBytesCaptor = ArgumentCaptor.forClass(byte[].class); |