Skip to content

Commit 646ea3b

Browse files
Bugfix FXIOS-13476 [Summarizer] Enable apple intelligence for users with lang is english (backport #29390) (#29391)
Bugfix FXIOS-13476 [Summarizer] Enable apple intelligence for users with lang is english (#29390) * fix: enable for all en users * fix: also process state early (cherry picked from commit 36afb31) Co-authored-by: Issam Mani <[email protected]>
1 parent fa7cedb commit 646ea3b

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

firefox-ios/Client/Application/AppLaunchUtil.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ final class AppLaunchUtil: Sendable {
3636
}
3737

3838
DefaultBrowserUtil().processUserDefaultState(isFirstRun: introScreenManager.shouldShowIntroScreen)
39+
if #available(iOS 26, *) {
40+
#if canImport(FoundationModels)
41+
AppleIntelligenceUtil().processAvailabilityState()
42+
#endif
43+
}
3944

4045
// Need to get "settings.sendCrashReports" this way so that Sentry can be initialized before getting the Profile.
4146
let sendCrashReports = NSUserDefaultsPrefs(prefix: "profile").boolForKey(AppConstants.prefSendCrashReports) ?? true

firefox-ios/Client/Frontend/Summarizer/SummarizerNimbusUtils.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ struct DefaultSummarizerNimbusUtils: FeatureFlaggable, SummarizerNimbusUtils {
6666
func isAppleSummarizerEnabled() -> Bool {
6767
#if canImport(FoundationModels)
6868
let isFlagEnabled = featureFlags.isFeatureEnabled(.appleSummarizer, checking: .buildOnly)
69-
return AppleIntelligenceUtil().isAppleIntelligenceAvailable && isFlagEnabled
69+
let isEngLang = NSLocale.current.languageCode == "en"
70+
return isEngLang && AppleIntelligenceUtil().isAppleIntelligenceAvailable && isFlagEnabled
7071
#else
7172
return false
7273
#endif
@@ -78,7 +79,8 @@ struct DefaultSummarizerNimbusUtils: FeatureFlaggable, SummarizerNimbusUtils {
7879

7980
private func isAppleSummarizerToolbarEndpointEnabled() -> Bool {
8081
let isFlagEnabled = featureFlags.isFeatureEnabled(.appleSummarizerToolbarEntrypoint, checking: .buildOnly)
81-
return isAppleSummarizerEnabled() && isFlagEnabled
82+
let isEngLang = NSLocale.current.languageCode == "en"
83+
return isEngLang && isAppleSummarizerEnabled() && isFlagEnabled
8284
}
8385

8486
private func isHostedSummarizerToolbarEndpointEnabled() -> Bool {
@@ -88,7 +90,8 @@ struct DefaultSummarizerNimbusUtils: FeatureFlaggable, SummarizerNimbusUtils {
8890

8991
private func isAppleSummarizerShakeGestureEnabled() -> Bool {
9092
let isShakeEnabled = featureFlags.isFeatureEnabled(.appleSummarizerShakeGesture, checking: .buildOnly)
91-
return isAppleSummarizerEnabled() && isShakeEnabled
93+
let isEngLang = NSLocale.current.languageCode == "en"
94+
return isEngLang && isAppleSummarizerEnabled() && isShakeEnabled
9295
}
9396

9497
private func isHostedSummarizerShakeGestureEnabled() -> Bool {

firefox-ios/nimbus-features/appleSummarizerFeature.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ features:
88
description: >
99
Enables the apple summarizer feature.
1010
type: Boolean
11-
default: false
11+
default: true
1212
toolbarEntrypoint:
1313
description: >
1414
Enables the toolbar entrypoint for the summarizer feature.
1515
type: Boolean
16-
default: false
16+
default: true
1717
shakeGesture:
1818
description: >
1919
Enables the shake gesture for the summarizer feature.
2020
type: Boolean
21-
default: false
21+
default: true
2222
defaults:
2323
- channel: beta
2424
value:

0 commit comments

Comments
 (0)