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

Commit 4cb0ecc0 authored by Elliot Sisteron's avatar Elliot Sisteron Committed by Android (Google) Code Review
Browse files

Merge "Respond with null data when no screen lock." into main

parents 3cab6d2e cea9ff38
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -63,6 +63,12 @@ public final class LockScreenSafetySource {
        }

        if (!screenLockPreferenceDetailsUtils.isAvailable()) {
            SafetyCenterManagerWrapper.get().setSafetySourceData(
                    context,
                    SAFETY_SOURCE_ID,
                    /* safetySourceData= */ null,
                    safetyEvent
            );
            return;
        }

+3 −3
Original line number Diff line number Diff line
@@ -102,15 +102,15 @@ public class LockScreenSafetySourceTest {
    }

    @Test
    public void setSafetySourceData_whenScreenLockIsDisabled_doesNotSetData() {
    public void setSafetySourceData_whenScreenLockIsDisabled_setsNullData() {
        when(mSafetyCenterManagerWrapper.isEnabled(mApplicationContext)).thenReturn(true);
        when(mScreenLockPreferenceDetailsUtils.isAvailable()).thenReturn(false);

        LockScreenSafetySource.setSafetySourceData(mApplicationContext,
                mScreenLockPreferenceDetailsUtils, EVENT_SOURCE_STATE_CHANGED);

        verify(mSafetyCenterManagerWrapper, never()).setSafetySourceData(
                any(), any(), any(), any());
        verify(mSafetyCenterManagerWrapper).setSafetySourceData(
                any(), eq(LockScreenSafetySource.SAFETY_SOURCE_ID), eq(null), any());
    }

    @Test