It simply uses the RunCommand plugin to run commands named "unlock".
Details
- Reviewers
- None
- Group Reviewers
KDE Connect
add command named "unlock" iin desktop app (eg "loginctl unlock-session" for plasma) > pair and connect with remote device > add tile
When device is locked
tap tile > unlock android to unlock device
When device is unlocked
tap tile > scan finger to unlock device
Diff Detail
- Repository
- R225 KDE Connect - Android application
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Thanks for the patch! I left some inline comments. It's working good so far, but relying on the unlock command is too hacky IMHO. It should be no problem to port it into a proper plugin with a desktop counterpart that executes the unlocking. You can use the PingPlugin as a template for creating a plugin.
build.gradle | ||
---|---|---|
70 ↗ | (On Diff #34152) | Please remove those unrelated changes |
src/org/kde/kdeconnect/Plugins/LockPlugin/LockHelper.java | ||
181 | Is this really necessary? | |
src/org/kde/kdeconnect/Plugins/LockPlugin/TileService.java | ||
12 ↗ | (On Diff #34152) | Why not import? |
14 ↗ | (On Diff #34152) | Could Lockhelper become a singleton? |
22 ↗ | (On Diff #34152) | You can use a lambda here |
- Added lock plugin for unlocking specifically
- Old runcommand is still available till a desktop plugin is available
- LockHelper is now a singleton
- Used lambdas wherever possible
- Revert unrelated changes in build.gradle
It seems like you just uploaded the changes to your last patch instead of all your changes. It's best to use arc to upload your patches, see https://community.kde.org/Infrastructure/Phabricator#Using_Arcanist_to_post_patches for an introduction
I couldn't setup arcanist, so I squashed my commits into a single commit and updated using git diff. That should contain all my changes.
There already is a unlock plugin that you can use as desktop counterpart in the desktop repo. https://cgit.kde.org/kdeconnect-kde.git/tree/plugins/lockdevice To build it you must pass -DEXPERIMENTALAPP_ENABLED with the cmake command.
src/org/kde/kdeconnect/Plugins/LockPlugin/LockPlugin.java | ||
---|---|---|
38 | I would say yes | |
src/org/kde/kdeconnect/Plugins/LockPlugin/LockTileService.java | ||
77 | Why two different unlockComputer()? | |
98 | What does a do? | |
101 | Where is the preference written? |