Santos Cordon | 8f3fd30 | 2014-01-27 08:46:21 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 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 | |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 17 | package android.telecom; |
Santos Cordon | 8f3fd30 | 2014-01-27 08:46:21 -0800 | [diff] [blame] | 18 | |
Tyler Gunn | 876dbfb | 2016-03-14 15:18:07 -0700 | [diff] [blame] | 19 | import android.os.Bundle; |
Sailesh Nepal | ab5d282 | 2014-03-08 18:01:06 -0800 | [diff] [blame] | 20 | import android.os.RemoteException; |
| 21 | |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 22 | import com.android.internal.telecom.IInCallAdapter; |
Sailesh Nepal | ab5d282 | 2014-03-08 18:01:06 -0800 | [diff] [blame] | 23 | |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 24 | import java.util.List; |
| 25 | |
Santos Cordon | 8f3fd30 | 2014-01-27 08:46:21 -0800 | [diff] [blame] | 26 | /** |
Sailesh Nepal | ab5d282 | 2014-03-08 18:01:06 -0800 | [diff] [blame] | 27 | * Receives commands from {@link InCallService} implementations which should be executed by |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 28 | * Telecom. When Telecom binds to a {@link InCallService}, an instance of this class is given to |
Santos Cordon | 8f3fd30 | 2014-01-27 08:46:21 -0800 | [diff] [blame] | 29 | * the in-call service through which it can manipulate live (active, dialing, ringing) calls. When |
Ihab Awad | e63fadb | 2014-07-09 21:52:04 -0700 | [diff] [blame] | 30 | * the in-call service is notified of new calls, it can use the |
Santos Cordon | 8f3fd30 | 2014-01-27 08:46:21 -0800 | [diff] [blame] | 31 | * given call IDs to execute commands such as {@link #answerCall} for incoming calls or |
| 32 | * {@link #disconnectCall} for active calls the user would like to end. Some commands are only |
| 33 | * appropriate for calls in certain states; please consult each method for such limitations. |
Ihab Awad | b19a0bc | 2014-08-07 19:46:01 -0700 | [diff] [blame] | 34 | * <p> |
| 35 | * The adapter will stop functioning when there are no more calls. |
| 36 | * |
| 37 | * {@hide} |
Santos Cordon | 8f3fd30 | 2014-01-27 08:46:21 -0800 | [diff] [blame] | 38 | */ |
Sailesh Nepal | ab5d282 | 2014-03-08 18:01:06 -0800 | [diff] [blame] | 39 | public final class InCallAdapter { |
| 40 | private final IInCallAdapter mAdapter; |
| 41 | |
| 42 | /** |
| 43 | * {@hide} |
| 44 | */ |
| 45 | public InCallAdapter(IInCallAdapter adapter) { |
| 46 | mAdapter = adapter; |
| 47 | } |
| 48 | |
Santos Cordon | 8f3fd30 | 2014-01-27 08:46:21 -0800 | [diff] [blame] | 49 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 50 | * Instructs Telecom to answer the specified call. |
Santos Cordon | 8f3fd30 | 2014-01-27 08:46:21 -0800 | [diff] [blame] | 51 | * |
| 52 | * @param callId The identifier of the call to answer. |
Andrew Lee | 8da4c3c | 2014-07-16 10:11:42 -0700 | [diff] [blame] | 53 | * @param videoState The video state in which to answer the call. |
Santos Cordon | 8f3fd30 | 2014-01-27 08:46:21 -0800 | [diff] [blame] | 54 | */ |
Andrew Lee | 8da4c3c | 2014-07-16 10:11:42 -0700 | [diff] [blame] | 55 | public void answerCall(String callId, int videoState) { |
Sailesh Nepal | ab5d282 | 2014-03-08 18:01:06 -0800 | [diff] [blame] | 56 | try { |
Andrew Lee | 8da4c3c | 2014-07-16 10:11:42 -0700 | [diff] [blame] | 57 | mAdapter.answerCall(callId, videoState); |
Sailesh Nepal | ab5d282 | 2014-03-08 18:01:06 -0800 | [diff] [blame] | 58 | } catch (RemoteException e) { |
| 59 | } |
| 60 | } |
Santos Cordon | 8f3fd30 | 2014-01-27 08:46:21 -0800 | [diff] [blame] | 61 | |
| 62 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 63 | * Instructs Telecom to reject the specified call. |
Santos Cordon | 8f3fd30 | 2014-01-27 08:46:21 -0800 | [diff] [blame] | 64 | * |
| 65 | * @param callId The identifier of the call to reject. |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 66 | * @param rejectWithMessage Whether to reject with a text message. |
| 67 | * @param textMessage An optional text message with which to respond. |
Santos Cordon | 8f3fd30 | 2014-01-27 08:46:21 -0800 | [diff] [blame] | 68 | */ |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 69 | public void rejectCall(String callId, boolean rejectWithMessage, String textMessage) { |
Sailesh Nepal | ab5d282 | 2014-03-08 18:01:06 -0800 | [diff] [blame] | 70 | try { |
Ihab Awad | c067754 | 2014-06-10 13:29:47 -0700 | [diff] [blame] | 71 | mAdapter.rejectCall(callId, rejectWithMessage, textMessage); |
Sailesh Nepal | ab5d282 | 2014-03-08 18:01:06 -0800 | [diff] [blame] | 72 | } catch (RemoteException e) { |
| 73 | } |
| 74 | } |
Santos Cordon | 8f3fd30 | 2014-01-27 08:46:21 -0800 | [diff] [blame] | 75 | |
| 76 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 77 | * Instructs Telecom to disconnect the specified call. |
Santos Cordon | 8f3fd30 | 2014-01-27 08:46:21 -0800 | [diff] [blame] | 78 | * |
| 79 | * @param callId The identifier of the call to disconnect. |
| 80 | */ |
Sailesh Nepal | ab5d282 | 2014-03-08 18:01:06 -0800 | [diff] [blame] | 81 | public void disconnectCall(String callId) { |
| 82 | try { |
| 83 | mAdapter.disconnectCall(callId); |
| 84 | } catch (RemoteException e) { |
| 85 | } |
| 86 | } |
Yorke Lee | 81ccaaa | 2014-03-12 18:33:19 -0700 | [diff] [blame] | 87 | |
| 88 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 89 | * Instructs Telecom to put the specified call on hold. |
Yorke Lee | 81ccaaa | 2014-03-12 18:33:19 -0700 | [diff] [blame] | 90 | * |
| 91 | * @param callId The identifier of the call to put on hold. |
| 92 | */ |
| 93 | public void holdCall(String callId) { |
| 94 | try { |
| 95 | mAdapter.holdCall(callId); |
| 96 | } catch (RemoteException e) { |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 101 | * Instructs Telecom to release the specified call from hold. |
Yorke Lee | 81ccaaa | 2014-03-12 18:33:19 -0700 | [diff] [blame] | 102 | * |
| 103 | * @param callId The identifier of the call to release from hold. |
| 104 | */ |
| 105 | public void unholdCall(String callId) { |
| 106 | try { |
| 107 | mAdapter.unholdCall(callId); |
| 108 | } catch (RemoteException e) { |
| 109 | } |
| 110 | } |
Sailesh Nepal | 4cff392 | 2014-03-19 10:15:37 -0700 | [diff] [blame] | 111 | |
| 112 | /** |
| 113 | * Mute the microphone. |
| 114 | * |
| 115 | * @param shouldMute True if the microphone should be muted. |
| 116 | */ |
| 117 | public void mute(boolean shouldMute) { |
| 118 | try { |
| 119 | mAdapter.mute(shouldMute); |
| 120 | } catch (RemoteException e) { |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | /** |
Yorke Lee | 4af5935 | 2015-05-13 14:14:54 -0700 | [diff] [blame] | 125 | * Sets the audio route (speaker, bluetooth, etc...). See {@link CallAudioState}. |
Sailesh Nepal | 4cff392 | 2014-03-19 10:15:37 -0700 | [diff] [blame] | 126 | * |
| 127 | * @param route The audio route to use. |
| 128 | */ |
| 129 | public void setAudioRoute(int route) { |
| 130 | try { |
| 131 | mAdapter.setAudioRoute(route); |
| 132 | } catch (RemoteException e) { |
| 133 | } |
| 134 | } |
Ihab Awad | 2f23664 | 2014-03-10 15:33:45 -0700 | [diff] [blame] | 135 | |
| 136 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 137 | * Instructs Telecom to play a dual-tone multi-frequency signaling (DTMF) tone in a call. |
Ihab Awad | 2f23664 | 2014-03-10 15:33:45 -0700 | [diff] [blame] | 138 | * |
| 139 | * Any other currently playing DTMF tone in the specified call is immediately stopped. |
| 140 | * |
| 141 | * @param callId The unique ID of the call in which the tone will be played. |
| 142 | * @param digit A character representing the DTMF digit for which to play the tone. This |
| 143 | * value must be one of {@code '0'} through {@code '9'}, {@code '*'} or {@code '#'}. |
| 144 | */ |
| 145 | public void playDtmfTone(String callId, char digit) { |
| 146 | try { |
| 147 | mAdapter.playDtmfTone(callId, digit); |
| 148 | } catch (RemoteException e) { |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 153 | * Instructs Telecom to stop any dual-tone multi-frequency signaling (DTMF) tone currently |
Ihab Awad | 2f23664 | 2014-03-10 15:33:45 -0700 | [diff] [blame] | 154 | * playing. |
| 155 | * |
| 156 | * DTMF tones are played by calling {@link #playDtmfTone(String,char)}. If no DTMF tone is |
| 157 | * currently playing, this method will do nothing. |
| 158 | * |
| 159 | * @param callId The unique ID of the call in which any currently playing tone will be stopped. |
| 160 | */ |
| 161 | public void stopDtmfTone(String callId) { |
| 162 | try { |
| 163 | mAdapter.stopDtmfTone(callId); |
| 164 | } catch (RemoteException e) { |
| 165 | } |
| 166 | } |
| 167 | |
| 168 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 169 | * Instructs Telecom to continue playing a post-dial DTMF string. |
Ihab Awad | 2f23664 | 2014-03-10 15:33:45 -0700 | [diff] [blame] | 170 | * |
| 171 | * A post-dial DTMF string is a string of digits entered after a phone number, when dialed, |
| 172 | * that are immediately sent as DTMF tones to the recipient as soon as the connection is made. |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 173 | * While these tones are playing, Telecom will notify the {@link InCallService} that the call |
Ihab Awad | e63fadb | 2014-07-09 21:52:04 -0700 | [diff] [blame] | 174 | * is in the post dial state. |
Ihab Awad | 2f23664 | 2014-03-10 15:33:45 -0700 | [diff] [blame] | 175 | * |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 176 | * If the DTMF string contains a {@link TelecomManager#DTMF_CHARACTER_PAUSE} symbol, Telecom |
Evan Charlton | 8acdbb8 | 2014-04-01 13:50:07 -0700 | [diff] [blame] | 177 | * will temporarily pause playing the tones for a pre-defined period of time. |
Ihab Awad | 2f23664 | 2014-03-10 15:33:45 -0700 | [diff] [blame] | 178 | * |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 179 | * If the DTMF string contains a {@link TelecomManager#DTMF_CHARACTER_WAIT} symbol, Telecom |
Evan Charlton | 8acdbb8 | 2014-04-01 13:50:07 -0700 | [diff] [blame] | 180 | * will pause playing the tones and notify the {@link InCallService} that the call is in the |
Ihab Awad | e63fadb | 2014-07-09 21:52:04 -0700 | [diff] [blame] | 181 | * post dial wait state. When the user decides to continue the postdial sequence, the |
| 182 | * {@link InCallService} should invoke the {@link #postDialContinue(String,boolean)} method. |
Ihab Awad | 2f23664 | 2014-03-10 15:33:45 -0700 | [diff] [blame] | 183 | * |
| 184 | * @param callId The unique ID of the call for which postdial string playing should continue. |
Evan Charlton | 6dea4ac | 2014-06-03 14:07:13 -0700 | [diff] [blame] | 185 | * @param proceed Whether or not to continue with the post-dial sequence. |
Ihab Awad | 2f23664 | 2014-03-10 15:33:45 -0700 | [diff] [blame] | 186 | */ |
Evan Charlton | 6dea4ac | 2014-06-03 14:07:13 -0700 | [diff] [blame] | 187 | public void postDialContinue(String callId, boolean proceed) { |
Ihab Awad | 2f23664 | 2014-03-10 15:33:45 -0700 | [diff] [blame] | 188 | try { |
Evan Charlton | 6dea4ac | 2014-06-03 14:07:13 -0700 | [diff] [blame] | 189 | mAdapter.postDialContinue(callId, proceed); |
Ihab Awad | 2f23664 | 2014-03-10 15:33:45 -0700 | [diff] [blame] | 190 | } catch (RemoteException e) { |
| 191 | } |
| 192 | } |
Sailesh Nepal | b632e5b | 2014-04-03 12:54:33 -0700 | [diff] [blame] | 193 | |
| 194 | /** |
Nancy Chen | 36c62f3 | 2014-10-21 18:36:39 -0700 | [diff] [blame] | 195 | * Instructs Telecom to add a PhoneAccountHandle to the specified call. |
Nancy Chen | 5da0fd5 | 2014-07-08 14:16:17 -0700 | [diff] [blame] | 196 | * |
Nancy Chen | 36c62f3 | 2014-10-21 18:36:39 -0700 | [diff] [blame] | 197 | * @param callId The identifier of the call. |
| 198 | * @param accountHandle The PhoneAccountHandle through which to place the call. |
| 199 | * @param setDefault {@code True} if this account should be set as the default for calls. |
Nancy Chen | 5da0fd5 | 2014-07-08 14:16:17 -0700 | [diff] [blame] | 200 | */ |
Nancy Chen | 36c62f3 | 2014-10-21 18:36:39 -0700 | [diff] [blame] | 201 | public void phoneAccountSelected(String callId, PhoneAccountHandle accountHandle, |
| 202 | boolean setDefault) { |
Nancy Chen | 5da0fd5 | 2014-07-08 14:16:17 -0700 | [diff] [blame] | 203 | try { |
Nancy Chen | 36c62f3 | 2014-10-21 18:36:39 -0700 | [diff] [blame] | 204 | mAdapter.phoneAccountSelected(callId, accountHandle, setDefault); |
Nancy Chen | 5da0fd5 | 2014-07-08 14:16:17 -0700 | [diff] [blame] | 205 | } catch (RemoteException e) { |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 210 | * Instructs Telecom to conference the specified call. |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 211 | * |
| 212 | * @param callId The unique ID of the call. |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 213 | * @hide |
| 214 | */ |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 215 | public void conference(String callId, String otherCallId) { |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 216 | try { |
Santos Cordon | 7c7bc7f | 2014-07-28 18:15:48 -0700 | [diff] [blame] | 217 | mAdapter.conference(callId, otherCallId); |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 218 | } catch (RemoteException ignored) { |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 223 | * Instructs Telecom to split the specified call from any conference call with which it may be |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 224 | * connected. |
| 225 | * |
| 226 | * @param callId The unique ID of the call. |
| 227 | * @hide |
| 228 | */ |
Santos Cordon | b693998 | 2014-06-04 20:20:58 -0700 | [diff] [blame] | 229 | public void splitFromConference(String callId) { |
Santos Cordon | 980acb9 | 2014-05-31 10:31:19 -0700 | [diff] [blame] | 230 | try { |
| 231 | mAdapter.splitFromConference(callId); |
| 232 | } catch (RemoteException ignored) { |
| 233 | } |
| 234 | } |
Sailesh Nepal | 6120386 | 2014-07-11 14:50:13 -0700 | [diff] [blame] | 235 | |
| 236 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 237 | * Instructs Telecom to merge child calls of the specified conference call. |
Santos Cordon | a486804 | 2014-09-04 17:39:22 -0700 | [diff] [blame] | 238 | */ |
| 239 | public void mergeConference(String callId) { |
| 240 | try { |
| 241 | mAdapter.mergeConference(callId); |
| 242 | } catch (RemoteException ignored) { |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 247 | * Instructs Telecom to swap the child calls of the specified conference call. |
Santos Cordon | a486804 | 2014-09-04 17:39:22 -0700 | [diff] [blame] | 248 | */ |
| 249 | public void swapConference(String callId) { |
| 250 | try { |
| 251 | mAdapter.swapConference(callId); |
| 252 | } catch (RemoteException ignored) { |
| 253 | } |
| 254 | } |
| 255 | |
| 256 | /** |
Tyler Gunn | 876dbfb | 2016-03-14 15:18:07 -0700 | [diff] [blame] | 257 | * Instructs Telecom to pull an external call to the local device. |
| 258 | * |
| 259 | * @param callId The callId to pull. |
| 260 | */ |
| 261 | public void pullExternalCall(String callId) { |
| 262 | try { |
| 263 | mAdapter.pullExternalCall(callId); |
| 264 | } catch (RemoteException ignored) { |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | /** |
| 269 | * Intructs Telecom to send a call event. |
| 270 | * |
| 271 | * @param callId The callId to send the event for. |
| 272 | * @param event The event. |
| 273 | * @param extras Extras associated with the event. |
| 274 | */ |
| 275 | public void sendCallEvent(String callId, String event, Bundle extras) { |
| 276 | try { |
| 277 | mAdapter.sendCallEvent(callId, event, extras); |
| 278 | } catch (RemoteException ignored) { |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | /** |
Tyler Gunn | dee56a8 | 2016-03-23 16:06:34 -0700 | [diff] [blame] | 283 | * Intructs Telecom to add extras to a call. |
| 284 | * |
| 285 | * @param callId The callId to add the extras to. |
| 286 | * @param extras The extras. |
| 287 | */ |
| 288 | public void putExtras(String callId, Bundle extras) { |
| 289 | try { |
| 290 | mAdapter.putExtras(callId, extras); |
| 291 | } catch (RemoteException ignored) { |
| 292 | } |
| 293 | } |
| 294 | |
| 295 | /** |
| 296 | * Intructs Telecom to add an extra to a call. |
| 297 | * |
| 298 | * @param callId The callId to add the extras to. |
| 299 | * @param key The extra key. |
| 300 | * @param value The extra value. |
| 301 | */ |
| 302 | public void putExtra(String callId, String key, boolean value) { |
| 303 | try { |
| 304 | Bundle bundle = new Bundle(); |
| 305 | bundle.putBoolean(key, value); |
| 306 | mAdapter.putExtras(callId, bundle); |
| 307 | } catch (RemoteException ignored) { |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | /** |
| 312 | * Intructs Telecom to add an extra to a call. |
| 313 | * |
| 314 | * @param callId The callId to add the extras to. |
| 315 | * @param key The extra key. |
| 316 | * @param value The extra value. |
| 317 | */ |
| 318 | public void putExtra(String callId, String key, int value) { |
| 319 | try { |
| 320 | Bundle bundle = new Bundle(); |
| 321 | bundle.putInt(key, value); |
| 322 | mAdapter.putExtras(callId, bundle); |
| 323 | } catch (RemoteException ignored) { |
| 324 | } |
| 325 | } |
| 326 | |
| 327 | /** |
| 328 | * Intructs Telecom to add an extra to a call. |
| 329 | * |
| 330 | * @param callId The callId to add the extras to. |
| 331 | * @param key The extra key. |
| 332 | * @param value The extra value. |
| 333 | */ |
| 334 | public void putExtra(String callId, String key, String value) { |
| 335 | try { |
| 336 | Bundle bundle = new Bundle(); |
| 337 | bundle.putString(key, value); |
| 338 | mAdapter.putExtras(callId, bundle); |
| 339 | } catch (RemoteException ignored) { |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | /** |
| 344 | * Intructs Telecom to remove extras from a call. |
| 345 | * @param callId The callId to remove the extras from. |
| 346 | * @param keys The extra keys to remove. |
| 347 | */ |
| 348 | public void removeExtras(String callId, List<String> keys) { |
| 349 | try { |
| 350 | mAdapter.removeExtras(callId, keys); |
| 351 | } catch (RemoteException ignored) { |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 356 | * Instructs Telecom to turn the proximity sensor on. |
Yorke Lee | 0d6ea71 | 2014-07-28 14:39:23 -0700 | [diff] [blame] | 357 | */ |
| 358 | public void turnProximitySensorOn() { |
| 359 | try { |
| 360 | mAdapter.turnOnProximitySensor(); |
| 361 | } catch (RemoteException ignored) { |
| 362 | } |
| 363 | } |
| 364 | |
| 365 | /** |
Tyler Gunn | ef9f6f9 | 2014-09-12 22:16:17 -0700 | [diff] [blame] | 366 | * Instructs Telecom to turn the proximity sensor off. |
Yorke Lee | 0d6ea71 | 2014-07-28 14:39:23 -0700 | [diff] [blame] | 367 | * |
| 368 | * @param screenOnImmediately If true, the screen will be turned on immediately if it was |
| 369 | * previously off. Otherwise, the screen will only be turned on after the proximity sensor |
| 370 | * is no longer triggered. |
| 371 | */ |
| 372 | public void turnProximitySensorOff(boolean screenOnImmediately) { |
| 373 | try { |
| 374 | mAdapter.turnOffProximitySensor(screenOnImmediately); |
| 375 | } catch (RemoteException ignored) { |
| 376 | } |
| 377 | } |
Santos Cordon | 8f3fd30 | 2014-01-27 08:46:21 -0800 | [diff] [blame] | 378 | } |