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

Commit a6dfaed5 authored by Fengjiang Li's avatar Fengjiang Li Committed by Kevin Lim
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: b/327705448
Bug: 340362067
Test: manual
Flag: NONE
Change-Id: I12696cd0ba8d46a115b7e086c6996ff7023179a2
parent b4914333
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) {