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

Commit 28727fe1 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Revert "Add test mock for PermissionCheckerManager"" into sc-dev

parents f56a92a3 2d13069b
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.IBluetoothCallback;
import android.content.AttributionSource;
import android.content.AttributionSourceState;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
@@ -97,7 +96,6 @@ public class AdapterServiceTest {
    private @Mock Binder mBinder;
    private @Mock AudioManager mAudioManager;
    private @Mock android.app.Application mApplication;
    private @Mock PermissionCheckerManager mMockPermissionCheckerManager;

    private static final int CONTEXT_SWITCH_MS = 100;
    private static final int PROFILE_SERVICE_TOGGLE_TIME_MS = 200;
@@ -205,14 +203,6 @@ public class AdapterServiceTest {
        // Wait for any async events to drain
        InstrumentationRegistry.getInstrumentation().waitForIdleSync();

        doReturn(Context.PERMISSION_CHECKER_SERVICE).when(mMockContext)
                .getSystemServiceName(PermissionCheckerManager.class);
        when(mMockContext.getSystemService(Context.PERMISSION_CHECKER_SERVICE))
                .thenReturn(mMockPermissionCheckerManager);
        when(mMockPermissionCheckerManager.checkPermission(anyString(),
                any(AttributionSourceState.class),
                anyString(), anyBoolean(), anyBoolean(),
                anyBoolean(), anyInt())).thenReturn(PackageManager.PERMISSION_GRANTED);
        mServiceBinder.registerCallback(mIBluetoothCallback, mAttributionSource);

        Config.init(mMockContext);