[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:
@@ -28,7 +28,6 @@ import androidx.annotation.VisibleForTesting;
|
||||
import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.SettingsPreferenceFragment;
|
||||
import com.android.settings.applications.AppInfoBase;
|
||||
import com.android.settings.applications.AppLocaleUtil;
|
||||
import com.android.settings.localepicker.AppLocalePickerActivity;
|
||||
|
||||
@@ -72,7 +71,6 @@ public class AppLocalePreferenceController extends AppInfoPreferenceControllerBa
|
||||
if (mParent != null) {
|
||||
Intent intent = new Intent(mContext, AppLocalePickerActivity.class);
|
||||
intent.setData(Uri.parse("package:" + mParent.getAppEntry().info.packageName));
|
||||
intent.putExtra(AppInfoBase.ARG_PACKAGE_UID, mParent.getAppEntry().info.uid);
|
||||
mContext.startActivity(intent);
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user