Skip to content

Commit

Permalink
Apply the second half of google#1977
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 570169149
  • Loading branch information
AlbertWang0116 authored and SobeckiSzymon committed Jan 1, 2024
1 parent 4a49bb7 commit c19e68d
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion AppFramework/AutomationSetup/GREYAutomationSetup.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
//

#import "GREYAutomationSetup.h"
#import <Foundation/Foundation.h>

#import "GREYAppleInternals.h"

Expand All @@ -24,7 +25,26 @@ @implementation GREYAutomationSetup

+ (void)load {
// Force software keyboard.
[[UIKeyboardImpl sharedInstance] setAutomaticMinimizationEnabled:NO];
static NSArray<NSString *> *legacyTargets;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
legacyTargets = @[
];
});
BOOL deferKeyboardChange = YES;
NSString *packagePath = NSProcessInfo.processInfo.environment[@"TEST_UNDECLARED_OUTPUTS_DIR"];
for (NSString *legacyTarget in legacyTargets) {
if ([packagePath containsString:legacyTarget]) {
deferKeyboardChange = NO;
}
}
if (deferKeyboardChange) {
dispatch_async(dispatch_get_main_queue(), ^{
[[UIKeyboardImpl sharedInstance] setAutomaticMinimizationEnabled:NO];
});
} else {
[[UIKeyboardImpl sharedInstance] setAutomaticMinimizationEnabled:NO];
}
}

@end

0 comments on commit c19e68d

Please sign in to comment.