0

I'm trying to implement a system level lock screen from a third-party/device-owner MDM app in Android.

I tried looking up on the internet for ways for third-party apps to implement system level lock-screen but from the information that I was able to gather there doesn't seem to be a standard way to implement the same.

The approach we are currently using for the same is to use the (system) overlay permission and showing up the overlay when the boot completes (BOOT_COMPLETED system broadcast intent) and when the device gets locked.

To know when the device gets locked, there were two approaches that we mainly found for the same.

  1. Use a background service, add an invisible overlay, listen to key events until we find a key event related to the power button
  2. Use a background service, register a receiver for SCREEN_OFF event there, and wait for the same.

In both the approaches, we need to use a background service which could potentially drain out battery... By any chance, is there any event/broadcast intent that we could listen to, to make this more efficient overall for the given use case?

Mohit Shetty
  • 1,551
  • 8
  • 26

0 Answers0