Skip to content

Commit a6a2186

Browse files
authored
Merge branch 'dev' into somalaya/flightWebCpFeature
2 parents bfffc9f + 52120b2 commit a6a2186

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ vNext
55
- [MINOR] Native auth: Make native auth MFA feature more backward compatible(#2669)
66
- [MINOR] Flighting webcp in webview (#2686)
77
- [MINOR] Construct broker app link redirect based on broker pkg name (#2682)
8+
- [MINOR] Update keyword to suppress camera consent (#2694)
89

910
Version 21.3.0
1011
----------

common/src/main/java/com/microsoft/identity/common/internal/broker/IRestrictionsManager.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ interface IRestrictionsManager {
3737
// String keys
3838
const val PREFERRED_AUTH_CONFIG = "preferred_auth_config"
3939
// Boolean keys
40-
const val SUPPRESS_CAMERA_CONSENT = "sdm_suppress_camera_consent"
40+
// SDM_SUPPRESS_CAMERA_CONSENT key was used in the past to suppress camera consent for the SDM QR PIN mode.
41+
// It is now deprecated and replaced with the new key SUPPRESS_CAMERA_CONSENT.
42+
// This key is kept for backward compatibility.
43+
@Deprecated("Use SUPPRESS_CAMERA_CONSENT instead")
44+
const val SDM_SUPPRESS_CAMERA_CONSENT = "sdm_suppress_camera_consent"
45+
const val SUPPRESS_CAMERA_CONSENT = "suppress_camera_consent"
4146

4247
/**
4348
* Creates a request bundle with the keys to be requested from the app restrictions manager.

common/src/main/java/com/microsoft/identity/common/internal/broker/SdmQrPinManager.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
package com.microsoft.identity.common.internal.broker
2424

2525
import com.microsoft.identity.common.internal.broker.IRestrictionsManager.BrokerRestrictionsManagerKeys.PREFERRED_AUTH_CONFIG
26+
import com.microsoft.identity.common.internal.broker.IRestrictionsManager.BrokerRestrictionsManagerKeys.SDM_SUPPRESS_CAMERA_CONSENT
2627
import com.microsoft.identity.common.internal.broker.IRestrictionsManager.BrokerRestrictionsManagerKeys.SUPPRESS_CAMERA_CONSENT
28+
import com.microsoft.identity.common.internal.broker.IRestrictionsManager.BrokerRestrictionsManagerKeys.buildMultiValueRequest
2729
import com.microsoft.identity.common.logging.Logger
2830

2931
/**
@@ -80,11 +82,15 @@ object SdmQrPinManager {
8082
val methodTag = "$TAG:isCameraConsentSuppressed"
8183
val defaultValue = false
8284
restrictionsManager?.let { manager ->
83-
return manager.getBoolean(
84-
key = SUPPRESS_CAMERA_CONSENT,
85+
val multiValueRequest = buildMultiValueRequest(
86+
booleanKeys = setOf(SUPPRESS_CAMERA_CONSENT, SDM_SUPPRESS_CAMERA_CONSENT)
87+
)
88+
val values = manager.getMultiValues(
8589
brokerAppPackageName = authenticatorPackageName,
86-
defaultValue = defaultValue
90+
bundleOfKeys = multiValueRequest
8791
)
92+
return values.getBoolean(SUPPRESS_CAMERA_CONSENT, defaultValue) ||
93+
values.getBoolean(SDM_SUPPRESS_CAMERA_CONSENT, defaultValue)
8894
} ?: run {
8995
Logger.warn(methodTag, "Broker restrictions manager is not initialized.")
9096
return defaultValue

0 commit comments

Comments
 (0)