Skip to content

feat: configure activity to support lock screen access and the Android Notes role intent - #1747

Open
IGS-GIT wants to merge 6 commits into
saber-notes:mainfrom
IGS-GIT:main
Open

feat: configure activity to support lock screen access and the Android Notes role intent#1747
IGS-GIT wants to merge 6 commits into
saber-notes:mainfrom
IGS-GIT:main

Conversation

@IGS-GIT

@IGS-GIT IGS-GIT commented May 13, 2026

Copy link
Copy Markdown

I added the necessary flags and filters needed to designate Saber as the default note-taking app for Android. It supports Lock Screen Notes and opening the app when pressing a stylus button. Functionality was tested on a Google Pixel Tablet running Android 16 QPR 3 and with an unreleased Pixel Stylus that supports the USI 2.0 protocol. Button is fully functional and the note widget on the lock screen opens up to the home screen of the app. This resolves the following Issue(s):

#1708

@IGS-GIT

IGS-GIT commented May 13, 2026

Copy link
Copy Markdown
Author

Unsure why those tests failed as what I added doesn't affect those features.

@codecov

codecov Bot commented May 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 10.00000% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 51.93%. Comparing base (92d9b06) to head (569c0ce).
⚠️ Report is 34 commits behind head on main.

Files with missing lines Patch % Lines
lib/main.dart 0.00% 9 Missing ⚠️
lib/data/lock_screen.dart 28.57% 5 Missing ⚠️
lib/pages/home/home.dart 0.00% 2 Missing ⚠️
lib/components/canvas/save_indicator.dart 0.00% 1 Missing ⚠️
lib/pages/editor/editor.dart 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1747      +/-   ##
==========================================
- Coverage   52.22%   51.93%   -0.30%     
==========================================
  Files         131      132       +1     
  Lines        9395     9415      +20     
==========================================
- Hits         4907     4890      -17     
- Misses       4488     4525      +37     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@adil192

adil192 commented May 29, 2026

Copy link
Copy Markdown
Member

@cubic review this

(I'm trying out AI code reviews. They may or may not be helpful.)

@cubic-dev-ai

cubic-dev-ai Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

@cubic review this

(I'm trying out AI code reviews. They may or may not be helpful.)

@adil192 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 1 file

Confidence score: 2/5

  • There is a high-confidence security/privacy risk in android/app/src/main/AndroidManifest.xml: enabling showWhenLocked and turnScreenOn on the main activity can expose note content over the lock screen outside the intended CREATE_NOTE flow.
  • Because this behavior is user-facing and can reveal sensitive data after auto-lock, the change carries clear regression risk and is not a low-risk merge as-is.
  • Pay close attention to android/app/src/main/AndroidManifest.xml - lock-screen visibility flags appear too broadly applied and should be scoped to the intended scenario only.

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread android/app/src/main/AndroidManifest.xml

@adil192 adil192 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unfortunately the AI is right. I see these two issues:

  • When you open the notes app from the lockscreen, it opens to the normal home screen of Saber, showing all the user's notes without unlocking. We should restrict the lockscreen behaviour to only create a new note and not reveal any existing notes.
  • While using Saber, if you lock the screen or let it timeout, pressing the power button launches you straight into Saber without the lock screen.

@IGS-GIT

IGS-GIT commented May 30, 2026

Copy link
Copy Markdown
Author

Ah yeah I did catch that originally. I was planning on reworking it to only allow new notes on the lockscreen. Ive been really busy with finals so I haven't had time to work on it but I'll get some time this weekend to resolve this. Apologies

@IGS-GIT

IGS-GIT commented May 30, 2026

Copy link
Copy Markdown
Author

I'll need to make a new utility class for lock-screen state and platform channel communication. I'll begin the work and make a new commit soon.

@IGS-GIT

IGS-GIT commented May 30, 2026

Copy link
Copy Markdown
Author

I had to rebase because the commit history was getting filled with small fixes that I should've caught the first time. My apologies

@IGS-GIT IGS-GIT reopened this May 30, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

3 issues found across 7 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread lib/main.dart
Comment thread lib/pages/home/home.dart Outdated
Comment thread lib/data/lock_screen.dart
@IGS-GIT

IGS-GIT commented May 30, 2026

Copy link
Copy Markdown
Author

I'll wait for confirmation first. Those changes look fine but I don't want to make that call. It's your AI

@IGS-GIT

IGS-GIT commented Jun 4, 2026

Copy link
Copy Markdown
Author

Do I have to create a new test case for this feature? I'm thinking we'd want to test to make sure the security of the lock screen isn't compromised.

IGS-GIT and others added 4 commits June 17, 2026 16:24
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
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.

2 participants