lukeweber / webrtc-jingle-client

Webrtc audio + jingle protocol brought to IOS and Android.
https://groups.google.com/forum/?fromgroups#!forum/webrtc-jingle
BSD 3-Clause "New" or "Revised" License
335 stars 137 forks source link

Add Correct proximity logic back to master branch #45

Closed lukeweber closed 11 years ago

lukeweber commented 11 years ago

Logic for private api. This is the only option on some older phones that have funky Power management settings, especially samsung:

https://github.com/lukeweber/webrtc-jingle-client/blob/stable/voice-client-example/src/main/java/com/tuenti/voice/example/util/WakeLockManager.java

Logic using a proximity sensor, if you can't use the private api: https://github.com/lukeweber/webrtc-jingle-client/blob/stable/voice-client-example/src/main/java/com/tuenti/voice/example/util/ProximitySensor.java

All of it is driven from here: https://github.com/lukeweber/webrtc-jingle-client/blob/stable/voice-client-example/src/main/java/com/tuenti/voice/example/ui/activity/CallInProgressActivity.java

OnPause() logic is particularly important for making sure to stop proximitysensor correctly based on whether the screen is on or off when this method is hit.