From 3cd589030226e9f7a4b74c548e57484617493fe6 Mon Sep 17 00:00:00 2001 From: Dome Pongmongkol Date: Wed, 20 May 2026 11:35:59 -0700 Subject: [PATCH 1/7] Add SilentAuthReceiver for Doze network-block reproduction Add a BroadcastReceiver to MsalTestApp that triggers acquireTokenSilent from a background process context (PROCESS_STATE_RECEIVER). This enables reliable reproduction of the Doze network-block issue that affects background broker auth triggered by FCM notifications. Key findings from investigation: - When a foreground app binds to Broker via IPC, Android's NetworkPolicyManagerService adds a dozable-allow firewall rule for the Broker's UID. This masks the Doze network block during UI testing. - When the caller is in a background context (BroadcastReceiver/Service), the IPC binding does NOT elevate the Broker enough for dozable-allow. The Broker's network call fails with UnknownHostException. - This matches the production scenario: Outlook receives FCM push in background -> calls OneAuth -> OneAuth calls Broker -> Broker's network to eSTS is blocked by Doze firewall. Usage: adb shell dumpsys battery unplug adb shell dumpsys deviceidle force-idle adb shell am broadcast \ -a com.microsoft.identity.client.testapp.SILENT_AUTH \ -n com.msft.identity.client.sample.local/com.microsoft.identity.client.testapp.SilentAuthReceiver adb logcat -s SilentAuthReceiver:* --- testapps/testapp/src/main/AndroidManifest.xml | 9 + .../client/testapp/SilentAuthReceiver.java | 194 ++++++++++++++++++ 2 files changed, 203 insertions(+) create mode 100644 testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java diff --git a/testapps/testapp/src/main/AndroidManifest.xml b/testapps/testapp/src/main/AndroidManifest.xml index 28286ca024..db1f36cb21 100644 --- a/testapps/testapp/src/main/AndroidManifest.xml +++ b/testapps/testapp/src/main/AndroidManifest.xml @@ -87,6 +87,15 @@ android:path="/1wIqXSqBj7w+h11ZifsnqwgyKrY="/> + + + + + + + diff --git a/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java b/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java new file mode 100644 index 0000000000..7dcf6a9010 --- /dev/null +++ b/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +package com.microsoft.identity.client.testapp; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.util.Log; + +import com.microsoft.identity.client.AcquireTokenSilentParameters; +import com.microsoft.identity.client.AuthenticationCallback; +import com.microsoft.identity.client.IAccount; +import com.microsoft.identity.client.IAuthenticationResult; +import com.microsoft.identity.client.IMultipleAccountPublicClientApplication; +import com.microsoft.identity.client.IPublicClientApplication; +import com.microsoft.identity.client.ISingleAccountPublicClientApplication; +import com.microsoft.identity.client.PublicClientApplication; +import com.microsoft.identity.client.exception.MsalException; + +import java.util.Arrays; +import java.util.List; + +/** + * BroadcastReceiver that triggers acquireTokenSilent from a background context. + * + * This runs at PROCESS_STATE_RECEIVER priority, which does NOT elevate the + * Broker process enough to get a dozable-allow firewall rule. This simulates + * the production scenario where Outlook handles an FCM push in the background + * and calls the Broker via OneAuth. + * + * Usage: + * adb shell am broadcast \ + * -a com.microsoft.identity.client.testapp.SILENT_AUTH \ + * -n com.msft.identity.client.sample.local/com.microsoft.identity.client.testapp.SilentAuthReceiver \ + * --es scopes "https://graph.microsoft.com/.default" + */ +public class SilentAuthReceiver extends BroadcastReceiver { + + private static final String TAG = "SilentAuthReceiver"; + public static final String ACTION_SILENT_AUTH = + "com.microsoft.identity.client.testapp.SILENT_AUTH"; + + @Override + public void onReceive(final Context context, final Intent intent) { + Log.w(TAG, "=== SilentAuthReceiver triggered (PROCESS_STATE_RECEIVER) ==="); + + final String scopes = intent.getStringExtra("scopes"); + final String scopeString = (scopes != null) ? scopes : "https://graph.microsoft.com/.default"; + + Log.w(TAG, "Scopes: " + scopeString); + + // Use goAsync() to extend the receiver's lifecycle beyond the 10s limit + final PendingResult pendingResult = goAsync(); + + // Create PCA with default config (uses broker) + final int configResourceId = Constants.getResourceIdFromConfigFile(Constants.ConfigFile.DEFAULT); + + PublicClientApplication.create(context.getApplicationContext(), + configResourceId, + new PublicClientApplication.ApplicationCreatedListener() { + @Override + public void onCreated(IPublicClientApplication application) { + // Force-disable powerOptCheck so the Broker attempts the real + // network call instead of proactively blocking with a Doze check. + // This matches production Authenticator behavior (which doesn't + // have powerOptCheckEnabled set by OneAuth). + application.getConfiguration().setPowerOptCheckEnabled(false); + + Log.w(TAG, "PCA created, mode: " + + (application instanceof ISingleAccountPublicClientApplication + ? "SingleAccount" : "MultipleAccount")); + Log.w(TAG, "powerOptCheckEnabled forced to: " + + application.getConfiguration().isPowerOptCheckForEnabled()); + loadAccountsAndAcquire(application, scopeString, pendingResult); + } + + @Override + public void onError(MsalException exception) { + Log.e(TAG, "Failed to create PCA: " + exception.getMessage(), exception); + pendingResult.finish(); + } + }); + } + + private void loadAccountsAndAcquire( + final IPublicClientApplication app, + final String scopeString, + final PendingResult pendingResult) { + + if (app instanceof ISingleAccountPublicClientApplication) { + final ISingleAccountPublicClientApplication singleApp = + (ISingleAccountPublicClientApplication) app; + try { + final IAccount account = singleApp.getCurrentAccount().getCurrentAccount(); + if (account == null) { + Log.e(TAG, "No signed-in account found in single-account mode."); + pendingResult.finish(); + return; + } + doSilentAuth(app, account, scopeString, pendingResult); + } catch (Exception e) { + Log.e(TAG, "Error loading account: " + e.getMessage(), e); + pendingResult.finish(); + } + } else if (app instanceof IMultipleAccountPublicClientApplication) { + final IMultipleAccountPublicClientApplication multiApp = + (IMultipleAccountPublicClientApplication) app; + multiApp.getAccounts(new IPublicClientApplication.LoadAccountsCallback() { + @Override + public void onTaskCompleted(List result) { + if (result == null || result.isEmpty()) { + Log.e(TAG, "No accounts found in multiple-account mode."); + pendingResult.finish(); + return; + } + Log.w(TAG, "Found " + result.size() + " account(s). Using first."); + doSilentAuth(app, result.get(0), scopeString, pendingResult); + } + + @Override + public void onError(MsalException exception) { + Log.e(TAG, "Error loading accounts: " + exception.getMessage(), exception); + pendingResult.finish(); + } + }); + } + } + + private void doSilentAuth( + final IPublicClientApplication app, + final IAccount account, + final String scopeString, + final PendingResult pendingResult) { + + Log.w(TAG, "Calling acquireTokenSilent for account: " + account.getUsername()); + Log.w(TAG, "Authority: " + account.getAuthority()); + + final AcquireTokenSilentParameters parameters = new AcquireTokenSilentParameters.Builder() + .forAccount(account) + .fromAuthority(account.getAuthority()) + .withScopes(Arrays.asList(scopeString.toLowerCase().split(" "))) + .forceRefresh(true) // Force network call to eSTS (no cache) + .withCallback(new AuthenticationCallback() { + @Override + public void onSuccess(IAuthenticationResult authenticationResult) { + Log.w(TAG, "=== SUCCESS === Token acquired silently!"); + Log.w(TAG, "Access token (first 20 chars): " + + authenticationResult.getAccessToken().substring(0, 20) + "..."); + pendingResult.finish(); + } + + @Override + public void onError(MsalException exception) { + Log.e(TAG, "=== FAILED === " + exception.getClass().getSimpleName()); + Log.e(TAG, "Error code: " + exception.getErrorCode()); + Log.e(TAG, "Message: " + exception.getMessage()); + if (exception.getCause() != null) { + Log.e(TAG, "Cause: " + exception.getCause().getClass().getSimpleName() + + " - " + exception.getCause().getMessage()); + } + pendingResult.finish(); + } + + @Override + public void onCancel() { + Log.w(TAG, "=== CANCELLED ==="); + pendingResult.finish(); + } + }) + .build(); + + app.acquireTokenSilentAsync(parameters); + } +} From a6d237386cd606bcf102fb67050ec72c30b84a0c Mon Sep 17 00:00:00 2001 From: Dome Pongmongkol <19558668+rpdome@users.noreply.github.com> Date: Wed, 20 May 2026 13:55:46 -0700 Subject: [PATCH 2/7] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- .../microsoft/identity/client/testapp/SilentAuthReceiver.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java b/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java index 7dcf6a9010..ca095494ca 100644 --- a/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java +++ b/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java @@ -164,8 +164,7 @@ private void doSilentAuth( @Override public void onSuccess(IAuthenticationResult authenticationResult) { Log.w(TAG, "=== SUCCESS === Token acquired silently!"); - Log.w(TAG, "Access token (first 20 chars): " + - authenticationResult.getAccessToken().substring(0, 20) + "..."); + Log.w(TAG, "Silent token acquisition completed successfully."); pendingResult.finish(); } From a39c8d2c2ad134b85b41e90d25637481387a09e2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 May 2026 23:07:03 +0000 Subject: [PATCH 3/7] Address review comments in SilentAuthReceiver logging and scope handling Agent-Logs-Url: https://github.com/AzureAD/microsoft-authentication-library-for-android/sessions/8666a879-5695-4eb3-bed2-71862e059d5f Co-authored-by: rpdome <19558668+rpdome@users.noreply.github.com> --- .../client/testapp/SilentAuthReceiver.java | 40 +++++++++++++------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java b/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java index ca095494ca..e4f6a7dcbf 100644 --- a/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java +++ b/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java @@ -36,8 +36,9 @@ import com.microsoft.identity.client.ISingleAccountPublicClientApplication; import com.microsoft.identity.client.PublicClientApplication; import com.microsoft.identity.client.exception.MsalException; +import com.microsoft.identity.common.java.util.StringUtil; -import java.util.Arrays; +import java.util.ArrayList; import java.util.List; /** @@ -65,7 +66,9 @@ public void onReceive(final Context context, final Intent intent) { Log.w(TAG, "=== SilentAuthReceiver triggered (PROCESS_STATE_RECEIVER) ==="); final String scopes = intent.getStringExtra("scopes"); - final String scopeString = (scopes != null) ? scopes : "https://graph.microsoft.com/.default"; + final String scopeString = StringUtil.isNullOrEmpty(scopes) || StringUtil.isNullOrEmpty(scopes.trim()) + ? "https://graph.microsoft.com/.default" + : scopes; Log.w(TAG, "Scopes: " + scopeString); @@ -79,7 +82,7 @@ public void onReceive(final Context context, final Intent intent) { configResourceId, new PublicClientApplication.ApplicationCreatedListener() { @Override - public void onCreated(IPublicClientApplication application) { + public void onCreated(final IPublicClientApplication application) { // Force-disable powerOptCheck so the Broker attempts the real // network call instead of proactively blocking with a Doze check. // This matches production Authenticator behavior (which doesn't @@ -95,7 +98,7 @@ public void onCreated(IPublicClientApplication application) { } @Override - public void onError(MsalException exception) { + public void onError(final MsalException exception) { Log.e(TAG, "Failed to create PCA: " + exception.getMessage(), exception); pendingResult.finish(); } @@ -127,7 +130,7 @@ private void loadAccountsAndAcquire( (IMultipleAccountPublicClientApplication) app; multiApp.getAccounts(new IPublicClientApplication.LoadAccountsCallback() { @Override - public void onTaskCompleted(List result) { + public void onTaskCompleted(final List result) { if (result == null || result.isEmpty()) { Log.e(TAG, "No accounts found in multiple-account mode."); pendingResult.finish(); @@ -138,7 +141,7 @@ public void onTaskCompleted(List result) { } @Override - public void onError(MsalException exception) { + public void onError(final MsalException exception) { Log.e(TAG, "Error loading accounts: " + exception.getMessage(), exception); pendingResult.finish(); } @@ -152,24 +155,24 @@ private void doSilentAuth( final String scopeString, final PendingResult pendingResult) { - Log.w(TAG, "Calling acquireTokenSilent for account: " + account.getUsername()); + Log.i(TAG, "Calling acquireTokenSilent for account: " + account.getUsername()); Log.w(TAG, "Authority: " + account.getAuthority()); final AcquireTokenSilentParameters parameters = new AcquireTokenSilentParameters.Builder() .forAccount(account) .fromAuthority(account.getAuthority()) - .withScopes(Arrays.asList(scopeString.toLowerCase().split(" "))) + .withScopes(parseScopes(scopeString)) .forceRefresh(true) // Force network call to eSTS (no cache) .withCallback(new AuthenticationCallback() { @Override - public void onSuccess(IAuthenticationResult authenticationResult) { - Log.w(TAG, "=== SUCCESS === Token acquired silently!"); - Log.w(TAG, "Silent token acquisition completed successfully."); + public void onSuccess(final IAuthenticationResult authenticationResult) { + Log.i(TAG, "=== SUCCESS === Token acquired silently!"); + Log.i(TAG, "Silent token acquisition completed successfully."); pendingResult.finish(); } @Override - public void onError(MsalException exception) { + public void onError(final MsalException exception) { Log.e(TAG, "=== FAILED === " + exception.getClass().getSimpleName()); Log.e(TAG, "Error code: " + exception.getErrorCode()); Log.e(TAG, "Message: " + exception.getMessage()); @@ -190,4 +193,17 @@ public void onCancel() { app.acquireTokenSilentAsync(parameters); } + + private List parseScopes(final String scopeString) { + final String[] rawScopes = scopeString.trim().split("\\s+"); + final List parsedScopes = new ArrayList<>(); + + for (final String scope : rawScopes) { + if (!StringUtil.isNullOrEmpty(scope)) { + parsedScopes.add(scope); + } + } + + return parsedScopes; + } } From fe2790f7d34b0782b1f6d1c47152f858a9d4096d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 May 2026 23:10:36 +0000 Subject: [PATCH 4/7] Harden scope parsing and align SilentAuthReceiver log levels Agent-Logs-Url: https://github.com/AzureAD/microsoft-authentication-library-for-android/sessions/8666a879-5695-4eb3-bed2-71862e059d5f Co-authored-by: rpdome <19558668+rpdome@users.noreply.github.com> --- .../client/testapp/SilentAuthReceiver.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java b/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java index e4f6a7dcbf..3e982cce23 100644 --- a/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java +++ b/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java @@ -66,9 +66,10 @@ public void onReceive(final Context context, final Intent intent) { Log.w(TAG, "=== SilentAuthReceiver triggered (PROCESS_STATE_RECEIVER) ==="); final String scopes = intent.getStringExtra("scopes"); - final String scopeString = StringUtil.isNullOrEmpty(scopes) || StringUtil.isNullOrEmpty(scopes.trim()) + final String trimmedScopes = scopes == null ? null : scopes.trim(); + final String scopeString = StringUtil.isNullOrEmpty(trimmedScopes) ? "https://graph.microsoft.com/.default" - : scopes; + : trimmedScopes; Log.w(TAG, "Scopes: " + scopeString); @@ -156,7 +157,7 @@ private void doSilentAuth( final PendingResult pendingResult) { Log.i(TAG, "Calling acquireTokenSilent for account: " + account.getUsername()); - Log.w(TAG, "Authority: " + account.getAuthority()); + Log.i(TAG, "Authority: " + account.getAuthority()); final AcquireTokenSilentParameters parameters = new AcquireTokenSilentParameters.Builder() .forAccount(account) @@ -195,7 +196,16 @@ public void onCancel() { } private List parseScopes(final String scopeString) { - final String[] rawScopes = scopeString.trim().split("\\s+"); + if (scopeString == null) { + return new ArrayList<>(); + } + + final String trimmedScopeString = scopeString.trim(); + if (trimmedScopeString.isEmpty()) { + return new ArrayList<>(); + } + + final String[] rawScopes = trimmedScopeString.split("\\s+"); final List parsedScopes = new ArrayList<>(); for (final String scope : rawScopes) { From a6cbf58cfa82b207e5d467227ffeb6e058cf502c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 May 2026 23:11:26 +0000 Subject: [PATCH 5/7] Harden SilentAuthReceiver scope fallback and logging Agent-Logs-Url: https://github.com/AzureAD/microsoft-authentication-library-for-android/sessions/cbdbc7c2-0ac5-48a5-9349-50239c795309 Co-authored-by: rpdome <19558668+rpdome@users.noreply.github.com> --- .../client/testapp/SilentAuthReceiver.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java b/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java index 3e982cce23..f3b92d3254 100644 --- a/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java +++ b/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java @@ -58,6 +58,7 @@ public class SilentAuthReceiver extends BroadcastReceiver { private static final String TAG = "SilentAuthReceiver"; + private static final String DEFAULT_SCOPE = "https://graph.microsoft.com/.default"; public static final String ACTION_SILENT_AUTH = "com.microsoft.identity.client.testapp.SILENT_AUTH"; @@ -68,7 +69,7 @@ public void onReceive(final Context context, final Intent intent) { final String scopes = intent.getStringExtra("scopes"); final String trimmedScopes = scopes == null ? null : scopes.trim(); final String scopeString = StringUtil.isNullOrEmpty(trimmedScopes) - ? "https://graph.microsoft.com/.default" + ? DEFAULT_SCOPE : trimmedScopes; Log.w(TAG, "Scopes: " + scopeString); @@ -156,7 +157,7 @@ private void doSilentAuth( final String scopeString, final PendingResult pendingResult) { - Log.i(TAG, "Calling acquireTokenSilent for account: " + account.getUsername()); + Log.i(TAG, "Calling acquireTokenSilent for selected account."); Log.i(TAG, "Authority: " + account.getAuthority()); final AcquireTokenSilentParameters parameters = new AcquireTokenSilentParameters.Builder() @@ -196,16 +197,10 @@ public void onCancel() { } private List parseScopes(final String scopeString) { - if (scopeString == null) { - return new ArrayList<>(); - } - - final String trimmedScopeString = scopeString.trim(); - if (trimmedScopeString.isEmpty()) { - return new ArrayList<>(); - } - - final String[] rawScopes = trimmedScopeString.split("\\s+"); + final String normalizedScopeString = StringUtil.isNullOrEmpty(scopeString) + ? DEFAULT_SCOPE + : scopeString.trim(); + final String[] rawScopes = normalizedScopeString.split("\\s+"); final List parsedScopes = new ArrayList<>(); for (final String scope : rawScopes) { From 2c6879c3473e3fdd62878f0d25b497ea78a8a538 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 May 2026 23:13:38 +0000 Subject: [PATCH 6/7] Simplify scope handling to single trim operation Agent-Logs-Url: https://github.com/AzureAD/microsoft-authentication-library-for-android/sessions/0e8621a1-0a3e-4157-b8ac-c8436b3d2a33 Co-authored-by: rpdome <19558668+rpdome@users.noreply.github.com> --- .../identity/client/testapp/SilentAuthReceiver.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java b/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java index f3b92d3254..ba6780daa4 100644 --- a/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java +++ b/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java @@ -67,10 +67,9 @@ public void onReceive(final Context context, final Intent intent) { Log.w(TAG, "=== SilentAuthReceiver triggered (PROCESS_STATE_RECEIVER) ==="); final String scopes = intent.getStringExtra("scopes"); - final String trimmedScopes = scopes == null ? null : scopes.trim(); - final String scopeString = StringUtil.isNullOrEmpty(trimmedScopes) + final String scopeString = (scopes == null || scopes.trim().isEmpty()) ? DEFAULT_SCOPE - : trimmedScopes; + : scopes.trim(); Log.w(TAG, "Scopes: " + scopeString); From b4b3fcc609300e1d7de0cc8de67032312f44aaa1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 May 2026 23:14:22 +0000 Subject: [PATCH 7/7] Adjust SilentAuthReceiver operational log levels Agent-Logs-Url: https://github.com/AzureAD/microsoft-authentication-library-for-android/sessions/cbdbc7c2-0ac5-48a5-9349-50239c795309 Co-authored-by: rpdome <19558668+rpdome@users.noreply.github.com> --- .../identity/client/testapp/SilentAuthReceiver.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java b/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java index ba6780daa4..5de898dcd1 100644 --- a/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java +++ b/testapps/testapp/src/main/java/com/microsoft/identity/client/testapp/SilentAuthReceiver.java @@ -64,14 +64,14 @@ public class SilentAuthReceiver extends BroadcastReceiver { @Override public void onReceive(final Context context, final Intent intent) { - Log.w(TAG, "=== SilentAuthReceiver triggered (PROCESS_STATE_RECEIVER) ==="); + Log.i(TAG, "=== SilentAuthReceiver triggered (PROCESS_STATE_RECEIVER) ==="); final String scopes = intent.getStringExtra("scopes"); final String scopeString = (scopes == null || scopes.trim().isEmpty()) ? DEFAULT_SCOPE : scopes.trim(); - Log.w(TAG, "Scopes: " + scopeString); + Log.i(TAG, "Scopes: " + scopeString); // Use goAsync() to extend the receiver's lifecycle beyond the 10s limit final PendingResult pendingResult = goAsync(); @@ -90,10 +90,10 @@ public void onCreated(final IPublicClientApplication application) { // have powerOptCheckEnabled set by OneAuth). application.getConfiguration().setPowerOptCheckEnabled(false); - Log.w(TAG, "PCA created, mode: " + + Log.i(TAG, "PCA created, mode: " + (application instanceof ISingleAccountPublicClientApplication ? "SingleAccount" : "MultipleAccount")); - Log.w(TAG, "powerOptCheckEnabled forced to: " + + Log.i(TAG, "powerOptCheckEnabled forced to: " + application.getConfiguration().isPowerOptCheckForEnabled()); loadAccountsAndAcquire(application, scopeString, pendingResult); } @@ -137,7 +137,7 @@ public void onTaskCompleted(final List result) { pendingResult.finish(); return; } - Log.w(TAG, "Found " + result.size() + " account(s). Using first."); + Log.i(TAG, "Found " + result.size() + " account(s). Using first."); doSilentAuth(app, result.get(0), scopeString, pendingResult); }