Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions msal/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,33 @@
android:name="com.microsoft.identity.common.internal.providers.oauth2.AuthorizationActivity"
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|keyboard"
android:exported="false"
android:launchMode="singleTask" />
android:launchMode="singleTask"
android:theme="@style/MsalRedirectActivity" />

<activity
android:name="com.microsoft.identity.common.internal.providers.oauth2.CurrentTaskAuthorizationActivity"
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout|keyboard"
android:exported="false"
android:launchMode="standard" />
android:launchMode="standard"
android:theme="@style/MsalRedirectActivity" />

<!-- Helper activity for displaying current broker redirect URI configuration -->
<activity
android:name="com.microsoft.identity.client.helper.BrokerHelperActivity"
android:exported="false"
android:launchMode="standard" />
android:launchMode="standard"
android:theme="@style/MsalRedirectActivity" />

<!-- MSAL will use system webview (custom tab) to render the sign-in page, BrowserTabActivity is to get response back from System Webview. Multiple apps on the device could integrate MSAL, OS will check which BrowserTabActivity can handle the intent based on the intent filter declared, so this activity has to be exported.-->
<activity
android:name="com.microsoft.identity.client.BrowserTabActivity"
android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|screenLayout"
android:exported="true" />
android:exported="true"
android:theme="@style/MsalRedirectActivity" />

<activity
android:name="com.microsoft.identity.client.CurrentTaskBrowserTabActivity"
android:exported="true" />
android:exported="true"
android:theme="@style/MsalRedirectActivity" />
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import android.os.Bundle;
import android.widget.Toast;

import androidx.core.view.WindowCompat;

import com.microsoft.identity.common.internal.providers.oauth2.BrowserAuthorizationFragment;
import com.microsoft.identity.common.internal.util.StringUtil;
import com.microsoft.identity.common.logging.Logger;
Expand Down Expand Up @@ -60,6 +62,11 @@ public final class BrowserTabActivity extends Activity {
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Opt out of edge-to-edge display for compatibility with androidx.activity:activity:1.12.0+
// This prevents blank WebView rendering when user's activity extends ComponentActivity
// with automatic edge-to-edge enforcement
WindowCompat.setDecorFitsSystemWindows(getWindow(), true);

final String methodTag = TAG + ":onCreate";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
import android.os.Bundle;
import android.widget.Toast;

import androidx.core.view.WindowCompat;

import com.microsoft.identity.common.internal.providers.oauth2.CurrentTaskBrowserAuthorizationFragment;
import com.microsoft.identity.common.internal.util.StringUtil;
import com.microsoft.identity.common.logging.Logger;
Expand Down Expand Up @@ -77,6 +79,11 @@ public final class CurrentTaskBrowserTabActivity extends Activity {
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Opt out of edge-to-edge display for compatibility with androidx.activity:activity:1.12.0+
// This prevents blank WebView rendering when user's activity extends ComponentActivity
// with automatic edge-to-edge enforcement
WindowCompat.setDecorFitsSystemWindows(getWindow(), true);

final String methodTag = TAG + ":onCreate";
final String response = getIntent().getDataString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.core.view.WindowCompat;

import com.microsoft.identity.common.adal.internal.AuthenticationConstants;
import com.microsoft.identity.common.internal.broker.PackageHelper;
Expand Down Expand Up @@ -45,6 +46,12 @@ public static Intent createStartIntent(final Context context) {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

// Opt out of edge-to-edge display for compatibility with androidx.activity:activity:1.12.0+
// This prevents blank WebView rendering when user's activity extends ComponentActivity
// with automatic edge-to-edge enforcement
WindowCompat.setDecorFitsSystemWindows(getWindow(), true);

setContentView(R.layout.broker_helper);

mPackageName = findViewById(R.id.txtPackageName);
Expand Down
21 changes: 21 additions & 0 deletions msal/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--
Theme for MSAL redirect handling activities that should not use edge-to-edge display.
These activities are temporary redirect handlers and don't need edge-to-edge layouts.

The windowOptOutEdgeToEdgeEnforcement attribute opts out of edge-to-edge enforcement
on Android 15 (API 35). This is needed because:
- androidx.activity:activity:1.12.0+ enforces edge-to-edge automatically
- Android 15+ enforces edge-to-edge for apps targeting SDK 35+
- WebView content in redirect activities can render blank when edge-to-edge is active

Note: This opt-out is temporary and will be removed in Android 16. Activities also
programmatically set WindowCompat.setDecorFitsSystemWindows(window, true) for forward
compatibility.
-->
<style name="MsalRedirectActivity" parent="@android:style/Theme.Translucent.NoTitleBar">
<!-- Opt out of edge-to-edge enforcement for Android 15 (API 35) -->
<item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
</style>
</resources>
Loading