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

Commit 6749f7fd authored by Jordan Liu's avatar Jordan Liu Committed by Gerrit Code Review
Browse files

Merge "Move AppInfo mock to FakeContext"

parents bd26eb73 dbf2fdc3
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ import android.app.Notification;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.database.ContentObserver;
import android.net.Uri;
import android.os.HandlerThread;
@@ -104,8 +103,6 @@ public class CarrierServiceStateTrackerTest extends TelephonyTest {

        when(mPhone.getContext().getContentResolver()).thenReturn(mFakeContentResolver);

        doReturn(new ApplicationInfo()).when(mContext).getApplicationInfo();

        mNotificationManager = (NotificationManager) mContext.getSystemService(
                Context.NOTIFICATION_SERVICE);

+7 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
@@ -277,6 +278,11 @@ public class ContextFixture implements TestFixture<Context> {
            return mResources;
        }

        @Override
        public ApplicationInfo getApplicationInfo() {
            return mApplicationInfo;
        }

        @Override
        public String getOpPackageName() {
            return "com.android.internal.telephony";
@@ -526,6 +532,7 @@ public class ContextFixture implements TestFixture<Context> {
    // when(...) logic to be used to add specific little responses where needed.

    private final Resources mResources = mock(Resources.class);
    private final ApplicationInfo mApplicationInfo = mock(ApplicationInfo.class);
    private final PackageManager mPackageManager = mock(PackageManager.class);
    private final TelephonyManager mTelephonyManager = mock(TelephonyManager.class);
    private final DownloadManager mDownloadManager = mock(DownloadManager.class);