Don't show default payment component in search if Wallet role is enabled

Bug: 372254720
Test: atest PaymentSettingsTest
Flag: android.permission.flags.wallet_role_enabled
Change-Id: I4044d8fcd95db215d4a06b335b3cb96f8a5e3697
This commit is contained in:
James Willcox
2024-10-08 19:24:35 +00:00
parent aa7114cf3e
commit 1133353e5d
2 changed files with 25 additions and 1 deletions

View File

@@ -30,6 +30,7 @@ import androidx.annotation.VisibleForTesting;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
import com.android.internal.hidden_from_bootclasspath.android.permission.flags.Flags;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -120,6 +121,9 @@ public class PaymentSettings extends DashboardFragment {
@Override
protected boolean isPageSearchEnabled(Context context) {
if (Flags.walletRoleEnabled()) {
return false;
}
final UserManager userManager = context.getSystemService(UserManager.class);
final UserInfo myUserInfo = userManager.getUserInfo(UserHandle.myUserId());
if (myUserInfo.isGuest()) {