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

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

Update managed services tests that were broken on HSUM

The setup assumes that 10 != mUserId, which maybe was the case for non-HSUM setups (hence the test passing locally) but was not the case in an HSUM environment.

Fixes: 414941297
Test: presubmit, atest rerun of failing tests with hsum configuration
Flag: EXEMPT test fix only
Change-Id: I52210061ea7687330b11407770dbea2ec283f1a2
parent 7cfbf1fd
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -6855,7 +6855,8 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
        UserInfo ui = new UserInfo(10, "Clone", UserInfo.FLAG_PROFILE);
        ui.userType = USER_TYPE_PROFILE_CLONE;
        when(mUmInternal.getUserInfo(10)).thenReturn(ui);
        when(mUmInternal.getProfileParentId(10)).thenReturn(mUserId);
        // the parent ID needs to be different from the profile ID to identify it as a profile
        when(mUmInternal.getProfileParentId(10)).thenReturn(11);
        mService.readPolicyXml(
                new BufferedInputStream(new ByteArrayInputStream(policyXml.getBytes())),
                true,
@@ -6882,7 +6883,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
        UserInfo ui = new UserInfo(10, "Work", UserInfo.FLAG_PROFILE);
        ui.userType = USER_TYPE_PROFILE_MANAGED;
        when(mUmInternal.getUserInfo(10)).thenReturn(ui);
        when(mUmInternal.getProfileParentId(10)).thenReturn(mUserId);
        when(mUmInternal.getProfileParentId(10)).thenReturn(11);
        mService.readPolicyXml(
                new BufferedInputStream(new ByteArrayInputStream(policyXml.getBytes())),
                true,
@@ -6911,7 +6912,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
        UserInfo ui = new UserInfo(10, "Private", UserInfo.FLAG_PROFILE);
        ui.userType = USER_TYPE_PROFILE_PRIVATE;
        when(mUmInternal.getUserInfo(10)).thenReturn(ui);
        when(mUmInternal.getProfileParentId(10)).thenReturn(mUserId);
        when(mUmInternal.getProfileParentId(10)).thenReturn(11);
        mService.readPolicyXml(
                new BufferedInputStream(new ByteArrayInputStream(policyXml.getBytes())),
                true,