Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add an option to immediately remote verify #228

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

zarakik
Copy link

@zarakik zarakik commented Apr 8, 2023

This PR adds an option in the menu bar that says "Remote verify now". It will schedule an immediate job that performs the Remote Verification Job instead of the regular periodic trigger.

Fixes #197

@zarakik
Copy link
Author

zarakik commented Apr 8, 2023

cc: @flawedworld

@zarakik
Copy link
Author

zarakik commented Apr 8, 2023

Since this new job is scheduled with the same ID as the periodic job, the periodic job is canceled and replaced by the new non-periodic job (until the periodic job is scheduled again in a different way).

Check the scheduled jobs:

adb shell dumpsys jobscheduler app.attestation.auditor.debug

You can find the periodic job (or your non-periodic replacement) as RemoteVerifyJob#0.

Ah, I see the ID 0 used for the periodic jobs. Shall we use the ID 1 for "fire-once" job then? (I see that 1 is used for FIRST_RUN_JOB_ID and I may be interpreting it wrong but I don't really see the point of it being used. See my explanation here - The "first run" builder here is anyway succeeded by the "periodic" builder here and the period job scheduler job does the job for us anyway right? )

Edited:
I guess maybe we do want to execute the first occurrence immediately when scheduled. And the rest to be handled by the periodic scheduler.

@thestinger
Copy link
Member

There's a first run job to get the initial pairing done with extremely high priority so users don't need to wait for it to appear even if they're in battery saver mode, etc.

@@ -548,7 +549,19 @@ public boolean onOptionsItemSelected(final MenuItem item) {
stage = Stage.EnableRemoteVerify;
startQrScanner();
return true;
} else if (itemId == R.id.action_disable_remote_verify) {
}
else if (itemId == R.id.action_remote_verify_now) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be right to use PERMISSIONS_REQUEST_POST_NOTIFICATIONS_REMOTE_VERIFY?

@zarakik zarakik requested a review from a user April 9, 2023 16:33
@zarakik zarakik force-pushed the zarakik/feat/remote-verify-now branch from 42aa1c8 to 3adc5f9 Compare April 23, 2023 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to manually trigger remote attestation
2 participants