- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 944
feat: Component to handle permissions request (A13+) #2710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
feat: Component to handle permissions request (A13+) #2710
Conversation
| <string name="patcher_notification_running_title">Patching in progress…</string> | ||
| <string name="patcher_notification_running_text">Tap to return to the patcher</string> | ||
| <string name="patcher_notification_success_title">Patching completed</string> | ||
| <string name="patcher_notification_success_text">Patching completed! Tap to return to the patcher</string> | ||
| <string name="patcher_notification_failure_title">Failure while patching</string> | ||
| <string name="patcher_notification_failure_text">Patching completed with errors. Tap to return to the patcher</string> | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My english sucks, please propose anything that works better in these strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flutter manager might have similar strings. Otherwise, I can try and help you come up with strings later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if permissions should be requested on app launch or in the patcher screen. This is up to the UI team to decide.
        
          
                app/src/main/java/app/revanced/manager/patcher/worker/PatcherWorker.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                app/src/main/java/app/revanced/manager/ui/screen/PatcherScreen.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                app/src/main/java/app/revanced/manager/ui/screen/PatcherScreen.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                app/src/main/java/app/revanced/manager/ui/screen/PatcherScreen.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                app/src/main/java/app/revanced/manager/ui/component/RequestPermissionDialog.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                app/src/main/java/app/revanced/manager/util/permissions/ContextExtension.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                app/src/main/java/app/revanced/manager/util/permissions/Helper.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                app/src/main/java/app/revanced/manager/patcher/worker/PatcherWorker.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                app/src/main/java/app/revanced/manager/patcher/worker/PatcherWorker.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | <string name="patcher_notification_running_title">Patching in progress…</string> | ||
| <string name="patcher_notification_running_text">Tap to return to the patcher</string> | ||
| <string name="patcher_notification_success_title">Patching completed</string> | ||
| <string name="patcher_notification_success_text">Patching completed! Tap to return to the patcher</string> | ||
| <string name="patcher_notification_failure_title">Failure while patching</string> | ||
| <string name="patcher_notification_failure_text">Patching completed with errors. Tap to return to the patcher</string> | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flutter manager might have similar strings. Otherwise, I can try and help you come up with strings later.
| 
 My reasoning for putting the dialog in the patcher screen is that there is already a popup shown at app first launch (to configure updates). Once that is closed, there are two mores "alert", one for the battery optimization and one for the downloaders configuration. I didn't want to add another dialog to not overwhelm the user; also the notification permission is striclty related to the patching process (for now at least). Of course, it can be changed according to what UI team thinks. | 
        
          
                app/src/main/java/app/revanced/manager/ui/component/RequestPermissionDialog.kt
          
            Show resolved
            Hide resolved
        
              
          
                app/src/main/java/app/revanced/manager/util/permissions/ContextExtension.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                app/src/main/java/app/revanced/manager/ui/viewmodel/PermissionViewModel.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                app/src/main/java/app/revanced/manager/ui/viewmodel/PermissionViewModel.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                app/src/main/java/app/revanced/manager/ui/screen/AppSelectorScreen.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                app/src/main/java/app/revanced/manager/ui/component/RequestPermissionDialog.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | ("An exception occurred in the remote process while patching." + | ||
| " ${e.originalStackTrace}").logFmt()) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to split this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to respect the right margin.
        
          
                app/src/main/java/app/revanced/manager/patcher/worker/PatcherWorker.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                app/src/main/java/app/revanced/manager/ui/component/RequestPermissionDialog.kt
          
            Show resolved
            Hide resolved
        
      | 
 | 
        
          
                app/src/main/java/app/revanced/manager/ui/component/RequestPermissionDialog.kt
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | Hi. I see in your screenshot that there is a problem with the white ReVanced logo being displayed on a white background. I plan to fix this in #2762, can you please rebase this PR to the dev branch? Thanks By the way, does this PR fix the lack of a notification icon in the status bar during patching? | 
Starting from Android 13, notification permission is now not granted by default. With this motivation, I created a component to handle permission requests (
PermissionRequestHandler). This will show a dialog with an explantion of why the permission is requested, and will allow the user to give or reject the permission. Currently this is just used for the notifications permission, but it's possible other permissions will be needed in the future.I have also added a notification when the patching process is completed (both in case of success and failure).
