Skip to content

Commit

Permalink
fix initial incall volume setting
Browse files Browse the repository at this point in the history
Jpolly will now re-send the initial incall volume value after sleeping for 1 second.
This has the disadvantage of being unable to controll the volume for 1 second after switching from IDLE to INCALL mode. However: The modem takes more than 1 sec to initialize anyway, so nobody will notice.
This is still not 100% perfect but will usually win the 'volume race'
  • Loading branch information
adrian-bl committed Oct 2, 2012
1 parent e9e52b0 commit f516d30
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/ch/blinkenlights/android/polly/PollyService.java
Expand Up @@ -108,7 +108,19 @@ private void updateIncallVolume() {
**************************************************************/
private void checkPhoneState() {
if(tMgr.getCallState() == tMgr.CALL_STATE_OFFHOOK) {
xlog("we are IN_CALL - forcing audio setting");
xlog("switched to INCALL mode - setting initial volume");
lastvol = -1;
updateIncallVolume();

/* the modem may suffer from alzheimer's, a hacky
** solution is to sleep 1 second and send it again.
** I don't like this, but we have NO IDEA when the
** modem is ready. Thank you HTC.
*/
try {Thread.sleep(1000);}
catch (InterruptedException e) { xlog("Sleep was interrupted"); }

xlog("sent incall volume a 2nd time");
lastvol = -1;
updateIncallVolume();
}
Expand Down

0 comments on commit f516d30

Please sign in to comment.