From 8519218a7384228ca79d985abbf969944d012ae8 Mon Sep 17 00:00:00 2001 From: arangelov Date: Wed, 13 May 2020 13:19:19 +0100 Subject: [PATCH] Initialize workProfileUserHandle before initial check for work tabs The shouldShowTabs() call checks for the existence of the work profile user, which is actually initialized after that call. Fixes: 156462936 Test: manual Test: atest ChooserActivityTest Test: atest ResolverActivityTest Change-Id: Iff840826f7b008420f1a254c1044c05c27764d0c --- core/java/com/android/internal/app/ResolverActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/com/android/internal/app/ResolverActivity.java b/core/java/com/android/internal/app/ResolverActivity.java index e95f99bb0429c..3084f2a84945f 100644 --- a/core/java/com/android/internal/app/ResolverActivity.java +++ b/core/java/com/android/internal/app/ResolverActivity.java @@ -358,6 +358,7 @@ public class ResolverActivity extends Activity implements : isHttpSchemeAndViewAction(getTargetIntent()); mSupportsAlwaysUseOption = supportsAlwaysUseOption; + mWorkProfileUserHandle = fetchWorkProfileUserProfile(); // The last argument of createResolverListAdapter is whether to do special handling // of the last used choice to highlight it in the list. We need to always @@ -366,7 +367,6 @@ public class ResolverActivity extends Activity implements // to handle. We also turn it off when the work tab is shown to simplify the UX. boolean filterLastUsed = mSupportsAlwaysUseOption && !isVoiceInteraction() && !shouldShowTabs(); - mWorkProfileUserHandle = fetchWorkProfileUserProfile(); mMultiProfilePagerAdapter = createMultiProfilePagerAdapter(initialIntents, rList, filterLastUsed); if (configureContentView()) { return;