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
@Override
public boolean equals (Object o) {
- ServiceState s;
-
- try {
- s = (ServiceState) o;
- } catch (ClassCastException ex) {
- return false;
- }
-
- if (o == null) {
- return false;
- }
+ if (!(o instanceof ServiceState)) return false;
+ ServiceState s = (ServiceState) o;
return (mVoiceRegState == s.mVoiceRegState
&& mDataRegState == s.mDataRegState