am 6c91d20e: Fix exported property on NotificationBroadcastReceiver.
* commit '6c91d20edc59f0e9c46c5efdcea6770d1519f9cb':
Fix exported property on NotificationBroadcastReceiver.
diff --git a/Android.mk b/Android.mk
index ce4d98d..e36adad 100644
--- a/Android.mk
+++ b/Android.mk
@@ -5,8 +5,6 @@
# LOCAL_STATIC_JAVA_LIBRARIES := com.android.phone.common
include $(CLEAR_VARS)
-LOCAL_MODULE_TAGS := user
-
LOCAL_SRC_FILES := \
src/com/android/phone/CallLogAsync.java \
src/com/android/phone/HapticFeedback.java
@@ -18,8 +16,7 @@
# for the 'other' dialer.
include $(CLEAR_VARS)
-LOCAL_MODULE_TAGS := optional
-
+LOCAL_JAVA_LIBRARIES := telephony-common
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_SRC_FILES += \
src/com/android/phone/EventLogTags.logtags \
diff --git a/src/com/android/phone/BluetoothHandsfree.java b/src/com/android/phone/BluetoothHandsfree.java
index 3dbe278..5845397 100755
--- a/src/com/android/phone/BluetoothHandsfree.java
+++ b/src/com/android/phone/BluetoothHandsfree.java
@@ -53,6 +53,7 @@
import com.android.internal.telephony.Call;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyIntents;
import com.android.internal.telephony.CallManager;
@@ -126,7 +127,7 @@
private final BluetoothPhoneState mBluetoothPhoneState; // for CIND and CIEV updates
private final BluetoothAtPhonebook mPhonebook;
- private Phone.State mPhoneState = Phone.State.IDLE;
+ private PhoneConstants.State mPhoneState = PhoneConstants.State.IDLE;
CdmaPhoneCallState.PhoneCallState mCdmaThreeWayCallState =
CdmaPhoneCallState.PhoneCallState.IDLE;
@@ -1019,10 +1020,10 @@
// This function will get called when the Precise Call State
// {@link Call.State} changes. Hence, we might get this update
- // even if the {@link Phone.state} is same as before.
+ // even if the {@link PhoneConstants.state} is same as before.
// Check for the same.
- Phone.State newState = mCM.getState();
+ PhoneConstants.State newState = mCM.getState();
if (newState != mPhoneState) {
mPhoneState = newState;
switch (mPhoneState) {
@@ -1049,7 +1050,7 @@
// +BLND: OK response
// There is a special case handling of the same case
// for CDMA below
- if (mCM.getFgPhone().getPhoneType() == Phone.PHONE_TYPE_GSM) {
+ if (mCM.getFgPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_GSM) {
callStarted();
}
break;
@@ -1131,7 +1132,7 @@
}
}
- if (mCM.getDefaultPhone().getPhoneType() == Phone.PHONE_TYPE_CDMA) {
+ if (mCM.getDefaultPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
PhoneApp app = PhoneApp.getInstance();
if (app.cdmaPhoneCallState != null) {
CdmaPhoneCallState.PhoneCallState currCdmaThreeWayCallState =
@@ -1194,7 +1195,7 @@
boolean callsSwitched;
- if (mCM.getDefaultPhone().getPhoneType() == Phone.PHONE_TYPE_CDMA &&
+ if (mCM.getDefaultPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA &&
mCdmaThreeWayCallState == CdmaPhoneCallState.PhoneCallState.CONF_CALL) {
callsSwitched = mCdmaCallsSwapped;
} else {
@@ -2321,9 +2322,9 @@
result.addResponse(args);
return result;
}
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
return cdmaGetClccResult();
- } else if (phoneType == Phone.PHONE_TYPE_GSM) {
+ } else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
return gsmGetClccResult();
} else {
throw new IllegalStateException("Unexpected phone type: " + phoneType);
@@ -2353,7 +2354,7 @@
return new AtCommandResult(AtCommandResult.ERROR);
}
} else if (args[0].equals(1)) {
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
if (ringingCall.isRinging()) {
// Hangup the active call and then answer call waiting call.
if (VDBG) log("CHLD:1 Callwaiting Answer call");
@@ -2366,7 +2367,7 @@
PhoneUtils.hangup(PhoneApp.getInstance().mCM);
}
return new AtCommandResult(AtCommandResult.OK);
- } else if (phoneType == Phone.PHONE_TYPE_GSM) {
+ } else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
// Hangup active call, answer held call
if (PhoneUtils.answerAndEndActive(
PhoneApp.getInstance().mCM, ringingCall)) {
@@ -2379,7 +2380,7 @@
}
} else if (args[0].equals(2)) {
sendURC("OK");
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
// For CDMA, the way we switch to a new incoming call is by
// calling PhoneUtils.answerCall(). switchAndHoldActive() won't
// properly update the call state within telephony.
@@ -2399,7 +2400,7 @@
// Toggle the second callers active state flag
cdmaSwapSecondCallState();
}
- } else if (phoneType == Phone.PHONE_TYPE_GSM) {
+ } else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
PhoneUtils.switchHoldingAndActive(backgroundCall);
} else {
throw new IllegalStateException("Unexpected phone type: " + phoneType);
@@ -2407,7 +2408,7 @@
return new AtCommandResult(AtCommandResult.UNSOLICITED);
} else if (args[0].equals(3)) {
sendURC("OK");
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
CdmaPhoneCallState.PhoneCallState state =
PhoneApp.getInstance().cdmaPhoneCallState.getCurrentCallState();
// For CDMA, we need to check if the call is in THRWAY_ACTIVE state
@@ -2419,7 +2420,7 @@
// This can happen when CONF_CALL was entered from a Call Waiting
mBluetoothPhoneState.updateCallHeld();
}
- } else if (phoneType == Phone.PHONE_TYPE_GSM) {
+ } else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
if (mCM.hasActiveFgCall() && mCM.hasActiveBgCall()) {
PhoneUtils.mergeCalls();
}
diff --git a/src/com/android/phone/CallCard.java b/src/com/android/phone/CallCard.java
index 413a697..77702d1 100644
--- a/src/com/android/phone/CallCard.java
+++ b/src/com/android/phone/CallCard.java
@@ -47,6 +47,7 @@
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import java.util.List;
@@ -249,7 +250,7 @@
// Update the onscreen UI based on the current state of the phone.
- Phone.State state = cm.getState(); // IDLE, RINGING, or OFFHOOK
+ PhoneConstants.State state = cm.getState(); // IDLE, RINGING, or OFFHOOK
Call ringingCall = cm.getFirstActiveRingingCall();
Call fgCall = cm.getActiveFgCall();
Call bgCall = cm.getFirstActiveBgCall();
@@ -312,8 +313,8 @@
* Updates the overall size and positioning of mCallInfoContainer and
* the "Call info" blocks, based on the phone state.
*/
- private void updateCallInfoLayout(Phone.State state) {
- boolean ringing = (state == Phone.State.RINGING);
+ private void updateCallInfoLayout(PhoneConstants.State state) {
+ boolean ringing = (state == PhoneConstants.State.RINGING);
if (DBG) log("updateCallInfoLayout()... ringing = " + ringing);
// Based on the current state, update the overall
@@ -361,7 +362,7 @@
Phone phone = fgCall.getPhone();
int phoneType = phone.getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
if ((mApplication.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE)
&& mApplication.cdmaPhoneCallState.IsThreeWayCallOrigStateDialing()) {
@@ -371,8 +372,8 @@
// we need to clean up the background call area.
displaySecondaryCallStatus(cm, bgCall);
}
- } else if ((phoneType == Phone.PHONE_TYPE_GSM)
- || (phoneType == Phone.PHONE_TYPE_SIP)) {
+ } else if ((phoneType == PhoneConstants.PHONE_TYPE_GSM)
+ || (phoneType == PhoneConstants.PHONE_TYPE_SIP)) {
displaySecondaryCallStatus(cm, bgCall);
}
}
@@ -523,10 +524,10 @@
// has only one connection.)
Connection conn = null;
int phoneType = call.getPhone().getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
conn = call.getLatestConnection();
- } else if ((phoneType == Phone.PHONE_TYPE_GSM)
- || (phoneType == Phone.PHONE_TYPE_SIP)) {
+ } else if ((phoneType == PhoneConstants.PHONE_TYPE_GSM)
+ || (phoneType == PhoneConstants.PHONE_TYPE_SIP)) {
conn = call.getEarliestConnection();
} else {
throw new IllegalStateException("Unexpected phone type: " + phoneType);
@@ -539,7 +540,8 @@
// with the current implementation of getCallerInfo and
// updateDisplayForPerson.
CallerInfo info = PhoneUtils.getCallerInfo(getContext(), null /* conn */);
- updateDisplayForPerson(info, Connection.PRESENTATION_ALLOWED, false, call, conn);
+ updateDisplayForPerson(info, PhoneConstants.PRESENTATION_ALLOWED, false, call,
+ conn);
} else {
if (DBG) log(" - CONN: " + conn + ", state = " + conn.getState());
int presentation = conn.getNumberPresentation();
@@ -557,7 +559,7 @@
// Adding a check to see if the update was caused due to a Phone number update
// or CNAP update. If so then we need to start a new query
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
Object obj = conn.getUserData();
String updatedNumber = conn.getAddress();
String updatedCnapName = conn.getCnapName();
@@ -660,10 +662,10 @@
Call call = (Call) cookie;
Connection conn = null;
int phoneType = call.getPhone().getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
conn = call.getLatestConnection();
- } else if ((phoneType == Phone.PHONE_TYPE_GSM)
- || (phoneType == Phone.PHONE_TYPE_SIP)) {
+ } else if ((phoneType == PhoneConstants.PHONE_TYPE_GSM)
+ || (phoneType == PhoneConstants.PHONE_TYPE_SIP)) {
conn = call.getEarliestConnection();
} else {
throw new IllegalStateException("Unexpected phone type: " + phoneType);
@@ -671,7 +673,7 @@
PhoneUtils.CallerInfoToken cit =
PhoneUtils.startGetCallerInfo(getContext(), conn, this, null);
- int presentation = Connection.PRESENTATION_ALLOWED;
+ int presentation = PhoneConstants.PRESENTATION_ALLOWED;
if (conn != null) presentation = conn.getNumberPresentation();
if (DBG) log("- onQueryComplete: presentation=" + presentation
+ ", contactExists=" + ci.contactExists);
@@ -680,7 +682,7 @@
// CallerInfo (for CNAP). Therefore if ci.contactExists then use the ci passed in.
// Otherwise, regenerate the CIT from the Connection and use the CallerInfo from there.
if (ci.contactExists) {
- updateDisplayForPerson(ci, Connection.PRESENTATION_ALLOWED, false, call, conn);
+ updateDisplayForPerson(ci, PhoneConstants.PRESENTATION_ALLOWED, false, call, conn);
} else {
updateDisplayForPerson(cit.currentInfo, presentation, false, call, conn);
}
@@ -802,7 +804,7 @@
// Check a couple of other special cases (these are all CDMA-specific).
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
if ((state == Call.State.ACTIVE)
&& mApplication.cdmaPhoneCallState.IsThreeWayCallOrigStateDialing()) {
// Display "Dialing" while dialing a 3Way call, even
@@ -991,7 +993,7 @@
// CDMA: This is because in CDMA when the user originates the second call,
// although the Foreground call state is still ACTIVE in reality the network
// put the first call on hold.
- if (mApplication.phone.getPhoneType() == Phone.PHONE_TYPE_CDMA) {
+ if (mApplication.phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
showSecondaryCallInfo();
List<Connection> connections = call.getConnections();
@@ -1018,7 +1020,7 @@
String name = PhoneUtils.getCompactNameFromCallerInfo(info, getContext());
boolean forceGenericPhoto = false;
if (info != null && info.numberPresentation !=
- Connection.PRESENTATION_ALLOWED) {
+ PhoneConstants.PRESENTATION_ALLOWED) {
name = PhoneUtils.getPresentationString(
getContext(), info.numberPresentation);
forceGenericPhoto = true;
@@ -1233,7 +1235,7 @@
// (or potentially some other default based on the presentation.)
displayName = PhoneUtils.getPresentationString(getContext(), presentation);
if (DBG) log(" ==> no name *or* number! displayName = " + displayName);
- } else if (presentation != Connection.PRESENTATION_ALLOWED) {
+ } else if (presentation != PhoneConstants.PRESENTATION_ALLOWED) {
// This case should never happen since the network should never send a phone #
// AND a restricted presentation. However we leave it here in case of weird
// network behavior
@@ -1270,7 +1272,7 @@
} else {
// We do have a valid "name" in the CallerInfo. Display that
// in the "name" slot, and the phone number in the "number" slot.
- if (presentation != Connection.PRESENTATION_ALLOWED) {
+ if (presentation != PhoneConstants.PRESENTATION_ALLOWED) {
// This case should never happen since the network should never send a name
// AND a restricted presentation. However we leave it here in case of weird
// network behavior
@@ -1384,7 +1386,7 @@
if (DBG) log("updateDisplayForConference()...");
int phoneType = call.getPhone().getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
// This state corresponds to both 3-Way merged call and
// Call Waiting accepted call.
// In this case we display the UI in a "generic" state, with
@@ -1393,8 +1395,8 @@
// which caller party he is talking to.
showImage(mPhoto, R.drawable.picture_dialing);
mName.setText(R.string.card_title_in_call);
- } else if ((phoneType == Phone.PHONE_TYPE_GSM)
- || (phoneType == Phone.PHONE_TYPE_SIP)) {
+ } else if ((phoneType == PhoneConstants.PHONE_TYPE_GSM)
+ || (phoneType == PhoneConstants.PHONE_TYPE_SIP)) {
// Normal GSM (or possibly SIP?) conference call.
// Display the "conference call" image as the contact photo.
// TODO: Better visual treatment for contact photos in a
@@ -1490,10 +1492,10 @@
{
Connection conn = null;
int phoneType = call.getPhone().getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
conn = call.getLatestConnection();
- } else if ((phoneType == Phone.PHONE_TYPE_GSM)
- || (phoneType == Phone.PHONE_TYPE_SIP)) {
+ } else if ((phoneType == PhoneConstants.PHONE_TYPE_GSM)
+ || (phoneType == PhoneConstants.PHONE_TYPE_SIP)) {
conn = call.getEarliestConnection();
} else {
throw new IllegalStateException("Unexpected phone type: " + phoneType);
@@ -1629,8 +1631,9 @@
* and/or icon to be displayed here.)
*/
private void updateCallTypeLabel(Call call) {
- int phoneType = (call != null) ? call.getPhone().getPhoneType() : Phone.PHONE_TYPE_NONE;
- if (phoneType == Phone.PHONE_TYPE_SIP) {
+ int phoneType = (call != null) ? call.getPhone().getPhoneType() :
+ PhoneConstants.PHONE_TYPE_NONE;
+ if (phoneType == PhoneConstants.PHONE_TYPE_SIP) {
mCallTypeLabel.setVisibility(View.VISIBLE);
mCallTypeLabel.setText(R.string.incall_call_type_label_sip);
mCallTypeLabel.setTextColor(mTextColorCallTypeSip);
diff --git a/src/com/android/phone/CallController.java b/src/com/android/phone/CallController.java
index 1f810f9..d9ec62d 100644
--- a/src/com/android/phone/CallController.java
+++ b/src/com/android/phone/CallController.java
@@ -18,6 +18,7 @@
import com.android.internal.telephony.CallManager;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyCapabilities;
import com.android.phone.Constants.CallStatusCode;
import com.android.phone.InCallUiState.InCallScreenMode;
@@ -533,7 +534,7 @@
exitedEcm = true; // this will cause us to return EXITED_ECM from this method
}
- if (phone.getPhoneType() == Phone.PHONE_TYPE_CDMA) {
+ if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
// Start the timer for 3 Way CallerInfo
if (mApp.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE) {
@@ -719,7 +720,7 @@
// TODO: Rather than launching a toast from here, it would
// be cleaner to just set a pending call status code here,
// and then let the InCallScreen display the toast...
- if (mCM.getState() == Phone.State.OFFHOOK) {
+ if (mCM.getState() == PhoneConstants.State.OFFHOOK) {
Toast.makeText(mApp, R.string.incall_status_dialed_mmi, Toast.LENGTH_SHORT)
.show();
}
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index acdbf19..53ee8f4 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -60,6 +60,7 @@
import com.android.internal.telephony.CallForwardInfo;
import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.cdma.TtyIntent;
import com.android.phone.sip.SipSharedPreferences;
@@ -876,7 +877,7 @@
+ " settings");
// No fwd settings on CDMA
- if (mPhone.getPhoneType() == Phone.PHONE_TYPE_CDMA) {
+ if (mPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
if (DBG) log("ignoring forwarding setting since this is CDMA phone");
mNewFwdSettings = FWD_SETTINGS_DONT_TOUCH;
}
@@ -1575,14 +1576,14 @@
prefSet.removePreference(options);
int phoneType = mPhone.getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
Preference fdnButton = prefSet.findPreference(BUTTON_FDN_KEY);
if (fdnButton != null)
prefSet.removePreference(fdnButton);
if (!getResources().getBoolean(R.bool.config_voice_privacy_disable)) {
addPreferencesFromResource(R.xml.cdma_call_privacy);
}
- } else if (phoneType == Phone.PHONE_TYPE_GSM) {
+ } else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
addPreferencesFromResource(R.xml.gsm_umts_call_options);
} else {
throw new IllegalStateException("Unexpected phone type: " + phoneType);
diff --git a/src/com/android/phone/CallNotifier.java b/src/com/android/phone/CallNotifier.java
index ac110f2..dee75de 100755
--- a/src/com/android/phone/CallNotifier.java
+++ b/src/com/android/phone/CallNotifier.java
@@ -22,6 +22,7 @@
import com.android.internal.telephony.CallerInfoAsyncQuery;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneBase;
import com.android.internal.telephony.TelephonyCapabilities;
import com.android.internal.telephony.cdma.CdmaCallWaitingNotification;
@@ -243,7 +244,7 @@
if (msg.obj != null && ((AsyncResult) msg.obj).result != null) {
PhoneBase pb = (PhoneBase)((AsyncResult)msg.obj).result;
- if ((pb.getState() == Phone.State.RINGING)
+ if ((pb.getState() == PhoneConstants.State.RINGING)
&& (mSilentRingerRequested == false)) {
if (DBG) log("RINGING... (PHONE_INCOMING_RING event)");
mRinger.ring();
@@ -641,7 +642,7 @@
// since in that case we *will* still get a DISCONNECT message sent
// to our handler. (And we will correctly stop the ringer when we
// process that event.)
- if (mCM.getState() != Phone.State.RINGING) {
+ if (mCM.getState() != PhoneConstants.State.RINGING) {
Log.i(LOG_TAG, "onCustomRingQueryComplete: No incoming call! Bailing out...");
// Don't start the ringer *or* bring up the "incoming call" UI.
// Just bail out.
@@ -658,9 +659,9 @@
}
private void onUnknownConnectionAppeared(AsyncResult r) {
- Phone.State state = mCM.getState();
+ PhoneConstants.State state = mCM.getState();
- if (state == Phone.State.OFFHOOK) {
+ if (state == PhoneConstants.State.OFFHOOK) {
// basically do onPhoneStateChanged + display the incoming call UI
onPhoneStateChanged(r);
if (DBG) log("- showing incoming call (unknown connection appeared)...");
@@ -747,17 +748,17 @@
* - see onDisconnect() for calls being hung up or disconnected
*/
private void onPhoneStateChanged(AsyncResult r) {
- Phone.State state = mCM.getState();
+ PhoneConstants.State state = mCM.getState();
if (VDBG) log("onPhoneStateChanged: state = " + state);
// Turn status bar notifications on or off depending upon the state
// of the phone. Notification Alerts (audible or vibrating) should
// be on if and only if the phone is IDLE.
mApplication.notificationMgr.statusBarHelper
- .enableNotificationAlerts(state == Phone.State.IDLE);
+ .enableNotificationAlerts(state == PhoneConstants.State.IDLE);
Phone fgPhone = mCM.getFgPhone();
- if (fgPhone.getPhoneType() == Phone.PHONE_TYPE_CDMA) {
+ if (fgPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
if ((fgPhone.getForegroundCall().getState() == Call.State.ACTIVE)
&& ((mPreviousCdmaCallState == Call.State.DIALING)
|| (mPreviousCdmaCallState == Call.State.ALERTING))) {
@@ -782,7 +783,7 @@
// Update the phone state and other sensor/lock.
mApplication.updatePhoneState(state);
- if (state == Phone.State.OFFHOOK) {
+ if (state == PhoneConstants.State.OFFHOOK) {
// stop call waiting tone if needed when answering
if (mCallWaitingTonePlayer != null) {
mCallWaitingTonePlayer.stopTone();
@@ -830,7 +831,7 @@
IN_CALL_NOTIFICATION_UPDATE_DELAY);
}
- if (fgPhone.getPhoneType() == Phone.PHONE_TYPE_CDMA) {
+ if (fgPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
Connection c = fgPhone.getForegroundCall().getLatestConnection();
if ((c != null) && (PhoneNumberUtils.isLocalEmergencyNumber(c.getAddress(),
mApplication))) {
@@ -860,8 +861,8 @@
}
}
- if ((fgPhone.getPhoneType() == Phone.PHONE_TYPE_GSM)
- || (fgPhone.getPhoneType() == Phone.PHONE_TYPE_SIP)) {
+ if ((fgPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_GSM)
+ || (fgPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_SIP)) {
Call.State callState = mCM.getActiveFgCallState();
if (!callState.isDialing()) {
// If call get activated or disconnected before the ringback
@@ -1031,7 +1032,7 @@
}
int autoretrySetting = 0;
- if ((c != null) && (c.getCall().getPhone().getPhoneType() == Phone.PHONE_TYPE_CDMA)) {
+ if ((c != null) && (c.getCall().getPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)) {
autoretrySetting = android.provider.Settings.System.getInt(mApplication.
getContentResolver(),android.provider.Settings.System.CALL_AUTO_RETRY, 0);
}
@@ -1039,7 +1040,7 @@
// Stop any signalInfo tone being played when a call gets ended
stopSignalInfoTone();
- if ((c != null) && (c.getCall().getPhone().getPhoneType() == Phone.PHONE_TYPE_CDMA)) {
+ if ((c != null) && (c.getCall().getPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA)) {
// Resetting the CdmaPhoneCallState members
mApplication.cdmaPhoneCallState.resetCdmaPhoneCallState();
@@ -1062,7 +1063,7 @@
// call connection hence we should *not* be stopping the ringer being played for
// the Incoming Call
Call ringingCall = mCM.getFirstActiveRingingCall();
- if (ringingCall.getPhone().getPhoneType() == Phone.PHONE_TYPE_CDMA) {
+ if (ringingCall.getPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
if (PhoneUtils.isRealIncomingCall(ringingCall.getState())) {
// Also we need to take off the "In Call" icon from the Notification
// area as the Out going Call never got connected
@@ -1139,7 +1140,7 @@
// there's still an active call on the other line.)
// TODO: We may eventually want to disable this via a preference.
if ((toneToPlay == InCallTonePlayer.TONE_NONE)
- && (mCM.getState() == Phone.State.IDLE)
+ && (mCM.getState() == PhoneConstants.State.IDLE)
&& (c != null)) {
Connection.DisconnectCause cause = c.getDisconnectCause();
if ((cause == Connection.DisconnectCause.NORMAL) // remote hangup
@@ -1151,7 +1152,7 @@
}
// All phone calls are disconnected.
- if (mCM.getState() == Phone.State.IDLE) {
+ if (mCM.getState() == PhoneConstants.State.IDLE) {
// Don't reset the audio mode or bluetooth/speakerphone state
// if we still need to let the user hear a tone through the earpiece.
if (toneToPlay == InCallTonePlayer.TONE_NONE) {
@@ -1201,7 +1202,7 @@
// For international calls, 011 needs to be logged as +
final int presentation = getPresentation(c, ci);
- if (phone.getPhoneType() == Phone.PHONE_TYPE_CDMA) {
+ if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
if ((isEmergencyNumber)
&& (mCurrentEmergencyToneState != EMERGENCY_TONE_OFF)) {
if (mEmergencyTonePlayerVibrator != null) {
@@ -1445,12 +1446,12 @@
toneLengthMillis = Integer.MAX_VALUE - TONE_TIMEOUT_BUFFER;
break;
case TONE_BUSY:
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
toneType = ToneGenerator.TONE_CDMA_NETWORK_BUSY_ONE_SHOT;
toneVolume = TONE_RELATIVE_VOLUME_LOPRI;
toneLengthMillis = 1000;
- } else if ((phoneType == Phone.PHONE_TYPE_GSM)
- || (phoneType == Phone.PHONE_TYPE_SIP)) {
+ } else if ((phoneType == PhoneConstants.PHONE_TYPE_GSM)
+ || (phoneType == PhoneConstants.PHONE_TYPE_SIP)) {
toneType = ToneGenerator.TONE_SUP_BUSY;
toneVolume = TONE_RELATIVE_VOLUME_HIPRI;
toneLengthMillis = 4000;
@@ -1560,7 +1561,7 @@
if (toneGenerator != null) {
int ringerMode = mAudioManager.getRingerMode();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
if (toneType == ToneGenerator.TONE_CDMA_ALERT_CALL_GUARD) {
if ((ringerMode != AudioManager.RINGER_MODE_SILENT) &&
(ringerMode != AudioManager.RINGER_MODE_VIBRATE)) {
@@ -1626,7 +1627,7 @@
// "call ended", where the phone has already become idle but
// we need to defer the resetAudioStateAfterDisconnect() call
// till the tone finishes playing.)
- if (mCM.getState() == Phone.State.IDLE) {
+ if (mCM.getState() == PhoneConstants.State.IDLE) {
resetAudioStateAfterDisconnect();
}
}
@@ -1905,9 +1906,9 @@
// call.
String name = ci.name;
String number = ci.phoneNumber;
- if (ci.numberPresentation == Connection.PRESENTATION_RESTRICTED) {
+ if (ci.numberPresentation == PhoneConstants.PRESENTATION_RESTRICTED) {
name = mApplication.getString(R.string.private_num);
- } else if (ci.numberPresentation != Connection.PRESENTATION_ALLOWED) {
+ } else if (ci.numberPresentation != PhoneConstants.PRESENTATION_ALLOWED) {
name = mApplication.getString(R.string.unknown);
} else {
number = PhoneUtils.modifyForSpecialCnapCases(mApplication,
@@ -2051,7 +2052,7 @@
// from the connection.
if (null == callerInfo || TextUtils.isEmpty(callerInfo.phoneNumber) ||
callerInfo.isEmergencyNumber() || callerInfo.isVoiceMailNumber()) {
- if (conn.getCall().getPhone().getPhoneType() == Phone.PHONE_TYPE_CDMA) {
+ if (conn.getCall().getPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
// In cdma getAddress() is not always equals to getOrigDialString().
number = conn.getOrigDialString();
} else {
diff --git a/src/com/android/phone/CdmaCallOptions.java b/src/com/android/phone/CdmaCallOptions.java
index 5677177..656863b 100644
--- a/src/com/android/phone/CdmaCallOptions.java
+++ b/src/com/android/phone/CdmaCallOptions.java
@@ -17,6 +17,7 @@
package com.android.phone;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import android.content.DialogInterface;
import android.os.AsyncResult;
@@ -43,7 +44,7 @@
addPreferencesFromResource(R.xml.cdma_call_privacy);
mButtonVoicePrivacy = (CheckBoxPreference) findPreference(BUTTON_VP_KEY);
- if (PhoneApp.getPhone().getPhoneType() != Phone.PHONE_TYPE_CDMA
+ if (PhoneApp.getPhone().getPhoneType() != PhoneConstants.PHONE_TYPE_CDMA
|| getResources().getBoolean(R.bool.config_voice_privacy_disable)) {
//disable the entire screen
getPreferenceScreen().setEnabled(false);
diff --git a/src/com/android/phone/CdmaOptions.java b/src/com/android/phone/CdmaOptions.java
index cf28709..3e3c8b5 100644
--- a/src/com/android/phone/CdmaOptions.java
+++ b/src/com/android/phone/CdmaOptions.java
@@ -28,6 +28,7 @@
import android.text.TextUtils;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyProperties;
/**
@@ -75,7 +76,7 @@
final boolean voiceCapable = mPrefActivity.getResources().getBoolean(
com.android.internal.R.bool.config_voice_capable);
- final boolean isLTE = mPhone.getLteOnCdmaMode() == Phone.LTE_ON_CDMA_TRUE;
+ final boolean isLTE = mPhone.getLteOnCdmaMode() == PhoneConstants.LTE_ON_CDMA_TRUE;
if (voiceCapable || isLTE) {
// This option should not be available on voice-capable devices (i.e. regular phones)
// and is replaced by the LTE data service item on LTE devices
diff --git a/src/com/android/phone/EditFdnContactScreen.java b/src/com/android/phone/EditFdnContactScreen.java
index cdeae19..36a6b79 100644
--- a/src/com/android/phone/EditFdnContactScreen.java
+++ b/src/com/android/phone/EditFdnContactScreen.java
@@ -295,6 +295,7 @@
private void updateContact() {
if (DBG) log("updateContact");
+ final String name = getNameFromTextField();
final String number = PhoneNumberUtils.convertAndStrip(getNumberFromTextField());
if (!isValidNumber(number)) {
@@ -306,7 +307,7 @@
ContentValues bundle = new ContentValues();
bundle.put("tag", mName);
bundle.put("number", mNumber);
- bundle.put("newTag", number);
+ bundle.put("newTag", name);
bundle.put("newNumber", number);
bundle.put("pin2", mPin2);
diff --git a/src/com/android/phone/EmergencyCallHelper.java b/src/com/android/phone/EmergencyCallHelper.java
index 8a2392b..3508b94 100644
--- a/src/com/android/phone/EmergencyCallHelper.java
+++ b/src/com/android/phone/EmergencyCallHelper.java
@@ -19,6 +19,7 @@
import com.android.internal.telephony.CallManager;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.phone.Constants.CallStatusCode;
import com.android.phone.InCallUiState.ProgressIndicationType;
@@ -278,7 +279,7 @@
* Handles the retry timer expiring.
*/
private void onRetryTimeout() {
- Phone.State phoneState = mCM.getState();
+ PhoneConstants.State phoneState = mCM.getState();
int serviceState = mPhone.getServiceState().getState();
if (DBG) log("onRetryTimeout(): phone state " + phoneState
+ ", service state " + serviceState
@@ -292,7 +293,7 @@
//
// - If the radio is still powered off, try powering it on again.
- if (phoneState == Phone.State.OFFHOOK) {
+ if (phoneState == PhoneConstants.State.OFFHOOK) {
if (DBG) log("- onRetryTimeout: Call is active! Cleaning up...");
cleanup();
return;
diff --git a/src/com/android/phone/EmergencyCallbackModeService.java b/src/com/android/phone/EmergencyCallbackModeService.java
index 2b5fdd3..b506598 100644
--- a/src/com/android/phone/EmergencyCallbackModeService.java
+++ b/src/com/android/phone/EmergencyCallbackModeService.java
@@ -36,6 +36,7 @@
import com.android.internal.telephony.cdma.CDMAPhone;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.TelephonyIntents;
import com.android.internal.telephony.TelephonyProperties;
@@ -73,7 +74,7 @@
@Override
public void onCreate() {
// Check if it is CDMA phone
- if (PhoneFactory.getDefaultPhone().getPhoneType() != Phone.PHONE_TYPE_CDMA) {
+ if (PhoneFactory.getDefaultPhone().getPhoneType() != PhoneConstants.PHONE_TYPE_CDMA) {
Log.e(LOG_TAG, "Error! Emergency Callback Mode not supported for " +
PhoneFactory.getDefaultPhone().getPhoneName() + " phones");
stopSelf();
diff --git a/src/com/android/phone/GsmUmtsCallOptions.java b/src/com/android/phone/GsmUmtsCallOptions.java
index a3035ff..ed28be9 100644
--- a/src/com/android/phone/GsmUmtsCallOptions.java
+++ b/src/com/android/phone/GsmUmtsCallOptions.java
@@ -23,6 +23,7 @@
import android.preference.PreferenceScreen;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
public class GsmUmtsCallOptions extends PreferenceActivity {
private static final String LOG_TAG = "GsmUmtsCallOptions";
@@ -34,7 +35,7 @@
addPreferencesFromResource(R.xml.gsm_umts_call_options);
- if (PhoneApp.getPhone().getPhoneType() != Phone.PHONE_TYPE_GSM) {
+ if (PhoneApp.getPhone().getPhoneType() != PhoneConstants.PHONE_TYPE_GSM) {
//disable the entire screen
getPreferenceScreen().setEnabled(false);
}
diff --git a/src/com/android/phone/GsmUmtsOptions.java b/src/com/android/phone/GsmUmtsOptions.java
index 35991e3..64dccd8 100644
--- a/src/com/android/phone/GsmUmtsOptions.java
+++ b/src/com/android/phone/GsmUmtsOptions.java
@@ -22,6 +22,7 @@
import android.preference.PreferenceScreen;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneFactory;
/**
@@ -52,7 +53,7 @@
mButtonOperatorSelectionExpand =
(PreferenceScreen) mPrefScreen.findPreference(BUTTON_OPERATOR_SELECTION_EXPAND_KEY);
mButtonPrefer2g = (CheckBoxPreference) mPrefScreen.findPreference(BUTTON_PREFER_2G_KEY);
- if (PhoneFactory.getDefaultPhone().getPhoneType() != Phone.PHONE_TYPE_GSM) {
+ if (PhoneFactory.getDefaultPhone().getPhoneType() != PhoneConstants.PHONE_TYPE_GSM) {
log("Not a GSM phone");
mButtonAPNExpand.setEnabled(false);
mButtonOperatorSelectionExpand.setEnabled(false);
diff --git a/src/com/android/phone/InCallControlState.java b/src/com/android/phone/InCallControlState.java
index b44e310..e901cf1 100644
--- a/src/com/android/phone/InCallControlState.java
+++ b/src/com/android/phone/InCallControlState.java
@@ -23,6 +23,7 @@
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.CallManager;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyCapabilities;
/**
@@ -96,7 +97,7 @@
* the Phone.
*/
public void update() {
- final Phone.State state = mCM.getState(); // coarse-grained voice call state
+ final PhoneConstants.State state = mCM.getState(); // coarse-grained voice call state
final Call fgCall = mCM.getActiveFgCall();
final Call.State fgCallState = fgCall.getState();
final boolean hasActiveForegroundCall = (fgCallState == Call.State.ACTIVE);
@@ -142,7 +143,7 @@
// "Speaker": always enabled unless the phone is totally idle.
// The current speaker state comes from the AudioManager.
- speakerEnabled = (state != Phone.State.IDLE);
+ speakerEnabled = (state != PhoneConstants.State.IDLE);
speakerOn = PhoneUtils.isSpeakerOn(mInCallScreen);
// "Mute": only enabled when the foreground call is ACTIVE.
diff --git a/src/com/android/phone/InCallScreen.java b/src/com/android/phone/InCallScreen.java
index 008efd8..05675e6 100755
--- a/src/com/android/phone/InCallScreen.java
+++ b/src/com/android/phone/InCallScreen.java
@@ -66,6 +66,7 @@
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyCapabilities;
import com.android.phone.Constants.CallStatusCode;
import com.android.phone.InCallUiState.InCallScreenMode;
@@ -463,7 +464,7 @@
// set this flag so this activity will stay in front of the keyguard
int flags = WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED;
- if (mApp.getPhoneState() == Phone.State.OFFHOOK) {
+ if (mApp.getPhoneState() == PhoneConstants.State.OFFHOOK) {
// While we are in call, the in-call screen should dismiss the keyguard.
// This allows the user to press Home to go directly home without going through
// an insecure lock screen.
@@ -712,7 +713,7 @@
// Coming to the foreground while in an incoming call is ringing.
// We need to do something special.
- if (mCM.getState() == Phone.State.RINGING) {
+ if (mCM.getState() == PhoneConstants.State.RINGING) {
// If the phone is ringing, we *should* already be holding a
// full wake lock (which we would have acquired before
// firing off the intent that brought us here; see
@@ -867,7 +868,7 @@
// the same time that the phone state is changing. This can
// end up causing the sleep request to be ignored.
if (mHandler.hasMessages(DELAYED_CLEANUP_AFTER_DISCONNECT)
- && mCM.getState() != Phone.State.RINGING) {
+ && mCM.getState() != PhoneConstants.State.RINGING) {
if (DBG) log("DELAYED_CLEANUP_AFTER_DISCONNECT detected, moving UI to background.");
endInCallScreenSession();
}
@@ -913,7 +914,7 @@
updateKeyguardPolicy(false);
// See also PhoneApp#updatePhoneState(), which takes care of all the other release() calls.
- if (mApp.getUpdateLock().isHeld() && mApp.getPhoneState() == Phone.State.IDLE) {
+ if (mApp.getUpdateLock().isHeld() && mApp.getPhoneState() == PhoneConstants.State.IDLE) {
if (DBG) {
log("Release UpdateLock on onPause() because there's no active phone call.");
}
@@ -928,10 +929,10 @@
stopTimer();
- Phone.State state = mCM.getState();
+ PhoneConstants.State state = mCM.getState();
if (DBG) log("onStop: state = " + state);
- if (state == Phone.State.IDLE) {
+ if (state == PhoneConstants.State.IDLE) {
if (mRespondViaSmsManager.isShowingPopup()) {
// This means that the user has been opening the "Respond via SMS" dialog even
// after the incoming call hanging up, and the screen finally went background.
@@ -1310,7 +1311,7 @@
* value of false means there's currently no phone activity at all.
*/
private boolean phoneIsInUse() {
- return mCM.getState() != Phone.State.IDLE;
+ return mCM.getState() != PhoneConstants.State.IDLE;
}
private boolean handleDialerKeyDown(int keyCode, KeyEvent event) {
@@ -1387,7 +1388,7 @@
final boolean hasHoldingCall = mCM.hasActiveBgCall();
int phoneType = mPhone.getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
// The green CALL button means either "Answer", "Swap calls/On Hold", or
// "Add to 3WC", depending on the current state of the Phone.
@@ -1410,8 +1411,8 @@
if (DBG) log("answerCall: Switch btwn 2 calls scenario");
internalSwapCalls();
}
- } else if ((phoneType == Phone.PHONE_TYPE_GSM)
- || (phoneType == Phone.PHONE_TYPE_SIP)) {
+ } else if ((phoneType == PhoneConstants.PHONE_TYPE_GSM)
+ || (phoneType == PhoneConstants.PHONE_TYPE_SIP)) {
if (hasRingingCall) {
// If an incoming call is ringing, the CALL button is actually
// handled by the PhoneWindowManager. (We do this to make
@@ -1525,7 +1526,7 @@
case KeyEvent.KEYCODE_VOLUME_UP:
case KeyEvent.KEYCODE_VOLUME_DOWN:
case KeyEvent.KEYCODE_VOLUME_MUTE:
- if (mCM.getState() == Phone.State.RINGING) {
+ if (mCM.getState() == PhoneConstants.State.RINGING) {
// If an incoming call is ringing, the VOLUME buttons are
// actually handled by the PhoneWindowManager. (We do
// this to make sure that we'll respond to them even if
@@ -1665,7 +1666,7 @@
* Something has changed in the phone's state. Update the UI.
*/
private void onPhoneStateChanged(AsyncResult r) {
- Phone.State state = mCM.getState();
+ PhoneConstants.State state = mCM.getState();
if (DBG) log("onPhoneStateChanged: current state = " + state);
// There's nothing to do here if we're not the foreground activity.
@@ -1715,7 +1716,7 @@
boolean currentlyIdle = !phoneIsInUse();
int autoretrySetting = AUTO_RETRY_OFF;
- boolean phoneIsCdma = (mPhone.getPhoneType() == Phone.PHONE_TYPE_CDMA);
+ boolean phoneIsCdma = (mPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA);
if (phoneIsCdma) {
// Get the Auto-retry setting only if Phone State is IDLE,
// else let it stay as AUTO_RETRY_OFF
@@ -1939,7 +1940,7 @@
// higher preference. At this time framework sends a disconnect for the Out going
// call connection hence we should *not* bring down the InCallScreen as the Phone
// State would be RINGING
- if (mPhone.getPhoneType() == Phone.PHONE_TYPE_CDMA) {
+ if (mPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
if (!currentlyIdle) {
// Clean up any connections in the DISCONNECTED state.
// This is necessary cause in CallCollision the foreground call might have
@@ -2091,9 +2092,9 @@
// if phone is a CDMA phone display feature code completed message
int phoneType = mPhone.getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
PhoneUtils.displayMMIComplete(mPhone, mApp, mmiCode, null, null);
- } else if (phoneType == Phone.PHONE_TYPE_GSM) {
+ } else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
if (mmiCode.getState() != MmiCode.State.PENDING) {
if (DBG) log("Got MMI_COMPLETE, finishing InCallScreen...");
dismissAllDialogs();
@@ -2336,7 +2337,7 @@
if (DBG) log("updateScreen()...");
final InCallScreenMode inCallScreenMode = mApp.inCallUiState.inCallScreenMode;
if (VDBG) {
- Phone.State state = mCM.getState();
+ PhoneConstants.State state = mCM.getState();
log(" - phone state = " + state);
log(" - inCallScreenMode = " + inCallScreenMode);
}
@@ -2403,7 +2404,7 @@
// If an incoming call is ringing, make sure the dialpad is
// closed. (We do this to make sure we're not covering up the
// "incoming call" UI.)
- if (mCM.getState() == Phone.State.RINGING) {
+ if (mCM.getState() == PhoneConstants.State.RINGING) {
if (mDialer.isOpened()) {
Log.i(LOG_TAG, "During RINGING state we force hiding dialpad.");
closeDialpadInternal(false); // don't do the "closing" animation
@@ -2444,7 +2445,7 @@
String postDialStr = null;
List<Connection> fgConnections = mCM.getFgCallConnections();
int phoneType = mCM.getFgPhone().getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
Connection fgLatestConnection = mCM.getFgCallLatestConnection();
if (mApp.cdmaPhoneCallState.getCurrentCallState() ==
CdmaPhoneCallState.PhoneCallState.CONF_CALL) {
@@ -2460,8 +2461,8 @@
postDialStr = fgLatestConnection.getRemainingPostDialString();
showWaitPromptDialog(fgLatestConnection, postDialStr);
}
- } else if ((phoneType == Phone.PHONE_TYPE_GSM)
- || (phoneType == Phone.PHONE_TYPE_SIP)) {
+ } else if ((phoneType == PhoneConstants.PHONE_TYPE_GSM)
+ || (phoneType == PhoneConstants.PHONE_TYPE_SIP)) {
for (Connection cn : fgConnections) {
if ((cn != null) && (cn.getPostDialState() == Connection.PostDialState.WAIT)) {
postDialStr = cn.getRemainingPostDialString();
@@ -2513,7 +2514,7 @@
// does in fact implement getPendingMmiCodes(), so should we
// check that here regardless of the phone type?
boolean hasPendingMmiCodes =
- (mPhone.getPhoneType() == Phone.PHONE_TYPE_GSM)
+ (mPhone.getPhoneType() == PhoneConstants.PHONE_TYPE_GSM)
&& !mPhone.getPendingMmiCodes().isEmpty();
// Finally, it's also OK to stay here on the InCallScreen if we
@@ -3113,7 +3114,7 @@
// Notifications, so we should notify the user here.
// Otherwise, the code in PhoneUtils.java should handle
// user notifications in the form of Toasts or Dialogs.
- if (mCM.getState() == Phone.State.OFFHOOK) {
+ if (mCM.getState() == PhoneConstants.State.OFFHOOK) {
Toast.makeText(mApp, R.string.incall_status_dialed_mmi, Toast.LENGTH_SHORT)
.show();
}
@@ -3502,10 +3503,10 @@
Phone phone = mCM.getRingingPhone();
Call ringing = mCM.getFirstActiveRingingCall();
int phoneType = phone.getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
if (DBG) log("internalAnswerCall: answering (CDMA)...");
if (mCM.hasActiveFgCall()
- && mCM.getFgPhone().getPhoneType() == Phone.PHONE_TYPE_SIP) {
+ && mCM.getFgPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_SIP) {
// The incoming call is CDMA call and the ongoing
// call is a SIP call. The CDMA network does not
// support holding an active call, so there's no
@@ -3519,10 +3520,10 @@
} else {
PhoneUtils.answerCall(ringing);
}
- } else if (phoneType == Phone.PHONE_TYPE_SIP) {
+ } else if (phoneType == PhoneConstants.PHONE_TYPE_SIP) {
if (DBG) log("internalAnswerCall: answering (SIP)...");
if (mCM.hasActiveFgCall()
- && mCM.getFgPhone().getPhoneType() == Phone.PHONE_TYPE_CDMA) {
+ && mCM.getFgPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
// Similar to the PHONE_TYPE_CDMA handling.
// The incoming call is SIP call and the ongoing
// call is a CDMA call. The CDMA network does not
@@ -3537,7 +3538,7 @@
} else {
PhoneUtils.answerCall(ringing);
}
- } else if (phoneType == Phone.PHONE_TYPE_GSM) {
+ } else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
if (DBG) log("internalAnswerCall: answering (GSM)...");
// GSM: this is usually just a wrapper around
// PhoneUtils.answerCall(), *but* we also need to do
@@ -3628,7 +3629,7 @@
* Hang up the current active call.
*/
private void internalHangup() {
- Phone.State state = mCM.getState();
+ PhoneConstants.State state = mCM.getState();
log("internalHangup()... phone state = " + state);
// Regardless of the phone state, issue a hangup request.
@@ -3649,7 +3650,7 @@
// another call, or something else going on like an active MMI
// sequence.)
- if (state == Phone.State.IDLE) {
+ if (state == PhoneConstants.State.IDLE) {
// The user asked us to hang up, but the phone was (already) idle!
Log.w(LOG_TAG, "internalHangup(): phone is already IDLE!");
@@ -3702,7 +3703,7 @@
// If we have a valid BluetoothHandsfree then since CDMA network or
// Telephony FW does not send us information on which caller got swapped
// we need to update the second call active state in BluetoothHandsfree internally
- if (mCM.getBgPhone().getPhoneType() == Phone.PHONE_TYPE_CDMA) {
+ if (mCM.getBgPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
BluetoothHandsfree bthf = mApp.getBluetoothHandsfree();
if (bthf != null) {
bthf.cdmaSwapSecondCallState();
@@ -3821,7 +3822,7 @@
// Cleanup Ota Screen if necessary and set the panel
// to VISIBLE.
- if (mCM.getState() != Phone.State.OFFHOOK) {
+ if (mCM.getState() != PhoneConstants.State.OFFHOOK) {
if (mApp.otaUtils != null) {
mApp.otaUtils.cleanOtaScreen(true);
}
@@ -4622,7 +4623,7 @@
if (mApp.proximitySensorModeEnabled()) {
// We should not enable notification's expanded view on RINGING state.
mApp.notificationMgr.statusBarHelper.enableExpandedView(
- mCM.getState() != Phone.State.RINGING);
+ mCM.getState() != PhoneConstants.State.RINGING);
} else {
// If proximity sensor is unavailable on the device, disable it to avoid false
// touches toward notifications.
diff --git a/src/com/android/phone/InCallTouchUi.java b/src/com/android/phone/InCallTouchUi.java
index 9845fa8..84176d1 100644
--- a/src/com/android/phone/InCallTouchUi.java
+++ b/src/com/android/phone/InCallTouchUi.java
@@ -46,6 +46,7 @@
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallManager;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.widget.multiwaveview.GlowPadView;
import com.android.internal.widget.multiwaveview.GlowPadView.OnTriggerListener;
import com.android.phone.InCallUiState.InCallScreenMode;
@@ -192,7 +193,7 @@
// TODO: Back when these buttons had text labels, we changed
// the label of mSwapButton for CDMA as follows:
//
- // if (PhoneApp.getPhone().getPhoneType() == Phone.PHONE_TYPE_CDMA) {
+ // if (PhoneApp.getPhone().getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
// // In CDMA we use a generalized text - "Manage call", as behavior on selecting
// // this option depends entirely on what the current call state is.
// mSwapButtonLabel.setText(R.string.onscreenManageCallsText);
@@ -221,7 +222,7 @@
return;
}
- Phone.State state = cm.getState(); // IDLE, RINGING, or OFFHOOK
+ PhoneConstants.State state = cm.getState(); // IDLE, RINGING, or OFFHOOK
if (DBG) log("updateState: current state = " + state);
boolean showIncomingCallControls = false;
@@ -328,7 +329,7 @@
// end ringing) or ACTIVE (when the call is actually connected.) In any
// state *other* than these, the popup should not be visible.
- if ((state == Phone.State.OFFHOOK)
+ if ((state == PhoneConstants.State.OFFHOOK)
&& (fgCallState == Call.State.ALERTING || fgCallState == Call.State.ACTIVE)) {
// The audio mode popup is allowed to be visible in this state.
// So if it's up, leave it alone.
@@ -454,13 +455,13 @@
mAddButton.setEnabled(true);
mMergeButton.setVisibility(View.GONE);
} else if (inCallControlState.canMerge) {
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
// In CDMA "Add" option is always given to the user and the
// "Merge" option is provided as a button on the top left corner of the screen,
// we always set the mMergeButton to GONE
mMergeButton.setVisibility(View.GONE);
- } else if ((phoneType == Phone.PHONE_TYPE_GSM)
- || (phoneType == Phone.PHONE_TYPE_SIP)) {
+ } else if ((phoneType == PhoneConstants.PHONE_TYPE_GSM)
+ || (phoneType == PhoneConstants.PHONE_TYPE_SIP)) {
mMergeButton.setVisibility(View.VISIBLE);
mMergeButton.setEnabled(true);
mAddButton.setVisibility(View.GONE);
@@ -480,8 +481,8 @@
mMergeButton.setVisibility(View.GONE);
}
if (inCallControlState.canAddCall && inCallControlState.canMerge) {
- if ((phoneType == Phone.PHONE_TYPE_GSM)
- || (phoneType == Phone.PHONE_TYPE_SIP)) {
+ if ((phoneType == PhoneConstants.PHONE_TYPE_GSM)
+ || (phoneType == PhoneConstants.PHONE_TYPE_SIP)) {
// Uh oh, the InCallControlState thinks that "Add" *and* "Merge"
// should both be available right now. This *should* never
// happen with GSM, but if it's possible on any
@@ -489,7 +490,7 @@
// they can both be visible at the same time...
Log.w(LOG_TAG, "updateInCallControls: Add *and* Merge enabled," +
" but can't show both!");
- } else if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ } else if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
// In CDMA "Add" option is always given to the user and the hence
// in this case both "Add" and "Merge" options would be available to user
if (DBG) log("updateInCallControls: CDMA: Add and Merge both enabled");
@@ -559,7 +560,7 @@
Log.w(LOG_TAG, "updateInCallControls: Hold *and* Swap enabled, but can't show both!");
}
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
if (inCallControlState.canSwap && inCallControlState.canMerge) {
// Uh oh, the InCallControlState thinks that Swap *and* Merge
// should both be available. This *should* never happen with
@@ -583,7 +584,7 @@
// Note that mExtraButtonRow is ViewStub, which will be inflated for the first time when
// any of its buttons becomes visible.
final boolean showCdmaMerge =
- (phoneType == Phone.PHONE_TYPE_CDMA) && inCallControlState.canMerge;
+ (phoneType == PhoneConstants.PHONE_TYPE_CDMA) && inCallControlState.canMerge;
final boolean showExtraButtonRow =
showCdmaMerge || inCallControlState.manageConferenceVisible;
if (showExtraButtonRow && !inCallControlState.dialpadVisible) {
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
index 0c88bb7..2948216 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -17,6 +17,7 @@
package com.android.phone;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyIntents;
import com.android.internal.telephony.TelephonyProperties;
@@ -221,7 +222,7 @@
mButtonDataUsage = prefSet.findPreference(BUTTON_DATA_USAGE_KEY);
mLteDataServicePref = prefSet.findPreference(BUTTON_CDMA_LTE_DATA_SERVICE_KEY);
- boolean isLteOnCdma = mPhone.getLteOnCdmaMode() == Phone.LTE_ON_CDMA_TRUE;
+ boolean isLteOnCdma = mPhone.getLteOnCdmaMode() == PhoneConstants.LTE_ON_CDMA_TRUE;
if (getResources().getBoolean(R.bool.world_phone) == true) {
// set the listener for the mButtonPreferredNetworkMode list preference so we can issue
// change Preferred Network Mode.
@@ -239,7 +240,7 @@
prefSet.removePreference(mButtonPreferredNetworkMode);
}
int phoneType = mPhone.getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
mCdmaOptions = new CdmaOptions(this, prefSet, mPhone);
if (isLteOnCdma) {
mButtonPreferredNetworkMode.setOnPreferenceChangeListener(this);
@@ -255,7 +256,7 @@
Integer.toString(settingsNetworkMode));
}
- } else if (phoneType == Phone.PHONE_TYPE_GSM) {
+ } else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
mGsmUmtsOptions = new GsmUmtsOptions(this, prefSet);
} else {
throw new IllegalStateException("Unexpected phone type: " + phoneType);
@@ -516,11 +517,11 @@
break;
case Phone.NT_MODE_CDMA:
switch (mPhone.getLteOnCdmaMode()) {
- case Phone.LTE_ON_CDMA_TRUE:
+ case PhoneConstants.LTE_ON_CDMA_TRUE:
mButtonPreferredNetworkMode.setSummary(
R.string.preferred_network_mode_cdma_summary);
break;
- case Phone.LTE_ON_CDMA_FALSE:
+ case PhoneConstants.LTE_ON_CDMA_FALSE:
default:
mButtonPreferredNetworkMode.setSummary(
R.string.preferred_network_mode_cdma_evdo_summary);
diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index 8d90314..530389c 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -54,8 +54,10 @@
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneBase;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyCapabilities;
+
/**
* NotificationManager-related utility code for the Phone app.
*
@@ -620,7 +622,7 @@
private void updateSpeakerNotification() {
AudioManager audioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
boolean showNotification =
- (mPhone.getState() == Phone.State.OFFHOOK) && audioManager.isSpeakerphoneOn();
+ (mPhone.getState() == PhoneConstants.State.OFFHOOK) && audioManager.isSpeakerphoneOn();
if (DBG) log(showNotification
? "updateSpeakerNotification: speaker ON"
@@ -693,7 +695,7 @@
return;
}
- if ((mCM.getState() == Phone.State.OFFHOOK) && PhoneUtils.getMute()) {
+ if ((mCM.getState() == PhoneConstants.State.OFFHOOK) && PhoneUtils.getMute()) {
if (DBG) log("updateMuteNotification: MUTED");
notifyMute();
} else {
@@ -782,7 +784,7 @@
// If the phone is idle, completely clean up all call-related
// notifications.
- if (mCM.getState() == Phone.State.IDLE) {
+ if (mCM.getState() == PhoneConstants.State.IDLE) {
cancelInCall();
cancelMute();
cancelSpeakerphone();
diff --git a/src/com/android/phone/OtaUtils.java b/src/com/android/phone/OtaUtils.java
index a93e0e7..572c6ac 100644
--- a/src/com/android/phone/OtaUtils.java
+++ b/src/com/android/phone/OtaUtils.java
@@ -17,6 +17,7 @@
package com.android.phone;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyCapabilities;
import com.android.internal.telephony.TelephonyProperties;
import com.android.phone.OtaUtils.CdmaOtaInCallScreenUiState.State;
@@ -302,7 +303,7 @@
}
phone.unregisterForSubscriptionInfoReady(handler);
- if (getLteOnCdmaMode(context) == Phone.LTE_ON_CDMA_UNKNOWN) {
+ if (getLteOnCdmaMode(context) == PhoneConstants.LTE_ON_CDMA_UNKNOWN) {
if (sOtaCallLteRetries < OTA_CALL_LTE_RETRIES_MAX) {
if (DBG) log("maybeDoOtaCall: LTE state still unknown: retrying");
handler.sendEmptyMessageDelayed(request, OTA_CALL_LTE_RETRY_PERIOD);
@@ -323,7 +324,7 @@
// Run the OTASP call in "interactive" mode only if
// this is a non-LTE "voice capable" device.
- if (PhoneApp.sVoiceCapable && getLteOnCdmaMode(context) == Phone.LTE_ON_CDMA_FALSE) {
+ if (PhoneApp.sVoiceCapable && getLteOnCdmaMode(context) == PhoneConstants.LTE_ON_CDMA_FALSE) {
if (phoneNeedsActivation
&& (otaShowActivationScreen == OTA_SHOW_ACTIVATION_SCREEN_ON)) {
app.cdmaOtaProvisionData.isOtaCallIntentProcessed = false;
@@ -1620,9 +1621,9 @@
// If the telephony manager is not available yet, or if it doesn't know the answer yet,
// try falling back on the system property that may or may not be there
if (telephonyManager == null
- || telephonyManager.getLteOnCdmaMode() == Phone.LTE_ON_CDMA_UNKNOWN) {
+ || telephonyManager.getLteOnCdmaMode() == PhoneConstants.LTE_ON_CDMA_UNKNOWN) {
return SystemProperties.getInt(TelephonyProperties.PROPERTY_LTE_ON_CDMA_DEVICE,
- Phone.LTE_ON_CDMA_UNKNOWN);
+ PhoneConstants.LTE_ON_CDMA_UNKNOWN);
}
return telephonyManager.getLteOnCdmaMode();
}
diff --git a/src/com/android/phone/OutgoingCallBroadcaster.java b/src/com/android/phone/OutgoingCallBroadcaster.java
index fcf502a..df14ece 100644
--- a/src/com/android/phone/OutgoingCallBroadcaster.java
+++ b/src/com/android/phone/OutgoingCallBroadcaster.java
@@ -36,6 +36,7 @@
import android.widget.ProgressBar;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyCapabilities;
/**
@@ -192,7 +193,7 @@
if (DBG) Log.v(TAG, "CALL cancelled (null number), returning...");
return;
} else if (TelephonyCapabilities.supportsOtasp(app.phone)
- && (app.phone.getState() != Phone.State.IDLE)
+ && (app.phone.getState() != PhoneConstants.State.IDLE)
&& (app.phone.isOtaSpNumber(number))) {
if (DBG) Log.v(TAG, "Call is active, a 2nd OTA call cancelled -- returning.");
return;
diff --git a/src/com/android/phone/PhoneApp.java b/src/com/android/phone/PhoneApp.java
index 8afa3e2..10099f8 100644
--- a/src/com/android/phone/PhoneApp.java
+++ b/src/com/android/phone/PhoneApp.java
@@ -57,8 +57,10 @@
import com.android.internal.telephony.Call;
import com.android.internal.telephony.CallManager;
import com.android.internal.telephony.IccCard;
+import com.android.internal.telephony.IccCardConstants;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.TelephonyCapabilities;
import com.android.internal.telephony.TelephonyIntents;
@@ -213,7 +215,7 @@
private boolean mBeginningCall;
// Last phone state seen by updatePhoneState()
- private Phone.State mLastPhoneState = Phone.State.IDLE;
+ private PhoneConstants.State mLastPhoneState = PhoneConstants.State.IDLE;
private WakeState mWakeState = WakeState.SLEEP;
@@ -297,7 +299,7 @@
Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
- Phone.State phoneState;
+ PhoneConstants.State phoneState;
switch (msg.what) {
// Starts the SIP service. It's a no-op if SIP API is not supported
// on the deivce.
@@ -360,7 +362,7 @@
phoneState = mCM.getState();
// Do not change speaker state if phone is not off hook
- if (phoneState == Phone.State.OFFHOOK) {
+ if (phoneState == PhoneConstants.State.OFFHOOK) {
if (mBtHandsfree == null || !mBtHandsfree.isAudioOn()) {
if (!isHeadsetPlugged()) {
// if the state is "not connected", restore the speaker state.
@@ -385,7 +387,7 @@
// Marks the event where the SIM goes into ready state.
// Right now, this is only used for the PUK-unlocking
// process.
- if (msg.obj.equals(IccCard.INTENT_VALUE_ICC_READY)) {
+ if (msg.obj.equals(IccCardConstants.INTENT_VALUE_ICC_READY)) {
// when the right event is triggered and there
// are UI objects in the foreground, we close
// them to display the lock panel.
@@ -415,7 +417,7 @@
+ inDockMode);
phoneState = mCM.getState();
- if (phoneState == Phone.State.OFFHOOK &&
+ if (phoneState == PhoneConstants.State.OFFHOOK &&
!isHeadsetPlugged() &&
!(mBtHandsfree != null && mBtHandsfree.isAudioOn())) {
PhoneUtils.turnOnSpeaker(getApplicationContext(), inDockMode, true);
@@ -489,7 +491,7 @@
int phoneType = phone.getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
// Create an instance of CdmaPhoneCallState and initialize it to IDLE
cdmaPhoneCallState = new CdmaPhoneCallState();
cdmaPhoneCallState.CdmaPhoneCallStateInit();
@@ -837,7 +839,7 @@
* from the in-call UI (i.e. though it is not "foreground" anymore it will become
* so after screen being turned on), check
* {@link #isShowingCallScreenForProximity()} is true or not.
- * {@link #updateProximitySensorMode(com.android.internal.telephony.Phone.State)} is
+ * {@link #updateProximitySensorMode(com.android.internal.telephony.PhoneConstants.State)} is
* doing this.
*
* - If you want to know if the activity is not in foreground just because screen
@@ -1128,7 +1130,7 @@
* Phone UI (e.g. whether or not the InCallScreen is active.)
*/
/* package */ void updateWakeState() {
- Phone.State state = mCM.getState();
+ PhoneConstants.State state = mCM.getState();
// True if the in-call UI is the foreground activity.
// (Note this will be false if the screen is currently off,
@@ -1148,7 +1150,7 @@
// Note that we need to make a fresh call to this method any
// time the speaker state changes. (That happens in
// PhoneUtils.turnOnSpeaker().)
- boolean isSpeakerInUse = (state == Phone.State.OFFHOOK) && PhoneUtils.isSpeakerOn(this);
+ boolean isSpeakerInUse = (state == PhoneConstants.State.OFFHOOK) && PhoneUtils.isSpeakerOn(this);
// TODO (bug 1440854): The screen timeout *might* also need to
// depend on the bluetooth state, but this isn't as clear-cut as
@@ -1187,7 +1189,7 @@
// or if we're displaying the "Call ended" UI for a connection in
// the "disconnected" state.
//
- boolean isRinging = (state == Phone.State.RINGING);
+ boolean isRinging = (state == PhoneConstants.State.RINGING);
boolean isDialing = (phone.getForegroundCall().getState() == Call.State.DIALING);
boolean showingDisconnectedConnection =
PhoneUtils.hasDisconnectedConnections(phone) && isShowingCallScreen;
@@ -1298,7 +1300,7 @@
*
* @param state current state of the phone (see {@link Phone#State})
*/
- /* package */ void updateProximitySensorMode(Phone.State state) {
+ /* package */ void updateProximitySensorMode(PhoneConstants.State state) {
if (VDBG) Log.d(LOG_TAG, "updateProximitySensorMode: state = " + state);
if (proximitySensorModeEnabled()) {
@@ -1331,7 +1333,7 @@
}
screenOnImmediately |= dialpadVisible && horizontal;
- if (((state == Phone.State.OFFHOOK) || mBeginningCall) && !screenOnImmediately) {
+ if (((state == PhoneConstants.State.OFFHOOK) || mBeginningCall) && !screenOnImmediately) {
// Phone is in use! Arrange for the screen to turn off
// automatically when the sensor detects a close object.
if (!mProximityWakeLock.isHeld()) {
@@ -1373,7 +1375,7 @@
* This method will updates various states inside Phone app (e.g. proximity sensor mode,
* accelerometer listener state, update-lock state, etc.)
*/
- /* package */ void updatePhoneState(Phone.State state) {
+ /* package */ void updatePhoneState(PhoneConstants.State state) {
if (state != mLastPhoneState) {
mLastPhoneState = state;
updateProximitySensorMode(state);
@@ -1382,7 +1384,7 @@
//
// Watch out: we don't release the lock here when the screen is still in foreground.
// At that time InCallScreen will release it on onPause().
- if (state != Phone.State.IDLE) {
+ if (state != PhoneConstants.State.IDLE) {
// UpdateLock is a recursive lock, while we may get "acquire" request twice and
// "release" request once for a single call (RINGING + OFFHOOK and IDLE).
// We need to manually ensure the lock is just acquired once for each (and this
@@ -1403,7 +1405,7 @@
if (mAccelerometerListener != null) {
// use accelerometer to augment proximity sensor when in call
mOrientation = AccelerometerListener.ORIENTATION_UNKNOWN;
- mAccelerometerListener.enable(state == Phone.State.OFFHOOK);
+ mAccelerometerListener.enable(state == PhoneConstants.State.OFFHOOK);
}
// clear our beginning call flag
mBeginningCall = false;
@@ -1413,12 +1415,12 @@
// But we do not want to do this if there is no active call so we do not
// bypass the keyguard if the call is not answered or declined.
if (mInCallScreen != null) {
- mInCallScreen.updateKeyguardPolicy(state == Phone.State.OFFHOOK);
+ mInCallScreen.updateKeyguardPolicy(state == PhoneConstants.State.OFFHOOK);
}
}
}
- /* package */ Phone.State getPhoneState() {
+ /* package */ PhoneConstants.State getPhoneState() {
return mLastPhoneState;
}
@@ -1450,7 +1452,7 @@
private void initForNewRadioTechnology() {
if (DBG) Log.d(LOG_TAG, "initForNewRadioTechnology...");
- if (phone.getPhoneType() == Phone.PHONE_TYPE_CDMA) {
+ if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
// Create an instance of CdmaPhoneCallState and initialize it to IDLE
cdmaPhoneCallState = new CdmaPhoneCallState();
cdmaPhoneCallState.CdmaPhoneCallStateInit();
@@ -1615,18 +1617,18 @@
updateBluetoothIndication(true); // Also update any visible UI if necessary
} else if (action.equals(TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED)) {
if (VDBG) Log.d(LOG_TAG, "mReceiver: ACTION_ANY_DATA_CONNECTION_STATE_CHANGED");
- if (VDBG) Log.d(LOG_TAG, "- state: " + intent.getStringExtra(Phone.STATE_KEY));
+ if (VDBG) Log.d(LOG_TAG, "- state: " + intent.getStringExtra(PhoneConstants.STATE_KEY));
if (VDBG) Log.d(LOG_TAG, "- reason: "
- + intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY));
+ + intent.getStringExtra(PhoneConstants.STATE_CHANGE_REASON_KEY));
// The "data disconnected due to roaming" notification is shown
// if (a) you have the "data roaming" feature turned off, and
// (b) you just lost data connectivity because you're roaming.
boolean disconnectedDueToRoaming =
!phone.getDataRoamingEnabled()
- && "DISCONNECTED".equals(intent.getStringExtra(Phone.STATE_KEY))
+ && "DISCONNECTED".equals(intent.getStringExtra(PhoneConstants.STATE_KEY))
&& Phone.REASON_ROAMING_ON.equals(
- intent.getStringExtra(Phone.STATE_CHANGE_REASON_KEY));
+ intent.getStringExtra(PhoneConstants.STATE_CHANGE_REASON_KEY));
mHandler.sendEmptyMessage(disconnectedDueToRoaming
? EVENT_DATA_ROAMING_DISCONNECTED
: EVENT_DATA_ROAMING_OK);
@@ -1643,9 +1645,9 @@
// NOTE: This is ONLY triggered if an attempt to un-PUK-lock has
// been attempted.
mHandler.sendMessage(mHandler.obtainMessage(EVENT_SIM_STATE_CHANGED,
- intent.getStringExtra(IccCard.INTENT_KEY_ICC_STATE)));
+ intent.getStringExtra(IccCardConstants.INTENT_KEY_ICC_STATE)));
} else if (action.equals(TelephonyIntents.ACTION_RADIO_TECHNOLOGY_CHANGED)) {
- String newPhone = intent.getStringExtra(Phone.PHONE_NAME_KEY);
+ String newPhone = intent.getStringExtra(PhoneConstants.PHONE_NAME_KEY);
Log.d(LOG_TAG, "Radio technology switched. Now " + newPhone + " is active.");
initForNewRadioTechnology();
} else if (action.equals(TelephonyIntents.ACTION_SERVICE_STATE_CHANGED)) {
@@ -1713,7 +1715,7 @@
abortBroadcast();
}
} else {
- if (mCM.getState() != Phone.State.IDLE) {
+ if (mCM.getState() != PhoneConstants.State.IDLE) {
// If the phone is anything other than completely idle,
// then we consume and ignore any media key events,
// Otherwise it is too easy to accidentally start
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index fea5f2e..a5bb130 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -40,6 +40,7 @@
import com.android.internal.telephony.ITelephony;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.CallManager;
+import com.android.internal.telephony.PhoneConstants;
import java.util.List;
import java.util.ArrayList;
@@ -146,11 +147,11 @@
request = (MainThreadRequest) msg.obj;
boolean hungUp = false;
int phoneType = mPhone.getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
// CDMA: If the user presses the Power button we treat it as
// ending the complete call session
hungUp = PhoneUtils.hangupRingingAndActive(mPhone);
- } else if (phoneType == Phone.PHONE_TYPE_GSM) {
+ } else if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
// GSM: End the call as per the Phone state
hungUp = PhoneUtils.hangup(mCM);
} else {
@@ -254,8 +255,8 @@
}
// PENDING: should we just silently fail if phone is offhook or ringing?
- Phone.State state = mCM.getState();
- if (state != Phone.State.OFFHOOK && state != Phone.State.RINGING) {
+ PhoneConstants.State state = mCM.getState();
+ if (state != PhoneConstants.State.OFFHOOK && state != PhoneConstants.State.RINGING) {
Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse(url));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mApp.startActivity(intent);
@@ -397,7 +398,7 @@
* @see silenceRinger
*/
private void silenceRingerInternal() {
- if ((mCM.getState() == Phone.State.RINGING)
+ if ((mCM.getState() == PhoneConstants.State.RINGING)
&& mApp.notifier.isRinging()) {
// Ringer is actually playing, so silence it.
if (DBG) log("silenceRingerInternal: silencing...");
@@ -406,15 +407,15 @@
}
public boolean isOffhook() {
- return (mCM.getState() == Phone.State.OFFHOOK);
+ return (mCM.getState() == PhoneConstants.State.OFFHOOK);
}
public boolean isRinging() {
- return (mCM.getState() == Phone.State.RINGING);
+ return (mCM.getState() == PhoneConstants.State.RINGING);
}
public boolean isIdle() {
- return (mCM.getState() == Phone.State.IDLE);
+ return (mCM.getState() == PhoneConstants.State.IDLE);
}
public boolean isSimPinEnabled() {
diff --git a/src/com/android/phone/PhoneUtils.java b/src/com/android/phone/PhoneUtils.java
index 7181e43..616bd40 100644
--- a/src/com/android/phone/PhoneUtils.java
+++ b/src/com/android/phone/PhoneUtils.java
@@ -59,6 +59,7 @@
import com.android.internal.telephony.IExtendedNetworkService;
import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.TelephonyCapabilities;
import com.android.internal.telephony.TelephonyProperties;
import com.android.internal.telephony.cdma.CdmaConnection;
@@ -186,7 +187,7 @@
// the mute state with the earliest connection on the foreground
// call, and that with no connections, we should be back to a
// non-mute state.
- if (cm.getState() != Phone.State.IDLE) {
+ if (cm.getState() != PhoneConstants.State.IDLE) {
restoreMuteState();
} else {
setMuteInternal(cm.getFgPhone(), false);
@@ -250,7 +251,7 @@
app.getRinger().stopRing();
final Phone phone = ringing.getPhone();
- final boolean phoneIsCdma = (phone.getPhoneType() == Phone.PHONE_TYPE_CDMA);
+ final boolean phoneIsCdma = (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA);
boolean answered = false;
BluetoothHandsfree bluetoothHandsfree = null;
@@ -392,7 +393,7 @@
// a "hangupWaitingCall()" API that works on all devices,
// rather than us having to check the phone type here and do
// the notifier.sendCdmaCallWaitingReject() hack for CDMA phones.
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
// CDMA: Ringing call and Call waiting hangup is handled differently.
// For Call waiting we DO NOT call the conventional hangup(call) function
// as in CDMA we just want to hangup the Call waiting connection.
@@ -638,7 +639,7 @@
// Remember if the phone state was in IDLE state before this call.
// After calling CallManager#dial(), getState() will return different state.
- final boolean initiallyIdle = app.mCM.getState() == Phone.State.IDLE;
+ final boolean initiallyIdle = app.mCM.getState() == PhoneConstants.State.IDLE;
try {
connection = app.mCM.dial(phone, numberToDial);
@@ -658,7 +659,7 @@
// On GSM phones, null is returned for MMI codes
if (null == connection) {
- if (phoneType == Phone.PHONE_TYPE_GSM && gatewayUri == null) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_GSM && gatewayUri == null) {
if (DBG) log("dialed MMI code: " + number);
status = CALL_STATUS_DIALED_MMI;
// Set dialed MMI command to service
@@ -674,12 +675,12 @@
status = CALL_STATUS_FAILED;
}
} else {
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
updateCdmaCallStateOnNewOutgoingCall(app);
}
// Clean up the number to be displayed.
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
number = CdmaConnection.formatDialString(number);
}
number = PhoneNumberUtils.extractNetworkPortion(number);
@@ -773,7 +774,7 @@
* to the network prior to placing a 3-way call for it to be successful.
*/
static void sendEmptyFlash(Phone phone) {
- if (phone.getPhoneType() == Phone.PHONE_TYPE_CDMA) {
+ if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
Call fgCall = phone.getForegroundCall();
if (fgCall.getState() == Call.State.ACTIVE) {
// Send the empty flash
@@ -825,11 +826,11 @@
// a call where call can have multiple connections such as
// Three way and Call Waiting. Therefore retrieving Mute state for
// latest connection can apply for all connection in that call
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
shouldMute = sConnectionMuteTable.get(
phone.getForegroundCall().getLatestConnection());
- } else if ((phoneType == Phone.PHONE_TYPE_GSM)
- || (phoneType == Phone.PHONE_TYPE_SIP)) {
+ } else if ((phoneType == PhoneConstants.PHONE_TYPE_GSM)
+ || (phoneType == PhoneConstants.PHONE_TYPE_SIP)) {
shouldMute = sConnectionMuteTable.get(c);
}
if (shouldMute == null) {
@@ -850,7 +851,7 @@
static void mergeCalls(CallManager cm) {
int phoneType = cm.getFgPhone().getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
log("mergeCalls(): CDMA...");
PhoneApp app = PhoneApp.getInstance();
if (app.cdmaPhoneCallState.getCurrentCallState()
@@ -1023,7 +1024,7 @@
if (DBG) log("- using text from PENDING MMI message: '" + text + "'");
break;
case CANCELLED:
- text = context.getText(R.string.mmiCancelled);
+ text = null;
break;
case COMPLETE:
if (app.getPUKEntryActivity() != null) {
@@ -1090,10 +1091,10 @@
} catch (RemoteException e) {
mNwService = null;
}
- if (DBG) log("Extended NW displayMMIInitiate (" + text + ")");
- if (text == null || text.length() == 0)
- return;
}
+ if (DBG) log("Extended NW displayMMIInitiate (" + text + ")");
+ if (text == null || text.length() == 0)
+ return;
// displaying system alert dialog on the screen instead of
// using another activity to display the message. This
@@ -1423,10 +1424,10 @@
CallerInfoAsyncQuery.OnQueryCompleteListener listener, Object cookie) {
Connection conn = null;
int phoneType = call.getPhone().getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
conn = call.getLatestConnection();
- } else if ((phoneType == Phone.PHONE_TYPE_GSM)
- || (phoneType == Phone.PHONE_TYPE_SIP)) {
+ } else if ((phoneType == PhoneConstants.PHONE_TYPE_GSM)
+ || (phoneType == PhoneConstants.PHONE_TYPE_SIP)) {
conn = call.getEarliestConnection();
} else {
throw new IllegalStateException("Unexpected phone type: " + phoneType);
@@ -1514,10 +1515,10 @@
int phoneType = c.getCall().getPhone().getPhoneType();
log("- phoneType: " + phoneType);
switch (phoneType) {
- case Phone.PHONE_TYPE_NONE: log(" ==> PHONE_TYPE_NONE"); break;
- case Phone.PHONE_TYPE_GSM: log(" ==> PHONE_TYPE_GSM"); break;
- case Phone.PHONE_TYPE_CDMA: log(" ==> PHONE_TYPE_CDMA"); break;
- case Phone.PHONE_TYPE_SIP: log(" ==> PHONE_TYPE_SIP"); break;
+ case PhoneConstants.PHONE_TYPE_NONE: log(" ==> PHONE_TYPE_NONE"); break;
+ case PhoneConstants.PHONE_TYPE_GSM: log(" ==> PHONE_TYPE_GSM"); break;
+ case PhoneConstants.PHONE_TYPE_CDMA: log(" ==> PHONE_TYPE_CDMA"); break;
+ case PhoneConstants.PHONE_TYPE_SIP: log(" ==> PHONE_TYPE_SIP"); break;
default: log(" ==> Unknown phone type"); break;
}
}
@@ -1551,7 +1552,7 @@
// For scenarios where we may receive a valid number from the network but a
// restricted/unavailable presentation, we do not want to perform a contact query
// (see note on isFinal above). So we set isFinal to true here as well.
- if (cit.currentInfo.numberPresentation != Connection.PRESENTATION_ALLOWED) {
+ if (cit.currentInfo.numberPresentation != PhoneConstants.PRESENTATION_ALLOWED) {
cit.isFinal = true;
} else {
if (DBG) log("==> Actually starting CallerInfoAsyncQuery.startQuery()...");
@@ -1621,7 +1622,7 @@
// For scenarios where we may receive a valid number from the network but a
// restricted/unavailable presentation, we do not want to perform a contact query
// (see note on isFinal above). So we set isFinal to true here as well.
- if (cit.currentInfo.numberPresentation != Connection.PRESENTATION_ALLOWED) {
+ if (cit.currentInfo.numberPresentation != PhoneConstants.PRESENTATION_ALLOWED) {
cit.isFinal = true;
} else {
cit.asyncQuery = CallerInfoAsyncQuery.startQuery(QUERY_TOKEN, context,
@@ -1755,9 +1756,9 @@
// If we're still null/empty here, then check if we have a presentation
// string that takes precedence that we could return, otherwise display
// "unknown" string.
- if (ci != null && ci.numberPresentation == Connection.PRESENTATION_RESTRICTED) {
+ if (ci != null && ci.numberPresentation == PhoneConstants.PRESENTATION_RESTRICTED) {
compactName = context.getString(R.string.private_num);
- } else if (ci != null && ci.numberPresentation == Connection.PRESENTATION_PAYPHONE) {
+ } else if (ci != null && ci.numberPresentation == PhoneConstants.PRESENTATION_PAYPHONE) {
compactName = context.getString(R.string.payphone);
} else {
compactName = context.getString(R.string.unknown);
@@ -1791,7 +1792,7 @@
// Conference corresponds to generic display.
final PhoneApp app = PhoneApp.getInstance();
int phoneType = call.getPhone().getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
CdmaPhoneCallState.PhoneCallState state = app.cdmaPhoneCallState.getCurrentCallState();
if ((state == CdmaPhoneCallState.PhoneCallState.CONF_CALL)
|| ((state == CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE)
@@ -2090,7 +2091,7 @@
// If the phone is totally idle, we ignore HEADSETHOOK events
// (and instead let them fall through to the media player.)
- if (phone.getState() == Phone.State.IDLE) {
+ if (phone.getState() == PhoneConstants.State.IDLE) {
return false;
}
@@ -2112,10 +2113,10 @@
// If an incoming call is ringing, answer it (just like with the
// CALL button):
int phoneType = phone.getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
answerCall(phone.getRingingCall());
- } else if ((phoneType == Phone.PHONE_TYPE_GSM)
- || (phoneType == Phone.PHONE_TYPE_SIP)) {
+ } else if ((phoneType == PhoneConstants.PHONE_TYPE_GSM)
+ || (phoneType == PhoneConstants.PHONE_TYPE_SIP)) {
if (hasActiveCall && hasHoldingCall) {
if (DBG) log("handleHeadsetHook: ringing (both lines in use) ==> answer!");
answerAndEndActive(app.mCM, phone.getRingingCall());
@@ -2208,14 +2209,14 @@
*/
/* package */ static boolean okToSwapCalls(CallManager cm) {
int phoneType = cm.getDefaultPhone().getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
// CDMA: "Swap" is enabled only when the phone reaches a *generic*.
// state by either accepting a Call Waiting or by merging two calls
PhoneApp app = PhoneApp.getInstance();
return (app.cdmaPhoneCallState.getCurrentCallState()
== CdmaPhoneCallState.PhoneCallState.CONF_CALL);
- } else if ((phoneType == Phone.PHONE_TYPE_GSM)
- || (phoneType == Phone.PHONE_TYPE_SIP)) {
+ } else if ((phoneType == PhoneConstants.PHONE_TYPE_GSM)
+ || (phoneType == PhoneConstants.PHONE_TYPE_SIP)) {
// GSM: "Swap" is available if both lines are in use and there's no
// incoming call. (Actually we need to verify that the active
// call really is in the ACTIVE state and the holding call really
@@ -2235,7 +2236,7 @@
*/
/* package */ static boolean okToMergeCalls(CallManager cm) {
int phoneType = cm.getFgPhone().getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
// CDMA: "Merge" is enabled only when the user is in a 3Way call.
PhoneApp app = PhoneApp.getInstance();
return ((app.cdmaPhoneCallState.getCurrentCallState()
@@ -2266,15 +2267,15 @@
int phoneType = phone.getPhoneType();
final Call.State fgCallState = cm.getActiveFgCall().getState();
- if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
// CDMA: "Add call" button is only enabled when:
// - ForegroundCall is in ACTIVE state
// - After 30 seconds of user Ignoring/Missing a Call Waiting call.
PhoneApp app = PhoneApp.getInstance();
return ((fgCallState == Call.State.ACTIVE)
&& (app.cdmaPhoneCallState.getAddCallMenuStateAfterCallWaiting()));
- } else if ((phoneType == Phone.PHONE_TYPE_GSM)
- || (phoneType == Phone.PHONE_TYPE_SIP)) {
+ } else if ((phoneType == PhoneConstants.PHONE_TYPE_GSM)
+ || (phoneType == PhoneConstants.PHONE_TYPE_SIP)) {
// GSM: "Add call" is available only if ALL of the following are true:
// - There's no incoming ringing call
// - There's < 2 lines in use
@@ -2305,13 +2306,13 @@
n.equals("P") ||
n.equals("RES")) {
if (DBG) log("checkCnapSpecialCases, PRIVATE string: " + n);
- return Connection.PRESENTATION_RESTRICTED;
+ return PhoneConstants.PRESENTATION_RESTRICTED;
} else if (n.equals("UNAVAILABLE") ||
n.equals("UNKNOWN") ||
n.equals("UNA") ||
n.equals("U")) {
if (DBG) log("checkCnapSpecialCases, UNKNOWN string: " + n);
- return Connection.PRESENTATION_UNKNOWN;
+ return PhoneConstants.PRESENTATION_UNKNOWN;
} else {
if (DBG) log("checkCnapSpecialCases, normal str. number: " + n);
return CNAP_SPECIAL_CASE_NO;
@@ -2343,9 +2344,9 @@
// phone number, so if this happens, change it to "Unknown" in the CallerInfo
// and fix the presentation to be the same.
if (number.equals(context.getString(R.string.absent_num))
- && presentation == Connection.PRESENTATION_ALLOWED) {
+ && presentation == PhoneConstants.PRESENTATION_ALLOWED) {
number = context.getString(R.string.unknown);
- ci.numberPresentation = Connection.PRESENTATION_UNKNOWN;
+ ci.numberPresentation = PhoneConstants.PRESENTATION_UNKNOWN;
}
// Check for other special "corner cases" for CNAP and fix them similarly. Corner
@@ -2353,15 +2354,15 @@
// if we think we have an allowed presentation, or if the CallerInfo presentation doesn't
// match the presentation passed in for verification (meaning we changed it previously
// because it's a corner case and we're being called from a different entry point).
- if (ci.numberPresentation == Connection.PRESENTATION_ALLOWED
+ if (ci.numberPresentation == PhoneConstants.PRESENTATION_ALLOWED
|| (ci.numberPresentation != presentation
- && presentation == Connection.PRESENTATION_ALLOWED)) {
+ && presentation == PhoneConstants.PRESENTATION_ALLOWED)) {
int cnapSpecialCase = checkCnapSpecialCases(number);
if (cnapSpecialCase != CNAP_SPECIAL_CASE_NO) {
// For all special strings, change number & numberPresentation.
- if (cnapSpecialCase == Connection.PRESENTATION_RESTRICTED) {
+ if (cnapSpecialCase == PhoneConstants.PRESENTATION_RESTRICTED) {
number = context.getString(R.string.private_num);
- } else if (cnapSpecialCase == Connection.PRESENTATION_UNKNOWN) {
+ } else if (cnapSpecialCase == PhoneConstants.PRESENTATION_UNKNOWN) {
number = context.getString(R.string.unknown);
}
if (DBG) {
@@ -2576,7 +2577,7 @@
public static Phone getSipPhoneFromUri(CallManager cm, String target) {
for (Phone phone : cm.getAllPhones()) {
- if (phone.getPhoneType() == Phone.PHONE_TYPE_SIP) {
+ if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_SIP) {
String sipUri = ((SipPhone) phone).getSipUri();
if (target.equals(sipUri)) {
if (DBG) log("- pickPhoneBasedOnNumber:" +
@@ -2618,9 +2619,9 @@
*/
public static boolean useShortDtmfTones(Phone phone, Context context) {
int phoneType = phone.getPhoneType();
- if (phoneType == Phone.PHONE_TYPE_GSM) {
+ if (phoneType == PhoneConstants.PHONE_TYPE_GSM) {
return false;
- } else if (phoneType == Phone.PHONE_TYPE_CDMA) {
+ } else if (phoneType == PhoneConstants.PHONE_TYPE_CDMA) {
int toneType = android.provider.Settings.System.getInt(
context.getContentResolver(),
Settings.System.DTMF_TONE_TYPE_WHEN_DIALING,
@@ -2630,7 +2631,7 @@
} else {
return false;
}
- } else if (phoneType == Phone.PHONE_TYPE_SIP) {
+ } else if (phoneType == PhoneConstants.PHONE_TYPE_SIP) {
return false;
} else {
throw new IllegalStateException("Unexpected phone type: " + phoneType);
@@ -2639,9 +2640,9 @@
public static String getPresentationString(Context context, int presentation) {
String name = context.getString(R.string.unknown);
- if (presentation == Connection.PRESENTATION_RESTRICTED) {
+ if (presentation == PhoneConstants.PRESENTATION_RESTRICTED) {
name = context.getString(R.string.private_num);
- } else if (presentation == Connection.PRESENTATION_PAYPHONE) {
+ } else if (presentation == PhoneConstants.PRESENTATION_PAYPHONE) {
name = context.getString(R.string.payphone);
}
return name;
@@ -2710,7 +2711,7 @@
Log.d(LOG_TAG, b.toString());
// On CDMA phones, dump out the CdmaPhoneCallState too:
- if (phone.getPhoneType() == Phone.PHONE_TYPE_CDMA) {
+ if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_CDMA) {
if (app.cdmaPhoneCallState != null) {
Log.d(LOG_TAG, " - CDMA call state: "
+ app.cdmaPhoneCallState.getCurrentCallState());
diff --git a/src/com/android/phone/RespondViaSmsManager.java b/src/com/android/phone/RespondViaSmsManager.java
index ea9e188..bc2ee7b 100644
--- a/src/com/android/phone/RespondViaSmsManager.java
+++ b/src/com/android/phone/RespondViaSmsManager.java
@@ -19,6 +19,7 @@
import com.android.internal.telephony.Call;
import com.android.internal.telephony.Connection;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import android.app.ActionBar;
import android.app.AlertDialog;
@@ -258,8 +259,8 @@
dismissPopup();
- final Phone.State state = PhoneApp.getInstance().mCM.getState();
- if (state == Phone.State.IDLE) {
+ final PhoneConstants.State state = PhoneApp.getInstance().mCM.getState();
+ if (state == PhoneConstants.State.IDLE) {
// There's no other phone call to interact. Exit the entire in-call screen.
PhoneApp.getInstance().dismissCallScreen();
} else {
@@ -287,8 +288,8 @@
dismissPopup();
- final Phone.State state = PhoneApp.getInstance().mCM.getState();
- if (state == Phone.State.IDLE) {
+ final PhoneConstants.State state = PhoneApp.getInstance().mCM.getState();
+ if (state == PhoneConstants.State.IDLE) {
// This means the incoming call is already hung up when the user chooses not to
// use "Respond via SMS" feature. Let's just exit the whole in-call screen.
PhoneApp.getInstance().dismissCallScreen();
@@ -535,7 +536,7 @@
// Finally, check the "call presentation":
int presentation = conn.getNumberPresentation();
if (DBG) log("- presentation: " + presentation);
- if (presentation == Connection.PRESENTATION_RESTRICTED) {
+ if (presentation == PhoneConstants.PRESENTATION_RESTRICTED) {
// PRESENTATION_RESTRICTED means "caller-id blocked".
// The user isn't allowed to see the number in the first
// place, so obviously we can't let you send an SMS to it.
diff --git a/src/com/android/phone/SipBroadcastReceiver.java b/src/com/android/phone/SipBroadcastReceiver.java
index 457afb8..0717c72 100644
--- a/src/com/android/phone/SipBroadcastReceiver.java
+++ b/src/com/android/phone/SipBroadcastReceiver.java
@@ -18,6 +18,7 @@
import com.android.internal.telephony.CallManager;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.sip.SipPhone;
import com.android.phone.sip.SipProfileDb;
@@ -79,7 +80,7 @@
private void removeSipPhone(String sipUri) {
for (Phone phone : CallManager.getInstance().getAllPhones()) {
- if (phone.getPhoneType() == Phone.PHONE_TYPE_SIP) {
+ if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_SIP) {
if (((SipPhone) phone).getSipUri().equals(sipUri)) {
CallManager.getInstance().unregisterPhone((SipPhone)phone);
return;
@@ -95,7 +96,7 @@
SipAudioCall sipAudioCall = SipManager.newInstance(phoneContext)
.takeAudioCall(intent, null);
for (Phone phone : CallManager.getInstance().getAllPhones()) {
- if (phone.getPhoneType() == Phone.PHONE_TYPE_SIP) {
+ if (phone.getPhoneType() == PhoneConstants.PHONE_TYPE_SIP) {
if (((SipPhone) phone).canTake(sipAudioCall)) return;
}
}
diff --git a/src/com/android/phone/SpecialCharSequenceMgr.java b/src/com/android/phone/SpecialCharSequenceMgr.java
index 35519a6..0bda10a 100644
--- a/src/com/android/phone/SpecialCharSequenceMgr.java
+++ b/src/com/android/phone/SpecialCharSequenceMgr.java
@@ -21,7 +21,7 @@
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
-import android.provider.Telephony.Intents;
+import com.android.internal.telephony.TelephonyIntents;
import com.android.internal.telephony.Phone;
import android.telephony.PhoneNumberUtils;
import android.util.Log;
@@ -148,7 +148,7 @@
// Secret codes are in the form *#*#<code>#*#*
int len = input.length();
if (len > 8 && input.startsWith("*#*#") && input.endsWith("#*#*")) {
- Intent intent = new Intent(Intents.SECRET_CODE_ACTION,
+ Intent intent = new Intent(TelephonyIntents.SECRET_CODE_ACTION,
Uri.parse("android_secret_code://" + input.substring(4, len - 4)));
context.sendBroadcast(intent);
return true;
diff --git a/src/com/android/phone/sip/SipEditor.java b/src/com/android/phone/sip/SipEditor.java
index bab46ad..8145c94 100644
--- a/src/com/android/phone/sip/SipEditor.java
+++ b/src/com/android/phone/sip/SipEditor.java
@@ -18,6 +18,7 @@
import com.android.internal.telephony.CallManager;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.phone.R;
import com.android.phone.SipUtil;
@@ -142,7 +143,7 @@
public void onResume() {
super.onResume();
mHomeButtonClicked = false;
- if (mCallManager.getState() != Phone.State.IDLE) {
+ if (mCallManager.getState() != PhoneConstants.State.IDLE) {
mAdvancedSettings.show();
getPreferenceScreen().setEnabled(false);
if (mRemoveButton != null) mRemoveButton.setEnabled(false);
diff --git a/src/com/android/phone/sip/SipSettings.java b/src/com/android/phone/sip/SipSettings.java
index ef3ba48..d58386c 100644
--- a/src/com/android/phone/sip/SipSettings.java
+++ b/src/com/android/phone/sip/SipSettings.java
@@ -18,6 +18,7 @@
import com.android.internal.telephony.CallManager;
import com.android.internal.telephony.Phone;
+import com.android.internal.telephony.PhoneConstants;
import com.android.phone.CallFeaturesSetting;
import com.android.phone.R;
import com.android.phone.SipUtil;
@@ -167,7 +168,7 @@
public void onResume() {
super.onResume();
- if (mCallManager.getState() != Phone.State.IDLE) {
+ if (mCallManager.getState() != PhoneConstants.State.IDLE) {
mButtonSipReceiveCalls.setEnabled(false);
} else {
mButtonSipReceiveCalls.setEnabled(true);
@@ -490,7 +491,8 @@
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
- menu.findItem(MENU_ADD_ACCOUNT).setEnabled(mCallManager.getState() == Phone.State.IDLE);
+ menu.findItem(MENU_ADD_ACCOUNT).setEnabled(
+ mCallManager.getState() == PhoneConstants.State.IDLE);
return super.onPrepareOptionsMenu(menu);
}
diff --git a/tests/src/com/android/phone/unit/CnapTest.java b/tests/src/com/android/phone/unit/CnapTest.java
index 27bd284..7161ba8 100644
--- a/tests/src/com/android/phone/unit/CnapTest.java
+++ b/tests/src/com/android/phone/unit/CnapTest.java
@@ -22,10 +22,10 @@
import android.util.Log;
import com.android.internal.telephony.CallerInfo;
import com.android.phone.PhoneUtils;
-import static com.android.internal.telephony.Connection.PRESENTATION_ALLOWED;
-import static com.android.internal.telephony.Connection.PRESENTATION_PAYPHONE;
-import static com.android.internal.telephony.Connection.PRESENTATION_RESTRICTED;
-import static com.android.internal.telephony.Connection.PRESENTATION_UNKNOWN;
+import static com.android.internal.telephony.PhoneConstants.PRESENTATION_ALLOWED;
+import static com.android.internal.telephony.PhoneConstants.PRESENTATION_PAYPHONE;
+import static com.android.internal.telephony.PhoneConstants.PRESENTATION_RESTRICTED;
+import static com.android.internal.telephony.PhoneConstants.PRESENTATION_UNKNOWN;
// Test suite for the Caller Name Presentation (CNAP) handling.
// See AndroidManifest.xml how to run these tests.