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

Commit 8788b8f2 authored by Fengjiang Li's avatar Fengjiang Li
Browse files

Use UserHandle#hashCode() as default UserIconInfo#userSerial

Assiging 0 as default useSerial would cause different UserHandle overriding each other in cache, thus we should use some unique serial number.

It's observed that UserHandle#mUserHandle (returned by hashCode()) is always matching UserIconInfo#userSerial. So we should use UserHandle#hashCode() as the default serial number.

Bug: 340362067
Test: manual
Flag: NONE
Change-Id: I12696cd0ba8d46a115b7e086c6996ff7023179a2
parent 59ac9c8b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ public class UserIconInfo {
    public final long userSerial;

    public UserIconInfo(UserHandle user, @UserType int type) {
        this(user, type, 0);
        this(user, type, user != null ? user.hashCode() : 0);
    }

    public UserIconInfo(UserHandle user, @UserType int type, long userSerial) {