Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014, The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package com.android.telecomm; |
| 18 | |
Ben Gilad | c5b2269 | 2014-02-18 20:03:22 -0800 | [diff] [blame] | 19 | import android.telecomm.CallServiceDescriptor; |
Sailesh Nepal | b6141ae | 2014-02-18 08:45:26 -0800 | [diff] [blame] | 20 | |
Ben Gilad | 6192561 | 2014-03-11 19:06:36 -0700 | [diff] [blame] | 21 | import com.google.android.collect.Sets; |
Ben Gilad | 6192561 | 2014-03-11 19:06:36 -0700 | [diff] [blame] | 22 | import com.google.common.collect.Lists; |
Santos Cordon | 766d04f | 2014-05-06 10:28:25 -0700 | [diff] [blame^] | 23 | import com.google.common.collect.Maps; |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 24 | |
Sailesh Nepal | 18386a8 | 2014-03-19 10:22:40 -0700 | [diff] [blame] | 25 | import java.util.Collection; |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 26 | import java.util.Iterator; |
| 27 | import java.util.List; |
| 28 | import java.util.Map; |
| 29 | import java.util.Set; |
| 30 | |
| 31 | /** |
| 32 | * Utility class to place a call using the specified set of call-services and ordered selectors. |
Ben Gilad | c5b2269 | 2014-02-18 20:03:22 -0800 | [diff] [blame] | 33 | * Iterates through the selectors and gets a sorted list of supported call-service descriptors |
| 34 | * for each selector. Upon receiving each sorted list (one list per selector), each of the |
| 35 | * corresponding call services is then attempted until either the outgoing call is placed, the |
| 36 | * attempted call is aborted (by the switchboard), or the list is exhausted -- whichever occurs |
| 37 | * first. |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 38 | * |
Santos Cordon | 681663d | 2014-01-30 04:32:15 -0800 | [diff] [blame] | 39 | * Except for the abort case, all other scenarios should terminate with the switchboard notified |
| 40 | * of the result. |
Ben Gilad | d88323b | 2014-01-29 19:03:19 -0800 | [diff] [blame] | 41 | * |
| 42 | * NOTE(gilad): Currently operating under the assumption that we'll have one timeout per (outgoing) |
| 43 | * call attempt. If we (also) like to timeout individual selectors and/or call services, the code |
| 44 | * here will need to be re-factored (quite a bit) to support that. |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 45 | */ |
| 46 | final class OutgoingCallProcessor { |
| 47 | |
| 48 | /** |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 49 | * The outgoing call this processor is tasked with placing. |
| 50 | */ |
| 51 | private final Call mCall; |
| 52 | |
| 53 | /** |
Ben Gilad | c5b2269 | 2014-02-18 20:03:22 -0800 | [diff] [blame] | 54 | * The duplicate-free list of currently-available call-service descriptors. |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 55 | */ |
Ben Gilad | c5b2269 | 2014-02-18 20:03:22 -0800 | [diff] [blame] | 56 | private final List<CallServiceDescriptor> mCallServiceDescriptors = Lists.newArrayList(); |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 57 | |
| 58 | /** |
Sailesh Nepal | b6141ae | 2014-02-18 08:45:26 -0800 | [diff] [blame] | 59 | * The map of currently-available call-service implementations keyed by call-service ID. |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 60 | */ |
Sailesh Nepal | b6141ae | 2014-02-18 08:45:26 -0800 | [diff] [blame] | 61 | private final Map<String, CallServiceWrapper> mCallServicesById = Maps.newHashMap(); |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 62 | |
| 63 | /** |
Ben Gilad | 6192561 | 2014-03-11 19:06:36 -0700 | [diff] [blame] | 64 | * The set of attempted call services, used to ensure services are attempted at most once per |
| 65 | * outgoing-call attempt. |
| 66 | */ |
| 67 | private final Set<CallServiceWrapper> mAttemptedCallServices = Sets.newHashSet(); |
| 68 | |
| 69 | /** |
| 70 | * The set of incompatible call services, used to suppress unnecessary call switching attempts. |
| 71 | */ |
| 72 | private final Set<CallServiceWrapper> mIncompatibleCallServices = Sets.newHashSet(); |
| 73 | |
| 74 | /** |
Ben Gilad | 28e8ad6 | 2014-03-06 17:01:54 -0800 | [diff] [blame] | 75 | * The list of currently-available call-service selector implementations. |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 76 | */ |
Sailesh Nepal | 18386a8 | 2014-03-19 10:22:40 -0700 | [diff] [blame] | 77 | private final Collection<CallServiceSelectorWrapper> mSelectors; |
Ben Gilad | d88323b | 2014-01-29 19:03:19 -0800 | [diff] [blame] | 78 | |
Santos Cordon | 681663d | 2014-01-30 04:32:15 -0800 | [diff] [blame] | 79 | /** Manages all outgoing call processors. */ |
| 80 | private final OutgoingCallsManager mOutgoingCallsManager; |
| 81 | |
| 82 | private final Switchboard mSwitchboard; |
| 83 | |
Ben Gilad | 6192561 | 2014-03-11 19:06:36 -0700 | [diff] [blame] | 84 | private final Runnable mNextCallServiceCallback = new Runnable() { |
| 85 | @Override public void run() { |
| 86 | attemptNextCallService(); |
| 87 | } |
| 88 | }; |
| 89 | |
Sailesh Nepal | 18386a8 | 2014-03-19 10:22:40 -0700 | [diff] [blame] | 90 | private final Runnable mNextSelectorCallback = new Runnable() { |
| 91 | @Override public void run() { |
| 92 | attemptNextSelector(); |
| 93 | } |
| 94 | }; |
| 95 | |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 96 | /** |
Ben Gilad | c5b2269 | 2014-02-18 20:03:22 -0800 | [diff] [blame] | 97 | * The iterator over the currently-selected ordered list of call-service descriptors. |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 98 | */ |
Ben Gilad | c5b2269 | 2014-02-18 20:03:22 -0800 | [diff] [blame] | 99 | private Iterator<CallServiceDescriptor> mCallServiceDescriptorIterator; |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 100 | |
Sailesh Nepal | 18386a8 | 2014-03-19 10:22:40 -0700 | [diff] [blame] | 101 | private Iterator<CallServiceSelectorWrapper> mSelectorIterator; |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 102 | |
| 103 | private boolean mIsAborted = false; |
| 104 | |
| 105 | /** |
| 106 | * Persists the specified parameters and iterates through the prioritized list of selectors |
| 107 | * passing to each selector (read-only versions of) the call object and all available call- |
Ben Gilad | c5b2269 | 2014-02-18 20:03:22 -0800 | [diff] [blame] | 108 | * service descriptors. Stops once a matching selector is found. Calls with no matching |
| 109 | * selectors will eventually be killed by the cleanup/monitor switchboard handler, which will |
| 110 | * in turn call the abort method of this processor via {@link OutgoingCallsManager}. |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 111 | * |
| 112 | * @param call The call to place. |
| 113 | * @param callServices The available call-service implementations. |
| 114 | * @param selectors The available call-service selector implementations. |
Santos Cordon | 681663d | 2014-01-30 04:32:15 -0800 | [diff] [blame] | 115 | * @param outgoingCallsManager Manager of all outgoing call processors. |
| 116 | * @param switchboard The switchboard. |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 117 | */ |
| 118 | OutgoingCallProcessor( |
| 119 | Call call, |
Santos Cordon | c195e36 | 2014-02-11 17:05:31 -0800 | [diff] [blame] | 120 | Set<CallServiceWrapper> callServices, |
Sailesh Nepal | 18386a8 | 2014-03-19 10:22:40 -0700 | [diff] [blame] | 121 | Collection<CallServiceSelectorWrapper> selectors, |
Santos Cordon | 681663d | 2014-01-30 04:32:15 -0800 | [diff] [blame] | 122 | OutgoingCallsManager outgoingCallsManager, |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 123 | Switchboard switchboard) { |
| 124 | |
Ben Gilad | d88323b | 2014-01-29 19:03:19 -0800 | [diff] [blame] | 125 | ThreadUtil.checkOnMainThread(); |
| 126 | |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 127 | mCall = call; |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 128 | mSelectors = selectors; |
Santos Cordon | 681663d | 2014-01-30 04:32:15 -0800 | [diff] [blame] | 129 | mOutgoingCallsManager = outgoingCallsManager; |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 130 | mSwitchboard = switchboard; |
| 131 | |
Ben Gilad | c5b2269 | 2014-02-18 20:03:22 -0800 | [diff] [blame] | 132 | // Populate the list and map of call-service descriptors. The list is needed since |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 133 | // it's being passed down to selectors. |
Santos Cordon | c195e36 | 2014-02-11 17:05:31 -0800 | [diff] [blame] | 134 | for (CallServiceWrapper callService : callServices) { |
Ben Gilad | c5b2269 | 2014-02-18 20:03:22 -0800 | [diff] [blame] | 135 | CallServiceDescriptor descriptor = callService.getDescriptor(); |
| 136 | mCallServiceDescriptors.add(descriptor); |
| 137 | mCallServicesById.put(descriptor.getCallServiceId(), callService); |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 138 | } |
| 139 | } |
| 140 | |
| 141 | /** |
| 142 | * Initiates the attempt to place the call. No-op beyond the first invocation. |
| 143 | */ |
| 144 | void process() { |
Sailesh Nepal | 810735e | 2014-03-18 18:15:46 -0700 | [diff] [blame] | 145 | Log.v(this, "process, mIsAborted: %b", mIsAborted); |
Ben Gilad | 28e8ad6 | 2014-03-06 17:01:54 -0800 | [diff] [blame] | 146 | if (!mIsAborted) { |
| 147 | // Only process un-aborted calls. |
| 148 | ThreadUtil.checkOnMainThread(); |
Ben Gilad | d88323b | 2014-01-29 19:03:19 -0800 | [diff] [blame] | 149 | |
Ben Gilad | 28e8ad6 | 2014-03-06 17:01:54 -0800 | [diff] [blame] | 150 | if (mSelectorIterator == null) { |
| 151 | mSelectorIterator = mSelectors.iterator(); |
| 152 | attemptNextSelector(); |
| 153 | } |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 154 | } |
| 155 | } |
| 156 | |
| 157 | /** |
Ben Gilad | 6192561 | 2014-03-11 19:06:36 -0700 | [diff] [blame] | 158 | * Handles the specified compatibility status from the call-service implementation. |
| 159 | * TODO(gilad): Consider making this class stateful, potentially rejecting out-of-order/ |
| 160 | * unexpected invocations (i.e. beyond checking for unexpected call IDs). |
| 161 | * |
Ben Gilad | 6192561 | 2014-03-11 19:06:36 -0700 | [diff] [blame] | 162 | * @param isCompatible True if the call-service is compatible with the corresponding call and |
| 163 | * false otherwise. |
| 164 | */ |
Sailesh Nepal | e59bb19 | 2014-04-01 18:33:59 -0700 | [diff] [blame] | 165 | void setIsCompatibleWith(Call call, boolean isCompatible) { |
| 166 | Log.v(this, "setIsCompatibleWith, call: %s, isCompatible: %b", call, isCompatible); |
| 167 | if (call != mCall) { |
| 168 | Log.wtf(this, "setIsCompatibleWith invoked with unexpected call: %s, expected call: %s", |
| 169 | call, mCall); |
Sailesh Nepal | 810735e | 2014-03-18 18:15:46 -0700 | [diff] [blame] | 170 | return; |
| 171 | } |
Ben Gilad | 6192561 | 2014-03-11 19:06:36 -0700 | [diff] [blame] | 172 | |
Sailesh Nepal | 810735e | 2014-03-18 18:15:46 -0700 | [diff] [blame] | 173 | if (!mIsAborted) { |
| 174 | CallServiceWrapper callService = mCall.getCallService(); |
| 175 | if (callService != null) { |
| 176 | if (isCompatible) { |
Sailesh Nepal | e59bb19 | 2014-04-01 18:33:59 -0700 | [diff] [blame] | 177 | callService.call(mCall); |
Sailesh Nepal | 810735e | 2014-03-18 18:15:46 -0700 | [diff] [blame] | 178 | return; |
| 179 | } |
| 180 | mIncompatibleCallServices.add(callService); |
| 181 | } |
| 182 | attemptNextCallService(); |
| 183 | } |
Ben Gilad | 6192561 | 2014-03-11 19:06:36 -0700 | [diff] [blame] | 184 | } |
| 185 | |
| 186 | /** |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 187 | * Aborts the attempt to place the relevant call. Intended to be invoked by |
Santos Cordon | 681663d | 2014-01-30 04:32:15 -0800 | [diff] [blame] | 188 | * switchboard through the outgoing-calls manager. |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 189 | */ |
| 190 | void abort() { |
Sailesh Nepal | 810735e | 2014-03-18 18:15:46 -0700 | [diff] [blame] | 191 | Log.v(this, "abort"); |
Ben Gilad | 9c23411 | 2014-03-04 16:07:33 -0800 | [diff] [blame] | 192 | ThreadUtil.checkOnMainThread(); |
| 193 | if (!mIsAborted) { |
Ben Gilad | 9c23411 | 2014-03-04 16:07:33 -0800 | [diff] [blame] | 194 | mIsAborted = true; |
Sailesh Nepal | e59bb19 | 2014-04-01 18:33:59 -0700 | [diff] [blame] | 195 | // This will also clear the call's call service and selector. |
Sailesh Nepal | 810735e | 2014-03-18 18:15:46 -0700 | [diff] [blame] | 196 | mOutgoingCallsManager.handleFailedOutgoingCall(mCall, true /* isAborted */); |
Ben Gilad | 9c23411 | 2014-03-04 16:07:33 -0800 | [diff] [blame] | 197 | } |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 198 | } |
| 199 | |
| 200 | /** |
Santos Cordon | 681663d | 2014-01-30 04:32:15 -0800 | [diff] [blame] | 201 | * Completes the outgoing call sequence by setting the call service on the call object. This is |
| 202 | * invoked when the call service adapter receives positive confirmation that the call service |
| 203 | * placed the call. |
| 204 | */ |
| 205 | void handleSuccessfulCallAttempt() { |
Sailesh Nepal | 810735e | 2014-03-18 18:15:46 -0700 | [diff] [blame] | 206 | Log.v(this, "handleSuccessfulCallAttempt"); |
Ben Gilad | 8e55d1d | 2014-02-26 16:25:56 -0800 | [diff] [blame] | 207 | ThreadUtil.checkOnMainThread(); |
| 208 | |
| 209 | if (mIsAborted) { |
| 210 | // TODO(gilad): Ask the call service to drop the call? |
| 211 | return; |
| 212 | } |
| 213 | |
Ben Gilad | 6192561 | 2014-03-11 19:06:36 -0700 | [diff] [blame] | 214 | for (CallServiceWrapper callService : mIncompatibleCallServices) { |
| 215 | mCall.addIncompatibleCallService(callService); |
| 216 | } |
Santos Cordon | 681663d | 2014-01-30 04:32:15 -0800 | [diff] [blame] | 217 | mSwitchboard.handleSuccessfulOutgoingCall(mCall); |
| 218 | } |
| 219 | |
| 220 | /** |
| 221 | * Attempts the next call service if the specified call service is the one currently being |
| 222 | * attempted. |
| 223 | * |
| 224 | * @param reason The call-service supplied reason for the failed call attempt. |
| 225 | */ |
| 226 | void handleFailedCallAttempt(String reason) { |
Sailesh Nepal | 810735e | 2014-03-18 18:15:46 -0700 | [diff] [blame] | 227 | Log.v(this, "handleFailedCallAttempt"); |
Ben Gilad | 28e8ad6 | 2014-03-06 17:01:54 -0800 | [diff] [blame] | 228 | if (!mIsAborted) { |
| 229 | ThreadUtil.checkOnMainThread(); |
Ben Gilad | 28e8ad6 | 2014-03-06 17:01:54 -0800 | [diff] [blame] | 230 | attemptNextCallService(); |
| 231 | } |
Santos Cordon | 681663d | 2014-01-30 04:32:15 -0800 | [diff] [blame] | 232 | } |
| 233 | |
| 234 | /** |
Sailesh Nepal | 6ab6fb7 | 2014-04-01 20:03:19 -0700 | [diff] [blame] | 235 | * Persists the ordered-list of call-service descriptor as selected by the current selector and |
| 236 | * starts iterating through the corresponding call services continuing the attempt to place the |
| 237 | * call. |
| 238 | * |
| 239 | * @param descriptors The (ordered) list of call-service descriptor. |
| 240 | */ |
| 241 | void processSelectedCallServices(List<CallServiceDescriptor> descriptors) { |
| 242 | Log.v(this, "processSelectedCallServices"); |
| 243 | if (descriptors == null || descriptors.isEmpty()) { |
| 244 | attemptNextSelector(); |
| 245 | } else if (mCallServiceDescriptorIterator == null) { |
| 246 | mCallServiceDescriptorIterator = descriptors.iterator(); |
| 247 | attemptNextCallService(); |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | /** |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 252 | * Attempts to place the call using the next selector, no-op if no other selectors |
| 253 | * are available. |
| 254 | */ |
| 255 | private void attemptNextSelector() { |
Sailesh Nepal | 810735e | 2014-03-18 18:15:46 -0700 | [diff] [blame] | 256 | Log.v(this, "attemptNextSelector, mIsAborted: %b", mIsAborted); |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 257 | if (mIsAborted) { |
| 258 | return; |
| 259 | } |
| 260 | |
| 261 | if (mSelectorIterator.hasNext()) { |
Sailesh Nepal | 18386a8 | 2014-03-19 10:22:40 -0700 | [diff] [blame] | 262 | CallServiceSelectorWrapper selector = mSelectorIterator.next(); |
Ben Gilad | 8e55d1d | 2014-02-26 16:25:56 -0800 | [diff] [blame] | 263 | mCall.setCallServiceSelector(selector); |
Sailesh Nepal | 6ab6fb7 | 2014-04-01 20:03:19 -0700 | [diff] [blame] | 264 | selector.select(mCall, mCallServiceDescriptors, mNextSelectorCallback); |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 265 | } else { |
Sailesh Nepal | 810735e | 2014-03-18 18:15:46 -0700 | [diff] [blame] | 266 | Log.v(this, "attemptNextSelector, no more selectors, failing"); |
Sailesh Nepal | e59bb19 | 2014-04-01 18:33:59 -0700 | [diff] [blame] | 267 | mCall.clearCallServiceSelector(); |
Sailesh Nepal | 810735e | 2014-03-18 18:15:46 -0700 | [diff] [blame] | 268 | mOutgoingCallsManager.handleFailedOutgoingCall(mCall, false /* isAborted */); |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 269 | } |
| 270 | } |
| 271 | |
| 272 | /** |
Ben Gilad | c5b2269 | 2014-02-18 20:03:22 -0800 | [diff] [blame] | 273 | * Attempts to place the call using the call service specified by the next call-service |
| 274 | * descriptor of mCallServiceDescriptorIterator. If there are no more call services to |
| 275 | * attempt, the process continues to the next call-service selector via |
| 276 | * {@link #attemptNextSelector}. |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 277 | */ |
| 278 | private void attemptNextCallService() { |
Sailesh Nepal | 810735e | 2014-03-18 18:15:46 -0700 | [diff] [blame] | 279 | Log.v(this, "attemptNextCallService, mIsAborted: %b", mIsAborted); |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 280 | if (mIsAborted) { |
| 281 | return; |
| 282 | } |
| 283 | |
Evan Charlton | f02e988 | 2014-03-06 12:54:52 -0800 | [diff] [blame] | 284 | if (mCallServiceDescriptorIterator != null && mCallServiceDescriptorIterator.hasNext()) { |
Ben Gilad | c5b2269 | 2014-02-18 20:03:22 -0800 | [diff] [blame] | 285 | CallServiceDescriptor descriptor = mCallServiceDescriptorIterator.next(); |
Ben Gilad | 8e55d1d | 2014-02-26 16:25:56 -0800 | [diff] [blame] | 286 | final CallServiceWrapper callService = |
| 287 | mCallServicesById.get(descriptor.getCallServiceId()); |
| 288 | |
Ben Gilad | 6192561 | 2014-03-11 19:06:36 -0700 | [diff] [blame] | 289 | if (callService == null || mAttemptedCallServices.contains(callService)) { |
| 290 | // The next call service is either null or has already been attempted, fast forward |
| 291 | // to the next. |
Santos Cordon | 681663d | 2014-01-30 04:32:15 -0800 | [diff] [blame] | 292 | attemptNextCallService(); |
| 293 | } else { |
Ben Gilad | 6192561 | 2014-03-11 19:06:36 -0700 | [diff] [blame] | 294 | mAttemptedCallServices.add(callService); |
Ben Gilad | 8e55d1d | 2014-02-26 16:25:56 -0800 | [diff] [blame] | 295 | mCall.setCallService(callService); |
Sailesh Nepal | e59bb19 | 2014-04-01 18:33:59 -0700 | [diff] [blame] | 296 | callService.isCompatibleWith(mCall, mNextCallServiceCallback); |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 297 | } |
| 298 | } else { |
Ben Gilad | c5b2269 | 2014-02-18 20:03:22 -0800 | [diff] [blame] | 299 | mCallServiceDescriptorIterator = null; |
Sailesh Nepal | e59bb19 | 2014-04-01 18:33:59 -0700 | [diff] [blame] | 300 | mCall.clearCallService(); |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 301 | attemptNextSelector(); |
| 302 | } |
| 303 | } |
Ben Gilad | 0bf5b91 | 2014-01-28 17:55:57 -0800 | [diff] [blame] | 304 | } |