Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a66c513 authored by Achim Thesmann's avatar Achim Thesmann
Browse files

Grant BAL permission by AutofillManager

Starting with Android 15 apps need to opt in to grant BAL privileges.
android.autofillservice.cts.dropdown.LoginActivityTest#testClickCustomButton, android.autofillservice.cts.inline.InlineLoginActivityTest#testLongClickAttribution and android.autofillservice.cts.inline.InlineLoginActivityTest#testLongClickEventPassToIme are some of the tests we identified to fail if left unchanged.

Test: atest android.autofillservice.cts.dropdown.LoginActivityTest#testClickCustomButton android.autofillservice.cts.inline.InlineLoginActivityTest#testLongClickAttribution android.autofillservice.cts.inline.InlineLoginActivityTest#testLongClickEventPassToIme
Bug: 314033453
Change-Id: I4dfbd19674a840e1cc0d203cee3f762b1dde3b2b
parent fce39f14
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.annotation.RequiresFeature;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.TestApi;
import android.app.ActivityOptions;
import android.app.assist.AssistStructure.ViewNode;
import android.app.assist.AssistStructure.ViewNodeBuilder;
import android.app.assist.AssistStructure.ViewNodeParcelable;
@@ -4370,7 +4371,11 @@ public final class AutofillManager {
            if (afm != null) {
                afm.post(() -> {
                    try {
                        afm.mContext.startIntentSender(intentSender, intent, 0, 0, 0);
                        Bundle options = ActivityOptions.makeBasic()
                                .setPendingIntentBackgroundActivityStartMode(
                                        ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED)
                                .toBundle();
                        afm.mContext.startIntentSender(intentSender, intent, 0, 0, 0, options);
                    } catch (IntentSender.SendIntentException e) {
                        Log.e(TAG, "startIntentSender() failed for intent:" + intentSender, e);
                    }