diff options
author | John Wang <johnwang@google.com> | 2010-12-03 16:43:09 -0800 |
---|---|---|
committer | John Wang <johnwang@google.com> | 2010-12-06 10:25:52 -0800 |
commit | d6c3838672f043984457c1352e878af5b3e6a79b (patch) | |
tree | 8b269d61d647ffe6f9996e52a62ec5a41cd1ca0b | |
parent | efd804b0173dba80f05b59e72b19054f64854d54 (diff) | |
download | frameworks_base-d6c3838672f043984457c1352e878af5b3e6a79b.zip frameworks_base-d6c3838672f043984457c1352e878af5b3e6a79b.tar.gz frameworks_base-d6c3838672f043984457c1352e878af5b3e6a79b.tar.bz2 |
Block incoming calls for non-voice-device.
For bug 3038102.
Non-voice capable means that this device doesn't support circuit-switched
phone calls over the telephony network. It blocks the new ringing
notification at PhoneBase level.
Change-Id: Ibef28dadae222c7ad169ee59e5c11a2c93e60e93
-rw-r--r-- | telephony/java/com/android/internal/telephony/PhoneBase.java | 20 |
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 fce7b9b..b64b45d 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); } } |