Repository navigation
fix(lockscreen): scheduled call takes over lock screen on Android 14+ - #37
Merged
Merged
Conversation
…heduled calls A scheduled call arriving on a LOCKED screen was only showing a notification instead of the full-screen caller UI. Root cause: on Android 14+ (API 34) USE_FULL_SCREEN_INTENT is a user-revocable special access; without it the service's full-screen-intent notification is silently demoted to a shade/heads-up entry. The app only ever requested POST_NOTIFICATIONS, never the FSI access. - Add pure, unit-tested FullScreenIntentAccess helper (sdkInt + grant -> should-prompt decision). - MainActivity: on API 34+, if canUseFullScreenIntent() is false, send the user once to ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT. - CallAlarmReceiver: correct the now-misleading comments - the FSI grant is the lock-screen mechanism; the direct activity start is best-effort for the unlocked case. Not a regression from #31-#36 (all build-tooling/icon); pre-existing gap. fix -> PATCH, 1.4.6 -> 1.4.7.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
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.



Problem
A scheduled call arriving while the screen is locked only showed up in the notification bar - not the full-screen caller UI.
Not a regression from the recent PRs
#31-#36 were all build-classpath pins, the Gradle wrapper, and an icon vector - none touched the lock-screen / full-screen-intent path. This is a pre-existing gap that Android 14's stricter policy exposes.
Root cause
The lock-screen path is the high-priority full-screen-intent (FSI) notification posted by
CallSimulationService. On Android 14+ (API 34),USE_FULL_SCREEN_INTENTis no longer granted at install time to non-dialer/alarm apps - it is a user-revocable special access (NotificationManager.canUseFullScreenIntent()). When it isn't held, the system silently demotes the FSI to a shade/heads-up notification - exactly the "only the notification bar" symptom. The app only ever requestedPOST_NOTIFICATIONS.Fix
FullScreenIntentAccess- new pure, unit-tested helper:(sdkInt, canUseFullScreenIntent) -> shouldRequestAccess. Below API 34 it's always false (permission implicit); on 34+ it's true only when not granted.MainActivity- on API 34+, if access is missing, send the user once toSettings.ACTION_MANAGE_APP_USE_FULL_SCREEN_INTENT(standard for call apps), with a Toast fallback if the screen can't be opened.CallAlarmReceiver- corrected the misleading comments: the FSI grant is the lock-screen mechanism; the directstartActivityis best-effort for the screen-on/unlocked case and may legitimately be blocked over the keyguard.Tests / verification
FullScreenIntentAccessTest(4 cases, all pass): pre-34 never prompts, 34+ prompts only when ungranted, no prompt once granted, gated-SDK constant.testDebugUnitTestgreen,lintDebugclean,assembleRelease(R8) OK ->CallSimulator-1.4.7-release.apk.FullScreenIntentAccess) is measured and 100% covered; the Android glue lives in the already-sonar.coverage.exclusions-listedMainActivity/CallAlarmReceiver.fix -> PATCH, 1.4.6 -> 1.4.7.