summaryrefslogtreecommitdiff
path: root/InCallUI/src/com/android/incallui/ProximitySensor.java
AgeCommit message (Collapse)Author
2016-02-22Remove CallAudioStateCompatSailesh Nepal
Now that we're no longer backwards compatible with Lollipop we don't need CallAudioStateCompat. See ag/870962 for more info. Bug: 26676586 Change-Id: I7c754d89a6c9e13bf5a004b7c5b15b88b9aff9ad
2015-12-07Updating InCallUI to use CallAudioStateCompatBrandon Maxwell
Bug: 25776171 Change-Id: I94b42eb188e457a5470e33642cab2517949a8153
2015-09-09DO NOT MERGE Disable AccelerometerListener when display is offYorke Lee
Unregister the accelerometer listener when the screen is off to reduce power consumption. Slight refactor of component constructors to facilitate testing. Add test. Bug: 23498050 Change-Id: If1971a39e8a418253f6611116c855e3c6cf81b93
2015-05-13Rename AudioState to CallAudioStateYorke Lee
Deprecate AudioState class and make methods @SystemApi where necessary to minimize impact to SystemApi Replace usages of AudioState inside Telecom sub-systems Fire both onCallAudioStateChanged and onAudioStateChanged callbacks for backward compatibility Support both setAudioState and setCallAudioState for all classes Bug: 21040387 Bug: 21088300 Change-Id: I3ec7b3afdaa344c6d639d1c421f1842d67f7d0f7
2015-04-14Use proximity wake lock in InCallUIYorke Lee
Bug: 20160495 Change-Id: I821de3968e3dd825c2adc90a3339ee3ebec93e45
2014-09-12Renaming Telecomm to Telecom.Tyler Gunn
- Changing package from android.telecomm to android.telecom - Changing package from com.android.telecomm to com.android.server.telecomm. - Renaming TelecommManager to TelecomManager. Bug: 17364651 Change-Id: Ie5ae18f51baa5da2eb9793785ad0c9d83b6343d1
2014-09-03Do not request prox sensor ON without an ongoing call.Santos Cordon
Bug: 17323179 Change-Id: I34afc5e42ba1d5b559626b7d52b41e96af95b4f9
2014-08-13Final structural tweaks to Telecomm API (3/8)Ihab Awad
Bug: 16416927 Bug: 16494880 Change-Id: If756941a5bdd25ff8ac633a56fe90c894d4a46a4
2014-08-11Reduce latency for InCallUI by adding an intermediate stateNancy Chen
Add PENDING_OUTGOING as a state where the Telecomm information has not yet returned but the UI has started. This allows the UI to immediately begin initiating while Telecomm is waiting for the return of its broadcast intent. Bug: 16396523 Change-Id: Ia4b39689b89f9dea3aafae9e63ca0bfebb730501
2014-08-05Remove hardcoded audio route in video provider.Santos Cordon
The video provider always calls exitVideo() and as a result always sets the audio mode to EARPIECE when any call starts, negating any automatic setting done by telecomm (like bluetooth). This change has three items: 1. Only set the audio mode if we are exiting a previously entered video call. 2. When setting audio on exit, set it to the mode that was previously saved when the video call was entered. 3. Convert usages of the private AudioMode to the public CallStateAudio. Change-Id: I484ea8fadc9b7cf43692b517c97f906918fc49f8
2014-07-29Add new proximity sensors in Telecomm (3/3)Yorke Lee
Add the following two APIs in Telecomm and use them in InCallUI setProximitySensorOn setProximitySensorOff(boolean turnScreenOnImmediately) Bug: 16573954 Change-Id: I8219e9c659f4ea4493f5cd5c8bcaa95a98d180e2
2013-10-21Adds null check for proximity wakelockChristine Chen
Bug: 11319677 Change-Id: Ie62144dc5a738bb294a802230dce7847f734f39e
2013-10-08Merge "Turn screen on for call-waiting calls" into klp-devSantos Cordon
2013-10-08Turn screen on for call-waiting callsSantos Cordon
Normal incoming calls get the screen powered on through the window flag FLAG_TURN_SCREEN_ON. However, this only works when the window is being created or sent to foreground. But for call-waiting cases where the screen is off and in-call is in foreground, the screen remains off since the flag is not triggered. Solution is to look for the case where the screen is off and the new incoming call is a call-waiting call...and in that case finish() the activity and create it again. Since the screen is off, there is no concern over jank from bouncing the activity. bug:11031245 Change-Id: Ic0c206d57c9d1ce5beebff49a07c7877f6d1a423
2013-10-07Add logging to dialer.Santos Cordon
Two instances that need more logging: 1) Is UI showing for prox sensor. 2) Was the call hung up from notification? bug:11050553 Change-Id: I9eb60621bc320fe466780e5d7df7502354dd3f1f
2013-09-19Addressing finished and postponed TODO(klp)Christine Chen
Bug: 10605909 Change-Id: Id7594b306d23d4bd5d7a6983f2dbe524591a0d69
2013-09-19Tear down proximity sensors when no longer in use.Santos Cordon
bug:10493709 Change-Id: I76e1940472aa503f1fe8c4a73c82852f8670b61c
2013-09-12Calls to binder safe after disconnection of service.Santos Cordon
Calls to the binder can happen after onDestroy since the service methods and the binder methods have no sequence guarantee. This change makes it safe (no NPEs) for binder callbacks to happen after destruction. bug:10682538 Change-Id: I1ca4fcee522a92ae9f86b087239077e4a447d3f7
2013-09-09Improve lifecycle ordering for InCallUISantos Cordon
This CL rearranges startup and teardown of InCallUI to reduce the number of race conditions resulting in runtime exceptions and app crashes. At a high level this CL fixes the following: - TeleService should be able to unbind and rebind at any time without causing problems in the UI. (Fixes to InCallPresenter) - On weird occasions we were seeing secondary UIs pop up if we rebound while the older UI was still up and one of the UIs would be orphaned on the foreground. - call notifications can be sent during (1) activity startup, (2) activity lifetime, (3) activity destruction, (4) no activity...and nothing should crash. - Lots of crashes when notifications came during destruction and startup. (Fixed setup in InCallActivity + presenters, and startup/teardown ordering in InCallPresenter) Details: (1) InCallPresenter handed out instances of member classes to the UI classes, but upon unbinding and rebinding, the classes were recreated. This meant that the activity which was potentially still up had stale versions of AudioModeProvider and ProximitySensor. - Classes created/used by CallHandlerService are now singletons so that they do not change from one bind to the other. If the service tries to initialize InCallPresenter while the activity is still up (and so we haven't yet torn down) we reuse the reuse the previous initialization since there is no need to recreate them, and classes in the Activity dont ever become stale. (2) We were recreating new copies of InCallActivity on updates that occur while tearing down the previous activity. This caused weird errors where second emptier activities were up after all calls ended. - Solution to this was to ignore all updates while we are finishing the activity. When the activity is finally finished, we check if we should bring up a new activity in case some update came while we were finishing. (3) We set listeners on presenters from a parent class that wasn't aware of UI transitions. - All Presenters are not responsible for setting and unsetting their listeners. This allows them to unset them before their UI goes away. + renamed HIDDEN to NO_CALLS as hidden was confusing to developers which associated the term with foreground/backgroundness of the app. + Improved some logging bug:10573125 Change-Id: I2d1af6a6e972b3b3bd93af839054e879f0b74b4f
2013-08-29Support visual indication of mute from headsetSantos Cordon
This change uses new binder api changes to bring down mute status from TeleService. mute state routed through AudioModeProvider. bug:10395427 Change-Id: Ie15efcc780e99072363188de2a954a1888eec9dd
2013-08-27Add logging to proximity sensor.Santos Cordon
prox sensor bugs often come randomly and it's good to have logs in place. bug:10516724 Change-Id: I453f2a6904fec48f2a4e6acac13da111c60b2e2a
2013-08-21fix build break from mergeSantos Cordon
Change-Id: I0a0ae18bca3575d10e5b3d113b1e3d878e5c34e0
2013-08-21Adding proximity sensor code to in-call UI.Santos Cordon
Many of these changes are verbatim code copies from what used to exist in services/Telephony. The rest of them are straight logic copies that should do the exact same things. New class ProximitySensor manages the proximity behavior. It receives device state from InCallPresenter, AudioModeProvider, CallButtonPresenter, and AcceleromterListener, the last of which is a transplanted class from services/Telephony. ProximitySensor listens for the following events: 1. Change in the call state 2. Change in the audio mode 3. Change in the device orientation (from AccelerometerListener) 4. Change in the dialpad visibility 5. Change in hard keyboard open/close events. 6. Change in foreground position of InCall UI app. It uses these to figure out when to enable/disable proximity sensor. CL that removes code from TeleService: I77e0d15ad1a8f5a090c1368db98edaa246dbcd72 bug: 10366512 Change-Id: I5c2ea6daa9443e7ad77c67f272bc0bafdb060e5e