Merged
Conversation
Android-PowerUser
pushed a commit
that referenced
this pull request
Jun 16, 2025
This commit implements the following changes: 1. Introduces an `isProcessingExplicitScreenshotRequest` flag in MainActivity to differentiate between permission requests originating from app startup versus those from explicit screenshot commands. 2. Modifies `MainActivity.screenshotRequestHandler` to set this flag when an explicit screenshot request requires permission. 3. Modifies `MainActivity.mediaProjectionLauncher` to only start `ScreenCaptureService` if the permission was granted as a result of an explicit request (i.e., the flag is true). The flag is reset afterwards. 4. Restores the call to `requestMediaProjectionPermission()` in `MainActivity.onCreate()` to ensure permission is prompted at startup if not already granted. Due to change #3, this no longer auto-starts the capture service. 5. Confirmed that the `takeScreenshot()` call within `ScreenCaptureService.startCapture()` is necessary to fulfill the explicit screenshot request that leads to the service starting. This is no longer an "unwanted automatic" screenshot but part of the explicit flow. This addresses your feedback to: - Ensure permission is requested at app startup. - Prevent this startup permission request from automatically taking a screenshot. - Ensure explicit screenshot requests function correctly. - Remove any other unintended automatic screenshots.
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.
No description provided.