Commit ef16828
Add Auth Tab Switch Browser feature flag and telemetry constants to common4j, Fixes AB#3561423 (#3072)
Adds the feature flag and attribute constants needed to instrument the
Auth Tab switch browser feature.
## Changes
### `CommonFlight.java`
- New flight:
`ENABLE_AUTH_TAB_FOR_SWITCH_BROWSER("EnableAuthTabForSwitchBrowser",
false)`
### `AttributeName.java`
Four new attributes adjacent to existing switch browser attributes:
| Constant | Type | Description |
|---|---|---|
| `auth_tab_used` | boolean | Whether Auth Tab was used |
| `auth_tab_result_code` | integer | Android Activity result code from
Auth Tab |
| `is_auth_tab_supported` | boolean | Whether Auth Tab is supported |
| `auth_tab_fallback_to_custom_tabs` | boolean | Whether Auth Tab fell
back to Custom Tabs |
> **Note:** Per `AttributeName.java` policy, the four new attribute
constants must also be mirrored in the Broker repo's
(`AzureAD/ad-accounts-for-android`) `AttributeName.java`.
Auth Tab telemetry attributes will be recorded on the existing
`SwitchBrowserProcess` span via span context propagation, rather than a
dedicated new span.
<!-- START COPILOT CODING AGENT SUFFIX -->
<!-- START COPILOT ORIGINAL PROMPT -->
<details>
<summary>Original prompt</summary>
> ## Objective
> Add the feature flag enum entry and telemetry constants (attribute
names + span name) in the `common4j` module to support the Auth Tab
switch browser feature.
>
> ## Target Repository
> - Repo: AzureAD/microsoft-authentication-library-common-for-android
> - Base Branch: dev
> - Module: common4j
>
> ## Technical Requirements
>
> 1. **CommonFlight.java** — Add enum entry:
> `ENABLE_AUTH_TAB_FOR_SWITCH_BROWSER("EnableAuthTabForSwitchBrowser",
false),`
> Follow existing pattern. Default value `false`.
>
> 2. **AttributeName.java** — Add 4 new enum constants:
> `auth_tab_used,`
> `auth_tab_result_code,`
> `is_auth_tab_supported,`
> `auth_tab_fallback_to_custom_tabs,`
>
> 3. **SpanName.java** — Add 1 new enum constant near existing Switch
Browser entries:
> `SwitchBrowserAuthTab,`
>
> ## Files to Modify
> -
`common4j/src/main/com/microsoft/identity/common/java/flighting/CommonFlight.java`
> -
`common4j/src/main/com/microsoft/identity/common/java/opentelemetry/AttributeName.java`
> -
`common4j/src/main/com/microsoft/identity/common/java/opentelemetry/SpanName.java`
>
> ## Acceptance Criteria
> - `CommonFlight.ENABLE_AUTH_TAB_FOR_SWITCH_BROWSER` exists with key
`"EnableAuthTabForSwitchBrowser"` and default `false`
> - `AttributeName` contains: `auth_tab_used`, `auth_tab_result_code`,
`is_auth_tab_supported`, `auth_tab_fallback_to_custom_tabs`
> - `SpanName` contains: `SwitchBrowserAuthTab`
> - Compile check passes
>
> Fixes
[AB#3561423](https://identitydivision.visualstudio.com/fac9d424-53d2-45c0-91b5-ef6ba7a6bf26/_workitems/edit/3561423)
> Follow .github/copilot-instructions.md strictly
>
</details>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: p3dr0rv <76129899+p3dr0rv@users.noreply.github.com>
Co-authored-by: p3dr0rv <pedroro@microsoft.com>1 parent 4f86977 commit ef16828
2 files changed
Lines changed: 25 additions & 0 deletions
File tree
- common4j/src/main/com/microsoft/identity/common/java
- flighting
- opentelemetry
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
265 | 270 | | |
266 | 271 | | |
267 | 272 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
408 | 428 | | |
409 | 429 | | |
410 | 430 | | |
| |||
0 commit comments