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

Commit ee848efa authored by Clark Scheff's avatar Clark Scheff Committed by Gerrit Code Review
Browse files

Themes: Handle null request types in ThemeConfig

1) Just use == for comparison instead of .equals()
2) Check for null when computing hashCode

Change-Id: I2edebc9f0224fe3dc0073866d6860afe252b8d71
parent 1c7c0287
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ public class ThemeConfig implements Cloneable, Parcelable, Comparable<ThemeConfi
                    new HashMap<String, AppTheme>() : o.mThemes;

            return (currThemes.equals(newThemes) &&
                    mLastThemeChangeRequestType.equals(o.mLastThemeChangeRequestType));
                    mLastThemeChangeRequestType == o.mLastThemeChangeRequestType);
        }
        return false;
    }
@@ -159,7 +159,8 @@ public class ThemeConfig implements Cloneable, Parcelable, Comparable<ThemeConfi
    public int hashCode() {
        int hash = 17;
        hash = 31 * hash + mThemes.hashCode();
        hash = 31 * hash + mLastThemeChangeRequestType.ordinal();
        hash = 31 * hash + (mLastThemeChangeRequestType == null ? 0 :
               mLastThemeChangeRequestType.ordinal());
        return hash;
    }