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

Commit b3bd1fb4 authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Fix an assert in TelephonyRegistryTest.

Test: atest TelephonyRegistryTest
Bug: 184067889
Change-Id: I8502025d28f786ac4d1cc80d8850f1e02c603ae5
parent 76bab013
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -638,7 +638,7 @@ public class TelephonyRegistryTest extends TelephonyTest {
                .queryLocalInterface(anyString());
                .queryLocalInterface(anyString());


        UserInfo userInfo = new UserInfo(UserHandle.myUserId(), "" /* name */, 0 /* flags */);
        UserInfo userInfo = new UserInfo(UserHandle.myUserId(), "" /* name */, 0 /* flags */);
        doReturn(userInfo).when(mIActivityManager).getCurrentUser();
        doReturn(userInfo.id).when(mIActivityManager).getCurrentUserId();


        doReturn(true).when(mLocationManager).isLocationEnabledForUser(any(UserHandle.class));
        doReturn(true).when(mLocationManager).isLocationEnabledForUser(any(UserHandle.class));


@@ -662,6 +662,7 @@ public class TelephonyRegistryTest extends TelephonyTest {
        // Broadcast ACTION_USER_SWITCHED for the current user Id + 1. Callback shouldn't be
        // Broadcast ACTION_USER_SWITCHED for the current user Id + 1. Callback shouldn't be
        // triggered.
        // triggered.
        userInfo.id++;
        userInfo.id++;
        doReturn(userInfo.id).when(mIActivityManager).getCurrentUserId();
        mCellLocation = null;
        mCellLocation = null;
        mContext.sendBroadcast(new Intent(Intent.ACTION_USER_SWITCHED));
        mContext.sendBroadcast(new Intent(Intent.ACTION_USER_SWITCHED));