Fix enterprise settings bug
This fixes a bug where the picker is not using the correct user id and also ensures that the settings activity uses the correct user when launched. Test: flash & test w/ work profile Bug 322071206 Change-Id: I846593ff9ae320d9bb774e3e79ed9ef41f101ff5
This commit is contained in:
@@ -19,13 +19,16 @@ package com.android.settings.applications.credentials;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
|
||||
import com.android.settings.Utils;
|
||||
|
||||
public class DefaultCombinedPickerWork extends DefaultCombinedPicker {
|
||||
private static final String TAG = "DefaultCombinedPickerWork";
|
||||
|
||||
@Override
|
||||
protected int getUser() {
|
||||
UserHandle workProfile = Utils.getManagedProfile(UserManager.get(getContext()));
|
||||
return workProfile.getIdentifier();
|
||||
return UserHandle.myUserId();
|
||||
}
|
||||
|
||||
/** Returns whether the user is handled by this fragment. */
|
||||
public static boolean isUserHandledByFragment(UserManager userManager, int userId) {
|
||||
return userManager.isManagedProfile(userId);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user