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

Commit 1b1125cd authored by Olivier Nshimiye's avatar Olivier Nshimiye Committed by Android (Google) Code Review
Browse files

Merge "Update UserIconInfo to include LauncherUserInfo configs" into main

parents 9676415a a614b9dc
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;
    }
}