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

Commit 80e5830e authored by Danning Chen's avatar Danning Chen
Browse files

Fix the SecurityException in PeopleServiceTest

Test: atest FrameworksServicesTests:PeopleServiceTest
Bug: 174044734

Change-Id: I1ece77b363dae0a81687eff20e43a51918956d5a
parent 66b1bf46
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -74,7 +74,14 @@ public class PeopleService extends SystemService {

    @Override
    public void onStart() {
        onStart(/* isForTesting= */ false);
    }

    @VisibleForTesting
    protected void onStart(boolean isForTesting) {
        if (!isForTesting) {
            publishBinderService(Context.PEOPLE_SERVICE, mService);
        }
        publishLocalService(PeopleServiceInternal.class, new LocalService());
    }

+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ public final class PeopleServiceTest {
        when(mCallback.asBinder()).thenReturn(new Binder());

        PeopleService service = new PeopleService(mContext);
        service.onStart();
        service.onStart(/* isForTesting= */ true);

        mServiceInternal = LocalServices.getService(PeopleServiceInternal.class);
        mLocalService = (PeopleService.LocalService) mServiceInternal;