diff options
3 files changed, 7 insertions, 17 deletions
diff --git a/service/java/com/android/server/wifi/aware/WifiAwareNative.java b/service/java/com/android/server/wifi/aware/WifiAwareNative.java index cdab1a118..90663d1f2 100644 --- a/service/java/com/android/server/wifi/aware/WifiAwareNative.java +++ b/service/java/com/android/server/wifi/aware/WifiAwareNative.java @@ -18,7 +18,6 @@ package com.android.server.wifi.aware; import android.net.wifi.aware.Characteristics; import android.net.wifi.aware.ConfigRequest; -import android.net.wifi.aware.DiscoverySessionCallback; import android.net.wifi.aware.PublishConfig; import android.net.wifi.aware.SubscribeConfig; import android.os.Bundle; @@ -821,10 +820,7 @@ public class WifiAwareNative { private static void onPublishTerminated(int publishId, int status) { if (VDBG) Log.v(TAG, "onPublishTerminated: publishId=" + publishId + ", status=" + status); - sWifiAwareStateManager.onSessionTerminatedNotification(publishId, - status == AWARE_STATUS_SUCCESS - ? DiscoverySessionCallback.TERMINATE_REASON_DONE - : DiscoverySessionCallback.TERMINATE_REASON_FAIL, true); + sWifiAwareStateManager.onSessionTerminatedNotification(publishId, status, true); } // callback from native @@ -833,10 +829,7 @@ public class WifiAwareNative { Log.v(TAG, "onSubscribeTerminated: subscribeId=" + subscribeId + ", status=" + status); } - sWifiAwareStateManager.onSessionTerminatedNotification(subscribeId, - status == AWARE_STATUS_SUCCESS - ? DiscoverySessionCallback.TERMINATE_REASON_DONE - : DiscoverySessionCallback.TERMINATE_REASON_FAIL, false); + sWifiAwareStateManager.onSessionTerminatedNotification(subscribeId, status, false); } // callback from native diff --git a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareHalTest.java b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareHalTest.java index c18e27fcb..d462e1308 100644 --- a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareHalTest.java +++ b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareHalTest.java @@ -23,7 +23,6 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import android.net.wifi.aware.ConfigRequest; -import android.net.wifi.aware.DiscoverySessionCallback; import android.net.wifi.aware.PublishConfig; import android.net.wifi.aware.SubscribeConfig; import android.net.wifi.aware.TlvBufferUtils; @@ -663,7 +662,7 @@ public class WifiAwareHalTest { WifiAwareHalMock.callPublishTerminated(HalMockUtils.convertBundleToJson(args).toString()); verify(mAwareStateManager).onSessionTerminatedNotification(publishId, - DiscoverySessionCallback.TERMINATE_REASON_DONE, true); + WifiAwareNative.AWARE_STATUS_SUCCESS, true); verifyNoMoreInteractions(mAwareStateManager); } @@ -678,7 +677,7 @@ public class WifiAwareHalTest { WifiAwareHalMock.callSubscribeTerminated(HalMockUtils.convertBundleToJson(args).toString()); verify(mAwareStateManager).onSessionTerminatedNotification(subscribeId, - DiscoverySessionCallback.TERMINATE_REASON_FAIL, false); + WifiAwareNative.AWARE_STATUS_INTERNAL_FAILURE, false); verifyNoMoreInteractions(mAwareStateManager); } diff --git a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareStateManagerTest.java b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareStateManagerTest.java index 5ae96d5bb..b5ad7f9f3 100644 --- a/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareStateManagerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/aware/WifiAwareStateManagerTest.java @@ -44,7 +44,6 @@ import android.content.pm.PackageManager; import android.net.ConnectivityManager; import android.net.wifi.RttManager; import android.net.wifi.aware.ConfigRequest; -import android.net.wifi.aware.DiscoverySessionCallback; import android.net.wifi.aware.IWifiAwareDiscoverySessionCallback; import android.net.wifi.aware.IWifiAwareEventCallback; import android.net.wifi.aware.PublishConfig; @@ -490,7 +489,7 @@ public class WifiAwareStateManagerTest { final int uid = 1000; final int pid = 2000; final String callingPackage = "com.google.somePackage"; - final int reasonTerminate = DiscoverySessionCallback.TERMINATE_REASON_DONE; + final int reasonTerminate = WifiAwareNative.AWARE_STATUS_SUCCESS; final int publishId = 15; ConfigRequest configRequest = new ConfigRequest.Builder().build(); @@ -752,7 +751,7 @@ public class WifiAwareStateManagerTest { final int uid = 1000; final int pid = 2000; final String callingPackage = "com.google.somePackage"; - final int reasonTerminate = DiscoverySessionCallback.TERMINATE_REASON_DONE; + final int reasonTerminate = WifiAwareNative.AWARE_STATUS_SUCCESS; final int subscribeId = 15; ConfigRequest configRequest = new ConfigRequest.Builder().build(); @@ -2053,7 +2052,6 @@ public class WifiAwareStateManagerTest { final String serviceName = "some-service-name"; final String ssi = "some much longer and more arbitrary data"; final int publishCount = 7; - final int reason = DiscoverySessionCallback.TERMINATE_REASON_DONE; final int publishId = 22; ConfigRequest configRequest = new ConfigRequest.Builder().setClusterLow(clusterLow) @@ -2109,7 +2107,7 @@ public class WifiAwareStateManagerTest { mMockLooper.dispatchAll(); // (6) got some callback on original publishId - should be ignored - mDut.onSessionTerminatedNotification(publishId, reason, true); + mDut.onSessionTerminatedNotification(publishId, 0, true); mMockLooper.dispatchAll(); verifyNoMoreInteractions(mMockNative, mockCallback, mockSessionCallback); |