Lines Matching full:phone
17 package com.android.phone;
57 import com.android.internal.telephony.Phone;
61 import com.android.phone.OtaUtils.CdmaOtaScreenState;
65 * Top-level Application class for the Phone app.
71 * Phone app-wide debug level:
77 * Most individual classes in the phone app have a local DBG constant,
108 // the individual Activities of the Phone UI.
140 Phone phone;
176 // True if we are beginning a call, but the phone state has not changed yet
179 // Last phone state seen by updatePhoneState()
180 Phone.State mLastPhoneState = Phone.State.IDLE;
219 private int mPreferredTtyMode = Phone.TTY_MODE_OFF;
223 * OUTSIDE of user interaction {@link PhoneUtils#startNewCall(Phone)}
241 Phone.State phoneState;
284 PhoneUtils.cancelMmiCode(phone);
293 phoneState = phone.getState();
294 // Do not change speaker state if phone is not off hook
295 if (phoneState == Phone.State.OFFHOOK) {
340 // If the phone is docked/undocked during a call, and no wired or BT headset
347 if (VDBG) Log.d(LOG_TAG, "received EVENT_DOCK_STATE_CHANGED. Phone inDock = "
350 phoneState = phone.getState();
351 if (phoneState == Phone.State.OFFHOOK &&
367 ttyMode = Phone.TTY_MODE_OFF;
369 phone.setTTYMode(ttyMode, mHandler.obtainMessage(EVENT_TTY_MODE_SET));
393 if (phone == null) {
397 // Get the default phone
398 phone = PhoneFactory.getDefaultPhone();
402 phoneMgr = new PhoneInterfaceManager(this, phone);
404 int phoneType = phone.getPhoneType();
406 if (phoneType == Phone.PHONE_TYPE_CDMA) {
413 mBtHandsfree = new BluetoothHandsfree(this, phone);
420 ringer = new Ringer(phone);
422 // before registering for phone state changes
451 notifier = new CallNotifier(this, phone, ringer, mBtHandsfree, new CallLogAsync());
454 IccCard sim = phone.getIccCard();
461 if (phoneType == Phone.PHONE_TYPE_GSM) {
462 phone.registerForMmiComplete(mHandler, MMI_COMPLETE, null);
466 PhoneUtils.initializeConnectionHandler(phone);
503 //set the default values for the preferences in the phone.
510 // correctly, given the current state of the phone.
511 switch (phone.getState()) {
530 boolean phoneIsCdma = (phone.getPhoneType() == Phone.PHONE_TYPE_CDMA);
546 // phone.registerCdmaInformationRecord(mHandler, EVENT_UNSOL_CDMA_INFO_RECORD, null);
551 // This way, there is a single owner (i.e AP) for the TTY setting in the phone.
554 phone.getContext().getContentResolver(),
556 Phone.TTY_MODE_OFF);
561 int hac = android.provider.Settings.System.getInt(phone.getContext().getContentResolver(),
580 updateProximitySensorMode(phone.getState());
608 * This intent can only be used from within the Phone app, since the
616 intent.setClassName("com.android.phone", getCallScreenClassName());
646 * Normally, when the phone is idle, CALL takes you to the call log
648 * But if the phone is in use (either off-hook or ringing) we instead
651 * @return true if we intercepted the CALL keypress (i.e. the phone
657 if (phone.getState() != Phone.State.IDLE) {
658 // Phone is OFFHOOK or RINGING.
716 // allow user to see OTA UI update. Phone app needs to hold
752 * we are trying to un-PUK-lock the phone. In other words, iff
786 * Disables the status bar. This is used by the phone app when in-call UI is active.
853 * Update the state of the poke lock held by the phone app,
972 * of the phone, and the current state of the in-call UI.
977 * It's safe to call this method regardless of the state of the Phone
979 * Phone UI (e.g. whether or not the InCallScreen is active.)
982 Phone.State state = phone.getState();
996 // the phone up to his/her face, we don't need to worry about
1002 boolean isSpeakerInUse = (state == Phone.State.OFFHOOK) && PhoneUtils.isSpeakerOn(this);
1007 // user to put the phone straight into a pocket, in which case the
1040 // holding the phone up to their face. Here we use a
1050 // Force the screen to be on if the phone is ringing or dialing,
1054 boolean isRinging = (state == Phone.State.RINGING);
1055 boolean isDialing = (phone.getForegroundCall().getState() == Call.State.DIALING);
1057 PhoneUtils.hasDisconnectedConnections(phone) && isShowingCallScreen;
1127 updateProximitySensorMode(phone.getState());
1132 * based on the current state of the phone. This method is called
1133 * from the CallNotifier on any phone state change.
1137 * whenever the phone is off hook. (When held, that wake lock causes
1146 phone is in use, to avoid false cheek events
1156 * @param state current state of the phone (see {@link Phone#State})
1158 /* package */ void updateProximitySensorMode(Phone.State state) {
1172 if (((state == Phone.State.OFFHOOK) || mBeginningCall) && !screenOnImmediately) {
1173 // Phone is in use! Arrange for the screen to turn off
1182 // Phone is either idle, or ringing. We don't want any
1186 // Wait until user has moved the phone away from his head if we are
1187 // releasing due to the phone call ending.
1204 updateProximitySensorMode(phone.getState());
1208 * Notifies the phone app when the phone state changes.
1211 /* package */ void updatePhoneState(Phone.State state) {
1218 mAccelerometerListener.enable(state == Phone.State.OFFHOOK);
1228 mInCallScreen.updateKeyguardPolicy(state == Phone.State.OFFHOOK);
1233 /* package */ Phone.State getPhoneState() {
1252 PhoneUtils.displayMMIComplete(phone, getInstance(), mmiCode, null, null);
1258 if (phone.getPhoneType() == Phone.PHONE_TYPE_CDMA) {
1278 ringer.updateRingerContextAfterRadioTechnologyChange(this.phone);
1288 IccCard sim = phone.getIccCard();
1292 //Register all events new to the new active phone
1335 phone);
1344 updateProximitySensorMode(phone.getState());
1353 * current state of the phone.
1358 Phone phone) {
1369 switch (phone.getState()) {
1383 // once the user answers the phone.
1393 * Receiver for misc intent broadcasts the Phone app cares about.
1402 phone.setRadioPower(enabled);
1418 if (VDBG) Log.d(LOG_TAG, "- state: " + intent.getStringExtra(Phone.STATE_KEY));
1420 + intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY));
1426 if ("DISCONNECTED".equals(intent.getStringExtra(Phone.STATE_KEY))) {
1427 String reason = intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY);
1428 if (Phone.REASON_ROAMING_ON.equals(reason)) {
1456 String newPhone = intent.getStringExtra(Phone.PHONE_NAME_KEY);
1462 if (phone.getPhoneType() == Phone.PHONE_TYPE_CDMA) {
1471 phone
1480 Phone.TTY_MODE_OFF);
1512 boolean consumed = PhoneUtils.handleHeadsetHook(phone, event);
1524 if (phone.getState() != Phone.State.IDLE) {
1525 // If the phone is anything other than completely idle,
1528 // playing music while a phone call is in progress.
1631 ttyModeChanged.putExtra("ttyEnabled", ttymode != Phone.TTY_MODE_OFF);
1636 case Phone.TTY_MODE_FULL:
1639 case Phone.TTY_MODE_VCO:
1642 case Phone.TTY_MODE_HCO:
1645 case Phone.TTY_MODE_OFF:
1663 phone.queryTTYMode(mHandler.obtainMessage(EVENT_TTY_MODE_GET));