diff options
author | johnwang <johnwang@google.com> | 2009-08-10 11:44:57 -0700 |
---|---|---|
committer | johnwang <johnwang@google.com> | 2009-08-10 17:10:32 -0700 |
commit | 597f2b7022db1368831251d776f42b98d10ba2cd (patch) | |
tree | f30ecd5a62236dbe8b0a635d1871a6030cdf961f /telephony | |
parent | 614cf0b79bb44c4a63303f52093752d54f8108eb (diff) | |
download | frameworks_base-597f2b7022db1368831251d776f42b98d10ba2cd.zip frameworks_base-597f2b7022db1368831251d776f42b98d10ba2cd.tar.gz frameworks_base-597f2b7022db1368831251d776f42b98d10ba2cd.tar.bz2 |
Add ro.telephony.disable-call check in dialing.
When ro.telephony.disable-call is set to true the phone disable actual calls. It provides a way to test in user-debug builds for stability runs. See bug 2031157.
modified: java/com/android/internal/telephony/TelephonyProperties.java
modified: java/com/android/internal/telephony/cdma/CdmaCallTracker.java
modified: java/com/android/internal/telephony/gsm/GsmCallTracker.java
modified: java/com/android/internal/telephony/TelephonyProperties.java
modified: java/com/android/internal/telephony/cdma/CdmaCallTracker.java
modified: java/com/android/internal/telephony/gsm/GsmCallTracker.java
Diffstat (limited to 'telephony')
3 files changed, 18 insertions, 7 deletions
diff --git a/telephony/java/com/android/internal/telephony/TelephonyProperties.java b/telephony/java/com/android/internal/telephony/TelephonyProperties.java index 8a1e928..60e0a44 100644 --- a/telephony/java/com/android/internal/telephony/TelephonyProperties.java +++ b/telephony/java/com/android/internal/telephony/TelephonyProperties.java @@ -115,4 +115,9 @@ public interface TelephonyProperties */ static final String PROPERTY_OTASP_NUM_SCHEMA = "ro.cdma.otaspnumschema"; + /** + * Disable all calls including Emergency call when it set to true. + */ + static final String PROPERTY_DISABLE_CALL = "ro.telephony.disable-call"; + } diff --git a/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java b/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java index 3997639..be4763c 100644 --- a/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java +++ b/telephony/java/com/android/internal/telephony/cdma/CdmaCallTracker.java @@ -321,13 +321,16 @@ public final class CdmaCallTracker extends CallTracker { canDial() { boolean ret; int serviceState = phone.getServiceState().getState(); + String disableCall = SystemProperties.get( + TelephonyProperties.PROPERTY_DISABLE_CALL, "false"); - ret = (serviceState != ServiceState.STATE_POWER_OFF) && - pendingMO == null + ret = (serviceState != ServiceState.STATE_POWER_OFF) + && pendingMO == null && !ringingCall.isRinging() + && !disableCall.equals("true") && (!foregroundCall.getState().isAlive() - || (foregroundCall.getState() == CdmaCall.State.ACTIVE) - || !backgroundCall.getState().isAlive()); + || (foregroundCall.getState() == CdmaCall.State.ACTIVE) + || !backgroundCall.getState().isAlive()); return ret; } diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmCallTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmCallTracker.java index db6e339..91c089e 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmCallTracker.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmCallTracker.java @@ -294,12 +294,15 @@ public final class GsmCallTracker extends CallTracker { canDial() { boolean ret; int serviceState = phone.getServiceState().getState(); + String disableCall = SystemProperties.get( + TelephonyProperties.PROPERTY_DISABLE_CALL, "false"); - ret = (serviceState != ServiceState.STATE_POWER_OFF) && - pendingMO == null + ret = (serviceState != ServiceState.STATE_POWER_OFF) + && pendingMO == null && !ringingCall.isRinging() + && !disableCall.equals("true") && (!foregroundCall.getState().isAlive() - || !backgroundCall.getState().isAlive()); + || !backgroundCall.getState().isAlive()); return ret; } |