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

Commit b1bf9ab5 authored by Yuri Lin's avatar Yuri Lin
Browse files

For headless system, also include UID_HEADLESS in current UIDs.

Otherwise hasChannelsBypassingDnd will always be false because none of the channels created count for the "current" user.

Bug: 327482471
Test: PreferencesHelperTest on ABTD auto
Change-Id: I426ecabfc0743f9ae7b0909b43cc8ff43f8b503b
parent f37e3002
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -324,7 +324,11 @@ public class PreferencesHelperTest extends UiServiceTestCase {
        when(mPermissionHelper.getNotificationPermissionValues(USER_SYSTEM))
                .thenReturn(appPermissions);

        when(mUserProfiles.getCurrentProfileIds()).thenReturn(IntArray.wrap(new int[] {0}));
        IntArray currentProfileIds = IntArray.wrap(new int[]{0});
        if (UserManager.isHeadlessSystemUserMode()) {
            currentProfileIds.add(UserHandle.getUserId(UID_HEADLESS));
        }
        when(mUserProfiles.getCurrentProfileIds()).thenReturn(currentProfileIds);

        mHelper = new PreferencesHelper(getContext(), mPm, mHandler, mMockZenModeHelper,
                mPermissionHelper, mPermissionManager, mLogger, mAppOpsManager, mUserProfiles,