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

Commit 8a74e972 authored by d34d's avatar d34d Committed by Clark Scheff
Browse files

SysUI: Use Objects.equals() for comparing components

The current logic did not take into account when both objects are
null which causes an NPE.  Using Objects.equals() fixes this issue
and makes it much more readable.

Change-Id: I6b7a3986ddaa85246f906b5c30e2259dc5417915
TICKET: CYNGNOS-1595
parent 691a6189
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@ import cyanogenmod.externalviews.KeyguardExternalView;
import cyanogenmod.providers.CMSettings;

import java.util.List;
import java.util.Objects;

import org.cyanogenmod.internal.util.CmLockPatternUtils;

@@ -2688,9 +2689,7 @@ public class NotificationPanelView extends PanelView implements
    private void updateExternalKeyguardView() {
        ComponentName cn = mLockPatternUtils.getThirdPartyKeyguardComponent();
        // If mThirdPartyKeyguardViewComponent differs from cn, go ahead and update
        if ((cn == null && mThirdPartyKeyguardViewComponent != null) ||
                (cn != null && mThirdPartyKeyguardViewComponent == null) ||
                !mThirdPartyKeyguardViewComponent.equals(cn)) {
        if (!Objects.equals(mThirdPartyKeyguardViewComponent, cn)) {
            mThirdPartyKeyguardViewComponent = cn;
            if (mKeyguardExternalView != null) {
                if (indexOfChild(mKeyguardExternalView) >= 0) {