Re:Android: I don't need your permission
by quantumet on Tuesday December 16, 2014 @05:39PM
(#8760037)
We're already doing this. It's not enough. See our source code.
Re:Android: I don't need your permission
by yincrash on Tuesday December 16, 2014 @06:33PM
(#8760260)
Could you link to the relevant class?
src/org/videolan/vlc/audio/AudioService.java
Re:Android: I don't need your permission
by mlrtime on Wednesday December 17, 2014 @11:28AM
(#8762847)
link to method (I think): https://github.com/mstorsjo/vlc-android/blob/master/vlc-andr...
Re:Android: I don't need your permission
by TheQwerty on Thursday December 18, 2014 @12:16PM
(#8768363)
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...
Re:Android: I don't need your permission
by gabemart on Tuesday December 16, 2014 @09:00PM
(#8760691)
This simply doesn't work for pausing audio when the phone rings. The ringer doesn't request audio focus.
Re:Android: I don't need your permission
by leni536 on Wednesday December 17, 2014 @03:34AM
(#8761584)
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.«
Re:Android: I don't need your permission
by tripzilch on Wednesday December 17, 2014 @06:44AM
(#8761945)
Would be nice if you could request "you're using an older version of Android so we need more scary permissions".
Re:Android: I don't need your permission
by krschultz on Wednesday December 17, 2014 @11:10AM
(#8762760)
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.
It's seriously back-asswards that you'd have to have access to all phone state just to be able to start and stop audio on phone calls.
By comparison iOS has an audio interruption system which gets triggered on phone calls, alarms (calendar and clock) and other applications taking over the audio, the application getting interrupted neither not knows nor cares where the interruption comes from, only that it doesn't have the audio stream anymore.