Return my user id

Since the current context is the correct one, we can simply return
myUserId - just like for the managed profile.

Bug: 329784721
Test: manual
Change-Id: Ifbc13b0d87ba7b06c6d04c3442bbac0580c4cf3e
This commit is contained in:
Manish Singh
2024-03-15 12:25:51 +00:00
parent 7dee0538d6
commit 20b7cdcda8

View File

@@ -16,18 +16,14 @@
package com.android.settings.applications.credentials;
import android.os.UserHandle;
import android.os.UserManager;
import com.android.settings.Utils;
import com.android.settings.dashboard.profileselector.ProfileSelectFragment.ProfileType;
public class DefaultCombinedPickerPrivate extends DefaultCombinedPicker {
private static final String TAG = "DefaultCombinedPickerPrivate";
@Override
protected int getUser() {
UserManager userManager = getContext().getSystemService(UserManager.class);
return Utils.getCurrentUserIdOfType(userManager, ProfileType.PRIVATE);
return UserHandle.myUserId();
}
/** Returns whether the user is handled by this fragment. */