Repository navigation
Lock a lost R1 through Android's lockdown when device admin is missing - #63
Merged
Merged
Conversation
The R1's Android build doesn't declare android.software.device_admin, so activating robotOS's admin succeeds silently and does nothing, and lost mode couldn't lock Android. - DeviceLock uses device admin's lockNow() where it exists. Otherwise it uses root: `cmd lock_settings require-strong-auth STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN` plus the sleep key, Android's "Lockdown", which locks at once and requires the screen lock. It's available with a screen lock and either path. Root.verified records that a root command has succeeded. The root path runs off the main thread; the admin path stays synchronous. - A quarantined R1's page shows over the lock screen (setShowWhenLocked, changed only on transitions), so the finder still sees the return message. Content stays behind the cover. - Host & devices hides "Enable Android device admin" when Android lacks the feature, and the protection note mentions root. - Docs and release notes for 0.6.9.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On the R1, activating robotOS's device admin did nothing. Android reported success and stored nothing, because this Android build doesn't declare
android.software.device_admin. So lost mode couldn't lock Android.DeviceLock:lockNow()where Android supports it.cmd lock_settings require-strong-auth STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWNplus the sleep key. That's Android's "Lockdown", which locks at once and requires the screen lock; verified by hand on the R1.available()needs a screen lock and either path.Root.verifiedrecords that a root command has succeeded in this process.refreshProtectionand thelockcommand use it. The root path runs off the main thread; the admin path stays synchronous, as the existing test expects.setShowWhenLocked(true), only on transitions because the gate runs on every layout pass. The finder sees the lost page and return message, and content stays behind the cover. Unchanged: a press on a locked R1 is still ignored, and it can still stop ringing.Validation: 392 Android tests pass, 3 new:
The lost-R1 test also checks the over-lock flag turns on and off. Lint has no new warnings.
On the R1 with a pattern set, the lockdown command locked Android immediately (
deviceLocked=1,strongAuthRequired=0x20).