[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: I0dfc40b29a7a35f18f6bcffd22fb421c6ad9c230
Merged-In: I4405b3b7e832b71b9ef66fa71d9e42ce12da167c
This commit is contained in:
Josh Hou
2023-03-21 09:59:11 +00:00
parent d911a095eb
commit 7076cbc015
4 changed files with 10 additions and 49 deletions

View File

@@ -654,8 +654,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(