Skip to content

Commit 4895f92

Browse files
taliskjianliang00
authored andcommitted
[BugFix] Call LynxDevToolUtils only if lynxDebugEnabled is YES
summary: In LynxEnv, initLynxBase will call LynxDevToolUtils. It will make LynxDevToolEnv initialized. On Android platform, LynxEnv.java, there's a judge for isLynxDebugEnabled before LynxDevToolUtils calling. So make iOS and Android the same way. issue: m-6796700639 AutoLand: release/3.6, release/3.5, release_3.5_weekly_20251201
1 parent 23695fc commit 4895f92

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

platform/darwin/common/lynx/LynxEnv.mm

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,34 @@ - (void)setLocalEnv:(NSString *)value forKey:(NSString *)key {
188188
}
189189

190190
- (void)setDevtoolEnv:(BOOL)value forKey:(NSString *)key {
191+
if (![self lynxDebugEnabled]) {
192+
_LogI(@"setDevtoolEnv, lynxDebugEnabled is NO");
193+
return;
194+
}
191195
[LynxDevToolUtils setDevtoolEnv:value forKey:key];
192196
}
193197

194198
- (BOOL)getDevtoolEnv:(NSString *)key withDefaultValue:(BOOL)value {
199+
if (![self lynxDebugEnabled]) {
200+
_LogI(@"getDevtoolEnv, lynxDebugEnabled is NO, defaultValue is %@", value ? @"YES" : @"NO");
201+
return value;
202+
}
195203
return [LynxDevToolUtils getDevtoolEnv:key withDefaultValue:value];
196204
}
197205

198206
- (void)setDevtoolEnv:(NSSet *)newGroupValues forGroup:(NSString *)groupKey {
207+
if (![self lynxDebugEnabled]) {
208+
_LogI(@"setDevtoolEnv group %@, lynxDebugEnabled is NO", groupKey);
209+
return;
210+
}
199211
[LynxDevToolUtils setDevtoolEnv:newGroupValues forGroup:groupKey];
200212
}
201213

202214
- (NSSet *)getDevtoolEnvWithGroupName:(NSString *)groupKey {
215+
if (![self lynxDebugEnabled]) {
216+
_LogI(@"getDevtoolEnvWithGroupName %@, lynxDebugEnabled is NO", groupKey);
217+
return nil;
218+
}
203219
return [LynxDevToolUtils getDevtoolEnvWithGroupName:groupKey];
204220
}
205221

0 commit comments

Comments
 (0)