question

Sukhbir Singh avatar image
Sukhbir Singh asked cherry commented

Detecting whether screen is locked or not of Clover device

Hi,

Please provide the solution for the following questions:

  • Is any way to skip or disable clover default lock screen(Enter passcode screen)?
  • How can we check that clover device's default lock screen is showing or not from third party application programmatically?
  • How can we detect that device has locked in clover third party application? Like as via the broadcast receiver USER_PRESENT action we can detect that device has unlocked.
Please suggest.
Clover Android SDKClover Miniclover developer communitysemi-integrationsClover Flex
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

cherry avatar image cherry commented ·
  • Disabling Clover Lock Screen: You can disable the lock screen using MDM solutions or by modifying system settings on rooted devices, but it may pose security risks.

  • Checking if Lock Screen is Active: Use KeyguardManager to check if the device is locked with keyguardManager.isKeyguardLocked().

  • Detecting Lock/Unlock Events: Use a BroadcastReceiver to listen for Intent.ACTION_SCREEN_OFF (lock) and Intent.ACTION_USER_PRESENT (unlock) to detect when the device is locked or unlocked.


Violet Myers Net Worth


0 Likes 0 ·

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered Sukhbir Singh commented
Is any way to skip or disable clover default lock screen(Enter passcode screen)
No. The merchant can choose to allow one-button login to the default employee from the lock screen, but this is a merchant setting and not up to any particular application.

How can we check that clover device's default lock screen is showing or not from third party application programmatically
If `EmployeeConnector.getEmployee()` returns null then the lock screen will be showing (and vice versa).

How can we detect that device has locked in clover third party application? Like as via the broadcast receiver USER_PRESENT action we can detect that device has unlocked.

You aren't really able to sit in the background and listen for these things if that is what you are suggesting. Your app can know if there is a logged in employee but there's no broadcast that you can listen for. If your app is in the foreground you can register a listener (see `onActiveEmployeeChangedListener()` in `EmployeeConnector`).
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sukhbir Singh avatar image Sukhbir Singh commented ·
0 Likes 0 ·

Welcome to the
Clover Developer Community