Skip to content

Conversation

@Android-PowerUser
Copy link
Owner

No description provided.

@Android-PowerUser Android-PowerUser merged commit ef31852 into Chathistory Apr 13, 2025
1 check passed
@Android-PowerUser Android-PowerUser deleted the Background-run branch April 14, 2025 21:26
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants