Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a614b9dc authored by Olivier Nshimiye's avatar Olivier Nshimiye
Browse files

Update UserIconInfo to include LauncherUserInfo configs

Flag: android.multiuser.add_launcher_user_config

Bug: 346553745
Test: Manual - verified on device

Change-Id: I930cb6bad55f698cd8ef28adc39e7b5cdd74aa58
parent a15c787b
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static com.android.launcher3.icons.BitmapInfo.FLAG_CLONE;
import static com.android.launcher3.icons.BitmapInfo.FLAG_PRIVATE;
import static com.android.launcher3.icons.BitmapInfo.FLAG_WORK;

import android.os.Bundle;
import android.os.UserHandle;

import androidx.annotation.IntDef;
@@ -46,6 +47,8 @@ public class UserIconInfo {

    public final long userSerial;

    private final Bundle mUserConfig;

    public UserIconInfo(UserHandle user, @UserType int type) {
        this(user, type, user != null ? user.hashCode() : 0);
    }
@@ -54,6 +57,15 @@ public class UserIconInfo {
        this.user = user;
        this.type = type;
        this.userSerial = userSerial;
        this.mUserConfig = Bundle.EMPTY;
    }

    public UserIconInfo(UserHandle user, @UserType int type, long userSerial,
            @NonNull Bundle userConfig) {
        this.user = user;
        this.type = type;
        this.userSerial = userSerial;
        this.mUserConfig = userConfig;
    }

    public boolean isMain() {
@@ -78,4 +90,13 @@ public class UserIconInfo {
                .setFlag(FLAG_CLONE, isCloned())
                .setFlag(FLAG_PRIVATE, isPrivate());
    }

    /**
     * Returns additional configs for the user, e.g., whether to hide the private space entrypoint
     * when locked.
     */
    @NonNull
    public Bundle getUserConfig() {
        return mUserConfig;
    }
}