1. Are you ready for the Galaxy S20? Here is everything we know so far!

Is there a audio focus change app for android.

Discussion in 'Android Apps & Games' started by tweacle, Aug 12, 2013.

  1. tweacle

    tweacle Newbie
    Thread Starter

    Hi there I have audio focus change on my poweramp app of which cuts out when the phone rings.

    Is there another app or some thing similar that cuts out other apps when my phone rings. I.E if ive got the sat nav running on my mobile I need it to go silent when receiving a phone call.

    Thanks
     


    electricpete likes this.

    1. Download the Forums for Android™ app!


      Download

       
  2. chanchan05

    chanchan05 The Doctor

    What satnav are you using? My phone does this automatically
     
  3. electricpete

    electricpete Android Expert

    I need this also.
    It's true that MOST apps silence themselves during phone call{that's why they ask phone state permission) . BUT there are a few that do not.

    Example, chroma doz, Navfree

    Contacteddev...Burt no luck
     
  4. chanchan05

    chanchan05 The Doctor

    I use Waze for navigation. Maybe you could try that?
     
  5. electricpete

    electricpete Android Expert

    For me, navigation isn't the main problem, chroma doz is. I use it as white noise to block out distractions while I work. No other app I've seen uses as little battery for this purpose. Incoming call when listening to chroma doz with earbuds leaves me scrambling to answer, navigate to chroma dozx, and turn it off.

    I just wrote a tasker profile that fixes the problem completely:

    Profile: MyProfileName
    State: Call [ Type:Incoming Number:* ]
    Enter: MyTaskName
    A1: Media Volume [ Level:0 Display:Off Sound:Off ]

    It turns media volume to zero when call is received. Based on profile options setting (not shown), the setting is reverted when profile exits (medias volume restored when call ends)

    If anyone is interested in trying this and doesn't use tasker, I can do' little more work to add a toggle task, then export it as an apk. I think that would be safe from your standpoint because the permissions are still displayed/enforced when side loading and they will be limited to whatever needed to read phone state and adjust media volume. (open to discussion...I don't share many apk's)

    Let me know if interested, otherwise I won't bother
     
  6. DanPLC

    DanPLC Member

    You're correct that apps have to silence themselves when receiving incoming calls; however there's a way to do it without requiring the "read phone state" permission. You can accomplish the same thing by listening for the AUDIOFOCUS_LOSS_TRANSIENT message and pausing the music when it's received.

    You can also listen for the AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK message (which is sent by apps such as Navigation). When you receive this message, it informs the app that it can keep playing the audio, but it should tone it down so the incoming audio (like navigation instructions) can be heard. After the "transient can duck" audio has finished, the app should then fade their audio back up.
     
  7. tweacle

    tweacle Newbie
    Thread Starter

    How do I program this into my phone ?
     
  8. electricpete

    electricpete Android Expert

    You can download Tasker (small fee) learn to use the program (some effort) and enter the profile I described above. If you have inclination to want to spend time to do a lot of different customizations to your phone, I’d heartily recommend that.... you can do a whole lot more with Tasker. But again you have to devote some time to it.

    If you don’t want to do that, I offer you an alternative:
    Download and install attached file Phone1.2.apk (*)
    Run the program and you'll see a menu:
    “BMIC on” - activates this feature
    “BMIC off” - deactivates this feature
    (BMIC stands for Block Media on Incoming Call)
    After executing BMIC on, all media sounds will stop when phone rings (you’ll still hear the caller’s voice because phone call volume is different than media volume). At end of phone call, media volume is restored.
    Tested this apk on my Samsung Infuse running 2.3.6 and works perfectly.

    * Permissions it asks for are shown attached:
    Phone calls - Read phone state and identity
    System tools - disable keylock, prevent phone from sleeping
    automatically start at boot.

    I didn’t “decide” any permissions. I just told Tasker what I wanted to do and exported my profile and it created the apk and decided necessary permissions. I don’t know why it wants phone “identity” or disable keylock. The best I can figure is they came in a bundle with the other things it needs. I think “start at boot” may allow the setting to continue past a reboot? (not sure).

    Even though it seems like some extra permissions, at least it cannot send any data outside of your phone.

    If you trust me (electricpete, regular on Android forums for 18 months with 351 posts and 55 thanks) or if you trust the permissions to protect you (that’s a better logic imo) then go for it.

    If you don’t trust either, that’s your perogative as well.
     

    Attached Files:

    almozaffar likes this.
  9. electricpete

    electricpete Android Expert

    Another general precaution if you choose to install apk's from non-google-play sources, open the "google settings" app (which is in your app drawer... it's different than normal system settings), and check "verify apps". The description says "let google scan apps from sources other than Google Play, and warn you in the rare case that an app is potentially harmful."
     
Loading...

Share This Page

Loading...