summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSooraj Sasindran <sasindran@google.com>2019-04-10 23:37:11 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-04-10 23:37:11 +0000
commitc39a5950a0f3eb55f0ab74e985894dbedbb173a1 (patch)
tree9549eb65ef5f2df9e71e8bbde8a9168f9f7949aa
parent42895b066c53f2621e41b3efda6d94d8e9fed523 (diff)
parent73c90cbd0c1b125426e6f19effd3d827f48277ea (diff)
downloadAlternativeNetworkAccess-c39a5950a0f3eb55f0ab74e985894dbedbb173a1.tar.gz
Merge "Update a patch for OpportunisticNetworkService" into qt-dev
-rw-r--r--src/com/android/ons/OpportunisticNetworkService.java9
-rw-r--r--tests/src/com/android/ons/ONSProfileSelectorTest.java3
2 files changed, 4 insertions, 8 deletions
diff --git a/src/com/android/ons/OpportunisticNetworkService.java b/src/com/android/ons/OpportunisticNetworkService.java
index 2ab52a2..14f59a0 100644
--- a/src/com/android/ons/OpportunisticNetworkService.java
+++ b/src/com/android/ons/OpportunisticNetworkService.java
@@ -137,7 +137,7 @@ public class OpportunisticNetworkService extends Service {
if (!mIsEnabled) {
return;
}
- if (mONSConfigInputHashMap.get(SYSTEM_APP_CONFIG_NAME).getAvailableNetworkInfos() != null) {
+ if (mONSConfigInputHashMap.get(SYSTEM_APP_CONFIG_NAME) != null) {
mProfileSelector.startProfileSelection(
mONSConfigInputHashMap.get(SYSTEM_APP_CONFIG_NAME).getAvailableNetworkInfos(),
mONSConfigInputHashMap.get(
@@ -479,13 +479,12 @@ public class OpportunisticNetworkService extends Service {
return;
}
/* reporting unavailability */
- mONSConfigInputHashMap.put(
- SYSTEM_APP_CONFIG_NAME, new ONSConfigInput(null, callbackStub));
+ mONSConfigInputHashMap.put(SYSTEM_APP_CONFIG_NAME, null);
if (mONSConfigInputHashMap.get(CARRIER_APP_CONFIG_NAME) == null) {
mProfileSelector.stopProfileSelection();
- sendUpdateNetworksCallbackHelper(callbackStub,
- TelephonyManager.UPDATE_AVAILABLE_NETWORKS_SUCCESS);
}
+ sendUpdateNetworksCallbackHelper(callbackStub,
+ TelephonyManager.UPDATE_AVAILABLE_NETWORKS_SUCCESS);
}
} finally {
Binder.restoreCallingIdentity(identity);
diff --git a/tests/src/com/android/ons/ONSProfileSelectorTest.java b/tests/src/com/android/ons/ONSProfileSelectorTest.java
index 00011aa..44596a6 100644
--- a/tests/src/com/android/ons/ONSProfileSelectorTest.java
+++ b/tests/src/com/android/ons/ONSProfileSelectorTest.java
@@ -222,9 +222,6 @@ public class ONSProfileSelectorTest extends ONSBaseTest {
Intent callbackIntent = new Intent(MyONSProfileSelector.ACTION_SUB_SWITCH);
callbackIntent.putExtra("sequenceId", 1);
callbackIntent.putExtra("subId", 5);
- //assertFalse(mReady);
- mONSProfileSelector.mProfileSelectorBroadcastReceiverCpy.onReceive(mContext,
- callbackIntent);
waitUntilReady();
assertEquals(TelephonyManager.UPDATE_AVAILABLE_NETWORKS_SUCCESS, mResult);
assertTrue(mReady);