Home
last modified time | relevance | path

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

12

/frameworks/base/apct-tests/perftests/core/src/android/app/
DOverlayManagerPerfTest.java50 private static Context sContext; field in OverlayManagerPerfTest
63 sContext = InstrumentationRegistry.getTargetContext(); in classSetUp()
64 sOverlayManager = new OverlayManager(sContext); in classSetUp()
68 TestPackageInstaller installer = new TestPackageInstaller(sContext); in classSetUp()
90 assertSetEnabled(sContext, overlay.getPackageName(), false); in tearDown()
94 assertSetEnabled(sContext, overlay.getPackageName(), false); in tearDown()
127 assertSetEnabled(sContext, packageName, true); in setEnabledWarmCache()
131 assertSetEnabled(sContext, packageName, false); in setEnabledWarmCache()
141 assertSetEnabled(sContext, packageName, true); in setEnabledColdCacheSmallOverlay()
145 assertSetEnabled(sContext, packageName, false); in setEnabledColdCacheSmallOverlay()
[all …]
DResourcesManagerPerfTest.java43 private static Context sContext; field in ResourcesManagerPerfTest
52 sContext = InstrumentationRegistry.getTargetContext(); in setUp()
66 File file = File.createTempFile(fileName, null, sContext.getCacheDir()); in copyApkToTemp()
68 InputStream is = sContext.getResources().getAssets().openNonAsset(inputFileName)) { in copyApkToTemp()
81 Display.DEFAULT_DISPLAY, null, sContext.getResources().getCompatibilityInfo(), in getResourcesForPath()
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/power/
DFaceDownDetectorTest.java55 public static final TestableContext sContext = new TestableContext( field in FaceDownDetectorTest
73 sContext.addMockSystemService(SensorManager.class, mSensorManager); in setup()
74 sContext.addMockSystemService(PowerManager.class, mPowerManager); in setup()
85 mFaceDownDetector.systemReady(sContext); in faceDownFor2Seconds_triggersFaceDown()
95 mFaceDownDetector.systemReady(sContext); in faceDownFor2Seconds_withMotion_DoesNotTriggerFaceDown()
112 mFaceDownDetector.systemReady(sContext); in faceDownForHalfSecond_DoesNotTriggerFaceDown()
128 mFaceDownDetector.systemReady(sContext); in faceDownFor2Seconds_followedByFaceUp_triggersFaceDownExit()
142 mFaceDownDetector.systemReady(sContext); in notInteractive_doesNotTriggerFaceDown()
152 mFaceDownDetector.systemReady(sContext); in afterDisablingFeature_doesNotTriggerFaceDown()
162 mFaceDownDetector.systemReady(sContext); in afterReenablingWhileNonInteractive_doesNotTriggerFaceDown()
[all …]
/frameworks/base/core/tests/coretests/src/android/view/
DViewRootImplTest.java119 private static Context sContext; field in ViewRootImplTest
138 sContext = sInstrumentation.getTargetContext(); in setUpClass()
139 View view = new View(sContext); in setUpClass()
152 mViewRootImpl = new ViewRootImpl(sContext, sContext.getDisplayNoVerify())); in setUp()
158 Settings.Secure.resetToDefaults(sContext.getContentResolver(), TAG); in teardown()
160 var uiModeManager = sContext.getSystemService(UiModeManager.class); in teardown()
167 WindowManager wm = sContext.getSystemService(WindowManager.class); in teardown()
336 View view = new View(sContext); in requestScrollCapture_timeout()
364 mView = new View(sContext); in whenTouchModeChanges_viewRootIsNotified()
387 mView = new View(sContext); in whenDispatchFakeFocus_focusDoesNotPersist()
[all …]
/frameworks/base/services/tests/powerstatstests/src/com/android/server/power/stats/wakeups/
DIrqDeviceMapTest.java47 private static final Context sContext = InstrumentationRegistry.getTargetContext(); field in IrqDeviceMapTest
51 IrqDeviceMap irqDeviceMap1 = IrqDeviceMap.getInstance(sContext, R.xml.irq_device_map_1); in cachesInstancesPerXml()
52 IrqDeviceMap irqDeviceMap2 = IrqDeviceMap.getInstance(sContext, R.xml.irq_device_map_1); in cachesInstancesPerXml()
55 irqDeviceMap2 = IrqDeviceMap.getInstance(sContext, R.xml.irq_device_map_2); in cachesInstancesPerXml()
58 irqDeviceMap1 = IrqDeviceMap.getInstance(sContext, R.xml.irq_device_map_2); in cachesInstancesPerXml()
64 IrqDeviceMap deviceMap = IrqDeviceMap.getInstance(sContext, R.xml.irq_device_map_1); in simpleXml()
79 IrqDeviceMap deviceMap = IrqDeviceMap.getInstance(sContext, R.xml.irq_device_map_2); in complexXml()
DCpuWakeupStatsTest.java72 private static final Context sContext = InstrumentationRegistry.getTargetContext(); field in CpuWakeupStatsTest
86 final CpuWakeupStats obj = new CpuWakeupStats(sContext, R.xml.irq_device_map_3, mHandler); in removesOldWakeups()
149 final CpuWakeupStats obj = new CpuWakeupStats(sContext, R.xml.irq_device_map_3, in irqAttributionAllCombinations()
192 final CpuWakeupStats obj = new CpuWakeupStats(sContext, R.xml.irq_device_map_3, mHandler); in alarmIrqAttributionSolo()
225 final CpuWakeupStats obj = new CpuWakeupStats(sContext, R.xml.irq_device_map_3, mHandler); in soundTriggerIrqAttributionSolo()
259 final CpuWakeupStats obj = new CpuWakeupStats(sContext, R.xml.irq_device_map_3, mHandler); in wifiIrqAttributionSolo()
289 final CpuWakeupStats obj = new CpuWakeupStats(sContext, R.xml.irq_device_map_3, mHandler); in alarmAndWifiIrqAttribution()
348 final CpuWakeupStats obj = new CpuWakeupStats(sContext, R.xml.irq_device_map_3, mHandler); in unknownIrqSoloIgnored()
365 final CpuWakeupStats obj = new CpuWakeupStats(sContext, R.xml.irq_device_map_3, mHandler); in unknownAndWifiAttribution()
404 final CpuWakeupStats obj = new CpuWakeupStats(sContext, R.xml.irq_device_map_3, mHandler); in unknownFormatWakeupIgnored()
[all …]
/frameworks/base/services/core/java/com/android/server/audio/
DRotationHelper.java67 private static Context sContext; field in RotationHelper
80 sContext = context; in init()
83 sFoldStateListener = new FoldStateListener(sContext, RotationHelper::updateFoldState); in init()
90 ((DisplayManager) sContext.getSystemService(Context.DISPLAY_SERVICE)) in enable()
94 sContext.getSystemService(DeviceStateManager.class) in enable()
99 ((DisplayManager) sContext.getSystemService(Context.DISPLAY_SERVICE)) in disable()
101 sContext.getSystemService(DeviceStateManager.class) in disable()
/frameworks/base/telephony/java/android/telephony/
DAnomalyReporter.java64 private static Context sContext = null; field in AnomalyReporter
110 if (sContext == null) { in reportAnomaly()
151 sContext.sendBroadcast(dbgIntent, android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE); in reportAnomaly()
173 sContext = context; in initialize()
177 PackageManager pm = sContext.getPackageManager(); in initialize()
210 if (sContext == null) return; in dump()
212 sContext.enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, "Requires DUMP"); in dump()
213 pw.println("Initialized=" + (sContext != null ? "Yes" : "No")); in dump()
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/wallpaper/
DWallpaperManagerServiceTests.java126 public static final TestableContext sContext = new TestableContext( field in WallpaperManagerServiceTests
154 sContext.addMockSystemService(Context.APP_OPS_SERVICE, mock(AppOpsManager.class)); in setUpClass()
156 spyOn(sContext); in setUpClass()
157 sContext.getTestablePermissions().setPermission( in setUpClass()
160 sContext.getTestablePermissions().setPermission( in setUpClass()
163 sContext.getTestablePermissions().setPermission( in setUpClass()
166 sContext.getTestablePermissions().setPermission( in setUpClass()
169 doNothing().when(sContext).sendBroadcastAsUser(any(), any()); in setUpClass()
174 sContext.getResources().getString(R.string.image_wallpaper_component)); in setUpClass()
176 sDefaultWallpaperComponent = WallpaperManager.getCmfDefaultWallpaperComponent(sContext); in setUpClass()
[all …]
/frameworks/base/core/tests/coretests/src/android/os/
DBinderWorkSourceTest.java51 private static Context sContext; field in BinderWorkSourceTest
84 sContext = InstrumentationRegistry.getContext(); in setUp()
85 sContext.bindService( in setUp()
86 new Intent(sContext, BinderWorkSourceService.class), in setUp()
88 sContext.bindService( in setUp()
89 new Intent(sContext, BinderWorkSourceNestedService.class), in setUp()
103 sContext.unbindService(mConnection); in tearDown()
104 sContext.unbindService(mNestedConnection); in tearDown()
DBinderProxyCountingTest.java96 private static Context sContext; field in BinderProxyCountingTest
123 sContext = InstrumentationRegistry.getContext(); in setUp()
124 sTestPkgUid = sContext.getPackageManager().getPackageUid(TEST_APP_PKG, 0); in setUp()
125 ((ActivityManager) sContext.getSystemService(Context.ACTIVITY_SERVICE)).killUid(sTestPkgUid, in setUp()
147 sContext.bindService(intent, connection, in bindService()
160 sContext.unbindService(service); in unbindService()
/frameworks/opt/car/services/builtInServices/tests/src/com/android/server/inputmethod/
DImeSmokeTest.java68 private static Context sContext; field in ImeSmokeTest
76 sContext = sInstrumentation.getContext(); in setUpClass()
77 sContentResolver = sContext.getContentResolver(); in setUpClass()
81 assumeTrue(sContext.getPackageManager() in setUpClass()
132 sContext.startActivity(intent); in canOpenIME()
/frameworks/base/apct-tests/perftests/contentcapture/src/android/view/contentcapture/
DAbstractContentCapturePerfTestCase.java62 protected static final Context sContext = sInstrumentation.getTargetContext(); field in AbstractContentCapturePerfTestCase
132 final int stayOnWhilePluggedIn = Settings.Global.getInt(sContext.getContentResolver(), in setStayAwake()
159 sContext.getApplicationContext().setContentCaptureOptions(options); in setAllowSelf()
169 sContext.getApplicationContext().setContentCaptureOptions(null); in clearOptions()
211 final Application app = (Application) sContext.getApplicationContext(); in registerLifecycleCallback()
220 final Application app = (Application) sContext.getApplicationContext(); in unregisterLifecycleCallback()
272 final Intent intent = new Intent(sContext, CustomTestActivity.class) in getLaunchIntent()
/frameworks/base/services/tests/servicestests/src/com/android/server/am/
DProcessRecordTests.java57 private static Context sContext; field in ProcessRecordTests
66 sContext = getInstrumentation().getTargetContext(); in setUpOnce()
72 sService.mActivityTaskManager = new ActivityTaskManagerService(sContext); in setUpOnce()
73 sService.mActivityTaskManager.initialize(null, null, sContext.getMainLooper()); in setUpOnce()
87 final ComponentName sysUiName = new ComponentName(sContext.getPackageName(), "test"); in setUpOnce()
112 mProcessRecord = new ProcessRecord(sService, sContext.getApplicationInfo(), in setUpProcess()
DOomAdjusterTests.java54 private static Context sContext; field in OomAdjusterTests
66 sContext = getInstrumentation().getTargetContext(); in setUpOnce()
77 sService.mActivityTaskManager = new ActivityTaskManagerService(sContext); in setUpOnce()
78 sService.mActivityTaskManager.initialize(null, null, sContext.getMainLooper()); in setUpOnce()
83 sService.mConstants = new ActivityManagerConstants(sContext, sService, in setUpOnce()
84 sContext.getMainThreadHandler()); in setUpOnce()
125 mProcessRecord = spy(new ProcessRecord(sService, sContext.getApplicationInfo(), in setUpProcess()
/frameworks/base/services/tests/servicestests/src/com/android/server/accessibility/magnification/
DTwoFingersDownOrSwipeTest.java65 private static Context sContext; field in TwoFingersDownOrSwipeTest
73 sContext = InstrumentationRegistry.getContext(); in setupOnce()
75 sContext) + 100; in setupOnce()
76 sSwipeMinDistance = ViewConfiguration.get(sContext).getScaledTouchSlop() + 1; in setupOnce()
82 mGesturesObserver = new GesturesObserver(mListener, new TwoFingersDownOrSwipe(sContext)); in setUp()
/frameworks/base/tests/JobSchedulerPerfTests/src/com/android/frameworks/perftests/job/
DJobStorePerfTests.java51 private static Context sContext; field in JobStorePerfTests
63 sContext = InstrumentationRegistry.getTargetContext(); in setUpOnce()
64 sTestDir = new File(sContext.getFilesDir(), "JobStorePerfTests"); in setUpOnce()
65 sJobStore = JobStore.initAndGetForTesting(sContext, sTestDir); in setUpOnce()
207 new ComponentName(sContext, "JobStorePerfTestJobService")) in createJobStatus()
/frameworks/opt/telephony/src/java/com/android/internal/telephony/
DPhoneFactory.java99 static private Context sContext; field in PhoneFactory
131 sContext = context; in makeDefaultPhone()
260 sPhoneConfigurationManager = PhoneConfigurationManager.init(sContext, featureFlags); in makeDefaultPhone()
263 SimultaneousCallingTracker.init(sContext, featureFlags); in makeDefaultPhone()
266 sCellularNetworkValidator = CellularNetworkValidator.make(sContext); in makeDefaultPhone()
273 makePhoneSwitcher(maxActivePhones, sContext, Looper.myLooper(), in makeDefaultPhone()
450 value = Settings.Global.getInt(sContext.getContentResolver(), in isSMSPromptEnabled()
466 return ImsPhoneFactory.makePhone(sContext, phoneNotifier, defaultPhone, sFeatureFlags); in makeImsPhone()
626 if (sContext != null) { in dump()
627 SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(sContext); in dump()
/frameworks/base/services/tests/powerstatstests/src/com/android/server/power/stats/
DBstatsCpuTimesValidationTest.java112 private static Context sContext; field in BstatsCpuTimesValidationTest
127 sContext = InstrumentationRegistry.getContext(); in setupOnce()
129 sContext.getPackageManager().setApplicationEnabledSetting(TEST_PKG, in setupOnce()
131 sTestPkgUid = sContext.getPackageManager().getPackageUid(TEST_PKG, 0); in setupOnce()
144 Settings.Global.putString(sContext.getContentResolver(), in tearDownOnce()
151 sOriginalBatteryStatsConsts = Settings.Global.getString(sContext.getContentResolver(), in updateBatteryStatsConstants()
173 Settings.Global.putString(sContext.getContentResolver(), in updateBatteryStatsConstants()
645 sContext.bindService(launchIntent, connection, Context.BIND_AUTO_CREATE in startIsolatedService()
673 sContext.startForegroundService(launchIntent); in startForegroundService()
699 sContext.startService(launchIntent); in startService()
[all …]
/frameworks/base/packages/DynamicSystemInstallationService/tests/src/com/android/dynsystem/
DKeyRevocationListTest.java48 private static Context sContext; field in KeyRevocationListTest
54 sContext = InstrumentationRegistry.getInstrumentation().getContext(); in setUpClass()
56 sContext.getString(com.android.dynsystem.tests.R.string.blocklist_json_string); in setUpClass()
/frameworks/base/tests/DynamicCodeLoggerIntegrationTests/src/com/android/server/pm/dex/
DDynamicCodeLoggerIntegrationTests.java92 private static Context sContext; field in DynamicCodeLoggerIntegrationTests
97 sContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); in setUpAll()
103 assumeFalse(sContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)); in setup()
129 ClassLoader parentClassLoader = sContext.getClass().getClassLoader(); in testGeneratesEvents_standardClassLoader()
151 ClassLoader knownClassLoader = sContext.getClass().getClassLoader(); in testGeneratesEvents_unknownClassLoader()
315 File ourPath = sContext.getDatabasePath("android_pay"); in testGeneratesEvents_spoofed_otherAppFile()
377 return new File(sContext.getDir("dcl", Context.MODE_PRIVATE), name); in privateFile()
/frameworks/base/services/tests/servicestests/src/com/android/server/contentcapture/
DContentCaptureManagerServiceTest.java86 private static final Context sContext = ApplicationProvider.getApplicationContext(); field in ContentCaptureManagerServiceTest
550 ContentCaptureManagerService service = new ContentCaptureManagerService(sContext); in parseContentProtectionGroupsConfig_null()
557 ContentCaptureManagerService service = new ContentCaptureManagerService(sContext); in parseContentProtectionGroupsConfig_empty()
564 ContentCaptureManagerService service = new ContentCaptureManagerService(sContext); in parseContentProtectionGroupsConfig_singleValue()
572 ContentCaptureManagerService service = new ContentCaptureManagerService(sContext); in parseContentProtectionGroupsConfig_multipleValues()
580 ContentCaptureManagerService service = new ContentCaptureManagerService(sContext); in parseContentProtectionGroupsConfig_multipleGroups()
588 ContentCaptureManagerService service = new ContentCaptureManagerService(sContext); in parseContentProtectionGroupsConfig_emptyValues()
597 super(sContext); in TestContentCaptureManagerService()
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/appop/
DAppOpsServiceTest.java104 private static final Context sContext = InstrumentationRegistry.getTargetContext(); field in AppOpsServiceTest
105 private static final String sMyPackageName = sContext.getOpPackageName();
106 private static final String sSdkSandboxPackageName = sContext.getPackageManager()
120 spy(sContext)); in setupAppOpsService()
121 mAppOpsService.mHistoricalRegistry.systemReady(sContext.getContentResolver()); in setupAppOpsService()
133 mStorageFile = new File(sContext.getFilesDir(), APP_OPS_FILENAME); in setUp()
134 mRecentAccessesFile = new File(sContext.getFilesDir(), APP_OPS_ACCESSES_FILENAME); in setUp()
165 return sContext.getPackageManager().getPackageUid( in resolveSdkSandboxPackageUid()
/frameworks/base/tests/UsageReportingTest/src/com/android/tests/usagereporter/
DUsageReporterActivity.java52 private static Context sContext; field in UsageReporterActivity
59 sContext = getApplicationContext(); in onCreate()
244 Toast.makeText(sContext, e.toString(), Toast.LENGTH_LONG).show();
262 Toast.makeText(sContext, e.toString(), Toast.LENGTH_LONG).show();
/frameworks/base/tests/UsageStatsPerfTests/src/com/android/frameworks/perftests/usage/tests/
DUsageStatsDatabasePerfTest.java49 protected static Context sContext; field in UsageStatsDatabasePerfTest
81 sContext = InstrumentationRegistry.getTargetContext(); in setUpOnce()
82 mTestDir = new File(sContext.getFilesDir(), "UsageStatsDatabasePerfTest"); in setUpOnce()

12