1 /* 2 * Copyright (C) 2008 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.internal.telephony; 18 19 20 import android.app.ActivityManagerNative; 21 import android.content.Context; 22 import android.content.Intent; 23 import android.net.LinkCapabilities; 24 import android.net.LinkProperties; 25 import android.os.AsyncResult; 26 import android.os.Handler; 27 import android.os.Message; 28 import android.os.SystemProperties; 29 import android.os.UserHandle; 30 import android.telephony.CellInfo; 31 import android.telephony.CellLocation; 32 import android.telephony.ServiceState; 33 import android.telephony.SignalStrength; 34 import android.telephony.Rlog; 35 36 import com.android.internal.telephony.test.SimulatedRadioControl; 37 import com.android.internal.telephony.uicc.IccCardProxy; 38 import com.android.internal.telephony.uicc.IsimRecords; 39 import com.android.internal.telephony.uicc.UsimServiceTable; 40 import com.android.internal.telephony.CallManager; 41 42 import java.util.List; 43 44 public class PhoneProxy extends Handler implements Phone { 45 public final static Object lockForRadioTechnologyChange = new Object(); 46 47 private Phone mActivePhone; 48 private CommandsInterface mCommandsInterface; 49 private IccSmsInterfaceManagerProxy mIccSmsInterfaceManagerProxy; 50 private IccPhoneBookInterfaceManagerProxy mIccPhoneBookInterfaceManagerProxy; 51 private PhoneSubInfoProxy mPhoneSubInfoProxy; 52 private IccCardProxy mIccCardProxy; 53 54 private boolean mResetModemOnRadioTechnologyChange = false; 55 56 private int mRilVersion; 57 58 private static final int EVENT_VOICE_RADIO_TECH_CHANGED = 1; 59 private static final int EVENT_RADIO_ON = 2; 60 private static final int EVENT_REQUEST_VOICE_RADIO_TECH_DONE = 3; 61 private static final int EVENT_RIL_CONNECTED = 4; 62 63 private static final String LOG_TAG = "PhoneProxy"; 64 65 //***** Class Methods 66 public PhoneProxy(PhoneBase phone) { 67 mActivePhone = phone; 68 mResetModemOnRadioTechnologyChange = SystemProperties.getBoolean( 69 TelephonyProperties.PROPERTY_RESET_ON_RADIO_TECH_CHANGE, false); 70 mIccSmsInterfaceManagerProxy = new IccSmsInterfaceManagerProxy( 71 phone.getIccSmsInterfaceManager()); 72 mIccPhoneBookInterfaceManagerProxy = new IccPhoneBookInterfaceManagerProxy( 73 phone.getIccPhoneBookInterfaceManager()); 74 mPhoneSubInfoProxy = new PhoneSubInfoProxy(phone.getPhoneSubInfo()); 75 mCommandsInterface = ((PhoneBase)mActivePhone).mCi; 76 77 mCommandsInterface.registerForRilConnected(this, EVENT_RIL_CONNECTED, null); 78 mCommandsInterface.registerForOn(this, EVENT_RADIO_ON, null); 79 mCommandsInterface.registerForVoiceRadioTechChanged( 80 this, EVENT_VOICE_RADIO_TECH_CHANGED, null); 81 mIccCardProxy = new IccCardProxy(phone.getContext(), mCommandsInterface); 82 if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_GSM) { 83 // For the purpose of IccCardProxy we only care about the technology family 84 mIccCardProxy.setVoiceRadioTech(ServiceState.RIL_RADIO_TECHNOLOGY_UMTS); 85 } else if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) { 86 mIccCardProxy.setVoiceRadioTech(ServiceState.RIL_RADIO_TECHNOLOGY_1xRTT); 87 } 88 } 89 90 @Override 91 public void handleMessage(Message msg) { 92 AsyncResult ar = (AsyncResult) msg.obj; 93 switch(msg.what) { 94 case EVENT_RADIO_ON: 95 /* Proactively query voice radio technologies */ 96 mCommandsInterface.getVoiceRadioTechnology( 97 obtainMessage(EVENT_REQUEST_VOICE_RADIO_TECH_DONE)); 98 break; 99 100 case EVENT_RIL_CONNECTED: 101 if (ar.exception == null && ar.result != null) { 102 mRilVersion = (Integer) ar.result; 103 } else { 104 logd("Unexpected exception on EVENT_RIL_CONNECTED"); 105 mRilVersion = -1; 106 } 107 break; 108 109 case EVENT_VOICE_RADIO_TECH_CHANGED: 110 case EVENT_REQUEST_VOICE_RADIO_TECH_DONE: 111 112 if (ar.exception == null) { 113 if ((ar.result != null) && (((int[]) ar.result).length != 0)) { 114 int newVoiceTech = ((int[]) ar.result)[0]; 115 updatePhoneObject(newVoiceTech); 116 } else { 117 loge("Voice Radio Technology event " + msg.what + " has no tech!"); 118 } 119 } else { 120 loge("Voice Radio Technology event " + msg.what + " exception!" + ar.exception); 121 } 122 break; 123 124 default: 125 loge("Error! This handler was not registered for this message type. Message: " 126 + msg.what); 127 break; 128 } 129 super.handleMessage(msg); 130 } 131 132 private static void logd(String msg) { 133 Rlog.d(LOG_TAG, "[PhoneProxy] " + msg); 134 } 135 136 private void loge(String msg) { 137 Rlog.e(LOG_TAG, "[PhoneProxy] " + msg); 138 } 139 140 private void updatePhoneObject(int newVoiceRadioTech) { 141 142 if (mActivePhone != null) { 143 if(mRilVersion == 6 && getLteOnCdmaMode() == PhoneConstants.LTE_ON_CDMA_TRUE) { 144 /* 145 * On v6 RIL, when LTE_ON_CDMA is TRUE, always create CDMALTEPhone 146 * irrespective of the voice radio tech reported. 147 */ 148 if (mActivePhone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) { 149 logd("LTE ON CDMA property is set. Use CDMA Phone" + 150 " newVoiceRadioTech = " + newVoiceRadioTech + 151 " Active Phone = " + mActivePhone.getPhoneName()); 152 return; 153 } else { 154 logd("LTE ON CDMA property is set. Switch to CDMALTEPhone" + 155 " newVoiceRadioTech = " + newVoiceRadioTech + 156 " Active Phone = " + mActivePhone.getPhoneName()); 157 newVoiceRadioTech = ServiceState.RIL_RADIO_TECHNOLOGY_1xRTT; 158 } 159 } else { 160 if ((ServiceState.isCdma(newVoiceRadioTech) && 161 mActivePhone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) || 162 (ServiceState.isGsm(newVoiceRadioTech) && 163 mActivePhone.getPhoneType() == PhoneConstants.PHONE_TYPE_GSM)) { 164 // Nothing changed. Keep phone as it is. 165 logd("Ignoring voice radio technology changed message." + 166 " newVoiceRadioTech = " + newVoiceRadioTech + 167 " Active Phone = " + mActivePhone.getPhoneName()); 168 return; 169 } 170 } 171 } 172 173 if (newVoiceRadioTech == ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN) { 174 // We need some voice phone object to be active always, so never 175 // delete the phone without anything to replace it with! 176 logd("Ignoring voice radio technology changed message. newVoiceRadioTech = Unknown." 177 + " Active Phone = " + mActivePhone.getPhoneName()); 178 return; 179 } 180 181 boolean oldPowerState = false; // old power state to off 182 if (mResetModemOnRadioTechnologyChange) { 183 if (mCommandsInterface.getRadioState().isOn()) { 184 oldPowerState = true; 185 logd("Setting Radio Power to Off"); 186 mCommandsInterface.setRadioPower(false, null); 187 } 188 } 189 190 deleteAndCreatePhone(newVoiceRadioTech); 191 192 if (mResetModemOnRadioTechnologyChange && oldPowerState) { // restore power state 193 logd("Resetting Radio"); 194 mCommandsInterface.setRadioPower(oldPowerState, null); 195 } 196 197 // Set the new interfaces in the proxy's 198 mIccSmsInterfaceManagerProxy.setmIccSmsInterfaceManager( 199 mActivePhone.getIccSmsInterfaceManager()); 200 mIccPhoneBookInterfaceManagerProxy.setmIccPhoneBookInterfaceManager(mActivePhone 201 .getIccPhoneBookInterfaceManager()); 202 mPhoneSubInfoProxy.setmPhoneSubInfo(mActivePhone.getPhoneSubInfo()); 203 204 mCommandsInterface = ((PhoneBase)mActivePhone).mCi; 205 mIccCardProxy.setVoiceRadioTech(newVoiceRadioTech); 206 207 // Send an Intent to the PhoneApp that we had a radio technology change 208 Intent intent = new Intent(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED); 209 intent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING); 210 intent.putExtra(PhoneConstants.PHONE_NAME_KEY, mActivePhone.getPhoneName()); 211 ActivityManagerNative.broadcastStickyIntent(intent, null, UserHandle.USER_ALL); 212 213 } 214 215 private void deleteAndCreatePhone(int newVoiceRadioTech) { 216 217 String outgoingPhoneName = "Unknown"; 218 Phone oldPhone = mActivePhone; 219 220 if (oldPhone != null) { 221 outgoingPhoneName = ((PhoneBase) oldPhone).getPhoneName(); 222 } 223 224 logd("Switching Voice Phone : " + outgoingPhoneName + " >>> " 225 + (ServiceState.isGsm(newVoiceRadioTech) ? "GSM" : "CDMA")); 226 227 if (oldPhone != null) { 228 CallManager.getInstance().unregisterPhone(oldPhone); 229 logd("Disposing old phone.."); 230 oldPhone.dispose(); 231 } 232 233 // Give the garbage collector a hint to start the garbage collection 234 // asap NOTE this has been disabled since radio technology change could 235 // happen during e.g. a multimedia playing and could slow the system. 236 // Tests needs to be done to see the effects of the GC call here when 237 // system is busy. 238 // System.gc(); 239 240 if (ServiceState.isCdma(newVoiceRadioTech)) { 241 mActivePhone = PhoneFactory.getCdmaPhone(); 242 } else if (ServiceState.isGsm(newVoiceRadioTech)) { 243 mActivePhone = PhoneFactory.getGsmPhone(); 244 } 245 246 if (oldPhone != null) { 247 oldPhone.removeReferences(); 248 } 249 250 if(mActivePhone != null) { 251 CallManager.getInstance().registerPhone(mActivePhone); 252 } 253 254 oldPhone = null; 255 } 256 257 @Override 258 public ServiceState getServiceState() { 259 return mActivePhone.getServiceState(); 260 } 261 262 @Override 263 public CellLocation getCellLocation() { 264 return mActivePhone.getCellLocation(); 265 } 266 267 /** 268 * @return all available cell information or null if none. 269 */ 270 @Override 271 public List<CellInfo> getAllCellInfo() { 272 return mActivePhone.getAllCellInfo(); 273 } 274 275 /** 276 * {@inheritDoc} 277 */ 278 @Override 279 public void setCellInfoListRate(int rateInMillis) { 280 mActivePhone.setCellInfoListRate(rateInMillis); 281 } 282 283 @Override 284 public PhoneConstants.DataState getDataConnectionState() { 285 return mActivePhone.getDataConnectionState(PhoneConstants.APN_TYPE_DEFAULT); 286 } 287 288 @Override 289 public PhoneConstants.DataState getDataConnectionState(String apnType) { 290 return mActivePhone.getDataConnectionState(apnType); 291 } 292 293 @Override 294 public DataActivityState getDataActivityState() { 295 return mActivePhone.getDataActivityState(); 296 } 297 298 @Override 299 public Context getContext() { 300 return mActivePhone.getContext(); 301 } 302 303 @Override 304 public void disableDnsCheck(boolean b) { 305 mActivePhone.disableDnsCheck(b); 306 } 307 308 @Override 309 public boolean isDnsCheckDisabled() { 310 return mActivePhone.isDnsCheckDisabled(); 311 } 312 313 @Override 314 public PhoneConstants.State getState() { 315 return mActivePhone.getState(); 316 } 317 318 @Override 319 public String getPhoneName() { 320 return mActivePhone.getPhoneName(); 321 } 322 323 @Override 324 public int getPhoneType() { 325 return mActivePhone.getPhoneType(); 326 } 327 328 @Override 329 public String[] getActiveApnTypes() { 330 return mActivePhone.getActiveApnTypes(); 331 } 332 333 @Override 334 public String getActiveApnHost(String apnType) { 335 return mActivePhone.getActiveApnHost(apnType); 336 } 337 338 @Override 339 public LinkProperties getLinkProperties(String apnType) { 340 return mActivePhone.getLinkProperties(apnType); 341 } 342 343 @Override 344 public LinkCapabilities getLinkCapabilities(String apnType) { 345 return mActivePhone.getLinkCapabilities(apnType); 346 } 347 348 @Override 349 public SignalStrength getSignalStrength() { 350 return mActivePhone.getSignalStrength(); 351 } 352 353 @Override 354 public void registerForUnknownConnection(Handler h, int what, Object obj) { 355 mActivePhone.registerForUnknownConnection(h, what, obj); 356 } 357 358 @Override 359 public void unregisterForUnknownConnection(Handler h) { 360 mActivePhone.unregisterForUnknownConnection(h); 361 } 362 363 @Override 364 public void registerForPreciseCallStateChanged(Handler h, int what, Object obj) { 365 mActivePhone.registerForPreciseCallStateChanged(h, what, obj); 366 } 367 368 @Override 369 public void unregisterForPreciseCallStateChanged(Handler h) { 370 mActivePhone.unregisterForPreciseCallStateChanged(h); 371 } 372 373 @Override 374 public void registerForNewRingingConnection(Handler h, int what, Object obj) { 375 mActivePhone.registerForNewRingingConnection(h, what, obj); 376 } 377 378 @Override 379 public void unregisterForNewRingingConnection(Handler h) { 380 mActivePhone.unregisterForNewRingingConnection(h); 381 } 382 383 @Override 384 public void registerForIncomingRing(Handler h, int what, Object obj) { 385 mActivePhone.registerForIncomingRing(h, what, obj); 386 } 387 388 @Override 389 public void unregisterForIncomingRing(Handler h) { 390 mActivePhone.unregisterForIncomingRing(h); 391 } 392 393 @Override 394 public void registerForDisconnect(Handler h, int what, Object obj) { 395 mActivePhone.registerForDisconnect(h, what, obj); 396 } 397 398 @Override 399 public void unregisterForDisconnect(Handler h) { 400 mActivePhone.unregisterForDisconnect(h); 401 } 402 403 @Override 404 public void registerForMmiInitiate(Handler h, int what, Object obj) { 405 mActivePhone.registerForMmiInitiate(h, what, obj); 406 } 407 408 @Override 409 public void unregisterForMmiInitiate(Handler h) { 410 mActivePhone.unregisterForMmiInitiate(h); 411 } 412 413 @Override 414 public void registerForMmiComplete(Handler h, int what, Object obj) { 415 mActivePhone.registerForMmiComplete(h, what, obj); 416 } 417 418 @Override 419 public void unregisterForMmiComplete(Handler h) { 420 mActivePhone.unregisterForMmiComplete(h); 421 } 422 423 @Override 424 public List<? extends MmiCode> getPendingMmiCodes() { 425 return mActivePhone.getPendingMmiCodes(); 426 } 427 428 @Override 429 public void sendUssdResponse(String ussdMessge) { 430 mActivePhone.sendUssdResponse(ussdMessge); 431 } 432 433 @Override 434 public void registerForServiceStateChanged(Handler h, int what, Object obj) { 435 mActivePhone.registerForServiceStateChanged(h, what, obj); 436 } 437 438 @Override 439 public void unregisterForServiceStateChanged(Handler h) { 440 mActivePhone.unregisterForServiceStateChanged(h); 441 } 442 443 @Override 444 public void registerForSuppServiceNotification(Handler h, int what, Object obj) { 445 mActivePhone.registerForSuppServiceNotification(h, what, obj); 446 } 447 448 @Override 449 public void unregisterForSuppServiceNotification(Handler h) { 450 mActivePhone.unregisterForSuppServiceNotification(h); 451 } 452 453 @Override 454 public void registerForSuppServiceFailed(Handler h, int what, Object obj) { 455 mActivePhone.registerForSuppServiceFailed(h, what, obj); 456 } 457 458 @Override 459 public void unregisterForSuppServiceFailed(Handler h) { 460 mActivePhone.unregisterForSuppServiceFailed(h); 461 } 462 463 @Override 464 public void registerForInCallVoicePrivacyOn(Handler h, int what, Object obj){ 465 mActivePhone.registerForInCallVoicePrivacyOn(h,what,obj); 466 } 467 468 @Override 469 public void unregisterForInCallVoicePrivacyOn(Handler h){ 470 mActivePhone.unregisterForInCallVoicePrivacyOn(h); 471 } 472 473 @Override 474 public void registerForInCallVoicePrivacyOff(Handler h, int what, Object obj){ 475 mActivePhone.registerForInCallVoicePrivacyOff(h,what,obj); 476 } 477 478 @Override 479 public void unregisterForInCallVoicePrivacyOff(Handler h){ 480 mActivePhone.unregisterForInCallVoicePrivacyOff(h); 481 } 482 483 @Override 484 public void registerForCdmaOtaStatusChange(Handler h, int what, Object obj) { 485 mActivePhone.registerForCdmaOtaStatusChange(h,what,obj); 486 } 487 488 @Override 489 public void unregisterForCdmaOtaStatusChange(Handler h) { 490 mActivePhone.unregisterForCdmaOtaStatusChange(h); 491 } 492 493 @Override 494 public void registerForSubscriptionInfoReady(Handler h, int what, Object obj) { 495 mActivePhone.registerForSubscriptionInfoReady(h, what, obj); 496 } 497 498 @Override 499 public void unregisterForSubscriptionInfoReady(Handler h) { 500 mActivePhone.unregisterForSubscriptionInfoReady(h); 501 } 502 503 @Override 504 public void registerForEcmTimerReset(Handler h, int what, Object obj) { 505 mActivePhone.registerForEcmTimerReset(h,what,obj); 506 } 507 508 @Override 509 public void unregisterForEcmTimerReset(Handler h) { 510 mActivePhone.unregisterForEcmTimerReset(h); 511 } 512 513 @Override 514 public void registerForRingbackTone(Handler h, int what, Object obj) { 515 mActivePhone.registerForRingbackTone(h,what,obj); 516 } 517 518 @Override 519 public void unregisterForRingbackTone(Handler h) { 520 mActivePhone.unregisterForRingbackTone(h); 521 } 522 523 @Override 524 public void registerForResendIncallMute(Handler h, int what, Object obj) { 525 mActivePhone.registerForResendIncallMute(h,what,obj); 526 } 527 528 @Override 529 public void unregisterForResendIncallMute(Handler h) { 530 mActivePhone.unregisterForResendIncallMute(h); 531 } 532 533 @Override 534 public boolean getIccRecordsLoaded() { 535 return mIccCardProxy.getIccRecordsLoaded(); 536 } 537 538 @Override 539 public IccCard getIccCard() { 540 return mIccCardProxy; 541 } 542 543 @Override 544 public void acceptCall() throws CallStateException { 545 mActivePhone.acceptCall(); 546 } 547 548 @Override 549 public void rejectCall() throws CallStateException { 550 mActivePhone.rejectCall(); 551 } 552 553 @Override 554 public void switchHoldingAndActive() throws CallStateException { 555 mActivePhone.switchHoldingAndActive(); 556 } 557 558 @Override 559 public boolean canConference() { 560 return mActivePhone.canConference(); 561 } 562 563 @Override 564 public void conference() throws CallStateException { 565 mActivePhone.conference(); 566 } 567 568 @Override 569 public void enableEnhancedVoicePrivacy(boolean enable, Message onComplete) { 570 mActivePhone.enableEnhancedVoicePrivacy(enable, onComplete); 571 } 572 573 @Override 574 public void getEnhancedVoicePrivacy(Message onComplete) { 575 mActivePhone.getEnhancedVoicePrivacy(onComplete); 576 } 577 578 @Override 579 public boolean canTransfer() { 580 return mActivePhone.canTransfer(); 581 } 582 583 @Override 584 public void explicitCallTransfer() throws CallStateException { 585 mActivePhone.explicitCallTransfer(); 586 } 587 588 @Override 589 public void clearDisconnected() { 590 mActivePhone.clearDisconnected(); 591 } 592 593 @Override 594 public Call getForegroundCall() { 595 return mActivePhone.getForegroundCall(); 596 } 597 598 @Override 599 public Call getBackgroundCall() { 600 return mActivePhone.getBackgroundCall(); 601 } 602 603 @Override 604 public Call getRingingCall() { 605 return mActivePhone.getRingingCall(); 606 } 607 608 @Override 609 public Connection dial(String dialString) throws CallStateException { 610 return mActivePhone.dial(dialString); 611 } 612 613 @Override 614 public Connection dial(String dialString, UUSInfo uusInfo) throws CallStateException { 615 return mActivePhone.dial(dialString, uusInfo); 616 } 617 618 @Override 619 public boolean handlePinMmi(String dialString) { 620 return mActivePhone.handlePinMmi(dialString); 621 } 622 623 @Override 624 public boolean handleInCallMmiCommands(String command) throws CallStateException { 625 return mActivePhone.handleInCallMmiCommands(command); 626 } 627 628 @Override 629 public void sendDtmf(char c) { 630 mActivePhone.sendDtmf(c); 631 } 632 633 @Override 634 public void startDtmf(char c) { 635 mActivePhone.startDtmf(c); 636 } 637 638 @Override 639 public void stopDtmf() { 640 mActivePhone.stopDtmf(); 641 } 642 643 @Override 644 public void setRadioPower(boolean power) { 645 mActivePhone.setRadioPower(power); 646 } 647 648 @Override 649 public boolean getMessageWaitingIndicator() { 650 return mActivePhone.getMessageWaitingIndicator(); 651 } 652 653 @Override 654 public boolean getCallForwardingIndicator() { 655 return mActivePhone.getCallForwardingIndicator(); 656 } 657 658 @Override 659 public String getLine1Number() { 660 return mActivePhone.getLine1Number(); 661 } 662 663 @Override 664 public String getCdmaMin() { 665 return mActivePhone.getCdmaMin(); 666 } 667 668 @Override 669 public boolean isMinInfoReady() { 670 return mActivePhone.isMinInfoReady(); 671 } 672 673 @Override 674 public String getCdmaPrlVersion() { 675 return mActivePhone.getCdmaPrlVersion(); 676 } 677 678 @Override 679 public String getLine1AlphaTag() { 680 return mActivePhone.getLine1AlphaTag(); 681 } 682 683 @Override 684 public void setLine1Number(String alphaTag, String number, Message onComplete) { 685 mActivePhone.setLine1Number(alphaTag, number, onComplete); 686 } 687 688 @Override 689 public String getVoiceMailNumber() { 690 return mActivePhone.getVoiceMailNumber(); 691 } 692 693 /** @hide */ 694 @Override 695 public int getVoiceMessageCount(){ 696 return mActivePhone.getVoiceMessageCount(); 697 } 698 699 @Override 700 public String getVoiceMailAlphaTag() { 701 return mActivePhone.getVoiceMailAlphaTag(); 702 } 703 704 @Override 705 public void setVoiceMailNumber(String alphaTag,String voiceMailNumber, 706 Message onComplete) { 707 mActivePhone.setVoiceMailNumber(alphaTag, voiceMailNumber, onComplete); 708 } 709 710 @Override 711 public void getCallForwardingOption(int commandInterfaceCFReason, 712 Message onComplete) { 713 mActivePhone.getCallForwardingOption(commandInterfaceCFReason, 714 onComplete); 715 } 716 717 @Override 718 public void setCallForwardingOption(int commandInterfaceCFReason, 719 int commandInterfaceCFAction, String dialingNumber, 720 int timerSeconds, Message onComplete) { 721 mActivePhone.setCallForwardingOption(commandInterfaceCFReason, 722 commandInterfaceCFAction, dialingNumber, timerSeconds, onComplete); 723 } 724 725 @Override 726 public void getOutgoingCallerIdDisplay(Message onComplete) { 727 mActivePhone.getOutgoingCallerIdDisplay(onComplete); 728 } 729 730 @Override 731 public void setOutgoingCallerIdDisplay(int commandInterfaceCLIRMode, 732 Message onComplete) { 733 mActivePhone.setOutgoingCallerIdDisplay(commandInterfaceCLIRMode, 734 onComplete); 735 } 736 737 @Override 738 public void getCallWaiting(Message onComplete) { 739 mActivePhone.getCallWaiting(onComplete); 740 } 741 742 @Override 743 public void setCallWaiting(boolean enable, Message onComplete) { 744 mActivePhone.setCallWaiting(enable, onComplete); 745 } 746 747 @Override 748 public void getAvailableNetworks(Message response) { 749 mActivePhone.getAvailableNetworks(response); 750 } 751 752 @Override 753 public void setNetworkSelectionModeAutomatic(Message response) { 754 mActivePhone.setNetworkSelectionModeAutomatic(response); 755 } 756 757 @Override 758 public void selectNetworkManually(OperatorInfo network, Message response) { 759 mActivePhone.selectNetworkManually(network, response); 760 } 761 762 @Override 763 public void setPreferredNetworkType(int networkType, Message response) { 764 mActivePhone.setPreferredNetworkType(networkType, response); 765 } 766 767 @Override 768 public void getPreferredNetworkType(Message response) { 769 mActivePhone.getPreferredNetworkType(response); 770 } 771 772 @Override 773 public void getNeighboringCids(Message response) { 774 mActivePhone.getNeighboringCids(response); 775 } 776 777 @Override 778 public void setOnPostDialCharacter(Handler h, int what, Object obj) { 779 mActivePhone.setOnPostDialCharacter(h, what, obj); 780 } 781 782 @Override 783 public void setMute(boolean muted) { 784 mActivePhone.setMute(muted); 785 } 786 787 @Override 788 public boolean getMute() { 789 return mActivePhone.getMute(); 790 } 791 792 @Override 793 public void setEchoSuppressionEnabled(boolean enabled) { 794 mActivePhone.setEchoSuppressionEnabled(enabled); 795 } 796 797 @Override 798 public void invokeOemRilRequestRaw(byte[] data, Message response) { 799 mActivePhone.invokeOemRilRequestRaw(data, response); 800 } 801 802 @Override 803 public void invokeOemRilRequestStrings(String[] strings, Message response) { 804 mActivePhone.invokeOemRilRequestStrings(strings, response); 805 } 806 807 @Override 808 public void getDataCallList(Message response) { 809 mActivePhone.getDataCallList(response); 810 } 811 812 @Override 813 public void updateServiceLocation() { 814 mActivePhone.updateServiceLocation(); 815 } 816 817 @Override 818 public void enableLocationUpdates() { 819 mActivePhone.enableLocationUpdates(); 820 } 821 822 @Override 823 public void disableLocationUpdates() { 824 mActivePhone.disableLocationUpdates(); 825 } 826 827 @Override 828 public void setUnitTestMode(boolean f) { 829 mActivePhone.setUnitTestMode(f); 830 } 831 832 @Override 833 public boolean getUnitTestMode() { 834 return mActivePhone.getUnitTestMode(); 835 } 836 837 @Override 838 public void setBandMode(int bandMode, Message response) { 839 mActivePhone.setBandMode(bandMode, response); 840 } 841 842 @Override 843 public void queryAvailableBandMode(Message response) { 844 mActivePhone.queryAvailableBandMode(response); 845 } 846 847 @Override 848 public boolean getDataRoamingEnabled() { 849 return mActivePhone.getDataRoamingEnabled(); 850 } 851 852 @Override 853 public void setDataRoamingEnabled(boolean enable) { 854 mActivePhone.setDataRoamingEnabled(enable); 855 } 856 857 @Override 858 public void queryCdmaRoamingPreference(Message response) { 859 mActivePhone.queryCdmaRoamingPreference(response); 860 } 861 862 @Override 863 public void setCdmaRoamingPreference(int cdmaRoamingType, Message response) { 864 mActivePhone.setCdmaRoamingPreference(cdmaRoamingType, response); 865 } 866 867 @Override 868 public void setCdmaSubscription(int cdmaSubscriptionType, Message response) { 869 mActivePhone.setCdmaSubscription(cdmaSubscriptionType, response); 870 } 871 872 @Override 873 public SimulatedRadioControl getSimulatedRadioControl() { 874 return mActivePhone.getSimulatedRadioControl(); 875 } 876 877 @Override 878 public int enableApnType(String type) { 879 return mActivePhone.enableApnType(type); 880 } 881 882 @Override 883 public int disableApnType(String type) { 884 return mActivePhone.disableApnType(type); 885 } 886 887 @Override 888 public boolean isDataConnectivityPossible() { 889 return mActivePhone.isDataConnectivityPossible(PhoneConstants.APN_TYPE_DEFAULT); 890 } 891 892 @Override 893 public boolean isDataConnectivityPossible(String apnType) { 894 return mActivePhone.isDataConnectivityPossible(apnType); 895 } 896 897 @Override 898 public String getDeviceId() { 899 return mActivePhone.getDeviceId(); 900 } 901 902 @Override 903 public String getDeviceSvn() { 904 return mActivePhone.getDeviceSvn(); 905 } 906 907 @Override 908 public String getSubscriberId() { 909 return mActivePhone.getSubscriberId(); 910 } 911 912 @Override 913 public String getGroupIdLevel1() { 914 return mActivePhone.getGroupIdLevel1(); 915 } 916 917 @Override 918 public String getIccSerialNumber() { 919 return mActivePhone.getIccSerialNumber(); 920 } 921 922 @Override 923 public String getEsn() { 924 return mActivePhone.getEsn(); 925 } 926 927 @Override 928 public String getMeid() { 929 return mActivePhone.getMeid(); 930 } 931 932 @Override 933 public String getMsisdn() { 934 return mActivePhone.getMsisdn(); 935 } 936 937 @Override 938 public String getImei() { 939 return mActivePhone.getImei(); 940 } 941 942 @Override 943 public PhoneSubInfo getPhoneSubInfo(){ 944 return mActivePhone.getPhoneSubInfo(); 945 } 946 947 @Override 948 public IccSmsInterfaceManager getIccSmsInterfaceManager(){ 949 return mActivePhone.getIccSmsInterfaceManager(); 950 } 951 952 @Override 953 public IccPhoneBookInterfaceManager getIccPhoneBookInterfaceManager(){ 954 return mActivePhone.getIccPhoneBookInterfaceManager(); 955 } 956 957 @Override 958 public void setTTYMode(int ttyMode, Message onComplete) { 959 mActivePhone.setTTYMode(ttyMode, onComplete); 960 } 961 962 @Override 963 public void queryTTYMode(Message onComplete) { 964 mActivePhone.queryTTYMode(onComplete); 965 } 966 967 @Override 968 public void activateCellBroadcastSms(int activate, Message response) { 969 mActivePhone.activateCellBroadcastSms(activate, response); 970 } 971 972 @Override 973 public void getCellBroadcastSmsConfig(Message response) { 974 mActivePhone.getCellBroadcastSmsConfig(response); 975 } 976 977 @Override 978 public void setCellBroadcastSmsConfig(int[] configValuesArray, Message response) { 979 mActivePhone.setCellBroadcastSmsConfig(configValuesArray, response); 980 } 981 982 @Override 983 public void notifyDataActivity() { 984 mActivePhone.notifyDataActivity(); 985 } 986 987 @Override 988 public void getSmscAddress(Message result) { 989 mActivePhone.getSmscAddress(result); 990 } 991 992 @Override 993 public void setSmscAddress(String address, Message result) { 994 mActivePhone.setSmscAddress(address, result); 995 } 996 997 @Override 998 public int getCdmaEriIconIndex() { 999 return mActivePhone.getCdmaEriIconIndex(); 1000 } 1001 1002 @Override 1003 public String getCdmaEriText() { 1004 return mActivePhone.getCdmaEriText(); 1005 } 1006 1007 @Override 1008 public int getCdmaEriIconMode() { 1009 return mActivePhone.getCdmaEriIconMode(); 1010 } 1011 1012 public Phone getActivePhone() { 1013 return mActivePhone; 1014 } 1015 1016 @Override 1017 public void sendBurstDtmf(String dtmfString, int on, int off, Message onComplete){ 1018 mActivePhone.sendBurstDtmf(dtmfString, on, off, onComplete); 1019 } 1020 1021 @Override 1022 public void exitEmergencyCallbackMode(){ 1023 mActivePhone.exitEmergencyCallbackMode(); 1024 } 1025 1026 @Override 1027 public boolean needsOtaServiceProvisioning(){ 1028 return mActivePhone.needsOtaServiceProvisioning(); 1029 } 1030 1031 @Override 1032 public boolean isOtaSpNumber(String dialStr){ 1033 return mActivePhone.isOtaSpNumber(dialStr); 1034 } 1035 1036 @Override 1037 public void registerForCallWaiting(Handler h, int what, Object obj){ 1038 mActivePhone.registerForCallWaiting(h,what,obj); 1039 } 1040 1041 @Override 1042 public void unregisterForCallWaiting(Handler h){ 1043 mActivePhone.unregisterForCallWaiting(h); 1044 } 1045 1046 @Override 1047 public void registerForSignalInfo(Handler h, int what, Object obj) { 1048 mActivePhone.registerForSignalInfo(h,what,obj); 1049 } 1050 1051 @Override 1052 public void unregisterForSignalInfo(Handler h) { 1053 mActivePhone.unregisterForSignalInfo(h); 1054 } 1055 1056 @Override 1057 public void registerForDisplayInfo(Handler h, int what, Object obj) { 1058 mActivePhone.registerForDisplayInfo(h,what,obj); 1059 } 1060 1061 @Override 1062 public void unregisterForDisplayInfo(Handler h) { 1063 mActivePhone.unregisterForDisplayInfo(h); 1064 } 1065 1066 @Override 1067 public void registerForNumberInfo(Handler h, int what, Object obj) { 1068 mActivePhone.registerForNumberInfo(h, what, obj); 1069 } 1070 1071 @Override 1072 public void unregisterForNumberInfo(Handler h) { 1073 mActivePhone.unregisterForNumberInfo(h); 1074 } 1075 1076 @Override 1077 public void registerForRedirectedNumberInfo(Handler h, int what, Object obj) { 1078 mActivePhone.registerForRedirectedNumberInfo(h, what, obj); 1079 } 1080 1081 @Override 1082 public void unregisterForRedirectedNumberInfo(Handler h) { 1083 mActivePhone.unregisterForRedirectedNumberInfo(h); 1084 } 1085 1086 @Override 1087 public void registerForLineControlInfo(Handler h, int what, Object obj) { 1088 mActivePhone.registerForLineControlInfo( h, what, obj); 1089 } 1090 1091 @Override 1092 public void unregisterForLineControlInfo(Handler h) { 1093 mActivePhone.unregisterForLineControlInfo(h); 1094 } 1095 1096 @Override 1097 public void registerFoT53ClirlInfo(Handler h, int what, Object obj) { 1098 mActivePhone.registerFoT53ClirlInfo(h, what, obj); 1099 } 1100 1101 @Override 1102 public void unregisterForT53ClirInfo(Handler h) { 1103 mActivePhone.unregisterForT53ClirInfo(h); 1104 } 1105 1106 @Override 1107 public void registerForT53AudioControlInfo(Handler h, int what, Object obj) { 1108 mActivePhone.registerForT53AudioControlInfo( h, what, obj); 1109 } 1110 1111 @Override 1112 public void unregisterForT53AudioControlInfo(Handler h) { 1113 mActivePhone.unregisterForT53AudioControlInfo(h); 1114 } 1115 1116 @Override 1117 public void setOnEcbModeExitResponse(Handler h, int what, Object obj){ 1118 mActivePhone.setOnEcbModeExitResponse(h,what,obj); 1119 } 1120 1121 @Override 1122 public void unsetOnEcbModeExitResponse(Handler h){ 1123 mActivePhone.unsetOnEcbModeExitResponse(h); 1124 } 1125 1126 @Override 1127 public boolean isCspPlmnEnabled() { 1128 return mActivePhone.isCspPlmnEnabled(); 1129 } 1130 1131 @Override 1132 public IsimRecords getIsimRecords() { 1133 return mActivePhone.getIsimRecords(); 1134 } 1135 1136 @Override 1137 public void requestIsimAuthentication(String nonce, Message response) { 1138 mActivePhone.requestIsimAuthentication(nonce, response); 1139 } 1140 1141 /** 1142 * {@inheritDoc} 1143 */ 1144 @Override 1145 public int getLteOnCdmaMode() { 1146 return mActivePhone.getLteOnCdmaMode(); 1147 } 1148 1149 @Override 1150 public void setVoiceMessageWaiting(int line, int countWaiting) { 1151 mActivePhone.setVoiceMessageWaiting(line, countWaiting); 1152 } 1153 1154 @Override 1155 public UsimServiceTable getUsimServiceTable() { 1156 return mActivePhone.getUsimServiceTable(); 1157 } 1158 1159 @Override 1160 public void dispose() { 1161 mCommandsInterface.unregisterForOn(this); 1162 mCommandsInterface.unregisterForVoiceRadioTechChanged(this); 1163 mCommandsInterface.unregisterForRilConnected(this); 1164 } 1165 1166 @Override 1167 public void removeReferences() { 1168 mActivePhone = null; 1169 mCommandsInterface = null; 1170 } 1171 } 1172