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

Commit 0c189eaf authored by Chandru's avatar Chandru
Browse files

Remove unimplemented callback of KUMCallback

onKeyguardOccludedChanged is not implemented by any subclasses.
onUserInfoChanged has only one implementation and that is a noop.

Bug: 238187419
Test: atest KeyguardUpdateMonitorTest passes
Test: atest StatusBarKeyguardViewManagerTest passes
Change-Id: I75dc36c1e1cbc751af71feb28de5c935e94dded4
parent ad1cf3ab
Loading
Loading
Loading
Loading
+0 −33
Original line number Diff line number Diff line
@@ -165,7 +165,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
    private static final int MSG_USER_SWITCHING = 310;
    private static final int MSG_KEYGUARD_RESET = 312;
    private static final int MSG_USER_SWITCH_COMPLETE = 314;
    private static final int MSG_USER_INFO_CHANGED = 317;
    private static final int MSG_REPORT_EMERGENCY_CALL_ACTION = 318;
    private static final int MSG_STARTED_WAKING_UP = 319;
    private static final int MSG_FINISHED_GOING_TO_SLEEP = 320;
@@ -1456,9 +1455,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
            final String action = intent.getAction();
            if (AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED.equals(action)) {
                mHandler.sendEmptyMessage(MSG_TIME_UPDATE);
            } else if (Intent.ACTION_USER_INFO_CHANGED.equals(action)) {
                mHandler.sendMessage(mHandler.obtainMessage(MSG_USER_INFO_CHANGED,
                        intent.getIntExtra(Intent.EXTRA_USER_HANDLE, getSendingUserId()), 0));
            } else if (ACTION_FACE_UNLOCK_STARTED.equals(action)) {
                Trace.beginSection(
                        "KeyguardUpdateMonitor.mBroadcastAllReceiver#onReceive "
@@ -1815,16 +1811,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        }
    }

    private void handleUserInfoChanged(int userId) {
        Assert.isMainThread();
        for (int i = 0; i < mCallbacks.size(); i++) {
            KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
            if (cb != null) {
                cb.onUserInfoChanged(userId);
            }
        }
    }

    private void handleUserUnlocked(int userId) {
        Assert.isMainThread();
        mUserIsUnlocked.put(userId, true);
@@ -1942,9 +1928,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
                    case MSG_KEYGUARD_BOUNCER_CHANGED:
                        handleKeyguardBouncerChanged(msg.arg1, msg.arg2);
                        break;
                    case MSG_USER_INFO_CHANGED:
                        handleUserInfoChanged(msg.arg1);
                        break;
                    case MSG_REPORT_EMERGENCY_CALL_ACTION:
                        handleReportEmergencyCallAction();
                        break;
@@ -2055,7 +2038,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        });

        final IntentFilter allUserFilter = new IntentFilter();
        allUserFilter.addAction(Intent.ACTION_USER_INFO_CHANGED);
        allUserFilter.addAction(AlarmManager.ACTION_NEXT_ALARM_CLOCK_CHANGED);
        allUserFilter.addAction(ACTION_FACE_UNLOCK_STARTED);
        allUserFilter.addAction(ACTION_FACE_UNLOCK_STOPPED);
@@ -3168,20 +3150,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        updateBiometricListeningState(BIOMETRIC_ACTION_UPDATE);
    }

    /** Notifies that the occluded state changed. */
    public void onKeyguardOccludedChanged(boolean occluded) {
        Assert.isMainThread();
        if (DEBUG) {
            Log.d(TAG, "onKeyguardOccludedChanged(" + occluded + ")");
        }
        for (int i = 0; i < mCallbacks.size(); i++) {
            KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
            if (cb != null) {
                cb.onKeyguardOccludedChanged(occluded);
            }
        }
    }

    /**
     * Handle {@link #MSG_KEYGUARD_RESET}
     */
@@ -3403,7 +3371,6 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
        callback.onPhoneStateChanged(mPhoneState);
        callback.onRefreshCarrierInfo();
        callback.onClockVisibilityChanged();
        callback.onKeyguardOccludedChanged(mKeyguardOccluded);
        callback.onKeyguardVisibilityChangedRaw(mKeyguardIsVisible);
        callback.onTelephonyCapable(mTelephonyCapable);

+0 −11
Original line number Diff line number Diff line
@@ -80,12 +80,6 @@ public class KeyguardUpdateMonitorCallback {
     */
    public void onKeyguardVisibilityChanged(boolean showing) { }

    /**
     * Called when the keyguard occluded state changes.
     * @param occluded Indicates if the keyguard is now occluded.
     */
    public void onKeyguardOccludedChanged(boolean occluded) { }

    public void onKeyguardVisibilityChangedRaw(boolean showing) {
        final long now = SystemClock.elapsedRealtime();
        if (showing == mShowing
@@ -150,11 +144,6 @@ public class KeyguardUpdateMonitorCallback {
     */
    public void onSimStateChanged(int subId, int slotId, int simState) { }

    /**
     * Called when the user's info changed.
     */
    public void onUserInfoChanged(int userId) { }

    /**
     * Called when a user got unlocked.
     */
+0 −4
Original line number Diff line number Diff line
@@ -555,10 +555,6 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable,
            }
        }

        @Override
        public void onUserInfoChanged(int userId) {
        }

        @Override
        public void onClockVisibilityChanged() {
            adjustStatusBarLocked();
+0 −6
Original line number Diff line number Diff line
@@ -1041,7 +1041,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
        }

        if (occluded != mLastOccluded || mFirstUpdate) {
            mKeyguardUpdateManager.onKeyguardOccludedChanged(occluded);
            mKeyguardStateController.notifyKeyguardState(showing, occluded);
        }
        if ((showing && !occluded) != (mLastShowing && !mLastOccluded) || mFirstUpdate) {
@@ -1070,11 +1069,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
        mCentralSurfaces.onKeyguardViewManagerStatesUpdated();
    }

    private View getCurrentNavBarView() {
        final NavigationBarView navBarView = mCentralSurfaces.getNavigationBarView();
        return navBarView != null ? navBarView.getCurrentView() : null;
    }

    /**
     * Updates the visibility of the nav bar window (which will cause insets changes).
     */
+0 −5
Original line number Diff line number Diff line
@@ -275,21 +275,18 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {

        // Should be false to start, so no invocations
        mStatusBarKeyguardViewManager.setOccluded(false /* occluded */, false /* animated */);
        verify(mKeyguardUpdateMonitor, never()).onKeyguardOccludedChanged(anyBoolean());
        verify(mKeyguardStateController, never()).notifyKeyguardState(anyBoolean(), anyBoolean());

        clearInvocations(mKeyguardUpdateMonitor);
        clearInvocations(mKeyguardStateController);

        mStatusBarKeyguardViewManager.setOccluded(true /* occluded */, false /* animated */);
        verify(mKeyguardUpdateMonitor).onKeyguardOccludedChanged(true);
        verify(mKeyguardStateController).notifyKeyguardState(true, true);

        clearInvocations(mKeyguardUpdateMonitor);
        clearInvocations(mKeyguardStateController);

        mStatusBarKeyguardViewManager.setOccluded(true /* occluded */, false /* animated */);
        verify(mKeyguardUpdateMonitor, never()).onKeyguardOccludedChanged(anyBoolean());
        verify(mKeyguardStateController, never()).notifyKeyguardState(anyBoolean(), anyBoolean());
    }

@@ -299,7 +296,6 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
        mStatusBarKeyguardViewManager.show(null);

        mStatusBarKeyguardViewManager.setOccluded(true /* occluded */, false /* animated */);
        verify(mKeyguardUpdateMonitor).onKeyguardOccludedChanged(true);
        verify(mKeyguardStateController).notifyKeyguardState(true, true);
    }

@@ -309,7 +305,6 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase {
        mStatusBarKeyguardViewManager.show(null);

        mStatusBarKeyguardViewManager.setOccluded(true /* occluded */, false /* animated */);
        verify(mKeyguardUpdateMonitor).onKeyguardOccludedChanged(true);
        verify(mKeyguardStateController).notifyKeyguardState(true, true);
    }