Commits:
-
a68e4b13
by clairehurst at 2026-06-02T11:15:33-06:00
fixup! [android] Disable features and functionality
Bug 45031: Disable AI features for android
-
29cd7db3
by clairehurst at 2026-06-02T11:15:34-06:00
fixup! [android] Rename as Tor Browser
Bug 45031: Disable AI features on Android
14 changed files:
Changes:
mobile/android/android-components/components/browser/state/src/main/java/mozilla/components/browser/state/state/TranslationsBrowserState.kt
| ... |
... |
@@ -25,7 +25,7 @@ import mozilla.components.concept.engine.translate.TranslationSupport |
|
25
|
25
|
* See [TranslationsState.translationError] for session level errors.
|
|
26
|
26
|
*/
|
|
27
|
27
|
data class TranslationsBrowserState(
|
|
28
|
|
- val isTranslationsEnabled: Boolean = true,
|
|
|
28
|
+ val isTranslationsEnabled: Boolean = false,
|
|
29
|
29
|
val isEngineSupported: Boolean? = null,
|
|
30
|
30
|
val offerTranslation: Boolean? = null,
|
|
31
|
31
|
val supportedLanguages: TranslationSupport? = null,
|
mobile/android/android-components/components/concept/ai-controls/src/main/java/mozilla/components/concept/ai/controls/AIFeatureBlock.kt
| ... |
... |
@@ -32,7 +32,7 @@ interface AIFeatureBlock { |
|
32
|
32
|
}
|
|
33
|
33
|
|
|
34
|
34
|
private class InMemoryAIFeatureBlock(initialBlocked: Boolean) : AIFeatureBlock {
|
|
35
|
|
- private val _isBlocked = MutableStateFlow(initialBlocked)
|
|
|
35
|
+ private val _isBlocked = MutableStateFlow(true)
|
|
36
|
36
|
override val isBlocked: Flow<Boolean> = _isBlocked
|
|
37
|
37
|
|
|
38
|
38
|
override suspend fun block() {
|
| ... |
... |
@@ -40,6 +40,6 @@ private class InMemoryAIFeatureBlock(initialBlocked: Boolean) : AIFeatureBlock { |
|
40
|
40
|
}
|
|
41
|
41
|
|
|
42
|
42
|
override suspend fun unblock() {
|
|
43
|
|
- _isBlocked.value = false
|
|
|
43
|
+ _isBlocked.value = true
|
|
44
|
44
|
}
|
|
45
|
45
|
} |
mobile/android/android-components/components/lib/ai-controls/src/main/java/mozilla/components/lib/ai/controls/AIFeatureBlockStorage.kt
| ... |
... |
@@ -28,11 +28,11 @@ internal interface AIFeatureBlockStorage { |
|
28
|
28
|
}
|
|
29
|
29
|
|
|
30
|
30
|
private class InMemoryAiFeatureBlockStorage(initialBlocked: Boolean) : AIFeatureBlockStorage {
|
|
31
|
|
- private val _isBlocked = MutableStateFlow(initialBlocked)
|
|
|
31
|
+ private val _isBlocked = MutableStateFlow(true)
|
|
32
|
32
|
override val isBlocked: Flow<Boolean> = _isBlocked
|
|
33
|
33
|
|
|
34
|
34
|
override suspend fun setBlocked(isBlocked: Boolean) {
|
|
35
|
|
- _isBlocked.value = isBlocked
|
|
|
35
|
+ _isBlocked.value = true
|
|
36
|
36
|
}
|
|
37
|
37
|
}
|
|
38
|
38
|
|
| ... |
... |
@@ -46,13 +46,13 @@ internal class DataStoreBackedAIFeatureBlockStorage( |
|
46
|
46
|
|
|
47
|
47
|
override val isBlocked: Flow<Boolean>
|
|
48
|
48
|
get() = dataStore.data.map { preferences ->
|
|
49
|
|
- preferences[isBlockedKey] ?: false
|
|
|
49
|
+ true
|
|
50
|
50
|
}
|
|
51
|
51
|
|
|
52
|
52
|
override suspend fun setBlocked(isBlocked: Boolean) {
|
|
53
|
53
|
dataStore.updateData {
|
|
54
|
54
|
it.toMutablePreferences().also { preferences ->
|
|
55
|
|
- preferences[isBlockedKey] = isBlocked
|
|
|
55
|
+ preferences[isBlockedKey] = true
|
|
56
|
56
|
}
|
|
57
|
57
|
}
|
|
58
|
58
|
}
|
mobile/android/fenix/app/nimbus.fml.yaml
| ... |
... |
@@ -323,13 +323,13 @@ features: |
|
323
|
323
|
defaults:
|
|
324
|
324
|
- channel: developer
|
|
325
|
325
|
value:
|
|
326
|
|
- enabled: true
|
|
|
326
|
+ enabled: false
|
|
327
|
327
|
- channel: nightly
|
|
328
|
328
|
value:
|
|
329
|
|
- enabled: true
|
|
|
329
|
+ enabled: false
|
|
330
|
330
|
- channel: beta
|
|
331
|
331
|
value:
|
|
332
|
|
- enabled: true
|
|
|
332
|
+ enabled: false
|
|
333
|
333
|
|
|
334
|
334
|
setup-checklist:
|
|
335
|
335
|
description: A feature on the home page that allows the user to track onboarding setup progress.
|
| ... |
... |
@@ -407,42 +407,42 @@ features: |
|
407
|
407
|
description: >
|
|
408
|
408
|
Show the primary toolbar entry point into the translations feature. (Translations icon on URL toolbar.)
|
|
409
|
409
|
type: Boolean
|
|
410
|
|
- default: true
|
|
|
410
|
+ default: false
|
|
411
|
411
|
main-flow-browser-menu-enabled:
|
|
412
|
412
|
description: >
|
|
413
|
413
|
Show the browser menu entry point into the translations feature. ('Translate Page' on browser menu.)
|
|
414
|
414
|
type: Boolean
|
|
415
|
|
- default: true
|
|
|
415
|
+ default: false
|
|
416
|
416
|
page-settings-enabled:
|
|
417
|
417
|
description: >
|
|
418
|
418
|
Show the page settings entry point within the translations feature. (Gear icon on the translations main flow page.)
|
|
419
|
419
|
'main-flow-toolbar-enabled' or 'main-flow-browser-menu-enabled' must also be enabled for users to access this feature.
|
|
420
|
420
|
type: Boolean
|
|
421
|
|
- default: true
|
|
|
421
|
+ default: false
|
|
422
|
422
|
global-settings-enabled:
|
|
423
|
423
|
description: >
|
|
424
|
424
|
Show the global settings entry point within the translations feature. ('Translation Settings' on the page settings view.)
|
|
425
|
425
|
'page-settings-enabled' must also be enabled for users to access this feature.
|
|
426
|
426
|
type: Boolean
|
|
427
|
|
- default: true
|
|
|
427
|
+ default: false
|
|
428
|
428
|
global-lang-settings-enabled:
|
|
429
|
429
|
description: >
|
|
430
|
430
|
Show the global language options entry point for automatically translating. ('Automatic Translation' on the global settings view.)
|
|
431
|
431
|
'global-settings-enabled' must also be enabled for users to access this feature.
|
|
432
|
432
|
type: Boolean
|
|
433
|
|
- default: true
|
|
|
433
|
+ default: false
|
|
434
|
434
|
global-site-settings-enabled:
|
|
435
|
435
|
description: >
|
|
436
|
436
|
Show the global never translate this site options entry point for site management. ('Never translate these sites' on the global settings view.)
|
|
437
|
437
|
'global-settings-enabled' must also be enabled for users to access this feature.
|
|
438
|
438
|
type: Boolean
|
|
439
|
|
- default: true
|
|
|
439
|
+ default: false
|
|
440
|
440
|
downloads-enabled:
|
|
441
|
441
|
description: >
|
|
442
|
442
|
Show the global language model download options entry point for translations. ('Download languages' on the global settings view.)
|
|
443
|
443
|
'global-settings-enabled' must also be enabled for users to access this feature.
|
|
444
|
444
|
type: Boolean
|
|
445
|
|
- default: true
|
|
|
445
|
+ default: false
|
|
446
|
446
|
|
|
447
|
447
|
navigation-toolbar:
|
|
448
|
448
|
description: Feature for navigation toolbar.
|
| ... |
... |
@@ -1262,7 +1262,7 @@ features: |
|
1262
|
1262
|
defaults:
|
|
1263
|
1263
|
- channel: developer
|
|
1264
|
1264
|
value:
|
|
1265
|
|
- enabled: true
|
|
|
1265
|
+ enabled: false
|
|
1266
|
1266
|
- channel: nightly
|
|
1267
|
1267
|
value:
|
|
1268
|
1268
|
enabled: false
|
mobile/android/fenix/app/src/beta/res/drawable-hdpi/fenix_search_widget.png
No preview for this file type
mobile/android/fenix/app/src/debug/res/drawable-hdpi/fenix_search_widget.png
No preview for this file type
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/components/menu/MenuDialogFragment.kt
| ... |
... |
@@ -396,7 +396,7 @@ class MenuDialogFragment : BottomSheetDialogFragment() { |
|
396
|
396
|
}.collectAsState(initial = false)
|
|
397
|
397
|
|
|
398
|
398
|
val isTranslationsEnabled = TranslationsEnabledSettings.dataStore(requireContext())
|
|
399
|
|
- .isEnabled.collectAsState(true)
|
|
|
399
|
+ .isEnabled.collectAsState(false)
|
|
400
|
400
|
|
|
401
|
401
|
MenuDialogBottomSheet(
|
|
402
|
402
|
modifier = Modifier
|
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/translations/TranslationsAIControllableFeature.kt
| ... |
... |
@@ -22,8 +22,8 @@ class TranslationsAIControllableFeature( |
|
22
|
22
|
override val isEnabled: Flow<Boolean> = settings.isEnabled
|
|
23
|
23
|
|
|
24
|
24
|
override suspend fun set(enabled: Boolean) {
|
|
25
|
|
- settings.setEnabled(enabled)
|
|
26
|
|
- browserStore.dispatch(TranslationsAction.SetTranslationsEnabledAction(enabled))
|
|
|
25
|
+ settings.setEnabled(false)
|
|
|
26
|
+ browserStore.dispatch(TranslationsAction.SetTranslationsEnabledAction(false))
|
|
27
|
27
|
}
|
|
28
|
28
|
|
|
29
|
29
|
companion object : AIFeatureMetadata {
|
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/translations/TranslationsEnabledSettings.kt
| ... |
... |
@@ -29,10 +29,10 @@ interface TranslationsEnabledSettings { |
|
29
|
29
|
* An in-memory version for tests, previews, etc.
|
|
30
|
30
|
*/
|
|
31
|
31
|
fun inMemory(isEnabledInitial: Boolean = false) = object : TranslationsEnabledSettings {
|
|
32
|
|
- private val _isEnabled = MutableStateFlow(isEnabledInitial)
|
|
|
32
|
+ private val _isEnabled = MutableStateFlow(false)
|
|
33
|
33
|
override val isEnabled: Flow<Boolean> = _isEnabled
|
|
34
|
34
|
override suspend fun setEnabled(isEnabled: Boolean) {
|
|
35
|
|
- _isEnabled.value = isEnabled
|
|
|
35
|
+ _isEnabled.value = false
|
|
36
|
36
|
}
|
|
37
|
37
|
}
|
|
38
|
38
|
|
| ... |
... |
@@ -50,13 +50,13 @@ internal class DataStoreBackedTranslationsEnabledSettings( |
|
50
|
50
|
private val isEnabledKey = booleanPreferencesKey("is_enabled_key")
|
|
51
|
51
|
|
|
52
|
52
|
override val isEnabled: Flow<Boolean> = dataStore.data.map { preferences ->
|
|
53
|
|
- preferences[isEnabledKey] ?: true
|
|
|
53
|
+ false
|
|
54
|
54
|
}
|
|
55
|
55
|
|
|
56
|
56
|
override suspend fun setEnabled(isEnabled: Boolean) {
|
|
57
|
57
|
dataStore.updateData {
|
|
58
|
58
|
it.toMutablePreferences().also { preferences ->
|
|
59
|
|
- preferences[isEnabledKey] = isEnabled
|
|
|
59
|
+ preferences[isEnabledKey] = false
|
|
60
|
60
|
}
|
|
61
|
61
|
}
|
|
62
|
62
|
}
|
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/translations/settings/TranslationsSettingsState.kt
| ... |
... |
@@ -21,6 +21,6 @@ data class TranslationsSettingsState( |
|
21
|
21
|
val showAutomaticTranslations: Boolean,
|
|
22
|
22
|
val showNeverTranslate: Boolean,
|
|
23
|
23
|
val showDownloads: Boolean,
|
|
24
|
|
- val translationsEnabled: Boolean,
|
|
|
24
|
+ val translationsEnabled: Boolean = false,
|
|
25
|
25
|
val switchItems: List<TranslationSwitchItem>,
|
|
26
|
26
|
) |
mobile/android/fenix/app/src/main/java/org/mozilla/fenix/utils/Settings.kt
| ... |
... |
@@ -1908,7 +1908,7 @@ class Settings( |
|
1908
|
1908
|
|
|
1909
|
1909
|
var shouldShowVoiceSearch by booleanPreference(
|
|
1910
|
1910
|
appContext.getPreferenceKey(R.string.pref_key_show_voice_search),
|
|
1911
|
|
- default = true,
|
|
|
1911
|
+ default = false,
|
|
1912
|
1912
|
)
|
|
1913
|
1913
|
|
|
1914
|
1914
|
/**
|
| ... |
... |
@@ -2799,7 +2799,7 @@ class Settings( |
|
2799
|
2799
|
|
|
2800
|
2800
|
var aiControlsFeatureFlagEnabled by booleanPreference(
|
|
2801
|
2801
|
key = appContext.getPreferenceKey(R.string.pref_key_enable_ai_controls),
|
|
2802
|
|
- default = Config.channel.isNightlyOrDebug,
|
|
|
2802
|
+ default = false,
|
|
2803
|
2803
|
)
|
|
2804
|
2804
|
|
|
2805
|
2805
|
var importBookmarksFeatureFlagEnabled by booleanPreference(
|
mobile/android/fenix/app/src/main/res/drawable-hdpi/fenix_search_widget.png
No preview for this file type
mobile/android/fenix/app/src/nightly/res/drawable-hdpi/fenix_search_widget.png
No preview for this file type
mobile/android/fenix/app/src/release/res/drawable-hdpi/fenix_search_widget.png
No preview for this file type
|