Hacker Newsnew | past | comments | ask | show | jobs | submitlogin



We're already doing this. It's not enough. See our source code.


Could you link to the relevant class?


src/org/videolan/vlc/audio/AudioService.java



Curiously, it looks like Google's AOSP music app requests READ_PHONE_STATE but unless I'm missing something they don't use it - relying entirely on focus loss instead. Granted, I'm not sure anything actually uses this code now...

https://github.com/android/platform_packages_apps_music

http://androidxref.com/5.0.0_r2/xref/packages/apps/Music/


This simply doesn't work for pausing audio when the phone rings. The ringer doesn't request audio focus.


The ringer doesn't request audio focus.

I would think that this is a bug in the ringer and not an overall limitation of the Android permission system.


Which doesn't really help the users stuck on Android versions that never get any update or bugfixes. In which case apps have to take the pragmatic route and just work around the issue. Even if that requires a scary permission.

No user would point to Google and say »VLC doesn't pause when the phone rings, fix the ringer, please.«. Rather they point to VLC and say »VLC doesn't pause when the phone rings, fix VLC please.«


Would be nice if you could request "you're using an older version of Android so we need more scary permissions".


You can.

Split your APK based on SDK version. Have different manifests with different permissions & code for the respective versions. The new Gradle toolchain makes all of that easy to do, but it is tough to maintain lots of version specific code long term.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: