Feat: Add Lock Screen Permission for Xiaomi Devices#1
Merged
cavin-macwan merged 2 commits intoJun 4, 2025
Merged
Conversation
This commit introduces support for requesting the "Show on Lock Screen" permission, specifically for Xiaomi devices. This permission is often required for apps that need to display information or trigger actions while the device is locked.
Key changes:
- **TriggerXPermissionManager.kt**:
- Added `isShowOnLockScreenPermissionEnable()`: Checks if the "Show on Lock Screen" permission is granted for Xiaomi devices using `AppOpsManager`.
- Updated `isGranted()`: Now includes a check for `PermissionType.LOCK_SCREEN`.
- Updated `getPermissionIntent()`: Provides the specific intent to navigate users to the permission settings screen for "Show on Lock Screen" on Xiaomi devices.
- Added `LOCK_SCREEN` to the `PermissionType` enum.
- **TriggerXPermissionComposable.kt**:
- Modified `rememberAppPermissionState()`: Conditionally adds `PermissionType.LOCK_SCREEN` to the list of permissions to be checked if the device manufacturer is "Xiaomi".
- Minor formatting adjustments.
This enhancement ensures that applications using the TriggerX library can correctly prompt users for necessary lock screen permissions on Xiaomi devices, improving the reliability of features that depend on this capability.
This commit removes extra whitespace in the `TriggerXPermissionComposable.kt` file.
Key changes:
- **triggerx/src/main/java/com/meticha/triggerx/permission/TriggerXPermissionComposable.kt**:
- Removed extraneous whitespace in an `else` branch of a `when` statement.
This change improves code formatting and readability without affecting functionality.
cavin-macwan
added a commit
that referenced
this pull request
Jun 4, 2025
* Refactor: Introduce TriggerX library for scheduling alarms and managi… * Feat: Add Lock Screen Permission for Xiaomi Devices * Refactor: Remove Unnecessary Whitespace in TriggerXPermissionComposable * Merge pull request #1 from bhavikmaradiya/feature/xiaomi-permission * Feat: Launch TriggerActivity via ForegroundService * Feat: Introduce Configurable Logger for TriggerX Library * Feat: Base implementation of the whole library
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.
This commit introduces support for requesting the "Show on Lock Screen" permission, specifically for Xiaomi devices. This permission is often required for apps that need to display information or trigger actions while the device is locked.
Key changes:
TriggerXPermissionManager.kt:
isShowOnLockScreenPermissionEnable(): Checks if the "Show on Lock Screen" permission is granted for Xiaomi devices usingAppOpsManager.isGranted(): Now includes a check forPermissionType.LOCK_SCREEN.getPermissionIntent(): Provides the specific intent to navigate users to the permission settings screen for "Show on Lock Screen" on Xiaomi devices.LOCK_SCREENto thePermissionTypeenum.TriggerXPermissionComposable.kt:
rememberAppPermissionState(): Conditionally addsPermissionType.LOCK_SCREENto the list of permissions to be checked if the device manufacturer is "Xiaomi".This enhancement ensures that applications using the TriggerX library can correctly prompt users for necessary lock screen permissions on Xiaomi devices, improving the reliability of features that depend on this capability.