[Panlingual] Can't set per-app languages for apps on work profile page

Use startActivityAsUser instead of startActivity API to start the AppLocalePickerActivity of different users

Bug: 274378136
Test: 1. Perform AppLocalePickerActivityTest robolectric test
      2. Perform the manual test by switching different users
      3. Perform the manual test by switching different profiles
Change-Id: I4405b3b7e832b71b9ef66fa71d9e42ce12da167c
This commit is contained in:
Josh Hou
2023-03-21 10:49:35 +00:00
parent 36d78f8fe0
commit 38df174bba
5 changed files with 11 additions and 50 deletions

View File

@@ -709,8 +709,8 @@ public class ManageApplications extends InstrumentedFragment
case LIST_TYPE_APPS_LOCALE:
Intent intent = new Intent(getContext(), AppLocalePickerActivity.class);
intent.setData(Uri.parse("package:" + mCurrentPkgName));
intent.putExtra(AppInfoBase.ARG_PACKAGE_UID, mCurrentUid);
startActivity(intent);
getContext().startActivityAsUser(intent,
UserHandle.getUserHandleForUid(mCurrentUid));
break;
case LIST_TYPE_BATTERY_OPTIMIZATION:
AdvancedPowerUsageDetail.startBatteryDetailPage(