Home
last modified time | relevance | path

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

12

/cts/tests/camera/src/android/hardware/camera2/cts/rs/
DRenderScriptSingleton.java34 private static Context sContext; field in RenderScriptSingleton
47 if (context.equals(sContext)) { in setContext()
49 } else if (sContext != null) { in setContext()
52 ", before clearing previous "+ sContext); in setContext()
58 sContext = context; in setContext()
69 if (sContext != null) { in clearContext()
75 sContext = null; in clearContext()
/cts/tests/tests/print/src/android/print/pdf/cts/
DPrintedPdfDocumentTest.java44 private static Context sContext; field in PrintedPdfDocumentTest
48 sContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); in setUp()
53 assertException(() -> new PrintedPdfDocument(sContext, null), NullPointerException.class); in createWithNullAttributes()
59 assertException(() -> new PrintedPdfDocument(sContext, attr), NullPointerException.class); in createWithNullMediaSize()
66 assertException(() -> new PrintedPdfDocument(sContext, attr), in createWithNullMargins()
85 PrintedPdfDocument doc = new PrintedPdfDocument(sContext, attr); in startPage()
96 PrintedPdfDocument doc = new PrintedPdfDocument(sContext, attr); in oneMilPageSize()
122 PrintedPdfDocument doc = new PrintedPdfDocument(sContext, attr); in getPageWidth()
132 PrintedPdfDocument doc = new PrintedPdfDocument(sContext, attr); in getPageHeight()
142 PrintedPdfDocument doc = new PrintedPdfDocument(sContext, attr); in getContentRect()
[all …]
/cts/tests/tests/permission/permissionTestUtilLib/src/android/permission/cts/
DPermissionUtils.java63 private static final Context sContext = field in PermissionUtils
83 () -> sContext.getSystemService(AppOpsManager.class).unsafeCheckOpRaw( in getAppOp()
85 sContext.getPackageManager().getPackageUid(packageName, 0), packageName)); in getAppOp()
126 () -> sContext.getSystemService(AppOpsManager.class).setUidMode(op, in setAppOpByName()
127 sContext.getPackageManager().getPackageUid(packageName, 0), mode)); in setAppOpByName()
142 return sContext.checkPermission(permission, Process.myPid(), in isPermissionGranted()
143 sContext.getPackageManager().getPackageUid(packageName, 0)) in isPermissionGranted()
254 () -> sContext.getPackageManager().getPermissionFlags(permission, packageName, in getPermissionFlags()
272 () -> sContext.getPackageManager().updatePermissionFlags(permission, packageName, in setPermissionFlags()
285 PackageInfo appInfo = sContext.getPackageManager().getPackageInfo(packageName, in getPermissions()
[all …]
/cts/tests/contentcaptureservice/src/android/contentcaptureservice/cts/
DOutOfProcessActivity.java19 import static android.contentcaptureservice.cts.Helper.sContext;
117 final Intent startIntent = new Intent(sContext, in startAndWaitOutOfProcessActivity()
119 getStartedMarker(sContext).delete(); in startAndWaitOutOfProcessActivity()
120 sContext.startActivity(startIntent); in startAndWaitOutOfProcessActivity()
122 return getStartedMarker(sContext).exists(); in startAndWaitOutOfProcessActivity()
124 getStartedMarker(sContext).delete(); in startAndWaitOutOfProcessActivity()
154 return getStoppedMarker(sContext).exists();
DAbstractContentCaptureIntegrationTest.java21 import static android.contentcaptureservice.cts.Helper.sContext;
67 new DeviceConfigStateManager(sContext, DeviceConfig.NAMESPACE_CONTENT_CAPTURE,
77 sContext, DeviceConfig.NAMESPACE_CONTENT_CAPTURE,
125 sContext, CONTENT_CAPTURE_ENABLED, "1");
163 sContext.getApplicationContext().setContentCaptureOptions(options); in whitelistSelf()
169 sContext.getApplicationContext().setContentCaptureOptions(null); in unWhitelistSelf()
206 SettingsUtils.syncSet(sContext, CONTENT_CAPTURE_ENABLED, enabled ? "1" : "0"); in setFeatureEnabledBySettings()
DAbstractContentCaptureIntegrationAutoActivityLaunchTest.java19 import static android.contentcaptureservice.cts.Helper.sContext;
53 final Application app = (Application) sContext.getApplicationContext(); in registerLifecycleCallback()
62 final Application app = (Application) sContext.getApplicationContext(); in unregisterLifecycleCallback()
104 return new Intent(sContext, mActivityClass); in getLaunchIntent()
DWhitelistTest.java23 import static android.contentcaptureservice.cts.Helper.sContext;
111 OutOfProcessActivity.startActivity(sContext, ACTION_CHECK_MANAGER_AND_FINISH); in launchActivityAndAssert()
112 final File startedMarker = OutOfProcessActivity.waitActivityStarted(sContext); in launchActivityAndAssert()
DClipboardAccessTest.java20 import static android.contentcaptureservice.cts.Helper.sContext;
39 mClipboardManager = (ClipboardManager) sContext.getSystemService(CLIPBOARD_SERVICE); in prepareClipboardManager()
DCanaryTest.java21 import static android.contentcaptureservice.cts.Helper.sContext;
54 final String enableSettings = new DeviceConfigStateManager(sContext, in assertHasService()
DHelper.java64 public static final Context sContext = getInstrumentation().getTargetContext(); field in Helper
139 final Resources resources = sContext.getResources(); in getInternalString()
/cts/tests/autofillservice/src/android/autofillservice/cts/
DVisibilitySetterActionTest.java39 private static final Context sContext = getInstrumentation().getTargetContext(); field in VisibilitySetterActionTest
40 private final ViewGroup mRootView = new ViewGroup(sContext) {
67 final View view = new View(sContext); in testOneChild()
82 final View view = new View(sContext); in testOneChildAddedTwice()
97 final View view1 = new View(sContext); in testMultipleChildren()
102 final View view2 = new View(sContext); in testMultipleChildren()
DUserDataTest.java49 private static final Context sContext = getInstrumentation().getTargetContext(); field in UserDataTest
53 new SettingsStateChangerRule(sContext,
58 new SettingsStateChangerRule(sContext, AUTOFILL_USER_DATA_MAX_CATEGORY_COUNT, "2");
62 new SettingsStateChangerRule(sContext, AUTOFILL_USER_DATA_MAX_USER_DATA_SIZE, "4");
66 new SettingsStateChangerRule(sContext, AUTOFILL_USER_DATA_MIN_VALUE_LENGTH, "4");
70 new SettingsStateChangerRule(sContext, AUTOFILL_USER_DATA_MAX_VALUE_LENGTH, "50");
DVirtualContainerActivityCompatModeTest.java60 sContext, NAMESPACE_GLOBAL, AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES,
69 sContext.getApplicationContext().setAutofillOptions(null); in resetCompatMode()
74 sContext.getApplicationContext() in preActivityCreated()
103 SettingsUtils.syncSet(sContext, NAMESPACE_GLOBAL, AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES, in testMultipleUrlBars_firstDoesNotExist()
128 SettingsUtils.syncSet(sContext, NAMESPACE_GLOBAL, AUTOFILL_COMPAT_MODE_ALLOWED_PACKAGES, in testMultipleUrlBars_bothExist()
DAutoFillServiceTestCase.java180 protected static final Context sContext = getInstrumentation().getTargetContext();
184 new SettingsStateKeeperRule(sContext, Settings.Secure.AUTOFILL_SERVICE) {
234 .around(new DeviceConfigStateChangerRule(sContext, DeviceConfig.NAMESPACE_AUTOFILL,
242 protected final Context mContext = sContext;
277 final String value = Settings.Global.getString(sContext.getContentResolver(), prop);
/cts/tests/backup/src/android/backup/cts/
DPermissionTest.java71 private static final Context sContext = InstrumentationRegistry.getTargetContext(); field in PermissionTest
360 () -> sContext.getPackageManager().updatePermissionFlags(permission, app, in setFlag()
361 flag, flag, sContext.getUser())); in setFlag()
366 () -> sContext.getPackageManager().updatePermissionFlags(permission, app, in clearFlag()
367 flag, 0, sContext.getUser())); in clearFlag()
373 () -> sContext.getPackageManager().getPermissionFlags(permission, app, in isFlagSet()
374 sContext.getUser())) & flag) == flag; in isFlagSet()
381 return sContext.getPackageManager().checkPermission(permission, app); in checkPermission()
393 () -> sContext.getSystemService(AppOpsManager.class).setUidMode( in setAppOp()
395 sContext.getPackageManager().getPackageUid(app, 0), mode)); in setAppOp()
[all …]
/cts/tests/tests/permission/src/android/permission/cts/
DLocationAccessCheckTest.java110 private static final Context sContext = InstrumentationRegistry.getTargetContext(); field in LocationAccessCheckTest
114 private static final String PERMISSION_CONTROLLER_PKG = sContext.getPackageManager()
130 sContext.unbindService(this); in accessLocation()
143 sContext.bindService(testAppService, connection, BIND_AUTO_CREATE); in accessLocation()
329 runShellCommand("cmd notification allow_listener " + (new ComponentName(sContext, in allowNotificationAccess()
340 ContentResolver cr = sContext.getContentResolver(); in reduceDelays()
391 sContext.getSystemService(LocationManager.class).requestSingleUpdate(crit, in assumeCanGetFineLocation()
438 for (ResolveInfo ri : sContext.getPackageManager().queryBroadcastReceivers( in resetPermissionController()
449 sContext.sendBroadcast(permissionControllerSetupIntent); in resetPermissionController()
470 runShellCommand("cmd notification disallow_listener " + (new ComponentName(sContext, in disallowNotificationAccess()
[all …]
DPermissionControllerTest.java84 private static final Context sContext = InstrumentationRegistry.getTargetContext(); field in PermissionControllerTest
86 sContext.getSystemService(PermissionControllerManager.class);
141 request, doDryRun, REASON_MALWARE, sContext.getMainExecutor())); in revoke()
144 return revoke(request, doDryRun, REASON_MALWARE, sContext.getMainExecutor()); in revoke()
153 sContext.getSystemService(AppOpsManager.class).setUidMode(permissionToOp(perm), in setAppOp()
154 sContext.getPackageManager().getPackageUid(pkg, 0), mode); in setAppOp()
179 assertThat(sContext.getPackageManager().checkPermission(ACCESS_BACKGROUND_LOCATION, in revokeSinglePermission()
240 false, REASON_INSTALLER_POLICY_VIOLATION, sContext.getMainExecutor())); in revokePolicyViolationFromWrongPackage()
284 sContext.getMainExecutor(), in nullRequests()
297 sContext.getMainExecutor(), null); in nullCallback()
[all …]
DShellPermissionTest.java52 private static final Context sContext = InstrumentationRegistry.getTargetContext(); field in ShellPermissionTest
64 final PackageManager pm = sContext.getPackageManager(); in testBlacklistedPermissions()
/cts/tests/tests/syncmanager/apps/app1/src/android/content/syncmanager/cts/app/
DContextHolder.java21 static volatile Context sContext; field in ContextHolder
24 return sContext; in getContext()
/cts/tests/tests/permission2/src/android/permission2/cts/
DRestrictedStoragePermissionSharedUidTest.java75 private static @NonNull Context sContext = field in RestrictedStoragePermissionSharedUidTest.TestApp
78 sContext.getSystemService(AppOpsManager.class);
79 private static @NonNull PackageManager sPackageManager = sContext.getPackageManager();
113 int uid = sContext.getPackageManager().getPackageUid(mPkg, 0); in assertHasNotIsolatedStorage()
DPermissionPolicyTest.java85 private static final Context sContext = field in PermissionPolicyTest
91 getPermissionsForPackage(sContext, PLATFORM_PACKAGE_NAME); in platformPermissionPolicyIsUnaltered()
95 List<PermissionGroupInfo> declaredGroups = sContext.getPackageManager() in platformPermissionPolicyIsUnaltered()
107 if (sContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) { in platformPermissionPolicyIsUnaltered()
110 getPermissionsForPackage(sContext, AUTOMOTIVE_SERVICE_PACKAGE_NAME)); in platformPermissionPolicyIsUnaltered()
234 try (InputStream in = sContext.getResources().openRawResource(resourceId)) { in loadExpectedPermissions()
280 try (InputStream in = sContext.getResources().openRawResource(resourceId)) { in loadExpectedPermissionGroupNames()
/cts/tests/autofillservice/src/android/autofillservice/cts/augmented/
DAugmentedAutofillAutoActivityLaunchTestCase.java47 sContext.getApplicationContext() in allowAugmentedAutofill()
54 sContext.getApplicationContext().setAutofillOptions(null); in resetAllowAugmentedAutofill()
DAugmentedAutofillManualActivityLaunchTestCase.java46 sContext.getApplicationContext() in allowAugmentedAutofill()
53 sContext.getApplicationContext().setAutofillOptions(null); in resetAllowAugmentedAutofill()
/cts/tests/tests/role/src/android/app/role/cts/
DRoleManagerTest.java100 private static final Context sContext = InstrumentationRegistry.getTargetContext(); field in RoleManagerTest
101 private static final PackageManager sPackageManager = sContext.getPackageManager();
102 private static final RoleManager sRoleManager = sContext.getSystemService(RoleManager.class);
465 sContext.getMainExecutor(), future, user)); in assertOnRoleHoldersChangedListenerIsNotified()
485 sRoleManager.addOnRoleHoldersChangedListenerAsUser(sContext.getMainExecutor(), future, in addAndRemoveOnRoleHoldersChangedListenerAndAddRoleHolderThenIsNotNotified()
598 packageName, 0, Process.myUserHandle(), sContext.getMainExecutor(), future)); in addRoleHolder()
606 packageName, 0, Process.myUserHandle(), sContext.getMainExecutor(), future)); in removeRoleHolder()
613 Process.myUserHandle(), sContext.getMainExecutor(), future)); in clearRoleHolders()
/cts/tests/tests/net/src/android/net/cts/
DIpSecManagerTunnelTest.java116 private static Context sContext = InstrumentationRegistry.getContext(); field in IpSecManagerTunnelTest
124 sCM = (ConnectivityManager) sContext.getSystemService(Context.CONNECTIVITY_SERVICE); in setUpBeforeClass()
125 sTNM = (TestNetworkManager) sContext.getSystemService(Context.TEST_NETWORK_SERVICE); in setUpBeforeClass()
173 return sContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_IPSEC_TUNNELS) in hasTunnelsFeature()
180 for (String pkg : new String[] {"com.android.shell", sContext.getPackageName()}) { in setAppop()
237 new IpSecTransform.Builder(sContext) in testSecurityExceptionBuildTunnelTransformWithoutAppop()
521 buildIpSecTransform(sContext, inTransportSpi, null, remoteInner);
523 buildIpSecTransform(sContext, outTransportSpi, null, localInner);
604 buildIpSecTransform(sContext, inTransportSpi, null, remoteInner);
606 buildIpSecTransform(sContext, outTransportSpi, null, localInner);
[all …]

12