QuickLock is a lightweight, open-source utility designed to preserve your device's physical hardware. It provides two fast, software-based alternatives to lock your screen instantly—eliminating the need to press your physical power button.
Perfect for large devices, setups where the power button is damaged, or just extending your device's operational lifespan.
- Quick Settings Tile: Lock your screen directly from the Android status bar pull-down menu.
- Home Screen Widget: A simple, customizable one-tap widget to lock your phone right from your launcher.
- Biometric Friendly: Designed using modern Android APIs so that locking the device does not break Fingerprint or Face Unlock triggers on subsequent wake-ups.
- Battery Efficient: Zero background syncs, zero wake-locks, and absolute minimal memory footprint.
- Privacy First: Requires no internet permissions, ensuring your data never leaves your device.
Because this application interacts directly with system-level UI locking mechanisms, a quick one-time configuration is required:
- Install the APK: Build the app from source or download the latest version from the Releases tab.
- Enable Accessibility Privileges:
- Navigate to
Settings>Accessibility>Installed Apps / Services. - Find QuickLock and toggle it ON.
- Why? Modern Android operating systems require this permission to trigger native screen locks without forcing a PIN/Password lock on next wake.
- Navigate to
- Add the Quick Settings Tile:
- Swipe down twice from the top of your screen to open the full Quick Settings panel.
- Tap the Edit (Pencil) icon.
- Drag the QuickLock tile into your active grid.
- Place the Widget:
- Long-press any empty space on your Home Screen.
- Select Widgets, scroll to QuickLock, and drop it onto your desktop.
We maintain high code standards using static analysis and automated testing.
- Unit Tests:
./gradlew testDebugUnitTest - Instrumented UI Tests:
./gradlew connectedDebugAndroidTest(requires an emulator or device)
To generate a comprehensive code coverage report (combining both Unit and UI tests):
./gradlew jacocoTestReportThe report will be available at: app/build/reports/jacoco/jacocoTestReport/html/index.html
- Android Lint: To check for code issues and styling:
The report is generated at:
./gradlew lintapp/build/reports/lint-results-debug.html - SonarQube: To perform deep static analysis and upload reports:
./gradlew sonar -Dsonar.token=<your_token>
QuickLock is built purely with native Kotlin, leveraging modern Android components to guarantee fast execution and low resource usage.
[User Action] ───> [Input Mechanism] ───> [Execution Core] ───> [Android OS API]
├─ Home Screen Widget └─ QuickLockService └─ performGlobalAction
└─ Quick Settings Tile (Accessibility Context) (GLOBAL_ACTION_LOCK_SCREEN)
- Accessibility Service Backend: Instead of using the legacy
DevicePolicyManager(which violently locks the system and breaks Biometric authentication), this app usesAccessibilityService. When triggered, it executes:This securely locks the OS naturally, mimicking a normal physical power button press.performGlobalAction(AccessibilityService.GLOBAL_ACTION_LOCK_SCREEN)
- Glance / AppWidgets: The widget UI uses optimized layout management to remain lightweight and fully responsive to modern dynamic themes (Material You).
- TileService API: The Quick Settings option leverages
TileServiceto bind and unbind reactively, ensuring zero idle RAM consumption when the tile isn't actively being tapped.
- Minimum SDK: Android 9.0 (API Level 28 - required for the global lock action API)
- Target SDK: Android 14+ (API Level 34+)
- Build System: Gradle (Kotlin DSL)
- Language: Kotlin 100%
Contributions are welcome! If you want to improve the widget designs, add custom Material You color tint support, or enhance documentation:
- Fork the Project.
- Create your Feature Branch (
git checkout -b feature/AmazingFeature). - Commit your Changes (
git commit -m 'Add some AmazingFeature'). - Push to the Branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
Distributed under the Apache License 2.0. See LICENSE for more information.