-1

How does Android handle applications like MP3 player apps that run when the screen is locked (i.e. the user has to input their pin)?

Obviously Android doesn't just let applications like music players run as root, as I have faith that the Android community understands the principle of least privilege. So how is this behavior implemented?

EDIT:

I apologize as my original question was too broad. Perhaps the better question here is "With what permissions does the Android lock screen operate?"

  • "I have faith that the Android community understands the principle of least privilege" Damn right they do... – rahuldottech Aug 12 '16 at 15:37
  • 2
    This is a unclear question for a Q&A format. "How is this implemented"... Obviously root is not required for an app to display a widget anywhere. However, I'm not sure what you would consider a correct answer to the question? Perhaps this question was better suited for chat. – Bryan Field Aug 12 '16 at 15:41
  • @GeorgeBailey, I never said that I thought root access was needed, in fact, I implied the opposite. Fair enough about the question being too broad though. Although I guess a better question would be what permissions the lock screen itself is run as – Verbal Kint Aug 12 '16 at 15:42
  • I think that if you provided more details about your thoughts (show the audience that you are trying to figure it out mentally), and then clarified what is confusing about it that might help. I assume you are not asking for code samples. – Bryan Field Aug 12 '16 at 15:43
  • 1
    The APIs provided by modern mobile operating systems like Android and iOS typically operate at a much higher level than those provided by their older desktop counterparts. In other words, your music player isn't saying "Hey OS, I want to draw this box on the lock screen, with a play button, a thumbs up button, etc." it's saying "hey OS, I'm playing music in the background right now, display some controls for that on the lock screen", and the OS handles that accordingly. – Ajedi32 Aug 12 '16 at 16:04
1

Android has an API for music players. Those buttons you see? They're universal, and when they are pressed, they tell the app currently playing music to change/stop/pause/play the track, but Android displays them on the lock screen, not the apps themselves.

Your analogy is incorrect. Sticky keys is an application, these buttons are not separate from the operating system. Also, Windows and Android are two very different things.

Also, widgets exist for android lockscreens on many devices, and these do not require root...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.