From b3b1a5c40a76de713b1d4d7163aadfa08a1f8da8 Mon Sep 17 00:00:00 2001 From: Paul Chang Date: Fri, 17 Jan 2020 22:18:25 +0800 Subject: [PATCH] Fix incorrect sub text on Bug report handler settings launched by a work profile app. Bug: 147257237 Test: Flash device and check the sub text Change-Id: I2ea728c82502d3c91fa7262f353da6f98911adce --- .../settings/bugreporthandler/BugReportHandlerPicker.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/bugreporthandler/BugReportHandlerPicker.java b/src/com/android/settings/bugreporthandler/BugReportHandlerPicker.java index e7adf7f2a49..919e29b508d 100644 --- a/src/com/android/settings/bugreporthandler/BugReportHandlerPicker.java +++ b/src/com/android/settings/bugreporthandler/BugReportHandlerPicker.java @@ -25,6 +25,7 @@ import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageItemInfo; import android.content.pm.PackageManager; +import android.content.pm.UserInfo; import android.os.UserHandle; import android.util.Log; import android.util.Pair; @@ -169,8 +170,8 @@ public class BugReportHandlerPicker extends DefaultAppPickerFragment { if (BugReportHandlerUtil.SHELL_APP_PACKAGE.equals(handlerApp)) { return context.getString(R.string.system_default_app_subtext); } - final UserHandle managedProfile = Utils.getManagedProfile(mUserManager); - if (managedProfile != null && managedProfile.getIdentifier() == handlerUser) { + final UserInfo userInfo = mUserManager.getUserInfo(handlerUser); + if (userInfo != null && userInfo.isManagedProfile()) { return context.getString(R.string.work_profile_app_subtext); } return context.getString(R.string.personal_profile_app_subtext);