SettingsActivity: Get profile parent using UserManager.getProfileParent
In the headless system user mode(hsum) non-primary users can also have a profile. The existing implementation in SettingsActivity always gets the primary user as the profile parent, refactored the implementation to get profile parent using UserManager.getProfileParent. Test: NA Bug: 267162079 Change-Id: I2af581a4b7e3320f9351b862b7be3ef141b744b7
This commit is contained in:
@@ -466,7 +466,8 @@ public class SettingsActivity extends SettingsBaseActivity
|
|||||||
if (userInfo.isManagedProfile()) {
|
if (userInfo.isManagedProfile()) {
|
||||||
trampolineIntent.setClass(this, DeepLinkHomepageActivityInternal.class)
|
trampolineIntent.setClass(this, DeepLinkHomepageActivityInternal.class)
|
||||||
.putExtra(EXTRA_USER_HANDLE, getUser());
|
.putExtra(EXTRA_USER_HANDLE, getUser());
|
||||||
startActivityAsUser(trampolineIntent, um.getPrimaryUser().getUserHandle());
|
startActivityAsUser(trampolineIntent,
|
||||||
|
um.getProfileParent(userInfo.id).getUserHandle());
|
||||||
} else {
|
} else {
|
||||||
startActivity(trampolineIntent);
|
startActivity(trampolineIntent);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user