Device lock and passcode state
Reads whether the phone has a screen lock and whether it is locked.
In one line
Can tell if your phone has a screen lock and whether it is locked now
Reads whether the phone has a screen lock and whether it is locked.
A phone with no lock is a risk flag; banking apps change flows on it.
What it can and can't do
What the user does: Nothing. It happens when the app checks device security
It can
- Check if the phone is protected by a PIN, pattern, password or biometric
- Check if the screen is locked right now (Android)
- Use the answer to allow or refuse sensitive features
- On iPhone, guess that a passcode exists by trying to save a protected item
It cannot
- See your PIN, pattern or passcode
- Unlock the phone
- On iPhone, ask directly whether a passcode is set; there is no direct way to ask
How it differs between platforms: Android answers directly. iPhone has no direct question, so apps use an indirect test.
On Android and iPhone
| Android | iPhone | |
|---|---|---|
| Status | Supported | Partial |
| First version | Android 1.5 (API 3) | iOS 4.0 |
| Permission or entitlement | Not listed | none |
| Protection level | none | none |
| How access is granted | none | none |
| What the user sees | Not listed | Not listed |
| How long it lasts | Not listed | Not listed |
| How to take it back | Not listed | Not listed |
| Store policy | None listed | None listed |
| API | KeyguardManager.isDeviceSecure(), isKeyguardLocked(), isDeviceLocked() | No direct passcode-set API; probe by saving a Keychain item that needs a passcode |
| Notes | isDeviceSecure API 23 | None |
Data you get
What comes back: Lock state
Shape: boolean
How often: On check
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
secure | boolean | None | true, false | 1 bit |
Technical limits
- iOS probe is indirect
The story
What it is
An app can tell whether your phone has a screen lock and whether it is locked right now.
For you
You do not see this check. You notice only that some apps, like a wallet or work app, refuse to run until you set a screen lock. Some also hide your data the moment the phone locks.
For makers
Apps that hold money or private data want a lock on the phone before they show it. It is cheap to check and lowers the chance that a lost phone becomes a stolen account.
Where you see it
| Type | Example | Apps |
|---|---|---|
| banking | A bank app will not open on a phone with no passcode, because anyone who picks it up could move money. | None named |
| payments | A mobile wallet asks you to set a screen lock before it will store a card for tap to pay. | Google Wallet |
| enterprise | A work email app blocks company mail on any phone that has no screen lock, as set by IT. | Microsoft Outlook, Intune Company Portal |
| health | A health app holding test results refuses to show them on an unlocked phone, or locks itself after a short time. | None named |
| smart-home | A smart lock app only lets you issue a digital key if the phone itself is protected by a code. | Apple Home, August |
| security | A fraud engine marks sessions from phones with no lock as higher risk and asks for extra proof. | None named |
Risks
- Risk scoring of people
- Reveals weak setup
Android and iPhone in short
- Android: Android apps can ask if a lock is set (KeyguardManager) and whether the device is currently locked.
- iPhone: iPhone apps can learn whether a passcode is set only indirectly, by asking the system to check, and cannot see the lock status itself.
What the platform says
- Google: Device security checks. Android shows apps whether the device is protected by a lock screen so sensitive features can be limited.
Good uses and abuse
Legitimate uses
- Risk signals
Known abuse
- Little
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 3 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 1 | Rough identifying entropy, when known |
Related capabilities
Related
- Biometric availability and enrollment change. Can check whether you set up fingerprint or face unlock, but not who you are
Sources
How well checked: Based on official documentation.