mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-24 18:29:29 +00:00
Adjusted checks for auto-type permissions
We do not need to check for screen recording permissions, if auto-type is executed. Only global auto-type requires screen recording permissions and should check for them.
This commit is contained in:
@@ -51,14 +51,17 @@
|
||||
return instance;
|
||||
}
|
||||
|
||||
- (BOOL)hasNecessaryAutotypePermissions {
|
||||
if(![self hasAccessibiltyPermissions:NULL]) {
|
||||
return NO;
|
||||
- (BOOL)hasNecessaryPermissionForTask:(MPAutotypeTask)task {
|
||||
BOOL permissionsOK = YES;
|
||||
switch(task) {
|
||||
case MPAutotypeTaskGlobalAutotype:
|
||||
permissionsOK &= [self hasScreenRecordingPermissions:NULL];
|
||||
// fallthrough!
|
||||
case MPAutotypeTaskAutotype:
|
||||
permissionsOK &= [self hasAccessibiltyPermissions:NULL];
|
||||
break;
|
||||
}
|
||||
if(![self hasScreenRecordingPermissions:NULL]) {
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
return permissionsOK;
|
||||
}
|
||||
|
||||
- (BOOL)hasScreenRecordingPermissions:(NSError *__autoreleasing*)error {
|
||||
|
||||
Reference in New Issue
Block a user