Home
last modified time | relevance | path

Searched refs:mContextSpy (Results 1 – 25 of 25) sorted by relevance

/frameworks/base/services/tests/servicestests/src/com/android/server/hdmi/
DArcTerminationActionFromAvrTest.java55 private Context mContextSpy; field in ArcTerminationActionFromAvrTest
72 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext())); in setUp()
74 when(mContextSpy.getSystemService(Context.POWER_SERVICE)).thenAnswer(i -> in setUp()
75 new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
77 when(mContextSpy.getSystemService(PowerManager.class)).thenAnswer(i -> in setUp()
78 new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
83 new HdmiControlService(mContextSpy) { in setUp()
90 return new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
121 hdmiControlService.setHdmiCecConfig(new FakeHdmiCecConfig(mContextSpy)); in setUp()
DActiveSourceActionTest.java54 private Context mContextSpy; field in ActiveSourceActionTest
69 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext())); in setUp()
71 when(mContextSpy.getSystemService(Context.POWER_SERVICE)).thenAnswer(i -> in setUp()
72 new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
74 when(mContextSpy.getSystemService(PowerManager.class)).thenAnswer(i -> in setUp()
75 new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
79 mHdmiControlService = new HdmiControlService(mContextSpy) { in setUp()
102 return new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
114 mHdmiControlService.setHdmiCecConfig(new FakeHdmiCecConfig(mContextSpy)); in setUp()
DArcInitiationActionFromAvrTest.java55 private Context mContextSpy; field in ArcInitiationActionFromAvrTest
71 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext())); in setUp()
73 when(mContextSpy.getSystemService(Context.POWER_SERVICE)).thenAnswer(i -> in setUp()
74 new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
76 when(mContextSpy.getSystemService(PowerManager.class)).thenAnswer(i -> in setUp()
77 new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
82 new HdmiControlService(mContextSpy) { in setUp()
94 return new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
127 hdmiControlService.setHdmiCecConfig(new FakeHdmiCecConfig(mContextSpy)); in setUp()
DPowerStatusMonitorActionTest.java61 private Context mContextSpy; field in PowerStatusMonitorActionTest
79 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext())); in setUp()
81 when(mContextSpy.getSystemService(Context.POWER_SERVICE)).thenAnswer(i -> in setUp()
82 new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
84 when(mContextSpy.getSystemService(PowerManager.class)).thenAnswer(i -> in setUp()
85 new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
89 mHdmiControlService = new HdmiControlService(mContextSpy, in setUp()
113 return new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
125 mHdmiControlService.setHdmiCecConfig(new FakeHdmiCecConfig(mContextSpy)); in setUp()
DDevicePowerStatusActionTest.java62 private Context mContextSpy; field in DevicePowerStatusActionTest
81 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext())); in setUp()
83 when(mContextSpy.getSystemService(Context.POWER_SERVICE)).thenAnswer(i -> in setUp()
84 new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
86 when(mContextSpy.getSystemService(PowerManager.class)).thenAnswer(i -> in setUp()
87 new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
91 mHdmiControlService = new HdmiControlService(mContextSpy) { in setUp()
114 return new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
126 mHdmiControlService.setHdmiCecConfig(new FakeHdmiCecConfig(mContextSpy)); in setUp()
DSystemAudioAutoInitiationActionTest.java59 private Context mContextSpy; field in SystemAudioAutoInitiationActionTest
78 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext())); in setUp()
81 when(mContextSpy.getSystemService(Context.POWER_SERVICE)).thenAnswer(i -> in setUp()
82 new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
84 when(mContextSpy.getSystemService(PowerManager.class)).thenAnswer(i -> in setUp()
85 new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
89 mHdmiControlService = new HdmiControlService(mContextSpy) { in setUp()
112 return new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
DHdmiCecAtomLoggingTest.java80 private Context mContextSpy; field in HdmiCecAtomLoggingTest
97 mContextSpy = spy(new ContextWrapper( in setUp()
101 when(mContextSpy.getSystemService(Context.POWER_SERVICE)).thenAnswer(i -> in setUp()
102 new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
106 mHdmiControlServiceSpy = spy(new HdmiControlService(mContextSpy)); in setUp()
111 HdmiCecConfig hdmiCecConfig = new FakeHdmiCecConfig(mContextSpy); in setUp()
DOneTouchPlayActionTest.java69 private Context mContextSpy; field in OneTouchPlayActionTest
91 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext())); in setUp()
92 mHdmiCecConfig = new FakeHdmiCecConfig(mContextSpy); in setUp()
96 when(mContextSpy.getSystemService(Context.POWER_SERVICE)).thenAnswer(i -> in setUp()
97 new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
99 when(mContextSpy.getSystemService(PowerManager.class)).thenAnswer(i -> in setUp()
100 new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
104 mHdmiControlService = new HdmiControlService(mContextSpy, Collections.emptyList()) { in setUp()
127 return new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
DHdmiControlServiceTest.java178 private Context mContextSpy; field in HdmiControlServiceTest
196 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext())); in setUp()
198 when(mContextSpy.getSystemService(Context.POWER_SERVICE)).thenAnswer(i -> in setUp()
199 new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
201 when(mContextSpy.getSystemService(PowerManager.class)).thenAnswer(i -> in setUp()
202 new PowerManager(mContextSpy, mIPowerManagerMock, in setUp()
206 HdmiCecConfig hdmiCecConfig = new FakeHdmiCecConfig(mContextSpy); in setUp()
208 mHdmiControlServiceSpy = spy(new HdmiControlService(mContextSpy)); in setUp()
/frameworks/base/services/tests/servicestests/src/com/android/server/power/
DNotifierTest.java78 private Context mContextSpy; field in NotifierTest
90 mContextSpy = spy(new TestableContext(InstrumentationRegistry.getContext())); in setUp()
91 mResourcesSpy = spy(mContextSpy.getResources()); in setUp()
92 when(mContextSpy.getResources()).thenReturn(mResourcesSpy); in setUp()
94 when(mContextSpy.getSystemService(Vibrator.class)).thenReturn(mVibrator); in setUp()
96 mService = new PowerManagerService(mContextSpy, mInjector); in setUp()
270 mContextSpy.getContentResolver(), in enableChargingFeedback()
277 mContextSpy.getContentResolver(), in enableChargingFeedback()
287 mContextSpy.getContentResolver(), in enableChargingVibration()
296 mContextSpy, in createNotifier()
DPowerManagerServiceTest.java143 private ContextWrapper mContextSpy; field in PowerManagerServiceTest
198 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp()
199 mResourcesSpy = spy(mContextSpy.getResources()); in setUp()
200 when(mContextSpy.getResources()).thenReturn(mResourcesSpy); in setUp()
202 MockContentResolver cr = new MockContentResolver(mContextSpy); in setUp()
204 when(mContextSpy.getContentResolver()).thenReturn(cr); in setUp()
206 Settings.Global.putInt(mContextSpy.getContentResolver(), in setUp()
214 mService = new PowerManagerService(mContextSpy, new Injector() { in createService()
314 verify(mContextSpy).registerReceiver(batCaptor.capture(), in startSystem()
322 verify(mContextSpy).registerReceiver(userSwitchedCaptor.capture(), in startSystem()
[all …]
/frameworks/base/services/tests/uiservicestests/src/com/android/server/slice/
DSliceManagerServiceTest.java71 private TestableContext mContextSpy; field in SliceManagerServiceTest
79 mContextSpy = spy(mContext); in setUp()
80 mService = spy(new SliceManagerService(mContextSpy, TestableLooper.get(this).getLooper())); in setUp()
118 when(mContextSpy.checkUriPermission(any(), anyInt(), anyInt(), anyInt())) in testCheckAutoGrantPermissions()
120 when(mContextSpy.checkPermission("perm1", Process.myPid(), Process.myUid())) in testCheckAutoGrantPermissions()
122 when(mContextSpy.checkPermission("perm2", Process.myPid(), Process.myUid())) in testCheckAutoGrantPermissions()
128 verify(mContextSpy).checkPermission(eq("perm1"), eq(Process.myPid()), eq(Process.myUid())); in testCheckAutoGrantPermissions()
129 verify(mContextSpy).checkPermission(eq("perm2"), eq(Process.myPid()), eq(Process.myUid())); in testCheckAutoGrantPermissions()
/frameworks/base/services/tests/servicestests/src/com/android/server/vibrator/
DVibrationSettingsTest.java85 private ContextWrapper mContextSpy; field in VibrationSettingsTest
95 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp()
97 ContentResolver contentResolver = mSettingsProviderRule.mockContentResolver(mContextSpy); in setUp()
98 when(mContextSpy.getContentResolver()).thenReturn(contentResolver); in setUp()
99 when(mContextSpy.getSystemService(eq(Context.VIBRATOR_SERVICE))).thenReturn(mFakeVibrator); in setUp()
108 mAudioManager = mContextSpy.getSystemService(AudioManager.class); in setUp()
109 mVibrationSettings = new VibrationSettings(mContextSpy, in setUp()
171 VibrationSettings vibrationSettings = new VibrationSettings(mContextSpy, in shouldVibrateForRingerMode_beforeSystemReady_returnsFalseOnlyForRingtone()
338 VibrationSettings vibrationSettings = new VibrationSettings(mContextSpy, in getDefaultIntensity_beforeSystemReady_returnsMediumToAllExceptAlarm()
422 Settings.System.putIntForUser(mContextSpy.getContentResolver(), in getCurrentIntensity_updateTriggeredAfterUserSwitched()
[all …]
DVibrationScalerTest.java73 private ContextWrapper mContextSpy; field in VibrationScalerTest
82 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp()
84 ContentResolver contentResolver = mSettingsProviderRule.mockContentResolver(mContextSpy); in setUp()
85 when(mContextSpy.getContentResolver()).thenReturn(contentResolver); in setUp()
86 when(mContextSpy.getSystemService(eq(Context.VIBRATOR_SERVICE))).thenReturn(mFakeVibrator); in setUp()
92 mContextSpy, new Handler(mTestLooper.getLooper())); in setUp()
93 mVibrationScaler = new VibrationScaler(mContextSpy, mVibrationSettings); in setUp()
277 mContextSpy.getContentResolver(), settingName, value, UserHandle.USER_CURRENT);
DInputDeviceDelegateTest.java78 private ContextWrapper mContextSpy; field in InputDeviceDelegateTest
85 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp()
88 when(mContextSpy.getSystemService(eq(Context.INPUT_SERVICE))).thenReturn(inputManager); in setUp()
93 mContextSpy, new Handler(mTestLooper.getLooper())); in setUp()
106 mContextSpy, new Handler(mTestLooper.getLooper())); in beforeSystemReady_ignoresAnyUpdate()
DVibratorControllerTest.java84 private ContextWrapper mContextSpy; field in VibratorControllerTest
89 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp()
91 ContentResolver contentResolver = mSettingsProviderRule.mockContentResolver(mContextSpy); in setUp()
92 when(mContextSpy.getContentResolver()).thenReturn(contentResolver); in setUp()
DVibratorManagerServiceTest.java141 private Context mContextSpy; field in VibratorManagerServiceTest
151 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp()
154 ContentResolver contentResolver = mSettingsProviderRule.mockContentResolver(mContextSpy); in setUp()
155 when(mContextSpy.getContentResolver()).thenReturn(contentResolver); in setUp()
156 when(mContextSpy.getSystemService(eq(Context.VIBRATOR_SERVICE))).thenReturn(mVibrator); in setUp()
157 when(mContextSpy.getSystemService(eq(Context.INPUT_SERVICE))).thenReturn(inputManager); in setUp()
158 when(mContextSpy.getSystemService(Context.APP_OPS_SERVICE)).thenReturn(mAppOpsManagerMock); in setUp()
197 mContextSpy, in createService()
1078 AudioManager audioManager = mContextSpy.getSystemService(AudioManager.class);
1085 mContextSpy.getContentResolver(), settingName, value, UserHandle.USER_CURRENT);
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/display/utils/
DAmbientFilterTest.java39 private ContextWrapper mContextSpy; field in AmbientFilterTest
45 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp()
46 mResourcesSpy = spy(mContextSpy.getResources()); in setUp()
47 when(mContextSpy.getResources()).thenReturn(mResourcesSpy); in setUp()
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/toast/
DToastUITest.java97 private Context mContextSpy; field in ToastUITest
122 mContextSpy = spy(mContext); in setUp()
123 when(mContextSpy.getPackageManager()).thenReturn(mPackageManager); in setUp()
124 doReturn(mContextSpy).when(mContextSpy).createContextAsUser(any(), anyInt()); in setUp()
126 mContextSpy, in setUp()
163 assertThat(windowParams.packageName).isEqualTo(mContextSpy.getPackageName()); in testShowToast_addsViewWithCorrectLayoutParamsToWindowManager()
232 when(mContextSpy.getUserId()).thenReturn(USER_ID); in testShowToast_accessibilityManagerClientIsRemoved()
406 ViewGroup parent = new FrameLayout(mContextSpy); in verifyWmAddViewAndAttachToParent()
/frameworks/base/services/tests/wmtests/src/com/android/server/wm/
DTaskSnapshotPersisterTestBase.java66 private ContextWrapper mContextSpy; field in TaskSnapshotPersisterTestBase
100 mContextSpy = spy(new ContextWrapper(mWm.mContext)); in setUp()
101 mResourcesSpy = spy(mContextSpy.getResources()); in setUp()
102 when(mContextSpy.getResources()).thenReturn(mResourcesSpy); in setUp()
/frameworks/base/services/tests/servicestests/src/com/android/server/display/whitebalance/
DAmbientSensorTest.java64 private ContextWrapper mContextSpy; field in AmbientSensorTest
74 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp()
75 mResourcesSpy = spy(mContextSpy.getResources()); in setUp()
76 when(mContextSpy.getResources()).thenReturn(mResourcesSpy); in setUp()
DAmbientLuxTest.java67 private ContextWrapper mContextSpy; field in AmbientLuxTest
84 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp()
85 mResourcesSpy = spy(mContextSpy.getResources()); in setUp()
86 when(mContextSpy.getResources()).thenReturn(mResourcesSpy); in setUp()
/frameworks/base/services/tests/servicestests/src/com/android/server/display/
DHighBrightnessModeControllerTest.java88 private Context mContextSpy; field in HighBrightnessModeControllerTest
109 mContextSpy = spy(new ContextWrapper(ApplicationProvider.getApplicationContext())); in setUp()
110 final MockContentResolver resolver = mSettingsProviderRule.mockContentResolver(mContextSpy); in setUp()
111 when(mContextSpy.getContentResolver()).thenReturn(resolver); in setUp()
125 DEFAULT_MAX, null, () -> {}, mContextSpy); in testNoHbmData()
134 DEFAULT_MAX, null, () -> {}, mContextSpy); in testNoHbmData_Enabled()
466 mContextSpy); in createDefaultHbm()
/frameworks/base/core/tests/coretests/src/android/hardware/input/
DInputDeviceSensorManagerTest.java77 private ContextWrapper mContextSpy; field in InputDeviceSensorManagerTest
88 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getContext())); in setUp()
91 when(mContextSpy.getSystemService(eq(Context.INPUT_SERVICE))).thenReturn(inputManager); in setUp()
107 mInputManager = mContextSpy.getSystemService(InputManager.class); in setUp()
/frameworks/base/services/tests/servicestests/src/com/android/server/tv/tunerresourcemanager/
DTunerResourceManagerServiceTest.java65 private Context mContextSpy; field in TunerResourceManagerServiceTest
99 mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext())); in setUp()
100 when(mContextSpy.getSystemService(Context.TV_INPUT_SERVICE)).thenReturn(tvInputManager); in setUp()
101 mTunerResourceManagerService = new TunerResourceManagerService(mContextSpy) { in setUp()