Skip to content

Commit 3bc49c2

Browse files
Bug 1925091 - Make Android FxaAccountManager supply comma-separate list of values for service=sync
1 parent 743ccba commit 3bc49c2

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

components/fxa-client/android/src/main/java/mozilla/appservices/fxaclient/FxaClient.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ class FxaClient(inner: FirefoxAccount, persistCallback: PersistCallback?) : Auto
113113
fun beginOAuthFlow(
114114
scopes: Array<String>,
115115
entrypoint: String,
116+
services: List<String> = listOf("sync"),
116117
): String {
117118
return withMetrics {
118-
this.inner.beginOauthFlow(scopes.toList(), entrypoint, listOf("sync"))
119+
this.inner.beginOauthFlow(scopes.toList(), entrypoint, services)
119120
}
120121
}
121122

@@ -133,9 +134,10 @@ class FxaClient(inner: FirefoxAccount, persistCallback: PersistCallback?) : Auto
133134
pairingUrl: String,
134135
scopes: Array<String>,
135136
entrypoint: String,
137+
services: List<String> = listOf("sync"),
136138
): String {
137139
return withMetrics {
138-
this.inner.beginPairingFlow(pairingUrl, scopes.toList(), entrypoint, listOf("sync"))
140+
this.inner.beginPairingFlow(pairingUrl, scopes.toList(), entrypoint, services)
139141
}
140142
}
141143

components/fxa-client/src/auth.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ impl FirefoxAccount {
8080
/// - `metrics` - optionally, additional metrics tracking parameters.
8181
/// - These will be included as query parameters in the resulting URL.
8282
#[handle_error(Error)]
83+
#[uniffi::method(default(service = &["sync"]))]
8384
pub fn begin_oauth_flow<T: AsRef<str>>(
8485
&self,
8586
// Allow both &[String] and &[&str] since UniFFI can't represent `&[&str]` yet,
@@ -130,6 +131,7 @@ impl FirefoxAccount {
130131
/// - `metrics` - optionally, additional metrics tracking parameters.
131132
/// - These will be included as query parameters in the resulting URL.
132133
#[handle_error(Error)]
134+
#[uniffi::method(default(service = &["sync"]))]
133135
pub fn begin_pairing_flow(
134136
&self,
135137
pairing_url: &str,

components/fxa-client/src/internal/oauth.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ impl FirefoxAccount {
130130
/// * `entrypoint` - The entrypoint to be used for data collection
131131
/// * `service` - Space-separated list of requested services.
132132
/// * `metrics` - Optional parameters for metrics
133+
#[uniffi::method(default(service = &["sync"]))]
133134
pub fn begin_pairing_flow(
134135
&mut self,
135136
pairing_url: &str,
@@ -160,6 +161,7 @@ impl FirefoxAccount {
160161
/// * `entrypoint` - The entrypoint to be used for metrics
161162
/// * `service` - Space-separated list of requested services.
162163
/// * `metrics` - Optional metrics parameters
164+
#[uniffi::method(default(service = &["sync"]))]
163165
pub fn begin_oauth_flow(
164166
&mut self,
165167
scopes: &[&str],

0 commit comments

Comments
 (0)