Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/main' into 12289
Browse files Browse the repository at this point in the history
# Conflicts:
#	docs/changelog.md
  • Loading branch information
iorgamgabriel committed Jun 15, 2022
2 parents 7b5f8d5 + a4e9c35 commit 03e78b4
Show file tree
Hide file tree
Showing 36 changed files with 631 additions and 25 deletions.
4 changes: 4 additions & 0 deletions .buildconfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ projects:
path: components/support/android-test
description: 'A collection of helpers for testing components from instrumented (on device) tests.'
publish: true
support-rusterrors:
path: components/support/rusterrors
description: 'A bridge for reporting Rust errors to Sentry/Glean'
publish: true
support-test-appservices:
path: components/support/test-appservices
description: 'A component for synchronizing Application Services'' unit testing dependencies used in Android Components.'
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

plugins {
id "org.gradle.kotlin.kotlin-dsl" version "2.1.4"
id "org.gradle.kotlin.kotlin-dsl" version "2.1.7"
}

repositories {
Expand Down
3 changes: 2 additions & 1 deletion buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// If you ever need to force a toolchain rebuild (taskcluster) then edit the following comment.
// FORCE REBUILD 2022-06-02
// FORCE REBUILD 2022-06-13

// Synchronized version numbers for dependencies used by (some) modules
object Versions {
Expand Down Expand Up @@ -168,6 +168,7 @@ object Dependencies {
const val mozilla_full_megazord = "org.mozilla.appservices:full-megazord:${Versions.mozilla_appservices}"
const val mozilla_full_megazord_forUnitTests = "org.mozilla.appservices:full-megazord-forUnitTests:${Versions.mozilla_appservices}"

const val mozilla_errorsupport = "org.mozilla.appservices:errorsupport:${Versions.mozilla_appservices}"
const val mozilla_rustlog = "org.mozilla.appservices:rustlog:${Versions.mozilla_appservices}"
const val mozilla_sync15 = "org.mozilla.appservices:sync15:${Versions.mozilla_appservices}"

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/java/Gecko.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ object Gecko {
/**
* GeckoView Version.
*/
const val version = "103.0.20220609065921"
const val version = "103.0.20220614082301"

/**
* GeckoView channel
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package mozilla.components.concept.base.crash

/**
* Crash report for rust errors
*
* We implement this on exception classes that correspond to Rust errors to
* customize how the crash reports look.
*
* CrashReporting implementors should test if exceptions implement this
* interface. If so, they should try to customize their crash reports to match.
*/
interface RustCrashReport {
val typeName: String
val message: String
}
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ internal class MediaSessionServiceDelegate(

when (intent?.action) {
AbstractMediaSessionService.ACTION_LAUNCH -> {
startForegroundNotificationIfNeeded()
startForegroundNotification()
}
AbstractMediaSessionService.ACTION_PLAY -> {
controller?.play()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ class MediaSessionServiceDelegateTest {
service::class.java
)
)
verify(service, times(1)).startForeground(ArgumentMatchers.anyInt(), any())
verify(service, times(2)).startForeground(ArgumentMatchers.anyInt(), any())

delegate.onStartCommand(
AbstractMediaSessionService.launchIntent(
testContext,
service::class.java
)
)
verify(service, times(1)).startForeground(ArgumentMatchers.anyInt(), any())
verify(service, times(3)).startForeground(ArgumentMatchers.anyInt(), any())
}

@Test
Expand Down Expand Up @@ -267,7 +267,7 @@ class MediaSessionServiceDelegateTest {
)
)

verify(service, times(1)).startForeground(ArgumentMatchers.anyInt(), any())
verify(service, times(2)).startForeground(ArgumentMatchers.anyInt(), any())

delegate.onStartCommand(
AbstractMediaSessionService.pauseIntent(
Expand All @@ -277,7 +277,7 @@ class MediaSessionServiceDelegateTest {
)
verify(controller).pause()
mediaSessionCallback.onPause()
verify(service, times(1)).startForeground(ArgumentMatchers.anyInt(), any())
verify(service, times(2)).startForeground(ArgumentMatchers.anyInt(), any())

mediaSessionCallback.onPlay()
verify(controller, times(1)).play()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import mozilla.components.feature.prompts.dialog.Prompter
import mozilla.components.feature.prompts.dialog.SaveLoginDialogFragment
import mozilla.components.feature.prompts.dialog.TextPromptDialogFragment
import mozilla.components.feature.prompts.dialog.TimePickerDialogFragment
import mozilla.components.feature.prompts.facts.emitSuccessfulAddressAutofillFormDetectedFact
import mozilla.components.feature.prompts.facts.emitSuccessfulCreditCardAutofillFormDetectedFact
import mozilla.components.feature.prompts.file.FilePicker
import mozilla.components.feature.prompts.login.LoginExceptions
Expand Down Expand Up @@ -469,6 +470,7 @@ class PromptFeature private constructor(
}
}
is SelectAddress -> {
emitSuccessfulAddressAutofillFormDetectedFact()
if (isAddressAutofillEnabled() && promptRequest.addresses.isNotEmpty()) {
addressPicker?.handleSelectAddressRequest(promptRequest)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import mozilla.components.concept.engine.prompt.PromptRequest
import mozilla.components.concept.storage.Address
import mozilla.components.feature.prompts.concept.SelectablePromptView
import mozilla.components.feature.prompts.consumePromptFrom
import mozilla.components.feature.prompts.facts.emitAddressAutofillDismissedFact
import mozilla.components.feature.prompts.facts.emitAddressAutofillShownFact
import mozilla.components.support.base.log.logger.Logger

/**
Expand Down Expand Up @@ -40,6 +42,7 @@ class AddressPicker(
* @param request The [PromptRequest] containing the the address request data to be shown.
*/
internal fun handleSelectAddressRequest(request: PromptRequest.SelectAddress) {
emitAddressAutofillShownFact()
addressSelectBar.showPrompt(request.addresses)
}

Expand All @@ -51,6 +54,7 @@ class AddressPicker(
*/
@Suppress("TooGenericExceptionCaught")
fun dismissSelectAddressRequest(promptRequest: PromptRequest.SelectAddress? = null) {
emitAddressAutofillDismissedFact()
addressSelectBar.hidePrompt()

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import androidx.recyclerview.widget.RecyclerView
import mozilla.components.concept.storage.Address
import mozilla.components.feature.prompts.R
import mozilla.components.feature.prompts.concept.SelectablePromptView
import mozilla.components.feature.prompts.facts.emitAddressAutofillExpandedFact
import mozilla.components.feature.prompts.facts.emitSuccessfulAddressAutofillSuccessFact
import mozilla.components.support.ktx.android.view.hideKeyboard

/**
Expand All @@ -41,6 +43,7 @@ class AddressSelectBar @JvmOverloads constructor(
private val listAdapter = AddressAdapter { address ->
listener?.apply {
onOptionSelect(address)
emitSuccessfulAddressAutofillSuccessFact()
}
}

Expand Down Expand Up @@ -128,6 +131,7 @@ class AddressSelectBar @JvmOverloads constructor(
manageAddressesView?.isVisible = shouldExpand

if (shouldExpand) {
emitAddressAutofillExpandedFact()
view?.hideKeyboard()
expanderView?.rotation = ROTATE_180
headerView?.contentDescription =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package mozilla.components.feature.prompts.facts

import mozilla.components.support.base.Component
import mozilla.components.support.base.facts.Action
import mozilla.components.support.base.facts.Fact
import mozilla.components.support.base.facts.collect

/**
* Facts emitted for telemetry related to the Autofill prompt feature for addresses.
*/
class AddressAutofillDialogFacts {
/**
* Specific types of telemetry items.
*/
object Items {
const val AUTOFILL_ADDRESS_FORM_DETECTED = "autofill_address_form_detected"
const val AUTOFILL_ADDRESS_SUCCESS = "autofill_address_success"
const val AUTOFILL_ADDRESS_PROMPT_SHOWN = "autofill_address_prompt_shown"
const val AUTOFILL_ADDRESS_PROMPT_EXPANDED = "autofill_address_prompt_expanded"
const val AUTOFILL_ADDRESS_PROMPT_DISMISSED = "autofill_address_prompt_dismissed"
}
}

private fun emitAddressAutofillDialogFact(
action: Action,
item: String,
value: String? = null,
metadata: Map<String, Any>? = null
) {
Fact(
Component.FEATURE_PROMPTS,
action,
item,
value,
metadata
).collect()
}

internal fun emitSuccessfulAddressAutofillFormDetectedFact() {
emitAddressAutofillDialogFact(
Action.INTERACTION,
AddressAutofillDialogFacts.Items.AUTOFILL_ADDRESS_FORM_DETECTED
)
}

internal fun emitSuccessfulAddressAutofillSuccessFact() {
emitAddressAutofillDialogFact(
Action.INTERACTION,
AddressAutofillDialogFacts.Items.AUTOFILL_ADDRESS_SUCCESS
)
}

internal fun emitAddressAutofillShownFact() {
emitAddressAutofillDialogFact(
Action.INTERACTION,
AddressAutofillDialogFacts.Items.AUTOFILL_ADDRESS_PROMPT_SHOWN
)
}

internal fun emitAddressAutofillExpandedFact() {
emitAddressAutofillDialogFact(
Action.INTERACTION,
AddressAutofillDialogFacts.Items.AUTOFILL_ADDRESS_PROMPT_EXPANDED
)
}

internal fun emitAddressAutofillDismissedFact() {
emitAddressAutofillDialogFact(
Action.INTERACTION,
AddressAutofillDialogFacts.Items.AUTOFILL_ADDRESS_PROMPT_DISMISSED
)
}
10 changes: 10 additions & 0 deletions components/feature/prompts/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,14 @@
<string name="mozac_feature_prompts_update_credit_card_prompt_title">Aktualizovat platnost karty?</string>
<!-- Subtitle text displayed under the title of the save credit card dialog. -->
<string name="mozac_feature_prompts_save_credit_card_prompt_body">Číslo karty bude uložené šifrované. Bezpečnostní kód uložen nebude.</string>

<!-- Address Autofill -->
<!-- Header for the select address prompt to allow users to fill a form with a saved address. -->
<string name="mozac_feature_prompts_select_address">Vyberte adresy</string>
<!-- Content description for expanding the select addresses options in the select address prompt. -->
<string name="mozac_feature_prompts_expand_address_content_description">Zobrazit navrhované adresy</string>
<!-- Content description for collapsing the select address options in the select address prompt. -->
<string name="mozac_feature_prompts_collapse_address_content_description">Skrýt navrhované adresy</string>
<!-- Text for the manage addresses button. -->
<string name="mozac_feature_prompts_manage_address">Správa adres</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,10 @@
<!-- Address Autofill -->
<!-- Header for the select address prompt to allow users to fill a form with a saved address. -->
<string name="mozac_feature_prompts_select_address">Επιλογή διευθύνσεων</string>
</resources>
<!-- Content description for expanding the select addresses options in the select address prompt. -->
<string name="mozac_feature_prompts_expand_address_content_description">Ανάπτυξη προτεινόμενων διευθύνσεων</string>
<!-- Content description for collapsing the select address options in the select address prompt. -->
<string name="mozac_feature_prompts_collapse_address_content_description">Σύμπτυξη προτεινόμενων διευθύνσεων</string>
<!-- Text for the manage addresses button. -->
<string name="mozac_feature_prompts_manage_address">Διαχείριση διευθύνσεων</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@
<!-- Address Autofill -->
<!-- Header for the select address prompt to allow users to fill a form with a saved address. -->
<string name="mozac_feature_prompts_select_address">Fren tansiwin</string>
<!-- Content description for expanding the select addresses options in the select address prompt. -->
<string name="mozac_feature_prompts_expand_address_content_description">Snefli tansiwin d-yettwasumren</string>
<!-- Content description for collapsing the select address options in the select address prompt. -->
<string name="mozac_feature_prompts_collapse_address_content_description">Fneẓ tansiwin d-yettwasumren</string>
<!-- Text for the manage addresses button. -->
Expand Down
10 changes: 10 additions & 0 deletions components/feature/prompts/src/main/res/values-sk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,14 @@
<string name="mozac_feature_prompts_update_credit_card_prompt_title">Aktualizovať dátum vypršania platnosti karty?</string>
<!-- Subtitle text displayed under the title of the save credit card dialog. -->
<string name="mozac_feature_prompts_save_credit_card_prompt_body">Číslo karty bude zašifrované. Bezpečnostný kód sa neuloží.</string>

<!-- Address Autofill -->
<!-- Header for the select address prompt to allow users to fill a form with a saved address. -->
<string name="mozac_feature_prompts_select_address">Vyberte adresy</string>
<!-- Content description for expanding the select addresses options in the select address prompt. -->
<string name="mozac_feature_prompts_expand_address_content_description">Rozbaliť navrhované adresy</string>
<!-- Content description for collapsing the select address options in the select address prompt. -->
<string name="mozac_feature_prompts_collapse_address_content_description">Zbaliť navrhované adresy</string>
<!-- Text for the manage addresses button. -->
<string name="mozac_feature_prompts_manage_address">Spravovať adresy</string>
</resources>
7 changes: 7 additions & 0 deletions components/feature/prompts/src/main/res/values-sl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,11 @@
<string name="mozac_feature_prompts_update_credit_card_prompt_title">Posodobi datum poteka veljavnosti kartice?</string>
<!-- Subtitle text displayed under the title of the save credit card dialog. -->
<string name="mozac_feature_prompts_save_credit_card_prompt_body">Številka kartice bo šifrirana. Varnostna koda ne bo shranjena.</string>

<!-- Content description for expanding the select addresses options in the select address prompt. -->
<string name="mozac_feature_prompts_expand_address_content_description">Razširi predlagane naslove</string>
<!-- Content description for collapsing the select address options in the select address prompt. -->
<string name="mozac_feature_prompts_collapse_address_content_description">Strni predlagane naslove</string>
<!-- Text for the manage addresses button. -->
<string name="mozac_feature_prompts_manage_address">Upravljanje naslovov</string>
</resources>
10 changes: 10 additions & 0 deletions components/feature/prompts/src/main/res/values-su/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,14 @@
<string name="mozac_feature_prompts_update_credit_card_prompt_title">Mutahirkeun titimangsa kadaluwarsa kartu?</string>
<!-- Subtitle text displayed under the title of the save credit card dialog. -->
<string name="mozac_feature_prompts_save_credit_card_prompt_body">Nomer kartu bakal diénkrip. Kode kaamanan moal diteundeun.</string>

<!-- Address Autofill -->
<!-- Header for the select address prompt to allow users to fill a form with a saved address. -->
<string name="mozac_feature_prompts_select_address">Pilih alamat</string>
<!-- Content description for expanding the select addresses options in the select address prompt. -->
<string name="mozac_feature_prompts_expand_address_content_description">Legaan saran alamat</string>
<!-- Content description for collapsing the select address options in the select address prompt. -->
<string name="mozac_feature_prompts_collapse_address_content_description">Leutikan saran alamat</string>
<!-- Text for the manage addresses button. -->
<string name="mozac_feature_prompts_manage_address">Kokolakeun alamat</string>
</resources>
10 changes: 10 additions & 0 deletions components/feature/prompts/src/main/res/values-tr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,14 @@
<string name="mozac_feature_prompts_update_credit_card_prompt_title">Kartın son kullanma tarihi güncellensin mi?</string>
<!-- Subtitle text displayed under the title of the save credit card dialog. -->
<string name="mozac_feature_prompts_save_credit_card_prompt_body">Kart numarası şifrelenecektir. Güvenlik kodu kaydedilmeyecektir.</string>

<!-- Address Autofill -->
<!-- Header for the select address prompt to allow users to fill a form with a saved address. -->
<string name="mozac_feature_prompts_select_address">Adresleri seç</string>
<!-- Content description for expanding the select addresses options in the select address prompt. -->
<string name="mozac_feature_prompts_expand_address_content_description">Önerilen adresleri genişlet</string>
<!-- Content description for collapsing the select address options in the select address prompt. -->
<string name="mozac_feature_prompts_collapse_address_content_description">Önerilen adresleri daralt</string>
<!-- Text for the manage addresses button. -->
<string name="mozac_feature_prompts_manage_address">Adresleri yönet</string>
</resources>
Loading

0 comments on commit 03e78b4

Please sign in to comment.