File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
common/src/main/java/com/microsoft/identity/common/internal/broker Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 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
910Version 21.3.0
1011----------
Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff line change 2323package com.microsoft.identity.common.internal.broker
2424
2525import 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
2627import com.microsoft.identity.common.internal.broker.IRestrictionsManager.BrokerRestrictionsManagerKeys.SUPPRESS_CAMERA_CONSENT
28+ import com.microsoft.identity.common.internal.broker.IRestrictionsManager.BrokerRestrictionsManagerKeys.buildMultiValueRequest
2729import 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
You can’t perform that action at this time.
0 commit comments