31

I've tried googling, and looking on stackoverflow as well, but I can't seem to find any satisfying answer as to how the "App lock" applications(eg: ZDBox, App Lock, etc..) work. Is there a service that runs in the background continuously polling to see if the app is launched and tries to kill it? Or is there a way to intercept launch intents for new activities?

Apoorva Iyer
  • 580
  • 1
  • 7
  • 15

2 Answers2

23

there is a service running in the background to read the activity stack. if find new activity, will start the passwordActivity

user930177
  • 246
  • 3
  • 4
  • 4
    Where can I find more details on this? I wonder how much battery it would eat up if service constantly keeps running in background. – ABDroids Aug 26 '13 at 10:03
  • 2
    @user930177, according to you, the service is running continuously in the background but can you tell me one thing; there are chances when android kills the serivces itself; in that case what is happenning..??? – Custadian Mar 13 '14 at 18:44
  • 1
    Thanks for your answer. But I got another problem. After user enters correct password, locked app is open. But the service is running, so password activity starts again. – Phuc Tran Nov 16 '14 at 16:03
4

they are watching logcat output. whenever you start an activity, you can find specific logcat. like this,

I/ActivityManager(  585): Starting activity: Intent { action=android.intent.action...}

if this logcat printed by locked app, locker service starts password screen.

chitacan
  • 341
  • 4
  • 9