History log of /packages/apps/Phone/src/com/android/phone/PhoneUtils.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
64513fe4ba55ed888bbd38b88e11511a276128a1 18-Mar-2013 Santos Cordon <santoscordon@google.com> Update callLog on a failed outgoing call.

Did some calllog code consolidation into new CallLogger class.
Used new class to provide functionality into CallController which is
responsible for placing the call and reacting to failed outgoing calls.

It's worth noting that the consolidation wasn't necessary for the bug
fix, but it's a good change nonetheless.

The merging of the two codepaths in CallNotifier is hard to trace, but
looking through the execution path, both inevitably did the same thing
except for one case: We didn't previously call stripSeparators for the
CdmaCallWaitingReject calls. It isn't necessary since we
would never find those separators coming from direct cdma calls. Having
that extra call now doesn't hurt since it is a no-op in that case. It
should be the only difference between the two (thus merging made sense).

bug:7614900
Change-Id: Iac50cba53f4312715c803c2f375baed697c678a4
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
05cb8a5c8b2f55ad3494edbddb2a1360600878ca 03-Jan-2013 Wink Saville <wink@google.com> am fa5d3d05: am 73a5faa5: Merge "Phone: Fix NPE in PhoneUtils::toLogSafePhoneNumber"

* commit 'fa5d3d05788edeb189712725b9ed9785ade753f6':
Phone: Fix NPE in PhoneUtils::toLogSafePhoneNumber
fa5d3d05788edeb189712725b9ed9785ade753f6 03-Jan-2013 Wink Saville <wink@google.com> am 73a5faa5: Merge "Phone: Fix NPE in PhoneUtils::toLogSafePhoneNumber"

* commit '73a5faa509ad465a4fcaa0e80a24c3abae0ca6a3':
Phone: Fix NPE in PhoneUtils::toLogSafePhoneNumber
f5a395d029ed48d5c29aa2629f1234837d28768b 27-Dec-2012 Bin Li <libin@marvell.com> Phone: Fix NPE in PhoneUtils::toLogSafePhoneNumber

When PhoneGlobals.DEBUG_LEVEL is set to 2, there
will be NullPointerException when receiving an
incoming call from an unknown number.

Change-Id: I2a730b891420695f3a410164e611b66cf757edc8
Signed-off-by: Bin Li <libin@marvell.com>
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
6d8a9a4660238dc0f4ae78f36ea4f799dc9844f6 05-Dec-2012 Santos Cordon <santoscordon@google.com> Moving around some functions

Moving dtmf utility functions outside of the utility class and into the
only class that used the function.

Change-Id: Ib3134a33c223526d5e4b8e0f8cc180e502075ff5
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
f9abded9b7253c797af8b01102c153227b09446f 29-Nov-2012 Makoto Onuki <omakoto@google.com> Remove unused IExtendedNetworkService support

It was used in the cupcake era for docomo, and not used anymore.

Bug 7633569

Change-Id: I658bd5bd2f4d8d298a81d31a6b0b97ed1ccb7337
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
a85eca2b87c6e6c95a247f4853f2e8d8a7e7b1fd 20-Nov-2012 Santos Cordon <santoscordon@google.com> Merge "When answering a call, stop ringing even if network takes too long to connect." into jb-mr1.1-dev
4fb656ad4cfafb844d5257fc6e837c38f7e4e21d 20-Nov-2012 Santos Cordon <santoscordon@google.com> When answering a call, stop ringing even if network takes too long to connect.

When answering a call, we tell the Ringer to stop ringing. However,
CallNotifier receives a continuous stream of PHONE_INCOMING_CALL events
which restarts the ringer. The result is that the phone will start
ringing again if RIL takes too long to actually connect the call. Instead
of stopping the ringer once, this CL changes the code to "silence" the
ringer indefinitely for the current call. This piggy backs the same code
which silences the ringer when the user opts to silence the call instead
of answering it.

bug: 7439536
Change-Id: Ie2a1c83e147435821fca4d314414075c305d6aa3
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
62d9539c7e2540dae15d5ed46121e4836ef09253 15-Nov-2012 Santos Cordon <santoscordon@google.com> Adding "ABSENTNUMBER" to the list of known constants from network.

CDMA networks can sometimes send "ABSENT NUMBER" or "ABSENTNUMBER" as
the return number for incoming calls. This gets converted to a better,
localized string within Phone.

Previously we were only recognizing the format with space. This CL adds
"ABSENTNUMBER" to that list.

bug: 7226799
Change-Id: I1f4d65f2035ce207bce966f9829282e440af9610
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
a1a9601840e50e18ff8ca4be9b888e592287577b 11-Sep-2012 Dianne Hackborn <hackbod@google.com> Don't crash phone app when running as non-primary user.

Rename PhoneApp to PhoneGlobals. Add new PhoneApp that only
instantiates PhoneGlobals when running as the primary user. Add
check in PhoneGlobals.getInstance() to immediately throw if called
when there are no globals for that process. Add new
PhoneGlobals.getInstanceIfPrimary() that doesn't throw;
OtaStartupReceiver uses to abort early if receiving a BOOT_COMPLETED
for a non-primary user.

All of the other files here are just due to the rename of PhoneApp
to PhoneGlobals.

Change-Id: Ic3999d956198ac836cb6a07fa3c77f36c1754ea3
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
8aca6a3c591a5dea28c69d4ddae722a13bfbe3cf 07-Aug-2012 Geobio Boo <geobio@google.com> Added landscape dialer for the Phone in-call app when in car dock.

Bug: 2089513
Change-Id: I62b8037c1928ae4ccd1e748170e764e4d72fb26d
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
de1cf0101d2b20a7895d11fd0d8869840137fa55 14-Jul-2012 Matthew Xie <mattx@google.com> Resolve merge conflicts from Bluedroid stack changes.

Change-Id: Ife6b7d72ba1cf780d85e8a71a45382a8698c9e93
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
59d39bc3d1f3930550dc572172e144831ac91c31 17-Feb-2012 Matthew Xie <mattx@google.com> Implement a Handsfree phone service file to get phone states and
establish communication between phone and bluetooth.

Change-Id: I65a0e5076f5c09bde33c0d410a081a8c28b466e1
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
02d680e702821997b17f09b68946255e42d57bbb 18-Jan-2012 Jaikumar Ganesh <jaikumar@google.com> Temporary changes to the phone app to get the build to pass.

Change-Id: I1dfadfc9b1082aa68897daece74949b13689aceb
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
b0f85b4a78abead921c363f9c8e247d5bdd20c74 14-Jun-2012 Wink Saville <wink@google.com> Use telephony-common

Change-Id: I1710418850040fc20afff4795ee4a85027203fc9
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
dc9fc99e669bb2c7937bd9632cc24b729b35e05a 18-Jun-2012 Jim Miller <jaggies@google.com> am 04642a32: Fix 6672308: Keep the screen on while the MMI progress dialog is showing.

* commit '04642a324cf0dc284180d6abc5561ab69311f323':
Fix 6672308: Keep the screen on while the MMI progress dialog is showing.
04642a324cf0dc284180d6abc5561ab69311f323 16-Jun-2012 Jim Miller <jaggies@google.com> Fix 6672308: Keep the screen on while the MMI progress dialog is showing.

Change-Id: Ia9f1bdf127c1758a6be49f455e557a5399e743e9
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
ed937d9c1b8622c06823ffdb3a5fc59e5589a6d6 23-May-2012 Jean-Baptiste Queru <jbq@google.com> am c9931f1b: Merge "Fix issue #18053"

* commit 'c9931f1bb1c1f233649eebfde5985d4e4f528669':
Fix issue #18053
84e032e3b5cc9c9702a305103c9591e8c79f1a1a 09-May-2012 Daisuke Miyakawa <dmiyakawa@google.com> Remove STOPSHIP logging

NOTE: the original issue for which this logging is prepared is not fixed
yet, so we may need this again in the future.

Bug: 6201805
Change-Id: If02138176e47653f5bbf20a2e3a80379bc74013f
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
c49d1c9004f3151d1cc5f31d6fc617bfc9603267 30-Apr-2012 Daisuke Miyakawa <dmiyakawa@google.com> Suppress debug logs

Because of remaining issues to be fixed, some are still remained.

Bug: 6201805
Change-Id: Ic5d9deb3775c59bbfb63f353fcebb5c24a18c7a3
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
247b24bde0851d3935de398733b6c1f68736102f 14-Apr-2012 Daisuke Miyakawa <dmiyakawa@google.com> Send ViewNotification.

This requires Ibf2d0b9ec8bb94fd7f6f45a6f97f9a3e744add53

Bug: 5815920
Change-Id: I1b170bd5b3e7cc859c1067e0342dbea0804c043f
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
8247cfc71150493995ed2035d3071a3782ae7738 14-Apr-2012 Daisuke Miyakawa <dmiyakawa@google.com> Modify logging in PhoneUtils.

- remember what number is passed to radio (STOPSHIP)
This may help up in obviously weird circumstances.
- add VDBG for PII stuff

Bug: 5914560
Change-Id: I07e5de2f037b9a0160dddffa4781bfe95e1d4177
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
de723005a76fe9b67ac70820a480b787a4283722 05-Apr-2012 Daisuke Miyakawa <dmiyakawa@google.com> Catch a few Exceptions which shouldn't cause crash

CallNotifier or InCallScreen are legitimately called even when the
device is encrytped state, at which we cannot rely on database or
some of other Activities. As a result of that we need to catch some
Exceptions so that the whole process won't crash.

- Writing CallLog will caush an Exception when incoming call happens
in encrypted state.
- Add call request may be thrown when incoming call is answered during
ECM state.

Bug: 6062197
Change-Id: I2b6e5d1022cc107f8c4c88a222cc9877435daf9f
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
088f12f464a9044566c87a0cee0d2a9817b14fb0 03-Apr-2012 Cuihtlauac ALVARADO <cuihtlauac.alvarado@orange.com> Fix issue #18053

Removes useless confirmation after cancelling USSD response.

http://code.google.com/p/android/issues/detail?id=18053

Change-Id: I762a963da0f37929757c50ba39e01df2b03eb699
gned-off-by: Cuihtlauac ALVARADO <cuihtlauac.alvarado@orange.com>
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
8c3a5e592199af04897808f922d7ecc854fb0541 29-Mar-2012 Daisuke Miyakawa <dmiyakawa@google.com> Use presentation string in manage conference screen

Currently "manage conference" screen just shows "unknown" for
some kinds of phone calls like what with hidden caller id, while
CallCard correctly handles those cases.

This change makes "manage conference" screen use same strings when
appropriate.

- Move getPresentationString() from CallCard to PhoneUtils
- Make CallCard and ManageConferenceUtils use the new method.
- Have QueryCompleteListener inside ManageConferenceUtils instead
of making the class directly implement the listener interface, to
remember both ViewGroup's index and Connection object.

Bug: 5887603
Change-Id: I611d777200671a489dda5587e281be0b0ed0c121
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
f8a9fbe31969b4f97ea03d233684efc117888879 29-Mar-2012 Daisuke Miyakawa <dmiyakawa@google.com> Move TelephonyCapabilities from Phone to telephony

Must be after I0d4ca2f8e4d775004d146fe6f9c60165a94366a9 (framework)

- Use the class in framework and remove the original class.
- Add useShortDtmfTones() to PhoneUtils. It was originally in (old)
TelephonyCapabilities but it is more suitable to have it in the other
place.
- Remove now unused strings.

Bug: 6252254
Change-Id: Iee8964cd13f9a2fa9212b1655de0f49b04153ee5
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
fc56e5f5907e55c4a3f2d920806d198d254f10dc 18-Jan-2012 Daisuke Miyakawa <dmiyakawa@google.com> Turn off speaker mode when the first phone call is made

Tested:
- (Precondition) Turn on speaker mode using 3rd party app.
- Make a phone call. Check the speaker mode being turned off.
- Turn on speaker mode during making a phone call, and then
make another call, starting a phone conference.
See the speaker mode is not turned off.
- Use Bluetooth headset and try the sequence above. Nothing
strange should happen: BT headset should be usable and
still speaker mode is correctly managed by in-call UI.

- Try similar things when receiving phone calls.

Bug: 2512172
Change-Id: I2ae602564843444b34638217b5ce9724e85acc6a
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
2a5f795c4602bf519235a875b6a4003965642ddd 18-Jan-2012 Daisuke Miyakawa <dmiyakawa@google.com> Bunch of cleanups

- Add/fix comments (including misc ones for making IDE happier)
- Change visibility of some methods to make the intention clearer

Change-Id: I18cc8df323cd020b9376405c94f12177d9d712d9
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
8ba06a2f88a2fabdbcc7d8090b79837e2ed9b63b 17-Jan-2012 Daisuke Miyakawa <dmiyakawa@google.com> Move getInitialNumber() to PhoneUtils

Tiny clean up which removes an old TODO

Change-Id: I444d8a8a2ef0e65ebf0be47a8ed261753bb7e4a7
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
430f42b0bee5e778078354e072b4f3e5eee9c048 08-Nov-2011 Jeff Brown <jeffbrown@google.com> Handle EXTRA_DOCK_STATE_LE_DESK and HE_DESK.
Bug: 5569662

Change-Id: I52df009db345b9a25c0625e2775f9e1b2eed09f3
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
aa7a5e8ffbceca40991631e72fd94a0d9db357ea 19-Sep-2011 David Brown <dab@google.com> Merge "Update code to use location aware isEmergencyNumber."
4158ed3e7bdff5212a5542e662240ea0063664b2 16-Sep-2011 David Brown <dab@google.com> Enable logging in the phone app for a few important telephony actions

Slightly turn up logging verbosity to help debug a few strange
telephony-related problems that have started happening recently, for
example bugs 5313580, 5313015, and 5331988.

TESTED: Verified the new log messages, made sure no PII is leaked.

Bug: 5313580 (and others)

Change-Id: I0a2957f7ea167e079cbb7bf231af11908c6803c6
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
1ca2b2b333a7c22b728d648d3592ee064762dd00 14-Sep-2011 Shaopeng Jia <shaopengjia@google.com> Update code to use location aware isEmergencyNumber.

Bug: 5247602
Change-Id: Ibce4b29f7062117c89071f23f39019deb3969b13
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
238e0a1134e5ce2394a382fe9630d0d8fab1b593 08-Sep-2011 David Brown <dab@google.com> Suppress "mute" and "speaker" status bar icons while in-call UI is active

There's no need for these icons while the InCallScreen is active, since
the in-call touch UI already provides an onscreen indication of the mute /
speaker state. So hide them, to reduce clutter in the status bar.

Bug: 5270678

Change-Id: Iddf20908f9ec49770466a9aea79dee36d4189165
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
f85fdcac8bb2b3edb2f78d788bc0ee9989a841eb 25-Aug-2011 David Brown <dab@google.com> Fix wrong error message when trying to start a 3rd call

An exception from CallManager.dial() really means that the call failed.
Don't assume it was an MMI.

TESTED:
- The scenario from bug 5042533: the correct error message "Call not sent"
is now displayed.
- Real MMIs still work (e.g. "#646#"), but see bug 5210375 for a
cosmetic issue.

Bug: 5042533
Change-Id: Id55abf360fd746bb2da2f985bda2d66f541d7e82
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
df266ade99188365d4a52f89a6d26b549c2aaf9a 18-Aug-2011 David Brown <dab@google.com> Clean up StatusBarManager usage in the phone app

In preparation for adding the DISABLE_NAVIGATION flag while an incoming
call is ringing (see bug 5161286), here's a big cleanup / simplification
of the phone app's use of the StatusBarManager.

Previously, we had two separate helper methods to disable the status bar
"notification windowshade" while in-call: one in the PhoneApp
(disable/reenableStatusBar()) and the other in the NotificationMgr
(NotificationMgr$StatusBarMgr.enableExpandedView()).

The InCallScreen was calling them both(!) and they could potentially
interfere with each other.

Now, the InCallScreen purely uses the NotificationMgr's helper class for
this, so we can totally get rid of those two PhoneApp methods. (The
EmergencyDialer also used these, but it's a totally separate activity so
it can just call StatusBarManager.disable() directly.)

Also, some other related cleanup:

- Update the NotificationMgr to be more explicit about being a singleton,
and use the exact same naming conventions as we already use with the
CallController / CallNotifier / InCallUiState / etc.

- Rename the helper class from StatusBarMgr to StatusBarHelper to be less
confusing (since "StatusBarManager" means something already)

- Improve javadoc in several places

TESTED to make sure no regressions from Gingerbread:

- While on a call, with the in-call UI up:
- Status bar "windowshade" not draggable in all call states
- Speakerphone and Mute icons appear correctly when necessary
- Alert notifications (like when receiving a text) are silenced

- While still in-call, bail out of the in-call UI:
- Status bar "windowshade" is now draggable
- Speakerphone and Mute icons still appear correctly
- Alert notifications are still silenced

- End the call and return to the home screen
- Status bar "windowshade" is draggable
- Speakerphone and Mute icons are properly cleaned up
- Alert notifications make their usual sounds

- Also, tested bailing out of the in-call UI and then ending the call
remotely (by hanging up the other end): all status bar icons got
cleaned up correctly.

- Emergency dialer (from lockscreen): make sure "windowshade" is not
draggable

Bug: 5161286

Change-Id: I4fa0f0f305d038943b93494ce8500dc339304691
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
4ba332e62c4d54b2623ccdc59fafd46ecba08cf0 20-Jul-2011 David Brown <dab@google.com> Clean up dead code that originally supported non-prox-sensor devices

In previous Android releases, the in-call UI provided special support for
devices with no proximity sensor. The main differences were:

- The entire in-call UI had to be driven by hard buttons rather than
onscreen touchable UI

- All in-call controls that didn't have dedicated hard buttons were
menu-based rather than touchscreen-based

- The DTMF dialpad was contained in a "SlidingDrawer" widget that you
had to drag up from the bottom of the screen

- A special "touch lock overlay" would come up after 6 seconds and cover
the DTMF dialpad to avoid false touches

The code to implement this behavior has been unused (and untested) since
the froyo release: Google hasn't built software for any non-prox-sensor
devices since the G1 and myTouch, and any OEMs shipping non-prox-sensor
devices are probably using a completely custom in-call UI anyway (or
perhaps a customized version of the Cupcake-era phone app.)

Given that, it's not worth the extra complexity and clutter to keep these
features in the code base. So this change removes all code and resources
in the phone app that were only there to support non-prox-sensor devices.

The gory details:

- Entirely remove all Menu-related code from the in-call UI:
- The classes InCallMenu, InCallMenuView, and InCallMenuItemView
- Menu item handling in InCallScreen.onClick()
- Special handling of the Menu key itself

- Remove all code and resources for the "SlidingDrawer" that was used to
access the DTMF dialpad

- Remove all code / resources / animations for the "touch lock" overlay

- Rename non_drawer_dialpad.xml to dtmf_twelve_key_dialer_view.xml to be
less confusing (since we don't use a "drawer" anywhere any more)

- Remove the onscreen hint that said "Press Menu for call options" in a
couple of states

- Simplify the layout in call_card.xml: we don't need that top-level
RelativeLayout any more since the "menu hint" is gone

- Remove the config resources that allowed you to disable the normal
onscreen touch UI

- Remove a bunch of no-longer-needed string resources and ids

TESTED:
- Basic phone states (incoming / outgoing; 1 or 2 lines in use;
conference calls)
- Onscreen DTMF dialpad
- In-call screen prox sensor behavior
- In-call screen timeout
- Press Menu button (verify nothing happens)

Change-Id: I6ad5fd6df9bdef89e4defc7add7ade52d30d6335
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
65454c803eb305c4740885ad4995a871b034a58a 22-Jun-2011 David Brown <dab@google.com> Use constants for URI schemes

Use SCHEME_* constants instead of hardcoding
"tel" / "sip" / "sms" / etc. everywhere.

Change-Id: I1858384909a54ae86a27a5f557a80ee185873927
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
a232063e9bb9f7b8875a24af212287ba0d2cd0c3 11-Jun-2011 David Brown <dab@google.com> Display "geoDescription" for unknown incoming phone numbers

If caller-id lookup fails (i.e. if no contacts match the phone number of
an incoming call), display the new CallerInfo.geoDescription field along
with the raw number. This way we can show at least *some* useful info
about who's calling.

There are two key changes here:

- In CallCard.updateDisplayForPerson(), if we have a raw number but no
name, show the geoDescription in the secondary "number" slot onscreen.

- In PhoneUtils.sCallerInfoQueryListener, if the CallerInfo query
completes but there was no matching contact, copy the geoDescription
(from the query that just finished) over to the CallerInfo object
we're actually going to pass to the UI.

Also in this change: extra logging (not enabled by default!) for the
multitude of CallCard name/number presentation cases; comment cleanup
for query-related methods in PhoneUtils.

This change depends on https://android-git.corp.google.com/g/114716 in
the telephony framework, which is the code that actually does the geo
lookup using the PhoneNumberOfflineGeocoder API.

TESTED on Crespo-S:
- incoming calls that match a contact ==> same behavior as before
- incoming calls from unknown numbers ==> geo description is shown(*)

(*) Note that the geoDescription lookup in the framework is currently
disabled (see https://android-git.corp.google.com/g/116509); I
manually enabled it to do this test. Also, the libphonenumber
library only has placeholder data checked in right now, so the
resulting geoDescription string is always just "United States".

Bug: 4595580
Change-Id: I1d8f1f092c10185737587f3943f136dd0b1d4e43
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
211ff4c5c95f63f845b953f0020dfb516c01fcad 02-Jun-2011 David Brown <dab@google.com> Get interactive OTASP working again

Here's the next step of the CallController / InCallScreen redesign
(http://wiki/Main/InCallScreenRedesign). This change gets
"interactive OTASP" (i.e. CDMA activation on voice-capable devices)
working again.

The main change here is to initiate the outgoing OTASP call via the
CallController, *not* from the InCallScreen activity.

Background: In gingerbread and earlier releases, the InCallScreen
used to directly handle certain intent actions that could initiate
phone calls, mainly ACTION_CALL and ACTION_CALL_EMERGENCY, but also
OtaUtils.ACTION_PERFORM_CDMA_PROVISIONING.

But it was a bad design to tie those actions to the activity lifecycle
of the InCallScreen, and in change
https://android-git.corp.google.com/g/106821 I moved the phone app's
"call control" functionality out to a new class called CallController.

This change makes OTASP calls work the same way. Interactive OTASP
calls are now launched using the CallController, from the new
OtaUtils.startInteractiveOtasp() method. And the InCallScreen itself
is now purely a "view" class in MVC terms: we only ever launch it
using the ACTION_MAIN action, and (upon launch) it performs no
functionality other than displaying the UI in a state that matches the
current telephony state.

Other cleanup in this change:

- Got rid of the confusing use of the EXTRA_PHONE_NUMBER extra with
the ACTION_CALL intent (see CallController.getInitialNumber()).

Now, when we place a call from the OtaUtils code we simply load the
OTASP number into the *data* of the ACTION_CALL intent, which is
where it should have been all along.

- Cleaned up naming and/or doc comments in a bunch of places

- Have CdmaOtaStatusChange messages go only to the PhoneApp instance,
not to the InCallScreen some of the time. (Either way, they would
still ultimately get forwarded to the OtaUtils instance.)

Note there's still more cleanup to do:

- It's really ugly for the OtaUtils object to reach into the
InCallScreen and directly manipulate its widgets.

Instead, the model/view separation should be more clear: OtaUtils should
only know about a higher-level abstraction of the OTASP-specific UI
state (just like how the CallController uses the InCallUiState object),
and the InCallScreen itself should translate that higher-level
abstraction into actual onscreen views and widgets.

- The current state of the OTASP call is confusingly spread out among four
separate classes:
OtaUtils.CdmaOtaProvisionData
OtaUtils.CdmaOtaConfigData
OtaUtils.CdmaOtaScreenState
OtaUtils.CdmaOtaInCallScreenUiState
with at least some redundancy, especially between CdmaOtaScreenState and
CdmaOtaInCallScreenUiState (not to mention the "InCallScreenMode"
maintainted by the InCallUiState object.)

Instead, we should combine these into a single object (or container)
with zero redundancy and clear documentation, and possibly make it a
com.android.internal.util.StateMachine to make the state transitions
more clear too.

- When handling the ACTION_PERFORM_CDMA_PROVISIONING intent, we're
supposed to come up in the "activate" state where we display the
message "A special call needs to be made to activate your phone
service" and wait for the user to press the "Activate" button. But
right now we skip that state and launch the OTASP call immediately.

These open issues are all flagged with "TODO(OTASP)" comments.

TESTED on crespo-S:
- manually dial *228
==> interactive OTASP succeeds
- manually launch ACTION_PERFORM_CDMA_PROVISIONING intent
==> interactive OTASP succeeds
- regular incoming and outgoing calls
==> these work as before

Bug: 4194458
Change-Id: I40911c7774bd0f2e9c904f7e15defb753dbd5fab
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
2c092a140230bd14f7f2a617ba80ce25ffa8c2ff 28-Mar-2011 David Brown <dab@google.com> am 3373dcdf: am 82592a9f: Merge "Disable "Add Call" and "Mute" while in emergency callback mode" into gingerbread

* commit '3373dcdf06f7fc21388557ea9a54999e1791c849':
Disable "Add Call" and "Mute" while in emergency callback mode
ef181fc2a6ab6b37caa69efb5ccfe8c2c3c80be7 22-Mar-2011 David Brown <dab@google.com> Disable "Add Call" and "Mute" while in emergency callback mode

This is Sprint ECM requirement ANDR-118.

Note that this change affects ECM on all CDMA devices regardless of
carrier. (This particular requirement is from Sprint, but I don't think
it's *contrary* to any other carrier's requirements, so let's just do it
for any device that uses ECM.)

TESTED: On crespo-s, by temporarily hacking the isPhoneInEcm() method to
return true (so I wouldn't need to actually call 911.) Also removed the
hack and confirmed that "Add Call" and "Mute" still work normally.

Bug: 4147101
Change-Id: Idfeb79892f6cf6b9878735ad12bb97d52c22c0c2
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
081c40f5ad2e4de800982bcbfceced184b82e651 31-Jan-2011 Jean-Baptiste Queru <jbq@google.com> am e63890f2: am 96cacb5d: Merge from open-source gingerbread

* commit 'e63890f2247509edd887c98e586f52eff1830751':
"Connection problem or invalid MMI code" occrued when executing USSD USSD(Maxis *100#, Celcom *118#, Umobile *118#, Digi *128#)
96cacb5d2ace4fdf8b3ed95d937ba114b14cdcb6 31-Jan-2011 Jean-Baptiste Queru <jbq@google.com> Merge from open-source gingerbread

Change-Id: I74cc8c00eba697910f7ac101fabd3f1b3fd5b88f
9166a0644e64c7110dac3945503b13c5be013fdd 28-Jan-2011 Sang-Jun Park <sj2202.park@samsung.com> "Connection problem or invalid MMI code" occrued when executing USSD
USSD(Maxis *100#, Celcom *118#, Umobile *118#, Digi *128#)

When pressing touch key, USSD request is occured twice(UP/DOWN) respectively
So block a up key event

Change-Id: Ie8c5f59bdc405048c2f941f44fa7db75cd69122e
Signed-off-by: Sang-Jun Park <sj2202.park@samsung.com>
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
e4df27ef61508030a420dfaefaf20bba0ff25af2 25-Jan-2011 Hung-ying Tyan <tyanh@google.com> am e4bbe74f: am e303768a: Merge "Use CallManager.getMute() in PhoneUtils." into gingerbread

* commit 'e4bbe74ff0b055eec5aa3a75517258124d3739bb':
Use CallManager.getMute() in PhoneUtils.
e303768a7bd4672e8aece2e6edc30c2eef45285a 25-Jan-2011 Hung-ying Tyan <tyanh@google.com> Merge "Use CallManager.getMute() in PhoneUtils." into gingerbread
07ab8425f223a0cde1759ba4565f285a6d1c2d96 24-Jan-2011 David Brown <dab@google.com> resolved conflicts for merge of b83d07c2 to honeycomb-plus-aosp

Change-Id: I3c965d08dc3d8a9c1c7bed27f57ad27de49b803c
02d1c632adde606031c1fe6ea0e3be1e288fd6c6 21-Dec-2010 David Brown <dab@google.com> Fix hard-to-reproduce crash with emergency call in airplane mode

If you make an emergency call while in airplane mode, the phone app uses a
helper activity called EmergencyCallHandler that knows how to force you
out of airplane mode and then retry the call.

When launching the EmergencyCallHandler, we pass it an intent that it
should use later when re-launching the call. That happens in two places:
(1) in the placeCall() method, before even trying to place a call, if we
notice the radio is off, and (2) in the onDisconnect() method if we did
try the call but it failed with the disconnect reason OUT_OF_SERVICE.

The intent we use is basically the intent we were originally launched
with. Unfortunately, the code in case (2) was calling getIntent() to look
up that intent, but by that point we had already reset the "current
intent" to its initial UNDEFINED state :-(

The fix is to stash away the InCallScreen's original intent at the top of
onDisconnect(), and use that intent when launching the EmergencyCallHandler.

This bug is very rare in practice, by the way (and till recently was only
ever seen on early crespo prototypes) because case (1) is the most common
code path. Case (2) only runs if we re-try the call after turning on the
radio, but it still fails, and we have to try again.

Note the actual fix here is pretty small: just the lines of code in
InCallScreen.onDisconnect() where we use "originaInCallIntent" instead of
getIntent() when launching the EmergencyCallHandler. Everything else in
this change is comment updates and debug logging cleanup.

TESTED:
- normal 911 call: dialed successfully.
- dialing 911 while in airplane mode: turned radio on first, then dialed
successfully.
(Note I ran these tests using a hacked version of GSMPhone.java that
redirected 911 calls to a harmless regular number.)

Bug: 3094858
Change-Id: Ib2f7168d943cc8eeddb30455c85dfd868f634a23
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
72ecb67bc6d7fc5d7a08fa75e35ae3c098d8c2e2 07-Jan-2011 Hung-ying Tyan <tyanh@google.com> Use CallManager.getMute() in PhoneUtils.

Currently, PhoneUtils.getMute() only get mute state from the foreground phone.
But if the fg phone is idle while a bg phone is off-hook, then we should get
the mute state from the bg phone. All the logic should be done in
CallManager.getMute() so PhoneUtils just needs to call that.

Bug: 3323789
Change-Id: I21ad6df19aa82f720e746f8d3f6a4ba5933c639e
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
58a62f78a11fdb9c772a8544ad302603fd58bdeb 22-Dec-2010 Hung-ying Tyan <tyanh@google.com> Check multiple flags for SIP/phone integration.

Bug: 3304625
Change-Id: I6997b36e772c8a30eb8523171d00c68abca1f146
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
8623ba6c6f286aa732500a834a911070f09ed877 05-Nov-2010 Hung-ying Tyan <tyanh@google.com> Make PhoneUtils.placeCallVia() call CallManager.dial

instead of calling Phone.dial() directly so that CallManager can arbitrate
among simultaneous calls. Note that PhoneUtils.placeCall() already does this.
It is inconsistent between both implementations.

Bug: 3164807
Change-Id: I64bc643a70561328d35f6388aab058888dacb63d
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
4893310af4cab8ece2e1ac3ba563d9807c211618 02-Oct-2010 Hung-ying Tyan <tyanh@google.com> am 2278eb80: am 1fbfe00d: Merge "Call setEchoSuppressionEnabled() in PhoneUtils.turnOnSpeaker()" into gingerbread

Merge commit '2278eb8066f9ed07c80ff3a72934d27b1061f23c'

* commit '2278eb8066f9ed07c80ff3a72934d27b1061f23c':
Call setEchoSuppressionEnabled() in PhoneUtils.turnOnSpeaker()
96aab1486e38c472c3949ba585c4260c3da0d2e4 30-Sep-2010 David Brown <dab@google.com> am 0a347f28: am 08cd080c: Minor debugging cleanup

Merge commit '0a347f2868f28c5a48c179611798f61e2da5ca0d'

* commit '0a347f2868f28c5a48c179611798f61e2da5ca0d':
Minor debugging cleanup
b9d29011e5478a48e82013b7a776c8e8d6d0816f 29-Sep-2010 Hung-ying Tyan <tyanh@google.com> Call setEchoSuppressionEnabled() in PhoneUtils.turnOnSpeaker()

Change-Id: I3bc51c92afa8df804fd22da29bda53881bbe5ebb
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
08cd080c56979c22092ee611a416adb86618f868 28-Sep-2010 David Brown <dab@google.com> Minor debugging cleanup

Fix a misleading debug log message in OutgoingCallBroadcaster, add some
extra CallerInfo logging (disabled by default) in PhoneUtils.

Change-Id: I64d884038fcee94e9706298375b0568a0a4b7f33
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
363006e7fb0d717b1d378e8126c654242ece2e53 24-Sep-2010 John Wang <johnwang@google.com> am 34373b7d: am 6a3e77dd: Call hangup(CallManager) while handling headset hook.

Merge commit '34373b7d121e1538f590263d92543356251aed86'

* commit '34373b7d121e1538f590263d92543356251aed86':
Call hangup(CallManager) while handling headset hook.
6a3e77dd62a8934b28a3ba236ff56a2fbf0b0184 24-Sep-2010 John Wang <johnwang@google.com> Call hangup(CallManager) while handling headset hook.

For bug 3028772.

While handling the long press action of headset,

it should call hangup(CallManager) instead of hangup(ringingCall) to

hangup foreground call or background call.

Change-Id: Ia7ea715842c544aee72af08084e39377a33b36ad
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
577bb7d1cfbe3f8507fe5154b1c7734b1065c8b1 21-Sep-2010 John Wang <johnwang@google.com> am 5dc2da29: am 5eb7119f: Merge "Fix answerAndEndActive." into gingerbread

Merge commit '5dc2da2956853fe537d7ff1ac07f714fd31618e9'

* commit '5dc2da2956853fe537d7ff1ac07f714fd31618e9':
Fix answerAndEndActive.
e31a470b6c96f571880638b039c48e8942fa632a 21-Sep-2010 John Wang <johnwang@google.com> Fix answerAndEndActive.

For bug 3018776.

since hangupActiveCall() also accepts the ringing call

we have to check if the ringing call was already answered or not

before answering the ringing call.

Change-Id: Iea707fe26d6e84733c97f60e0108a6c9eeca1a70
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
2958e253fad69dfff3c8882408a11c0d15068fe8 18-Sep-2010 John Wang <johnwang@google.com> am 1c189e69: am 089160b0: Use CallManager state.

Merge commit '1c189e69e178e5b59beaf4983a76d7a6b01da93c'

* commit '1c189e69e178e5b59beaf4983a76d7a6b01da93c':
Use CallManager state.
089160b0b93bfe7faf67a2204475cc901cb32e55 17-Sep-2010 John Wang <johnwang@google.com> Use CallManager state.

Use callManager state instead of Phone state

while updating proximity sensor mode.

Change-Id: Ie877eae88351b9cb13d16a2584a4a88a7e8b2839
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
cd41e9dd72a467e1e92818b29edcacc88ea0bec1 09-Sep-2010 John Wang <johnwang@google.com> am f0dc37d3: am f8396c51: Handle hangupForegroundResumeBackground operation.

Merge commit 'f0dc37d37a8f1d7378554b7b388d6e154ba5ad59'

* commit 'f0dc37d37a8f1d7378554b7b388d6e154ba5ad59':
Handle hangupForegroundResumeBackground operation.
f8396c51f11b1044d236415f2ee88750b4e40e1f 03-Sep-2010 John Wang <johnwang@google.com> Handle hangupForegroundResumeBackground operation.

Change-Id: I4526e80cfe4fbe145cbc9f6d96f3e67560ed351c
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
1b4455031a45a9b87cf66b3384ce59287500a448 08-Sep-2010 Hung-ying Tyan <tyanh@google.com> resolved conflicts for merge of fa03557a to master

Change-Id: Ifcc948269206985b394682bc10385b3409e1541f
872a3a7af50ce6a4efb180336614bddefe102ac5 07-Sep-2010 Hung-ying Tyan <tyanh@google.com> Revise phone app to accept new PHONE_TYPE_SIP phone type.

Change-Id: Ib5d930b64a95a86822669367cb6f69359a04bfb6
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
84952328a62bd2e04e64155ea9284df2c74a5657 06-Sep-2010 Chung-yih Wang <cywang@google.com> am f17a2906: am 9eb1dd3b: Merge "Fix the sip call option." into gingerbread

Merge commit 'f17a2906a723eb0a9ad2c5a1d089624e00c129c5'

* commit 'f17a2906a723eb0a9ad2c5a1d089624e00c129c5':
Fix the sip call option.
2587d9c6437b680911e252efecc73788e876de76 04-Sep-2010 Chung-yih Wang <cywang@google.com> Fix the sip call option.

Instead of calling the InCallScreen activity in OutgoingCallReceiver,
we will have it in the SipCallOptionHandler when the phone is
selected.

Change-Id: Iddfcdbd614e83791e14ddaae9ae2fd45fa4e2e5c
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
138423ea2126035f7e316de18fc478362cf3b891 03-Sep-2010 John Wang <johnwang@google.com> am 507876ad: am 2b250f76: Merge "Fix mute/unmute operation with CallManager." into gingerbread

Merge commit '507876ad11ae076c2eae93ff219843b62eb7113d'

* commit '507876ad11ae076c2eae93ff219843b62eb7113d':
Fix mute/unmute operation with CallManager.
a50e10e2efadac960987eaadc0938c6f92d3ee90 03-Sep-2010 John Wang <johnwang@google.com> Fix mute/unmute operation with CallManager.

It is for bug 2968263.

The Mute concept is call based. PhoneUitls maintains a connectionMuteTable to track

the mute state of each connection. For every preciseCallSateChanged event, the table

gets updated for all foreground and background connections. For every UI mute/unmute

operation the table gets updated for affected foreground connections.

Meanwhile, clean up setMute() and getMute() APIs in PhoneUtils since all in-call operation

can only mute/unmute foreground call, which means works on foreground phone.

Also enforce all in-call UI use setMute() instead of setMuteInternal().

Change-Id: Ib608e040230d46b57434a0ac2597a6fb676ad639
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
28baffce94988f3aa3248e84008a51808ff7c82a 01-Sep-2010 John Wang <johnwang@google.com> am d7061ece: am 61bde155: Remove Phone from getNumberFromIntent.

Merge commit 'd7061ece40f40344552a6b3b6ce95b510e9627ef'

* commit 'd7061ece40f40344552a6b3b6ce95b510e9627ef':
Remove Phone from getNumberFromIntent.
61bde155c038489befc9c6cb9eb1765f44daaae0 01-Sep-2010 John Wang <johnwang@google.com> Remove Phone from getNumberFromIntent.

As part of removing Phone usage of InCallScreen, clean up the PhoneUtil.getNumberFromIntent().

The parameter phone is not in used.

Change-Id: I10b6f1bb3fb44763c9a310528c81d4c136ce0d2e
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
2882c4a1808f8368eb2954ffb9dbc0bdeb911ae6 27-Aug-2010 David Brown <dab@google.com> am 7bc9dbc7: am bbc3b157: Update the phone app to handle "sip:" URIs.

Merge commit '7bc9dbc7da897eb5fdbd4443d01b00529661fc5a'

* commit '7bc9dbc7da897eb5fdbd4443d01b00529661fc5a':
Update the phone app to handle "sip:" URIs.
bbc3b15705e4511da3c8fe3fc105ad99a85e1e0b 25-Aug-2010 David Brown <dab@google.com> Update the phone app to handle "sip:" URIs.

Now that the Contacts app knows about SIP addresses (see change
https://android-git.corp.google.com/g/62672), the phone app now needs
to handle URIs like "sip:foo@example.com" in the various flavors of
the CALL intent.

The details:

- Added intent-filters with android:scheme="sip" for the various CALL
intents in the manifest

- Updated PhoneUtils.pickPhoneBasedOnNumber() to take the scheme into
account.

If it's a sip: URI, we definitely try to find a SipPhone.
Otherwise, we do the same logic as before: if the URI contains an
"@" character, assume it's a SIP address, otherwise assume it's a
regular number and use the default Phone instance.

(This means that you can still use the tel: scheme with a SIP
address, like "tel:foo@example.com". That works for now, but we may
disable it eventually since that's an incorrect use of the tel:
scheme.)

- Updated PhoneUtils.getNumberFromIntent() to return the SIP address
if you pass it a sip: URI.

Bug: 2915381
Bug: 2942998

Change-Id: I1031cd71f9e232294a41d2cec81605a3309bc6d6
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
a4f8d09a653f1322bb3d38cd65a8cc038a984280 20-Aug-2010 Hung-ying Tyan <tyanh@google.com> resolved conflicts for merge of 62bdb7e7 to master

Change-Id: I23c9660917972b843a9c6ef375b528e1886726e5
47bf9386b2db81cdc7194711412194fce5b489c6 19-Aug-2010 Hung-ying Tyan <tyanh@google.com> resolved conflicts for merge of 4000ce7e to master

Change-Id: Ibbc34e5e1533b7eef54ab62169e002ecc0b1e7ea
b5190cc81c5cf5ea7bc8f92734b5824bf0b20854 18-Aug-2010 Hung-ying Tyan <tyanh@google.com> Add PhoneUtils.dumpCallState() to dump CallManager state

Change-Id: I98240a58902374873dcf15259d51031e9c370504
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
a4b443115c1442c9d65ba58fcb667b0e025993de 17-Aug-2010 Hung-ying Tyan <tyanh@google.com> Move PhoneUtils.setAudioMode().

As different audio modes need to be applied for different phone types, (for example,
SIP call needs to be in MODE_NORMAL while GSM call in MODE_IN_CALL,) we move the
logic to CallManager. A side benefit is that since CallManager knows the current
phone state, PhoneUtils does not need to keep the audio control state (sAudioBehaviourState)
anymore.

The companion CL is at https://android-git/g/#change,61553

Change-Id: Ibb40e1853f2e5818b4b28c976f5756f567b3de41
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
b045b9344f339170d134cf814357361d96c349cf 17-Aug-2010 Hung-ying Tyan <tyanh@google.com> Integrate confcall support with CallManager

Change-Id: Ifb5116a175b1f63d879c4bd64d4fabadd6c4e5a4
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
9afe1de771110096822a2501d78135575101421d 14-Aug-2010 John Wang <johnwang@google.com> resolved conflicts for merge of 17509be3 to master

Change-Id: Ie52e3bfd5f127788840b11e56ba5fe9dd5b97cf0
8343169cc89621d46dce86449f5ee1ff5d3a4919 11-Aug-2010 John Wang <johnwang@google.com> Enable CallManager to handle SIP call.

Using CallManager to handle SIP call

1. Register SIP phone in SipBroadcastReceiver

2. Answer SIP incoming call

3. Reject SIP incoming call

4. Make SIP outgoing call

5. hangup SIP outgoing call

6. Add SIP call while there is foreground call

7. Answer SIP call while there is foreground call

8. Swap SIP call and background call

Change-Id: I2fc1f88e0fc100da45eb497469d69c784f44d06a
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
50af50953c053c7822362a59d14bc32c20d873ee 01-Jul-2010 David Brown <dab@google.com> am 42e8d8de: am 7f63f08c: Launch incoming call UI via notification, not with startActivity()

Merge commit '42e8d8de0a8e31692c0f936f810bd1a6e5048b00'

* commit '42e8d8de0a8e31692c0f936f810bd1a6e5048b00':
Launch incoming call UI via notification, not with startActivity()
7f63f08c5c88d604abba447032ed42f4f972f3ef 25-Jun-2010 David Brown <dab@google.com> Launch incoming call UI via notification, not with startActivity()

This is step 2 toward the new notification-based incoming call UI, which
will allow for special behavior if a call comes in while a
non-interruptable ("immersive") activity is in the foreground.

Previously, we'd explicitly call PhoneApp.displayCallScreen() as the very
last step of the "incoming call" sequence in CallNotifier.java. Now, we
instead post a notification that includes a "fullScreenIntent" field,
which the framework will automagically launch as long as we're *not* in
the middle of an immersive activity.

(Note that we specify a non-null fullScreenIntent only while the phone is
ringing, so the regular "ongoing call" notification is unchanged. We also
set the notification's FLAG_HIGH_PRIORITY bit if the phone is ringing.)

Next: implement UI for the case where we *are* in an immersive activity.

Other refactoring/cleanup in this change:

- Replaced PhoneUtils.showIncomingCallUi() with the new
CallNotifier.showIncomingCall() method. The functionality is the same
*except* that the new version puts up a notification instead of
explicitly calling startActivity() to bring up the InCallScreen.

(I moved the code from PhoneUtils to CallNotifier since it's only ever
called from CallNotifier methods.)

- Update NotificationMgr to use the new stat_sys_phone_call_ringing
resource for the "incoming call" notification. (That's still a
placeholder icon, though.)

- Remove the totally obsolete PhoneApp.handleInCallOrRinging() method

Tested: incoming calls in both immersive and non-immersive activities.
(Note that there's currently no way to actually *answer* the call if
you're in an immersive activity, though.)

Bug: 2768760

Change-Id: If33a64d7c2fba3a4eb1ecab7db8f03f7593ca5c5
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
95bef36fa7efe381db81ec08b6244daf02414a28 27-May-2010 David Brown <dab@google.com> More phone app "if (CDMA)" cleanup

- Use "supportsConferenceCallManagement()" and "supportsHoldAndUnhold()"
in a couple more places rather than hardcoding "if (GSM)" or "if (CDMA)"

- Added a new supportsAnswerAndHold() capability to control what user
actions should be available in the call-waiting state

- Use supportsOtasp() rather than "if (CDMA)" in a few more places.

- Slight comment and logging cleanup in syncWithPhoneState().

- Also, similarly to the "disable mute during emergency calls" change from
https://android-git.corp.google.com/g/52739, also make the "force unmute
after answering a call" feature apply to all phones (not just CDMA.)

- Slightly simplify PhoneUtils.hangupRingingCall() logic. Added a TODO
about some CDMA-specific code that's still there.

Change-Id: I0f31c05ecfcae7a9e405a7f5e9ac77826a482519
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
b56ef54ecafce9304d8461a56a5e977ef9ed3e36 24-May-2010 Martin Hibdon <mah@android.com> Finish mergine placeCall and placeCallVia

Now fully merge PhoneUtils.placeCall and placeCallVia.
Change I5630f09c got rid of some duplicated code between
these two functions. Now they are fully merged together,
so callers just always call placeCall, and it
determines whether or not to use an external gateway
internally. This simplifies the inCallScreen.

Tested on Passion:
regular numbers, with and without google voice
MMI and USSD codes

Tested on Sholes:
regular numbers, with and without google voice
MMI and USSD codes
emergency numbers

Change-Id: I81b0c8ba1cee21ffc8debb9bc727bcbf7e6fb65a
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
ca3691037d0a15cc1f13a392e4fbdf2b68a728e1 19-May-2010 Martin Hibdon <mah@android.com> get rid of duplicated code in placeCall() and placeCallVia()

These two functions had mostly the same functionality, but
structured differently. Now these functions have been
merged into placeCallInternal().
This also fixes Bug: 2667919, which was that the speaker
phone was not activated when in the car dock and
using google voice. This was caused by a line
missing from placeCallVia().

Tested on Passion:
regular numbers, with and without google voice
regular numbers in car dock, with and without google voice
phone numbers with pause and wait in the post dial numbers
MMI codes
USSD codes

Tested on Sholes:
regular numbers, with and without google voice
phone numbers with pause and wait in the post dial numbers
emergency numbers

Change-Id: I5630f09cea8f27357a72b007aa7baf0277d59e96
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
98cdd546ec6b9224863ecef92307496761067cc6 21-May-2010 David Brown <dab@google.com> Clean up "ECM == CDMA" assumptions.

Style nit: Fix capitalization of TelephonyCapabilities.supportsEcm().

Use supportsEcm() instead of "if (CDMA)" in a couple of places.

Change-Id: I257104b6917887af3bccf0eee22329b5f7191456
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
1ca1b441b65d55659e2553540f9b75b9749d7fde 18-May-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: Ib4ce8d43cb8df5e2cbeed241def07bba63278af4
edbbd998abc6d1d1d2c2f3b54c939779c91a2708 17-May-2010 Christian Mehlmauer <FireFart@gmail.com> Removed calls to deprecated APIs and unused imports

Change-Id: Id5e94947f58a1282857ec9f4239e85299b9d7d51
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
77350aabae2f056ede7d0df806a9e5a3c22daf7a 15-May-2010 David Brown <dab@google.com> FIX 2684297: Phone app crash when rejecting second incoming call using BT

When rejecting an incoming "call waiting" call, CDMA phones use a special
CDMA-specific code path ("onCdmaCallWaitingReject()"). This code path is
only safe to call from the phone app main thread. Unfortunately, if you're
using a BT headset, that code path gets run in the BluetoothHandsfree thread :-(

The fix is to ensure that onCdmaCallWaitingReject() only ever gets run from
the CallNotifier's own handler thread. We do this by using a new
"sendCdmaCallWaitingReject()" method that simply posts a message causing
onCdmaCallWaitingReject() to run later, in the main thread.

Also added documentation for the mCallWaitingTimeOut field.

Tested: on Sholes, ran the scenario from bug 2684297. Before this change
it crashed; after this change the call is correctly rejected (without
crashing.)

Other related scenarios (rejecting the 1st incoming call; getting a CW
call and answering it) still work fine too.

Bug: 2684297

Change-Id: I35ca1712bcc8a11cd30b8a401d2939f4cfe6117a
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
aa3d3cfb32c7350f72771db8756e751eb5c61b1e 24-Apr-2010 David Brown <dab@google.com> Allow incoming calls in Emergency Callback Mode, even if not provisioned

Normally the phone app rejects any incoming calls if the device isn't
provisioned (i.e. before you've run thru the SetupWizard).

But since you *can* make an emergency call before completing the
SetupWizard, we also need to allow you to receive incoming calls in
emergency callback mode, regardless of whether the phone is provisioned.

(Emergency callback mode is a CDMA-only feature. The device goes into this
mode for the next 5 minutes after you make an outgoing call to an emergency
number.)

This change was originally a patch from Reli.Tal@motorola.com in
b/2489602. That was a patch against MotoBlur code, though, so I had to
apply it manually and throw out a bunch of stuff that didn't apply to our
tree.

Tested:
- Passion:
- incoming call on provisioned device: worked fine (the device rang)
- incoming call on freshly-wiped device before SetupWizard: rejected

- Sholes:
- incoming call on provisioned device: worked fine
- incoming call on freshly-wiped device before SetupWizard: rejected
- incoming call on freshly-wiped device while in ECM: worked fine

(I did that last test by using the Extended NAM menu to make "666" be
an emergency number. I then wiped the device, pressed "Emergency
dial" from the first SetupWizard screen, dialed 666, and then hung up
to get into ECM. Then I called the device, and the incoming call
*did* ring.)

Bug: 2489602
Change-Id: Ibb1fc40be73de9ac638c02c54930ec91d6e05cb0
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
6a04331f3f2c334be4f7c5fc41f6cd58de71dde5 18-Feb-2010 Jaikumar Ganesh <jaikumar@google.com> am b4137106: am 8ae7a578: Set the CONF_CALL state correctly.

Merge commit 'b41371069b9a5ffdc66f755edda4f368517f4e8f'

* commit 'b41371069b9a5ffdc66f755edda4f368517f4e8f':
Set the CONF_CALL state correctly.
8ae7a57878143b10d0057cf63bfcc7466d4f2730 18-Feb-2010 Jaikumar Ganesh <jaikumar@google.com> Set the CONF_CALL state correctly.

This was causing problems with the state being reported to headsets,
on account of a race condition.

Bug: 2430353
Dr No: jsh
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
893d0233193b2095293d890a9ad1c73b1dc6a9a2 05-Feb-2010 mah <mah@android.com> Fix bugs #2305101 and #1704011
Now when the user long presses the headset hook button on the wired headset,
the phone hangs up. Short press still toggles the mute state.
Also, the Phone app now captures and consumes any media key events
if a call is in progress, so pressing the next or previous button
will no longer start up the music player.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
9fd5e84fd6f5c2c5f488bf08d8dd9a2c0aab1370 02-Feb-2010 Wink Saville <wink@google.com> Cleanup comments, see bug 2401350.

Change-Id: Ic02eb907a663fe5e4a8991d42a5795199e228c2f
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
2eba6fabd0bedaf2a59da643ce475586b62f0ff9 02-Oct-2009 Peng Zhu <w46254@motorola.com> Phone in a dock: turn on speaker

When the phone is in a dock and you call a contact, the speaker phone should
be turned on by default, as long as there is no other headset connected.

Bug: 2144974
Change-Id: I9e1fb94f3b149056b7f40c6df1230740628f6ef2
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
9c1d8bc6472ebb7edb5cbda635e0afc1eb208d91 02-Dec-2009 Mike Lockwood <lockwood@android.com> am 69a2eb3f: Use FLAG_DISMISS_KEYGUARD flag and eliminate use of KeyguardManager.exitKeyguardSecurely()

Merge commit '69a2eb3f86688d69da8d9b51715a3e87c45b09ed' into eclair-mr2

* commit '69a2eb3f86688d69da8d9b51715a3e87c45b09ed':
Use FLAG_DISMISS_KEYGUARD flag and eliminate use of KeyguardManager.exitKeyguardSecurely()
69a2eb3f86688d69da8d9b51715a3e87c45b09ed 02-Dec-2009 Mike Lockwood <lockwood@android.com> Use FLAG_DISMISS_KEYGUARD flag and eliminate use of KeyguardManager.exitKeyguardSecurely()

This is an improvement on previous fixes for bugs b/2287830 and b/2297221

Change-Id: I2158bba05255826706c45d0511c3b597549660df
Signed-off-by: Mike Lockwood <lockwood@android.com>
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
a1449e3a5d5d9d5e0e8982c7098752ce11477680 04-Nov-2009 Nicolas Catania <niko@google.com> In getCompactNameFromCallerInfo, don't call modifyCnapCases on a name.

When the async query to lookup a CallerInfo completes, we update the logs
with a compact name which is the name of the contact associated with
the number or the number itself.
If we have a name, we should not call modifyForSpecialCnapCases because
it takes a number a argument. Special number strings are used to
mark a call as private and it clashes with some contact name entries.

For instance, a contact with name 'P' will always be marked as private
number even thought it is not.

Bug:2160795
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
6b0efb615a5b1a65984192384c88965fa7dd06a0 05-Nov-2009 David Brown <dab@google.com> Minor logging cleanup/tweaks to help debug bug 2202413.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
39a84144262f12df44861d746788b9de92259e4f 29-Oct-2009 Abhishek Pillai <pillai@motorola.com> CDMA 3-way calling and call-waiting UI changes

Changes in this patch have the following impact on calling UI for CDMA:

1) On originating a 3-way call, the "Dialing Party 2" is displayed for 3 seconds, after which
UI changes to generic "In call" screen.
Merge call icon in the upper left corner of the screen appears.
"Add call" option is available in the bottom Call control area.
2) On selecting "Merge" option
The "Merge" button changes to "Manage calls" button.
"Add call" option is available in the bottom Call control area.
3) On answering a call-waiting
The "Merge" button changes to "Manage calls" button
"Add call" option is available in the bottom Call control area.

Bug: 2226325
Change-Id: I4d116d1968a1fd5e0df9f14de1928df76c1803e0
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
055b927f7ee587bc1b1e595b12beaa232ab99ffc 29-Oct-2009 Eric Laurent <elaurent@google.com> Fix issue 2194140: [Passion] Support Audience chip.

Added method to PhoneUtils to turn noise suppression on or off.
Added configuration option indicating if noise suppression is available on the platform.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
c8f4017c60f26ee760cd2f597de307e1845cf35a 21-Oct-2009 Jean-Michel Trivi <jmtrivi@google.com> Fix bug 1511847, part 1 of 2: add a property in the Phone app to
specify whether calls to mute the microphone should be routed
through the AudioManager class or through the RIL, and read that
property to implement PhoneUtils.setMuteInternal(bool) accordingly.

This was discussed with DrNo (jsh) as the least risky approach to
using the AudioManager API for devices that use the libaudio-qsd8k
library without changing the current behavior of those that use
the Moto audio hardware library.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
008791ca2a9a1406c2a9f7b39c794104d151b898 09-Oct-2009 Paul Berman <paul.berman@motorola.com> Add ability to send empty flash to network for CDMA

Currently the TwelveKeyDialer does not allow the user to press the green
call button if the dial text is empty. However, in CDMA when we place a
3-way call in some network infrastructures, you need to send an empty
Flash command to the network before adding the call. The user is accustomed to
pressing the call button in order to do this. Therefore here we make the
changes in the Phone app required to handle that keypress and send the blank
flash.

Bug: 2179060
Change-Id: I1ebcdeaee602043d16480338ed35468e7edc9550
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
1e8a3579f8e49fd1f1a078d6be6864a6a8bac306 03-Oct-2009 David Brown <dab@google.com> Reduce Phone App logging verbosity

- Update PhoneUtils.dumpCallState() to use a (much) more compact format
- Turn down verbosity of some other stuff that's not needed any more
- STOPSHIP cleanup: Remove a runtime exception that should just be a Log.e()

TESTED=GSM,CDMA.
BUG=2163789
DRNO=timsullivan
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
6467d8c5867bd63f4c5fe7e450012c6899436b74 01-Oct-2009 David Brown <dab@google.com> In-call UI: Lots more asset integration / cleanup (bug 2092939)

Integrated final assets (both mdpi and hdpi) for:

- Photo borders (with corresponding layout tweaks)

- Backgrounds for in-call touch UI buttons

- Icons for the RotarySelector widget for incoming calls

Also cleaned up some unused / obsolete cruft, like assets from some
long-gone Moto UI.

There's now nothing left in the "generic" res/drawable directory except
for a couple of StateListDrawable XML files (which belong there), and 3
PNG assets from Moto (which we didn't create, and which are only used in a
couple of obscure places in the UI.)

Also clean up (unused) imports for the old Contacts API in PhoneUtils.

TESTED: hvga and wvga, all basic telephony states.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
f24849566edae03c1123203b4362c688d8fa57a9 30-Sep-2009 Nicolas Catania <niko@google.com> Removed annoying warning in the logs.

The message is really a debug message.
It is printed when no provider is used which is the case most of the
time.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
1f2526b75112595d0d7c4c43b98a52f89dfe09d9 27-Sep-2009 Peng Zhu <w462534@motorola.com> Fix issue of Call unmuted when toggle backlight.

This patch fixes an issue where mute status gets lost when phone goes dark
then woken up. This issue happens to all non 3-way voice calls.

The fix is to remove the condition to limit the restoring of the mute status
to THRWAY_ACTIVE.

Change-Id: I956dc54d3837b88f0b7d50ee2d199ac301ccf095
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
a52f06a12e64113097010cb126a722421c7c9cf3 24-Sep-2009 Peng Zhu <w46254@motorola.com> wired Head Set do not mute emg call.

The issue this patch fixes is:
On an emergency call with a wired headset attached, the in-call screen
mute key is disabled but pressing send/end key on the wired head set
mutes the call, but UI does not reflect the mute status.

The fix is to check for emergency call before changing the mute status.

Change-Id: I64c36fe826bd63632dd9d7f33106547bcf755193
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
02a199cd143518a01b2014c303908b95dfc58afb 24-Sep-2009 jsh <jsh@google.com> Fix IllegalStateException while making/receiving calls.

PhoneUtils.restoreMuteState was throwing an IllegalStateException
when it shouldn't have. Removed this.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
79b9f6e30e8402b103f1ec3ed9dda1fcad2b1cd5 22-Sep-2009 Tammo Spalink <tammo@google.com> Replace Phone.getPhoneName() calls with getPhoneType().

The latter is numeric, and hence allows some compiler protection
against typos.

Addresses issue:
http://buganizer/issue?id=1905415

Change-Id: If46c709fd7bfb817a2801d0200eac0ad8cf819e0
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
329dc035267d5f65f96021e26601df3f7cc57659 21-Sep-2009 Peng Zhu <w46254@motorola.com> Prevent extra call lost dialog in CDMA call waiting scenario

Specific issue that causes the extra dialog and prevents answering a call:
- Make an MO call and answer from remote side
- Make an MT call to trigger call waiting. Call waiting is displayed. Answer the MT call.
- Call 2 is active and call 1 is on hold (on the network side).
- Force the phone to drop the call in this state.
- Call lost notification is displayed, call 2 is ended but we get network callback from phone 1.
- When call 1 rings back, the call lost notification is displayed again and we are unable to
answer call. Pressing back key clears call lost notification.
- When we make an MO call after this, we get the call lost notification again if we don't clear
the call lost notification by pressing back key).

Also includes some cleanup from a previous change (I15110a92).

Change-Id: I5ab3af400a9d7ea90c5028315ca098e586997809
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
3ba1cd466a39eb22addb6f6fe3c7b0f3e7916330 19-Sep-2009 Nicolas Catania <niko@google.com> Fix for the missed call notification presentation.

When the query to the contact DB ends, update the new CallerInfo
instance generated from the DB with the info contained in the
Connection.

Bug 2125673
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
b8df8173e1a0ea8ba89cea984176216201c4d5e7 16-Sep-2009 Paul Berman <paul.berman@motorola.com> Correct the mute state for new incoming connections

When we receive a new incoming connection for CDMA, we want to make sure
that the audio is automatically unmuted (which is particularly important
when receiving a call-waiting call, but even for normal MT calls). Also
changed scope of an InCallScreen API to allow the onscreen widgets to be
updated when a wired headset is being used to answer/change mute state of
a call.

Bug: 2115195
Change-Id: I2921435e63bd42f285f09028779996f6d8de48de
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
64824003c89a7758240425f5c9f8d29cb00e4a65 12-Sep-2009 Nicolas Catania <niko@google.com> Fix the call log for voicemail and emergency numbers.

When retrieving the number that should be inserted in the logs,
don't use the callerInfo.phoneNumber for emergency and voicemail calls
because it contains the strings 'Voicemail' or 'Emergency Numbers'.
In this case, get the number from the connection instead.

bug:2112640
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
5e16b62c17a9ad0457008953e2228d5ee8a406d3 11-Sep-2009 Nicolas Catania <niko@google.com> Get the app's icon to build the overlay instead of a remote view.

In the incall screen layout, replace the generic frame layout with an image view
where the icon is drawn.

Removed the extra definition for the badge (RemoteViews).

Bug: 2101043
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
2cbf80dfbbc28ae24e093fb089973b3e59d4508a 10-Sep-2009 Nicolas Catania <niko@google.com> Centralized the processing of the intent's extras in internalResolveIntent.

Previously, the extras were processed in the methods internalResolveIntent and placeCall.
The issue was that if data was missing to build the badge, we would still redirect
the call but don't display the badge.

Now we extract and check all the provider's data as early as possible in internalResolveIntent
and use some fields to store the values collected.

Bug: 1984556
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
6fac3a6bdab79725a2ca2e3102eccb3f6e9c1ac4 09-Sep-2009 Nicolas Catania <niko@google.com> hasPhoneProviderExtras treat null values as false.

If the intent is null, the NPE is caught and false is returned.
I'd like to consolidate more of the checking in this method so
other NPE will arise potentially, hence the try/catch NPE vs if(null == intent)

Bug:1984555
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
ada76244191b2bb56fe8911d503c91f241083d80 03-Sep-2009 Peng Zhu <w46254@motorola.com> Cleanup in PhoneUtils.java

In case the phone.acceptCall() throws a CallStateException, we need to restore
the cdmaPhoneCallState and bthf.cdmaSetSecondCallState. This is a CDMA-only change.

This change addresses comments from cpr822 that was merged.

Change-Id: I15110a923c95af2252017840c346194bd75a46d8
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
69f61be83befb4effab14afd62951c9f01233d7b 08-Sep-2009 Nicolas Catania <niko@google.com> Use Uri instead of string in placeCallVia.

Bug:1984555
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
153b94130a5e7a0e7bb17f17ce8f1ed294453d9e 04-Sep-2009 Dmitri Plotnikov <dplotnikov@google.com> [Issue 2101088] Upgrading voicemail settings to new Contacts API
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
de0d16c814b5e7f6c75d00025dc331f64703de1c 31-Aug-2009 Paul Berman <paul.berman@motorola.com> Fix multiple CNAP display/logging issues

Fixed numerous issues where CNAP interactions with other features
(CW/3W/corner cases/missed calls) caused unexpected results. Now
*all* of these interactions should be accounted for and have been
tested on our end to work as expected based on known permutations
from the network.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
d94cc5e209bf871e4b6d5e84bcf6bd4e38d8ac65 01-Sep-2009 Nicolas Catania <niko@google.com> Modified the CALL's extras to provide the application's package name.

The name of the provider is passed using the new GATEWAY_PROVIDER_PACKAGE extra.

Made the gateway number extra a URI and renamed to GATEWAY_PROVIDER_URI to be
more generic and support VOIP.

Renamed copyPhoneProviderExtras to checkAndCopyPhoneProviderExtras
since the copy does not happen if some info is missing.
Added new helper method to detect if an intent has the required
phone provider extras.

Bug: 1984556
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
0f68bb19e2cca0bb7f70e2fcf16e0747a0036885 03-Sep-2009 David Brown <dab@google.com> Hide the dialpad "drawer handle" on devices that don't need it.

If this device already has an onscreen "Dialpad" button, don't ever show
the drawer handle (which will be mostly covered up by the buttons anyway.)

This is a temporary cosmetic fix. The real fix, coming soon, is that we
shouldn't use the SlidingDrawer AT ALL on devices with onscreen buttons.

Also, re-enable verbose logging of the telephony state when entering the
InCallScreen, to track down call state problems on CDMA devices.
Update PhoneUtils.dumpCallState() to show the CdmaPhoneCallState too.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
425b8e3c9846d5e0e76466604b35cad8856d79de 02-Sep-2009 Eric Laurent <elaurent@google.com> Fix issue 2094757: Wired headset connection while in call disables speaker button but leaves speaker on.

The fix consists for one part in never disabling the speaker button: the user has the possibility to enable/disable the speaker even if a headset is connected.
When a headset is connected while the speaker is on, the speaker is automatically turned of but its current state is remembered so that it can be reapplied if the headset is disconnected.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
5607afe15a507715078025beff1bd743c883a5cc 31-Aug-2009 Paul Berman <paul.berman@motorola.com> Fix CNAP NPE

Fix CNAP-related NPE where network can send a non-allowed presentation
and a null string for the number

Change-Id: I0ad8fa05c7ac488d863559b11b44adc49411696a
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
2312eba1a4821fd8f10535038555d12874e6fc67 01-Sep-2009 Wink Saville <wink@google.com> Don't send flash on wired headset

Current behavior on CDMA is sending a flash to the network and also playing
a tone, while the desired behavior is to just mute/unmute the audio.

Change-Id: Idf54ee8602f565adcee3fac4382fc4ced29a3506
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
62ce1135ff91e303d80cac0434ed5232edb63c86 28-Aug-2009 Nicolas Catania <niko@google.com> Added test to avoid special dial string to hit 3rd party providers.

If the stripped number does not match "[\\+]?[0-9.-]+" it will not be
routed through 3rd party providers.

Bug: 2082142
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
2f5a2e9b6dc69123abe36fd6deb93b7fb46c1cad 28-Aug-2009 Paul Berman <paul.berman@motorola.com> CNAP: only allow Contact query for ALLOWED presentations

In cases where the network sends us a valid phone number, but a
restricted/unavailable presentation, we do not want to perform a
Contacts query, since we do not want to accidentally give away any
PII (personally identifiable information) of the person calling if
that person is a contact.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
3d04d787659f87a21e7414b7e13c1d53be6b859f 26-Aug-2009 Nicolas Catania <niko@google.com> Implemented placeCallVia.

This change displays the right number/contact in the calling
card when a 3rd party provider is used.

InCallScreen:
Do not route emergency calls through a 3rd party provider.

PhoneUtils:
Refactored the code that set the CDMA call state once the connection
is setup in a new updateCdmaCallState method.

Manually create the connection caller's info to use the requested
phone number instead of the one dialed in the connection.

Fixed a bug in the code that copies the extras between intent,
the number is a String and not a Parcelable.

Bug: 1984555
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
62b318a7a708e464b1fc13692feeef88860064cd 25-Aug-2009 Peng Zhu <w46254@motorola.com> Fix the BT CIND issue

The issue this change fixes is:
BT-Call held indicator is wrong for an MO call followed by an MT call.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
7a2ee085993bc9cae01bf9daa993b1551ed64a7b 25-Aug-2009 Nicolas Catania <niko@google.com> Added a new extra for the provider's number.

Added a util method in PhoneUtils to copy the
provider's extras from one intent to another.

Bug: 1984555
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
153e79d8d413b1ccd4abf55a8dbe4e266aa92799 11-Aug-2009 Paul Berman <paul.berman@motorola.com> Fix CNAP corner case display/logging issues

Fix various CNAP scenarios that were not getting displayed or
logged properly, namely:

1. Issue where if network sends "corner case" string and ALLOWED
presentation, call would get logged incorrectly.
2. Issue where missing a call from a party where network sends
certain "corner case" string would show incorrect string in
notification.
3. Issue where in 3w/cw scenarios, CNAP information is not correctly
displayed in the ongoingCallStatus and onHoldCallStatus areas for
presentations other than ALLOWED.

Also fix an issue where the CallCard label is accidentally displayed
when phone is in Generic state.

Add and use resource absent_num
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
d3744ff481f7d96669740b015a39d7441208152b 20-Aug-2009 Abhishek Pillai <pillai@motorola.com> Disable proximity sensor for certain scenarios while on a call

PhoneApp.java Changes:
-> Added boolean member to track keyborad state
-> Added calls to updateProximitySensorMode() on receiving any wired headset,
keyboard show/hide, bluetooth event.
-> Modified updateProximitySensorMode() not to acquire PROXIMITY_SCREEN_OFF_WAKE_LOCK when:
1) If the audio is routed via Bluetooth
2) If a wired headset is connected
3) if the speaker is ON
4) If the slider is open(i.e. the hardkeyboard is *not* hidden)
-> Added new interface to provide "phone" object(required in changes in PhoneUtils.java)

PhoneUtils.java Changes:
-> Added call to updateProximitySensorMode() on changing speaker state
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
fa3fbeedf018e40f8d6696a382bbf316219cf4ae 18-Aug-2009 Reli Tal <reli.tal@motorola.com> Disable MMI registration for CDMA

Changes include:
1. PhoneApp.java: Do not register for MMI for CDMA
2. PhoneUtils.java: In placeCall() for CDMA, if connection object is NULL
return CALL_STATUS_FAILED
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
c9d9ed30aa547b79b81adc13a4d148a003b6ee62 30-Jul-2009 w36256 <pillai@motorola.com> CDMA Bluetooth calling fixes

BluetoothHandsfree.java Changes:
- Added CDMA_MAX_CONNECTIONS definition for CDMA CLCC connections update

- Added mCdmaIsSecondCallActive CDMA specific flag used in context with BT
devices having display capabilities to show which Caller is active.
This state might not be always true as in CDMA networks if a caller drops
off no update is provided to the Phone. This flag is just used as a toggle
to provide a update to the BT device to specify which caller is active.

- Modified BluetoothHandsfree() to initialize mCdmaIsSecondCallActive

- Modified updatePhoneState() to build CIEV response for:
1: 3 Way Call origination
2: Swaping between calls and merging two calls.

- Modified cdmaGetClccResult() for better readability

- Added CDMA specific interface to handle CLCC request
1: cdmaGetClccResult()
2: cdmaConnectionToClccEntry()

- Modified CLCC handler to call cdmaGetClccResult for CDMA phones

- Added new interface cdmaSwapSecondCallState() accessible to rest of the PhoneApp
to update the mCdmaIsSecondCallActive state.

- Modified CHLD handler to add capability to
1: Swap between calls after accepting a Call waiting and
2: Merge calls if on a Three-Way Call.
3: hangup a call on receiving CHLD=1 based on the phone state.

- Added cdmaSetSecondCallState() api to set second call state for CDMA

InCallScreen.java Changes:
- Modified internalSwapCalls() for calling cdmaSwapSecondCallState() if a BluetoothHandsfree
is connected.

- Modified handleCallKey() for calling internalSwapCalls() for CDMA.

PhoneApp.java Changes:
- Rearranged the creation and initialization of CdmaPhoneCallState before the BluetoothHandsfree creation.

PhoneUtils.java Changes:
- Added DBG statement for Merge calls in CDMA part.
- Modified answerCall() so as to set the second call state in Bluetooth as active
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
fe3abbbaea34fc41d6fa11f4abf5d69082e313d6 29-Jul-2009 Abhishek Pillai <pillai@motorola.com> Power key press handling for ending call in CDMA

If the user presses the Power button we end the complete call session i.e.:
- Hang up the Incoming/waiting Call by calling PhoneUtils.hangupRingingCall()
- Hang up the Ongoing call by Calling PhoneUtils.hangupActiveCall().

PhoneUtils.java Changes:
- Modified hangupRingingCall() specifically to check for WAITING state to
hangup a Call waiting call and added a default case which returns false if the RigningCall
state is not INCOMING or WAITING.

- Modified hangup(phone) interface to specifically call hangupRingingCall as in CDMA special
care needs to be taken for rejecting Call waiting.

- Added a new interface hangupRingingAndActive() which is used in
CDMA phones to end the complete Call session

InCallScreen.java Changes:
- Modified onClick() api for handling menuIgnore case to directly call internalHangupRingingCall().

BluetoothHandsfree.java Changes:
- Modified CHUP handler to call PhoneUtils.hangupRingingCall(), PhoneUtils.hangupActiveCall()
and PhoneUtils.hangupHoldingCall(). Changed the order of handling the CHUP cmd i.e.:
First hangup the ringingCall if any, then hangup hangup the foregroundCall if any and
lastly hangup the backgroundCall if any.

PhoneInterfaceManager.java Changes:
- Modified endCall() interface for CDMA to send an async request with CMD_END_CALL.

- Added new case to handle CMD_END_CALL and call endCallInternal().

- Added a new interface endCallInternal() for CDMA only to end the complete Call session
when the user presses the Power key.

- Modified endCall() for GSM to also use the sendRequest()

- Modified handleMessage() to call hangup api's based on phone type
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
bab058c1c34d10f0707cf654e9ed917f631925d1 05-Aug-2009 David Brown <dab@google.com> Remove old CallCard "generic call" code.

Nuke the CallCard methods updateGenericCall(),
updateDisplayForGenericCall(), and displayMainCallGeneric().

This was the original quick-and-dirty implementation of the "generic"
state of the in-call UI (commit b15bef0ddcb4f744dff92013a9b596f2fcc2a008,
change https://android-git.corp.google.com/g/3283 .)

But they're no longer used since the big "CDMA UI - 3-way calling" change
from Moto went in (commit 0fb2b4b8eff811fd3243aefdf536e7ba2b10f4e9.)

Also add a couple of missing PhoneUtils javadoc comments.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
316f2cbcea22d50a71d5ae7abaaff7b25ad20925 30-Jul-2009 Wink Saville <wink@google.com> am 46532b66: Fix CNAP Unknown on MT call issue

Merge commit '46532b66a467f247380054270c6151aa3dc7a761'

* commit '46532b66a467f247380054270c6151aa3dc7a761':
Fix CNAP Unknown on MT call issue
61b1c33263712551e0df0d35ad52c7b89474c09f 30-Jul-2009 Dianne Hackborn <hackbod@google.com> am 21449d5f: Fix issue #1999179: search -> click result -> press home = search dialog is shown then hidden

Merge commit '21449d5fff1aa3ef5dd49b5b38162a3dd0e0d98c'

* commit '21449d5fff1aa3ef5dd49b5b38162a3dd0e0d98c':
Fix issue #1999179: search -> click result -> press home = search dialog is shown then hidden
46532b66a467f247380054270c6151aa3dc7a761 29-Jul-2009 Wink Saville <wink@google.com> Fix CNAP Unknown on MT call issue

Fix a CNAP-related issue where receiving an MT call where the CNAP info
came as a phone update would not update the CallerInfo data correctly
and only display "Unknown" as CallerInfo on the InCallScreen.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
21449d5fff1aa3ef5dd49b5b38162a3dd0e0d98c 29-Jul-2009 Dianne Hackborn <hackbod@google.com> Fix issue #1999179: search -> click result -> press home = search dialog is shown then hidden

Re-arrange various things to ensure that the search dialog is told about system windows being
closed before it is told about the navigation back to home.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
7fe7f7e57aaa38290c37ab48867d34a279d198f3 21-Jul-2009 w00278 <w00278@motorola.com> CDMA OTA tone/vibrate and misc CDMA fixes

1. Remove OTA vibrate feature when OTA call ends.
2. Fix OTA issue: When All Sounds are in Silence Mode, OTA tone is still played.
3. Fix call waiting issue: Phone display does not Update after Incoming call is ignored.
4. Add TTY support: sync TTY settings from AP to BP NV after phone completes powerup.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
05fb729f41a3f7e06891d0c73c04be4be933a89c 15-Jul-2009 Peng Zhu <w46254@motorola,.com> Fix for continuous ringing during CDMA MT call
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
19dd8f9c63ba7471c76fc31847a8063d18a83b6d 13-Jul-2009 Jaikumar Ganesh <jaikumar@google.com> Rename registerPhoneStateChange to registerPreciseCallStateChange

As registerPhoneStateChange was actually notifying CallStateChange,
rename appropriately.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
80e7149ffe1f9cd99cc6c161717ff1780232d907 14-Jul-2009 Wink Saville <wink@google.com> Merge commit 'e31c5008' into fix-merge

* commit 'e31c5008':
Fix muting/notification issues on 3w/cw calls.

Conflicts:
src/com/android/phone/CallNotifier.java
c9eddc4caa45b1e39b964a60c4edab9ae6f689cf 30-Jun-2009 Paul Berman <paul.berman@motorola.com> Fix muting/notification issues on 3w/cw calls.

During various scenarios of making/receiving 3w/cw calls, the mute state
was not getting updated correctly, ex: being muted on a first call would still be
muted after receiving the second (cw) call which is incorrect.

Also resolved issue where missing an incoming cw call and trying to show
the notification in NotificationMgr would throw an exception.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
7957f63826136b71474d24f29954dfb03758003b 02-Jul-2009 David Brown <dab@google.com> resolved conflicts for merge of 87258b2b to master
86c4a92aff88506bc81a7ad6d8a3853cd7fbe597 27-Jun-2009 Peng Zhu <w46254@motorola.com> CNAP special cases

For CNAP, if the received numberPresention is ALLOWED (pi=0), and the number is one of the
following special strings, the phone UI needs to translate:
PRIVATE, RES or P: display as "Private number"
UNAVAILABLE, UNA, UNKNOWN, or U: display as "Unknown".
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
87258b2b589c3afea4b89b840251012378e0d3b4 27-Jun-2009 David Brown <dab@google.com> Misc phone app code cleanup.

- remove unused String "finalTitle" in NotificationMgr (accidentally
included in one of the Moto changes)

- tweak bottom margin of one CallCard text field to avoid cutting off
descenders

- remove the unused PhoneUtils getCompactName() methods

- remove unused CallCard showCall* methods

- remove useless CallCard reset() method

- When the radio technology changes, have PhoneApp call a new InCallScreen
method that unregisters then re-registers for phone state events.
(Even though we don't have any devices yet that can switch on the fly
between GSM and CDMA, the code still ought to do this.)

- some minor debug logging cleanup

TESTED: ran basic telephony test cases.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
e2c9e16a099b6a120db0a589ad1959b8787b9f9b 11-Jun-2009 Abhishek Pillai <pillai@motorola.com> apps/Phone: Support for CDMA caller name presentation (CNAP)

Phone app changes to support the network mechanism used in CDMA
to send caller name information from the network during call setup.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
0fb2b4b8eff811fd3243aefdf536e7ba2b10f4e9 25-Jun-2009 Wink Saville <wink@google.com> CDMA UI - 3-way calling, call waiting, and display info records

This is dependent on 5338 to add the string resource
network_message.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
b15bef0ddcb4f744dff92013a9b596f2fcc2a008 14-May-2009 David Brown <dab@google.com> Phone app: Initial *minimal* set of Phone UI changes for CDMA.

Fix a couple of CDMA-specific issues in the in-call UI:

- Add a new mode to the CallCard for the "generic call" state, where the
phone is in use but we don't know any specific details about the state
of the call (like who you're talking to, or how many lines are in use.)

NOTE this can't actually be enabled till the Call.isGeneric() API gets
checked in. (See the TODO comment in updateForegroundCall().)

- Make sure the "Manage conference" UI (which is GSM-specific) is never
enabled on CDMA phones

These changes are mostly untested, since I don't have a CDMA phone with
working telephony yet. (But the PhoneUtils/InCallScreen changes are
ultra-simple, and I was at least able to test the "generic call" UI by
temporarily hacking the code to pretend that Call.isGeneric() returned
true.)

I did at least make sure this doesn't break anything on GSM phones.

This change does NOT include:

- Automatically timing-out the "call waiting" connection if ignored by
the user. (The Moto team is already doing this, in the CallNotifier
class.)

- Make sure the "Merge calls" and "Swap calls" menu items are enabled
only when it's *really* possible to merge or swap. (The current logic
is GSM-specific.) Added TODO comments in PhoneUtils.java for these.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
1b8e24dac994b507540d25b02e2c56f52bff04ab 25-May-2009 Daisuke Miyakawa <dmiyakawa@google.com> Merge from cupcake_dcm. Should be reviewed by jackpal just in case.
Original change is 147853-p9 in perforce.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
404edc94de563aef5fd5ba48be9114a970cb93bb 18-May-2009 Wink Saville <wink@google.com> Teleca 2b changes.
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
a69de9f9a2e99fe08f0009bb218b95ed7985c575 02-Apr-2009 Wink Saville <> AI 144185: Integrate cdma into the main code base.

Automated import of CL 144185
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
4ccb1b7d68d5b5bb7ed54251a1f214162013bc60 28-Mar-2009 John Wang <> AI 143181: am: CL 142924 Support DCM specific MMI network service.
IExtendedNetworkService has 4 MMI service interface used by PhoneUtils to put DCM related nw service.
void setMmiString(String number);
CharSequence getMmiRunningText();
CharSequence getUserMessage(CharSequence text);
void clearMmiString();
And the service is bind via "com.android.ussd.IExtendedNetworkService".
Original author: johnwang
Merged from: //branches/cupcake/...

Automated import of CL 143181
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
796c70c99bc39295bf685061056f06ab8949c742 25-Mar-2009 David Brown <> Automated import from //branches/donutburger/...@140614,140614
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
b16363f5fc191b769e88c364243e34b92eb22688 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
a412e78a7bba553a66503370b4c618db83528916 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
60a7029cd43c5bcef4a0d30390bdaaab43690c7c 20-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@132569
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
0918cc33174eebee7ae13449a76a2fe48f84d6dc 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
bb1e6add51a1d0c4ed2ee63fd314503e8d62cdd8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java
abc47110c17fa8e8cb6161bc045e87f31eeb7a1c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/packages/apps/Phone/src/com/android/phone/PhoneUtils.java