summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author John Wang <johnwang@google.com> 2010-12-06 10:29:49 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2010-12-06 10:29:49 -0800
commit536da84f41b11f647d6212dd334750689ebd8b2a (patch)
tree408900982d50b20b6ede1991957d6c8a174f0dde
parentcb60e2acf6982d40855488cfcc8a64897f0459f7 (diff)
parentd6c3838672f043984457c1352e878af5b3e6a79b (diff)
Merge "Block incoming calls for non-voice-device."
-rw-r--r--telephony/java/com/android/internal/telephony/PhoneBase.java20
1 files changed, 18 insertions, 2 deletions
diff --git a/telephony/java/com/android/internal/telephony/PhoneBase.java b/telephony/java/com/android/internal/telephony/PhoneBase.java
index fce7b9b8ccef..b64b45dbc640 100644
--- a/telephony/java/com/android/internal/telephony/PhoneBase.java
+++ b/telephony/java/com/android/internal/telephony/PhoneBase.java
@@ -115,6 +115,7 @@ public abstract class PhoneBase extends Handler implements Phone {
int mCallRingContinueToken = 0;
int mCallRingDelay;
public boolean mIsTheCurrentActivePhone = true;
+ boolean mIsVoiceCapable = true;
/**
* Set a system property, unless we're in unit test mode
@@ -205,6 +206,15 @@ public abstract class PhoneBase extends Handler implements Phone {
mDnsCheckDisabled = sp.getBoolean(DNS_SERVER_CHECK_DISABLED_KEY, false);
mCM.setOnCallRing(this, EVENT_CALL_RING, null);
+ /* "Voice capable" means that this device supports circuit-switched
+ * (i.e. voice) phone calls over the telephony network, and is allowed
+ * to display the in-call UI while a cellular voice call is active.
+ * This will be false on "data only" devices which can't make voice
+ * calls and don't support any in-call UI.
+ */
+ mIsVoiceCapable = mContext.getResources().getBoolean(
+ com.android.internal.R.bool.config_voice_capable);
+
/**
* Some RIL's don't always send RIL_UNSOL_CALL_RING so it needs
* to be generated locally. Ideally all ring tones should be loops
@@ -1006,6 +1016,8 @@ public abstract class PhoneBase extends Handler implements Phone {
* version scoped to their packages
*/
protected void notifyNewRingingConnectionP(Connection cn) {
+ if (!mIsVoiceCapable)
+ return;
AsyncResult ar = new AsyncResult(null, cn, null);
mNewRingingConnectionRegistrants.notifyRegistrants(ar);
}
@@ -1014,6 +1026,8 @@ public abstract class PhoneBase extends Handler implements Phone {
* Notify registrants of a RING event.
*/
private void notifyIncomingRing() {
+ if (!mIsVoiceCapable)
+ return;
AsyncResult ar = new AsyncResult(null, this, null);
mIncomingRingRegistrants.notifyRegistrants(ar);
}
@@ -1022,7 +1036,8 @@ public abstract class PhoneBase extends Handler implements Phone {
* Send the incoming call Ring notification if conditions are right.
*/
private void sendIncomingCallRingNotification(int token) {
- if (!mDoesRilSendMultipleCallRing && (token == mCallRingContinueToken)) {
+ if (mIsVoiceCapable && !mDoesRilSendMultipleCallRing &&
+ (token == mCallRingContinueToken)) {
Log.d(LOG_TAG, "Sending notifyIncomingRing");
notifyIncomingRing();
sendMessageDelayed(
@@ -1031,7 +1046,8 @@ public abstract class PhoneBase extends Handler implements Phone {
Log.d(LOG_TAG, "Ignoring ring notification request,"
+ " mDoesRilSendMultipleCallRing=" + mDoesRilSendMultipleCallRing
+ " token=" + token
- + " mCallRingContinueToken=" + mCallRingContinueToken);
+ + " mCallRingContinueToken=" + mCallRingContinueToken
+ + " mIsVoiceCapable=" + mIsVoiceCapable);
}
}