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

Commit 7ee5f218 authored by Nathan Harold's avatar Nathan Harold
Browse files

Simplify equals() method of ServiceState

For whatever reason, ServiceState used a
somewhat-convoluted check for null and
class type. Updating to use a canonical
and brief approach.

Bug: 8675309
Test: compilation
Change-Id: I0d635067a06093affff478e13c28bbbe2bfda7df
parent b220fde2
Loading
Loading
Loading
Loading
+2 −11
Original line number Original line Diff line number Diff line
@@ -756,17 +756,8 @@ public class ServiceState implements Parcelable {


    @Override
    @Override
    public boolean equals (Object o) {
    public boolean equals (Object o) {
        ServiceState s;
        if (!(o instanceof ServiceState)) return false;

        ServiceState s = (ServiceState) o;
        try {
            s = (ServiceState) o;
        } catch (ClassCastException ex) {
            return false;
        }

        if (o == null) {
            return false;
        }


        return (mVoiceRegState == s.mVoiceRegState
        return (mVoiceRegState == s.mVoiceRegState
                && mDataRegState == s.mDataRegState
                && mDataRegState == s.mDataRegState