From dda5391d5079537e275c9f4ed2637a1484d0e4e8 Mon Sep 17 00:00:00 2001 From: Wink Saville Date: Thu, 28 May 2009 17:32:34 -0700 Subject: [PATCH] Motorola additions for CDMA support without CdmaSuppConnTracker There are corresponding changes to hardware/ril and packages/apps/Phone that are required to go with these changes. --- core/java/android/provider/CallLog.java | 18 + .../text/method/DialerKeyListener.java | 2 +- media/java/android/media/ToneGenerator.java | 319 +++++++++++-- .../internal/telephony/BaseCommands.java | 59 ++- .../internal/telephony/CallTracker.java | 1 + .../internal/telephony/CallerInfo.java | 9 +- .../telephony/CdmaInformationRecord.java | 201 --------- .../internal/telephony/CommandsInterface.java | 75 ++-- .../internal/telephony/Connection.java | 33 +- .../internal/telephony/ITelephony.aidl | 5 + .../com/android/internal/telephony/Phone.java | 196 +++++--- .../android/internal/telephony/PhoneBase.java | 114 +++-- .../internal/telephony/PhoneProxy.java | 94 ++-- .../com/android/internal/telephony/RIL.java | 272 +++++++----- .../internal/telephony/TelephonyIntents.java | 34 +- .../telephony/TelephonyProperties.java | 3 + .../internal/telephony/cdma/CDMAPhone.java | 418 ++++++++++++------ .../telephony/cdma/CdmaCallTracker.java | 32 +- .../telephony/cdma/CdmaCallWaiting.java | 33 -- .../cdma/CdmaCallWaitingNotification.java | 48 ++ .../telephony/cdma/CdmaConnection.java | 269 +++++++++-- .../cdma/CdmaInformationRecords.java | 75 ++++ .../cdma/CdmaServiceStateTracker.java | 299 ++++++++++++- .../internal/telephony/cdma/FeatureCode.java | 14 +- .../internal/telephony/cdma/RuimRecords.java | 46 +- .../telephony/cdma/SignalToneUtil.java | 272 ++++++++++++ .../internal/telephony/gsm/GSMPhone.java | 5 - .../telephony/test/SimulatedCommands.java | 6 +- 28 files changed, 2169 insertions(+), 783 deletions(-) delete mode 100644 telephony/java/com/android/internal/telephony/CdmaInformationRecord.java delete mode 100644 telephony/java/com/android/internal/telephony/cdma/CdmaCallWaiting.java create mode 100644 telephony/java/com/android/internal/telephony/cdma/CdmaCallWaitingNotification.java create mode 100644 telephony/java/com/android/internal/telephony/cdma/CdmaInformationRecords.java create mode 100644 telephony/java/com/android/internal/telephony/cdma/SignalToneUtil.java diff --git a/core/java/android/provider/CallLog.java b/core/java/android/provider/CallLog.java index abd6934a86b39..7d03801d7bd10 100644 --- a/core/java/android/provider/CallLog.java +++ b/core/java/android/provider/CallLog.java @@ -151,6 +151,9 @@ public class CallLog { int presentation, int callType, long start, int duration) { final ContentResolver resolver = context.getContentResolver(); + // TODO(Moto): Which is correct: original code, this only changes the + // number if the number is empty and never changes the caller info name. + if (false) { if (TextUtils.isEmpty(number)) { if (presentation == Connection.PRESENTATION_RESTRICTED) { number = CallerInfo.PRIVATE_NUMBER; @@ -160,7 +163,22 @@ public class CallLog { number = CallerInfo.UNKNOWN_NUMBER; } } + } else { + // NEWCODE: From Motorola + //If this is a private number then set the number to Private, otherwise check + //if the number field is empty and set the number to Unavailable + if (presentation == Connection.PRESENTATION_RESTRICTED) { + number = CallerInfo.PRIVATE_NUMBER; + ci.name = ""; + } else if (presentation == Connection.PRESENTATION_PAYPHONE) { + number = CallerInfo.PAYPHONE_NUMBER; + ci.name = ""; + } else if (TextUtils.isEmpty(number) || presentation == Connection.PRESENTATION_UNKNOWN) { + number = CallerInfo.UNKNOWN_NUMBER; + ci.name = ""; + } + } ContentValues values = new ContentValues(5); values.put(NUMBER, number); diff --git a/core/java/android/text/method/DialerKeyListener.java b/core/java/android/text/method/DialerKeyListener.java index b121e608b5b54..584e83f53e53d 100644 --- a/core/java/android/text/method/DialerKeyListener.java +++ b/core/java/android/text/method/DialerKeyListener.java @@ -106,7 +106,7 @@ public class DialerKeyListener extends NumberKeyListener */ public static final char[] CHARACTERS = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '#', '*', - '+', '-', '(', ')', ',', '/', 'N', '.', ' ' + '+', '-', '(', ')', ',', '/', 'N', '.', ' ', ';' }; private static DialerKeyListener sInstance; diff --git a/media/java/android/media/ToneGenerator.java b/media/java/android/media/ToneGenerator.java index 4b53756db118a..54ca6c40c5637 100644 --- a/media/java/android/media/ToneGenerator.java +++ b/media/java/android/media/ToneGenerator.java @@ -19,11 +19,11 @@ package android.media; /** - * This class provides methods to play DTMF tones (ITU-T Recommendation Q.23), - * call supervisory tones (3GPP TS 22.001, CEPT) and proprietary tones (3GPP TS 31.111). + * This class provides methods to play DTMF tones (ITU-T Recommendation Q.23), + * call supervisory tones (3GPP TS 22.001, CEPT) and proprietary tones (3GPP TS 31.111). * Depending on call state and routing options, tones are mixed to the downlink audio - * or output to the speaker phone or headset. - * This API is not for generating tones over the uplink audio path. + * or output to the speaker phone or headset. + * This API is not for generating tones over the uplink audio path. */ public class ToneGenerator { @@ -33,99 +33,99 @@ public class ToneGenerator * List of all available tones: These constants must be kept consistant with * the enum in ToneGenerator C++ class. */ - /** + /** * DTMF tone for key 0: 1336Hz, 941Hz, continuous

- * + * * @see #ToneGenerator(int, int) */ public static final int TONE_DTMF_0 = 0; /** * DTMF tone for key 1: 1209Hz, 697Hz, continuous - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_DTMF_1 = 1; /** * DTMF tone for key 2: 1336Hz, 697Hz, continuous - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_DTMF_2 = 2; /** * DTMF tone for key 3: 1477Hz, 697Hz, continuous - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_DTMF_3 = 3; /** * DTMF tone for key 4: 1209Hz, 770Hz, continuous - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_DTMF_4 = 4; /** * DTMF tone for key 5: 1336Hz, 770Hz, continuous - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_DTMF_5 = 5; /** * DTMF tone for key 6: 1477Hz, 770Hz, continuous - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_DTMF_6 = 6; /** * DTMF tone for key 7: 1209Hz, 852Hz, continuous - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_DTMF_7 = 7; /** * DTMF tone for key 8: 1336Hz, 852Hz, continuous - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_DTMF_8 = 8; /** * DTMF tone for key 9: 1477Hz, 852Hz, continuous - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_DTMF_9 = 9; /** * DTMF tone for key *: 1209Hz, 941Hz, continuous - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_DTMF_S = 10; /** * DTMF tone for key #: 1477Hz, 941Hz, continuous - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_DTMF_P = 11; /** * DTMF tone for key A: 1633Hz, 697Hz, continuous - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_DTMF_A = 12; /** * DTMF tone for key B: 1633Hz, 770Hz, continuous - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_DTMF_B = 13; /** * DTMF tone for key C: 1633Hz, 852Hz, continuous - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_DTMF_C = 14; /** * DTMF tone for key D: 1633Hz, 941Hz, continuous - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_DTMF_D = 15; @@ -151,7 +151,7 @@ public class ToneGenerator * Call supervisory tone, Congestion: * CEPT, JAPAN: 425Hz, 200ms ON, 200ms OFF... * ANSI (IS-95): 480Hz+620Hz, 250ms ON, 250ms OFF... - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_SUP_CONGESTION = 18; @@ -159,27 +159,28 @@ public class ToneGenerator * Call supervisory tone, Radio path acknowlegment : * CEPT, ANSI: 425Hz, 200ms ON * JAPAN: 400Hz, 1s ON, 2s OFF... - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_SUP_RADIO_ACK = 19; /** * Call supervisory tone, Radio path not available: 425Hz, 200ms ON, 200 OFF 3 bursts - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_SUP_RADIO_NOTAVAIL = 20; /** * Call supervisory tone, Error/Special info: 950Hz+1400Hz+1800Hz, 330ms ON, 1s OFF... - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_SUP_ERROR = 21; /** * Call supervisory tone, Call Waiting: * CEPT, JAPAN: 425Hz, 200ms ON, 600ms OFF, 200ms ON, 3s OFF... - * ANSI (IS-95): 440 Hz, 300 ms ON, 9.7 s OFF, (100 ms ON, 100 ms OFF, 100 ms ON, 9.7s OFF ...) - * + * ANSI (IS-95): 440 Hz, 300 ms ON, 9.7 s OFF, + * (100 ms ON, 100 ms OFF, 100 ms ON, 9.7s OFF ...) + * * @see #ToneGenerator(int, int) */ public static final int TONE_SUP_CALL_WAITING = 22; @@ -187,42 +188,43 @@ public class ToneGenerator * Call supervisory tone, Ring Tone: * CEPT, JAPAN: 425Hz, 1s ON, 4s OFF... * ANSI (IS-95): 440Hz + 480Hz, 2s ON, 4s OFF... - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_SUP_RINGTONE = 23; /** * Proprietary tone, general beep: 400Hz+1200Hz, 35ms ON - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_PROP_BEEP = 24; /** * Proprietary tone, positive acknowlegement: 1200Hz, 100ms ON, 100ms OFF 2 bursts - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_PROP_ACK = 25; /** * Proprietary tone, negative acknowlegement: 300Hz+400Hz+500Hz, 400ms ON - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_PROP_NACK = 26; /** * Proprietary tone, prompt tone: 400Hz+1200Hz, 200ms ON - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_PROP_PROMPT = 27; /** * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON - * + * * @see #ToneGenerator(int, int) */ public static final int TONE_PROP_BEEP2 = 28; /** - * Call supervisory tone (IS-95), intercept tone: alternating 440 Hz and 620 Hz tones, each on for 250 ms + * Call supervisory tone (IS-95), intercept tone: alternating 440 Hz and 620 Hz tones, + * each on for 250 ms * * @see #ToneGenerator(int, int) */ @@ -240,7 +242,8 @@ public class ToneGenerator */ public static final int TONE_SUP_CONGESTION_ABBREV = 31; /** - * Call supervisory tone (IS-95), confirm tone: a 350 Hz tone added to a 440 Hz tone repeated 3 times in a 100 ms on, 100 ms off cycle + * Call supervisory tone (IS-95), confirm tone: a 350 Hz tone added to a 440 Hz tone + * repeated 3 times in a 100 ms on, 100 ms off cycle * * @see #ToneGenerator(int, int) */ @@ -253,6 +256,241 @@ public class ToneGenerator public static final int TONE_SUP_PIP = 33; + /** + * CDMA SPECIFIC TONES START + */ + + /** TODO(Moto): Change "Proprietary" below with an appropriate specification reference */ + + /** + * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * + * @see #ToneGenerator(int, int) + * + * @hide + */ + public static final int TONE_CDMA_DIAL_TONE_LITE = 34; + + /** + * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * + * @see #ToneGenerator(int, int) + * + * @hide + */ + public static final int TONE_CDMA_NETWORK_USA_RINGBACK = 35; + + /** + * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * + * @see #ToneGenerator(int, int) + * + * @hide + */ + public static final int TONE_CDMA_REORDER = 36; + + /** + * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * + * @see #ToneGenerator(int, int) + * + * @hide + */ + public static final int TONE_CDMA_ABBR_REORDER = 37; + + /** + * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * + * @see #ToneGenerator(int, int) + * + * @hide + */ + public static final int TONE_CDMA_NETWORK_BUSY = 38; + + + /** + * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * + * @see #ToneGenerator(int, int) + * + * @hide + */ + public static final int TONE_CDMA_ANSWER = 39; + + /** + * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * + * @see #ToneGenerator(int, int) + * + * @hide + */ + public static final int TONE_CDMA_NETWORK_CALLWAITING = 40; + + /** + * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * + * @see #ToneGenerator(int, int) + * + * @hide + */ + public static final int TONE_CDMA_PIP = 41; + + + /** + * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * + * @see #ToneGenerator(int, int) + * + * @hide + */ + public static final int TONE_CDMA_CALL_SIGNAL_ISDN_NORMAL = 42; + + /** + * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * + * @see #ToneGenerator(int, int) + * + * @hide + */ + public static final int TONE_CDMA_CALL_SIGNAL_ISDN_INTERGROUP = 43; + + /** + * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * + * @see #ToneGenerator(int, int) + * + * @hide + */ + public static final int TONE_CDMA_CALL_SIGNAL_SP_PRI = 44; + + /** + * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * + * @see #ToneGenerator(int, int) + * + * @hide + */ + public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PAT3 = 45; + + /** + * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * + * @see #ToneGenerator(int, int) + * + * @hide + */ + public static final int TONE_CDMA_CALL_SIGNAL_ISDN_RING_RING = 46; + + /** + * Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * + * @see #ToneGenerator(int, int) + * + * @hide + */ + public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PAT5 = 47; + + /** + * general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * + * @see #ToneGenerator(int, int) + * + * @hide + */ + public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PAT6 = 48; + + /** + * general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON + * + * @see #ToneGenerator(int, int) + * + * @hide + */ + public static final int TONE_CDMA_CALL_SIGNAL_ISDN_PAT7 = 49; + + // TODO(Moto): Need comments for each one and we need ToneGenerator.cpp/ToneGenerator.h + + /** @hide */ + public static final int TONE_CDMA_HIGH_L = 50; + + /** @hide */ + public static final int TONE_CDMA_LOW_L = 51; + /** @hide */ + public static final int TONE_CDMA_HIGH_SS = 52; + /** @hide */ + public static final int TONE_CDMA_MED_SS = 53; + /** @hide */ + public static final int TONE_CDMA_LOW_SS = 54; + /** @hide */ + public static final int TONE_CDMA_HIGH_SSL = 55; + + + /** @hide */ + public static final int TONE_CDMA_MED_SSL = 56; + /** @hide */ + public static final int TONE_CDMA_LOW_SSL = 57; + /** @hide */ + public static final int TONE_CDMA_HIGH_SS_2 = 58; + /** @hide */ + public static final int TONE_CDMA_MED_SS_2 = 59; + /** @hide */ + public static final int TONE_CDMA_LOW_SS_2 = 60; + /** @hide */ + public static final int TONE_CDMA_HIGH_SLS = 61; + /** @hide */ + public static final int TONE_CDMA_MED_SLS = 62; + /** @hide */ + public static final int TONE_CDMA_LOW_SLS = 63; + /** @hide */ + public static final int TONE_CDMA_HIGH_S_X4 = 64; + /** @hide */ + public static final int TONE_CDMA_MED_S_X4 = 65; + /** @hide */ + public static final int TONE_CDMA_LOW_S_X4 = 66; + /** @hide */ + public static final int TONE_CDMA_HIGH_PBX_L = 67; + /** @hide */ + public static final int TONE_CDMA_MED_PBX_L = 68; + /** @hide */ + public static final int TONE_CDMA_LOW_PBX_L = 69; + /** @hide */ + public static final int TONE_CDMA_HIGH_PBX_SS = 70; + /** @hide */ + public static final int TONE_CDMA_MED_PBX_SS = 71; + /** @hide */ + public static final int TONE_CDMA_LOW_PBX_SS = 72; + /** @hide */ + public static final int TONE_CDMA_HIGH_PBX_SSL = 73; + /** @hide */ + public static final int TONE_CDMA_MED_PBX_SSL = 74; + + /** @hide */ + public static final int TONE_CDMA_LOW_PBX_SSL = 75; + /** @hide */ + public static final int TONE_CDMA_HIGH_PBX_SLS = 76; + /** @hide */ + public static final int TONE_CDMA_MED_PBX_SLS = 77; + /** @hide */ + public static final int TONE_CDMA_LOW_PBX_SLS = 78; + /** @hide */ + public static final int TONE_CDMA_HIGH_PBX_S_X4 = 79; + /** @hide */ + public static final int TONE_CDMA_MED_PBX_S_X4 = 80; + /** @hide */ + public static final int TONE_CDMA_LOW_PBX_S_X4 = 81; + /** @hide */ + public static final int TONE_CDMA_INTERCEPT_ONE_SHOT = TONE_SUP_INTERCEPT_ABBREV; + /** @hide */ + public static final int TONE_CDMA_REORDER_ONE_SHOT = TONE_CDMA_ABBR_REORDER; + /** @hide */ + public static final int TONE_CDMA_NETWORK_BUSY_ONE_SHOT = 82; + /** @hide */ + public static final int TONE_CDMA_ABBR_ALERT = 83; + /** @hide */ + public static final int TONE_CDMA_SIGNAL_OFF = 84; + /** @hide */ + public static final int TONE_CDMA_INVALID = 85; + /** Maximum volume, for use with {@link #ToneGenerator(int,int)} */ public static final int MAX_VOLUME = AudioSystem.MAX_VOLUME; /** Minimum volume setting, for use with {@link #ToneGenerator(int,int)} */ @@ -261,10 +499,10 @@ public class ToneGenerator /** * ToneGenerator class contructor specifying output stream type and volume. - * + * * @param streamType The streame type used for tone playback (e.g. STREAM_MUSIC). * @param volume The volume of the tone, given in percentage of maximum volume (from 0-100). - * + * */ public ToneGenerator(int streamType, int volume) { native_setup(streamType, volume); @@ -272,7 +510,7 @@ public class ToneGenerator /** * This method starts the playback of a tone of the specified type. - * only one tone can play at a time: if a tone is playing while this method is called, + * only one tone can play at a time: if a tone is playing while this method is called, * this tone is stopped and replaced by the one requested. * @param toneType The type of tone generate chosen from the following list: *