/cts/tests/tests/shortcutmanager/throttling/src/android/content/pm/cts/shortcutmanager/throttling/ |
D | ShortcutManagerThrottlingTestReceiver.java | 42 public ShortcutManager getManager(Context context) { in getManager() argument 44 mManager = context.getSystemService(ShortcutManager.class); in getManager() 50 public void onReceive(Context context, Intent intent) { in onReceive() argument 56 testSetDynamicShortcuts(context, replyAction); in onReceive() 59 testAddDynamicShortcuts(context, replyAction); in onReceive() 62 testUpdateShortcuts(context, replyAction); in onReceive() 66 testBgServiceThrottled(context, replyAction); in onReceive() 70 testActivityUnthrottled(context, replyAction); in onReceive() 73 testFgServiceUnthrottled(context, replyAction); in onReceive() 77 testInlineReplyShow(context, replyAction); in onReceive() [all …]
|
/cts/tests/tests/text/src/android/text/format/cts/ |
D | FormatterTest.java | 49 final Context context = in testFormatFileSize() local 53 assertEquals("0 B", Formatter.formatFileSize(context, 0)); in testFormatFileSize() 54 assertEquals("1 B", Formatter.formatFileSize(context, 1)); in testFormatFileSize() 55 assertEquals("9 B", Formatter.formatFileSize(context, 9)); in testFormatFileSize() 56 assertEquals("10 B", Formatter.formatFileSize(context, 10)); in testFormatFileSize() 57 assertEquals("99 B", Formatter.formatFileSize(context, 99)); in testFormatFileSize() 58 assertEquals("100 B", Formatter.formatFileSize(context, 100)); in testFormatFileSize() 59 assertEquals("900 B", Formatter.formatFileSize(context, 900)); in testFormatFileSize() 60 assertEquals("0.90 kB", Formatter.formatFileSize(context, 901)); in testFormatFileSize() 62 assertEquals("1.00 kB", Formatter.formatFileSize(context, bd.pow(1).longValue())); in testFormatFileSize() [all …]
|
/cts/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/ |
D | BasicAdminReceiver.java | 38 public static ComponentName getComponentName(Context context) { in getComponentName() argument 39 return new ComponentName(context, BasicAdminReceiver.class); in getComponentName() 43 public void onUserAdded(Context context, Intent intent, UserHandle userHandle) { in onUserAdded() argument 44 super.onUserAdded(context, intent, userHandle); in onUserAdded() 45 sendUserBroadcast(context, ACTION_USER_ADDED, userHandle); in onUserAdded() 49 public void onUserRemoved(Context context, Intent intent, UserHandle userHandle) { in onUserRemoved() argument 50 super.onUserRemoved(context, intent, userHandle); in onUserRemoved() 51 sendUserBroadcast(context, ACTION_USER_REMOVED, userHandle); in onUserRemoved() 55 public void onUserStarted(Context context, Intent intent, UserHandle userHandle) { in onUserStarted() argument 56 super.onUserStarted(context, intent, userHandle); in onUserStarted() [all …]
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/p2p/testcase/ |
D | ServReqTestSuite.java | 27 public static ArrayList<ReqTestCase> getTestSuite(Context context) { in getTestSuite() argument 28 initialize(context); in getTestSuite() 32 public static ReqTestCase getTestCase(Context context, in getTestCase() argument 34 initialize(context); in getTestCase() 44 private static void initialize(Context context) { in initialize() argument 50 sTestSuite.add(new ServReqAllTestCase01(context)); in initialize() 51 sTestSuite.add(new ServReqAllTestCase02(context)); in initialize() 52 sTestSuite.add(new ServReqAllTestCase03(context)); in initialize() 53 sTestSuite.add(new ServReqDnsPtrTestCase(context)); in initialize() 54 sTestSuite.add(new ServReqDnsTxtTestCase(context)); in initialize() [all …]
|
/cts/tests/app/app/src/android/app/stubs/ |
D | CommandReceiver.java | 58 public void onReceive(Context context, Intent intent) { in onReceive() argument 60 Log.d(TAG + "_" + context.getPackageName(), "Got command " + command + ", intent=" in onReceive() 64 doBindService(context, intent); in onReceive() 67 doUnbindService(context, intent); in onReceive() 70 doStartForegroundService(context, LocalForegroundService.class); in onReceive() 73 doStopForegroundService(context, LocalForegroundService.class); in onReceive() 79 doStartForegroundServiceWithType(context, LocalForegroundServiceLocation.class, in onReceive() 83 doStopForegroundService(context, LocalForegroundServiceLocation.class); in onReceive() 88 private void doBindService(Context context, Intent commandIntent) { in doBindService() argument 89 context = context.getApplicationContext(); in doBindService() [all …]
|
/cts/hostsidetests/appsecurity/test-apps/IsolatedSplitApp/src/com/android/cts/isolatedsplitapp/ |
D | SplitAppTest.java | 85 final Context context = mBaseActivityRule.getActivity(); in shouldLoadDefault() local 86 final Resources resources = context.getResources(); in shouldLoadDefault() 92 assertActivitiesDoNotExist(context, FEATURE_A_ACTIVITY, FEATURE_B_ACTIVITY, in shouldLoadDefault() 94 assertResourcesDoNotExist(context, FEATURE_A_STRING, FEATURE_B_STRING, FEATURE_C_STRING); in shouldLoadDefault() 99 final Context context = mBaseActivityRule.getActivity().createConfigurationContext(PL); in shouldLoadPolishLocale() local 100 final Resources resources = context.getResources(); in shouldLoadPolishLocale() 106 assertActivitiesDoNotExist(context, FEATURE_A_ACTIVITY, FEATURE_B_ACTIVITY, in shouldLoadPolishLocale() 108 assertResourcesDoNotExist(context, FEATURE_A_STRING, FEATURE_B_STRING, FEATURE_C_STRING); in shouldLoadPolishLocale() 113 final Context context = mFeatureActivityRule.launchActivity( in shouldLoadFeatureADefault() local 115 final Resources resources = context.getResources(); in shouldLoadFeatureADefault() [all …]
|
/cts/tests/sensor/src/android/hardware/cts/helpers/ |
D | TestSensorEnvironment.java | 58 public TestSensorEnvironment(Context context, int sensorType, int samplingPeriodUs) { in TestSensorEnvironment() argument 59 this(context, sensorType, false /* sensorMightHaveMoreListeners */, samplingPeriodUs); in TestSensorEnvironment() 74 Context context, in TestSensorEnvironment() argument 78 this(context, in TestSensorEnvironment() 97 Context context, in TestSensorEnvironment() argument 101 this(context, in TestSensorEnvironment() 121 Context context, in TestSensorEnvironment() argument 126 this(context, in TestSensorEnvironment() 127 getSensor(context, sensorType), in TestSensorEnvironment() 147 Context context, in TestSensorEnvironment() argument [all …]
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ |
D | DeviceAdminTestReceiver.java | 68 public void onProfileProvisioningComplete(Context context, Intent intent) { in onProfileProvisioningComplete() argument 70 setupProfile(context); in onProfileProvisioningComplete() 71 wipeIfNecessary(context, intent); in onProfileProvisioningComplete() 75 public void onBugreportSharingDeclined(Context context, Intent intent) { in onBugreportSharingDeclined() argument 77 Utils.showBugreportNotification(context, context.getString( in onBugreportSharingDeclined() 82 public void onBugreportShared(Context context, Intent intent, String bugreportFileHash) { in onBugreportShared() argument 84 Utils.showBugreportNotification(context, context.getString( in onBugreportShared() 89 public void onBugreportFailed(Context context, Intent intent, int failureCode) { in onBugreportFailed() argument 91 Utils.showBugreportNotification(context, context.getString( in onBugreportFailed() 96 public void onLockTaskModeEntering(Context context, Intent intent, String pkg) { in onLockTaskModeEntering() argument [all …]
|
/cts/hostsidetests/appsecurity/test-apps/rro/OverlayApp/src/com/android/cts/overlay/app/ |
D | OverlayableTest.java | 70 private void assertOverlayEnabled(Context context, String overlayPackage) throws Exception { in assertOverlayEnabled() argument 74 for (String path : context.getAssets().getApkPaths()) { in assertOverlayEnabled() 88 Context context = getTargetContext(); in testOverlayPolicyAll() local 89 assertOverlayEnabled(context, POLICY_ALL_PACKAGE); in testOverlayPolicyAll() 91 String result = context.getResources().getString(R.string.not_overlayable); in testOverlayPolicyAll() 94 result = context.getResources().getString(R.string.policy_public); in testOverlayPolicyAll() 97 result = context.getResources().getString(R.string.policy_product); in testOverlayPolicyAll() 100 result = context.getResources().getString(R.string.policy_system); in testOverlayPolicyAll() 103 result = context.getResources().getString(R.string.policy_vendor); in testOverlayPolicyAll() 106 result = context.getResources().getString(R.string.policy_signature); in testOverlayPolicyAll() [all …]
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/ |
D | TimerProgressBar.java | 31 public TimerProgressBar(Context context) { in TimerProgressBar() argument 32 super(context); in TimerProgressBar() 33 setHandler(context); in TimerProgressBar() 36 public TimerProgressBar(Context context, AttributeSet attrs) { in TimerProgressBar() argument 37 super(context, attrs); in TimerProgressBar() 38 setHandler(context); in TimerProgressBar() 41 public TimerProgressBar(Context context, AttributeSet attrs, int defStyleAttr) { in TimerProgressBar() argument 42 super(context, attrs, defStyleAttr); in TimerProgressBar() 43 setHandler(context); in TimerProgressBar() 47 public TimerProgressBar(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { in TimerProgressBar() argument [all …]
|
D | Version.java | 32 static String getVersionName(Context context) { in getVersionName() argument 33 return getPackageInfo(context).versionName; in getVersionName() 36 static int getVersionCode(Context context) { in getVersionCode() argument 37 return getPackageInfo(context).versionCode; in getVersionCode() 40 static PackageInfo getPackageInfo(Context context) { in getPackageInfo() argument 42 PackageManager packageManager = context.getPackageManager(); in getPackageInfo() 43 return packageManager.getPackageInfo(context.getPackageName(), 0); in getPackageInfo() 46 + context.getPackageName()); in getPackageInfo() 50 static String getMetadata(Context context, String name) { in getMetadata() argument 52 PackageManager packageManager = context.getPackageManager(); in getMetadata() [all …]
|
/cts/tests/tests/appwidget/src/android/appwidget/cts/provider/ |
D | StubbableAppWidgetProvider.java | 26 public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { in onUpdate() argument 29 callbacks.onUpdate(context, appWidgetManager, appWidgetIds); in onUpdate() 34 public void onAppWidgetOptionsChanged(Context context, AppWidgetManager appWidgetManager, in onAppWidgetOptionsChanged() argument 38 callbacks.onAppWidgetOptionsChanged(context, appWidgetManager, appWidgetId, newOptions); in onAppWidgetOptionsChanged() 43 public void onDeleted(Context context, int[] appWidgetIds) { in onDeleted() argument 46 callbacks.onDeleted(context, appWidgetIds); in onDeleted() 51 public void onEnabled(Context context) { in onEnabled() argument 54 callbacks.onEnabled(context); in onEnabled() 59 public void onDisabled(Context context) { in onDisabled() argument 62 callbacks.onDisabled(context); in onDisabled() [all …]
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/sensors/sixdof/Utils/ |
D | Version.java | 43 static String getVersionName(Context context) { in getVersionName() argument 44 return getVersionNameStrings(context)[0]; in getVersionName() 47 static int getVersionCode(Context context) { in getVersionCode() argument 48 return getPackageInfo(context).versionCode; in getVersionCode() 51 static private String[] getVersionNameStrings(Context context) { in getVersionNameStrings() argument 52 return getPackageInfo(context).versionName.split(" "); in getVersionNameStrings() 55 static PackageInfo getPackageInfo(Context context) { in getPackageInfo() argument 57 PackageManager packageManager = context.getPackageManager(); in getPackageInfo() 58 return packageManager.getPackageInfo(context.getPackageName(), 0); in getPackageInfo() 61 + context.getPackageName()); in getPackageInfo()
|
/cts/tests/contentcaptureservice/src/android/contentcaptureservice/cts/unit/ |
D | ContentCaptureContextTest.java | 84 final ContentCaptureContext context = mBuilder.build(); in testGetId() local 85 assertThat(context).isNotNull(); in testGetId() 86 assertThat(context.getLocusId()).isEqualTo(LOCUS_ID); in testGetId() 93 final ContentCaptureContext context = builder.build(); in testSetGetBundle() local 94 assertThat(context).isNotNull(); in testSetGetBundle() 95 assertExtras(context.getExtras()); in testSetGetBundle() 103 final ContentCaptureContext context = builder.build(); in testParcel() local 104 assertEverything(context); in testParcel() 106 final ContentCaptureContext clone = cloneThroughParcel(context); in testParcel() 117 final ContentCaptureContext context = ContentCaptureContext.forLocusId(ID); in testForLocus_valid() local [all …]
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/telecom/ |
D | PhoneAccountUtils.java | 78 public static void registerTestPhoneAccount(Context context) { in registerTestPhoneAccount() argument 79 TelecomManager telecomManager = (TelecomManager) context.getSystemService( in registerTestPhoneAccount() 89 public static PhoneAccount getPhoneAccount(Context context) { in getPhoneAccount() argument 90 TelecomManager telecomManager = (TelecomManager) context.getSystemService( in getPhoneAccount() 99 public static void unRegisterTestPhoneAccount(Context context) { in unRegisterTestPhoneAccount() argument 100 TelecomManager telecomManager = (TelecomManager) context.getSystemService( in unRegisterTestPhoneAccount() 109 public static void registerTestSelfManagedPhoneAccount(Context context) { in registerTestSelfManagedPhoneAccount() argument 110 TelecomManager telecomManager = (TelecomManager) context.getSystemService( in registerTestSelfManagedPhoneAccount() 120 public static void unRegisterTestSelfManagedPhoneAccount(Context context) { in unRegisterTestSelfManagedPhoneAccount() argument 121 TelecomManager telecomManager = (TelecomManager) context.getSystemService( in unRegisterTestSelfManagedPhoneAccount() [all …]
|
/cts/tests/tests/widget/src/android/widget/cts/ |
D | AutoCompleteTextViewNoIme.java | 31 public AutoCompleteTextViewNoIme(Context context) { in AutoCompleteTextViewNoIme() argument 32 super(context); in AutoCompleteTextViewNoIme() 35 public AutoCompleteTextViewNoIme(Context context, AttributeSet attrs) { in AutoCompleteTextViewNoIme() argument 36 super(context, attrs); in AutoCompleteTextViewNoIme() 39 public AutoCompleteTextViewNoIme(Context context, AttributeSet attrs, int defStyleAttr) { in AutoCompleteTextViewNoIme() argument 40 super(context, attrs, defStyleAttr); in AutoCompleteTextViewNoIme() 43 public AutoCompleteTextViewNoIme(Context context, AttributeSet attrs, int defStyleAttr, in AutoCompleteTextViewNoIme() argument 45 super(context, attrs, defStyleAttr, defStyleRes); in AutoCompleteTextViewNoIme() 48 public AutoCompleteTextViewNoIme(Context context, AttributeSet attrs, int defStyleAttr, in AutoCompleteTextViewNoIme() argument 50 super(context, attrs, defStyleAttr, defStyleRes, popupTheme); in AutoCompleteTextViewNoIme()
|
/cts/hostsidetests/statsd/apps/statsdapp/src/com/android/server/cts/device/statsd/ |
D | AtomTests.java | 76 Context context = InstrumentationRegistry.getContext(); in testAudioState() local 77 MediaPlayer mediaPlayer = MediaPlayer.create(context, R.raw.good); in testAudioState() 160 Context context = InstrumentationRegistry.getContext(); in testCameraState() local 161 CameraManager cam = context.getSystemService(CameraManager.class); in testCameraState() 197 waitForReceiver(context, 10_000, latch, null); in testCameraState() 202 Context context = InstrumentationRegistry.getContext(); in testFlashlight() local 203 CameraManager cam = context.getSystemService(CameraManager.class); in testFlashlight() 223 Context context = InstrumentationRegistry.getContext(); in testForegroundService() local 225 Intent intent = new Intent(context, StatsdCtsForegroundService.class); in testForegroundService() 226 context.startService(intent); in testForegroundService() [all …]
|
/cts/apps/NotificationBot/src/com/android/cts/robot/ |
D | NotificationBot.java | 61 public void onReceive(Context context, Intent intent) { in onReceive() argument 74 (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); in onReceive() 86 (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); in onReceive() 90 testShortcutResetSetupNotification(context, intent); in onReceive() 93 testShortcutResetInlineReplyReceived(context, intent); in onReceive() 104 private static void testShortcutResetSetupNotification(Context context, Intent intent) { in testShortcutResetSetupNotification() argument 105 final NotificationManager nm = context.getSystemService(NotificationManager.class); in testShortcutResetSetupNotification() 108 final ShortcutManager sm = context.getSystemService(ShortcutManager.class); in testShortcutResetSetupNotification() 122 sendShortcutResetReply(context, intent, in testShortcutResetSetupNotification() 130 PendingIntent.getBroadcast(context, 0, in testShortcutResetSetupNotification() [all …]
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/nfc/ |
D | NfcDialogs.java | 30 static AlertDialog createNotEnabledDialog(final Context context) { in createNotEnabledDialog() argument 31 return new AlertDialog.Builder(context) in createNotEnabledDialog() 39 context.startActivity(intent); in createNotEnabledDialog() 45 static AlertDialog createNdefPushNotEnabledDialog(final Context context) { 46 return new AlertDialog.Builder(context) 54 context.startActivity(intent); 60 public static AlertDialog createHceTapReaderDialog(final Context context, String message) { 61 String baseString = context.getString(R.string.nfc_hce_tap_reader_message); 62 return new AlertDialog.Builder(context) 70 public static AlertDialog createChangeForegroundDialog(final Context context) { [all …]
|
/cts/tests/tests/os/src/android/os/health/cts/ |
D | SystemHealthManagerTest.java | 37 final Context context = getInstrumentation().getTargetContext(); in testTakeMyUidSnapshot() local 38 final SystemHealthManager healthy = context.getSystemService(SystemHealthManager.class); in testTakeMyUidSnapshot() 48 final Context context = getInstrumentation().getTargetContext(); in testTakeUidSnapshotWithMe() local 49 final SystemHealthManager healthy = context.getSystemService(SystemHealthManager.class); in testTakeUidSnapshotWithMe() 59 final Context context = getInstrumentation().getTargetContext(); in testTakeMyUidSnapshotWithSystem() local 60 final SystemHealthManager healthy = context.getSystemService(SystemHealthManager.class); in testTakeMyUidSnapshotWithSystem() 77 final Context context = getInstrumentation().getTargetContext(); in testTakeUidSnapshotsWithEmptyArray() local 78 final SystemHealthManager healthy = context.getSystemService(SystemHealthManager.class); in testTakeUidSnapshotsWithEmptyArray() 89 final Context context = getInstrumentation().getTargetContext(); in testTakeUidSnapshotsWithMe() local 90 final SystemHealthManager healthy = context.getSystemService(SystemHealthManager.class); in testTakeUidSnapshotsWithMe() [all …]
|
/cts/tests/tests/nativemidi/jni/ |
D | native-lib.cpp | 281 TestContext* context = new TestContext; in Java_android_nativemidi_cts_NativeMidiEchoTest_allocTestContext() local 282 if (!context->initN(env)) { in Java_android_nativemidi_cts_NativeMidiEchoTest_allocTestContext() 283 delete context; in Java_android_nativemidi_cts_NativeMidiEchoTest_allocTestContext() 284 context = NULL; in Java_android_nativemidi_cts_NativeMidiEchoTest_allocTestContext() 287 return (jlong)context; in Java_android_nativemidi_cts_NativeMidiEchoTest_allocTestContext() 291 JNIEnv*, jclass, jlong context) { in Java_android_nativemidi_cts_NativeMidiEchoTest_freeTestContext() argument 292 delete (TestContext*)context; in Java_android_nativemidi_cts_NativeMidiEchoTest_freeTestContext() 310 void readThreadRoutine(TestContext* context) { in readThreadRoutine() argument 316 while (context->mReading) { in readThreadRoutine() 317 AMidiOutputPort* outputPort = context->midiOutputPort.load(); in readThreadRoutine() [all …]
|
/cts/tests/tests/widget/src/android/widget/cts/util/ |
D | ListItemFactory.java | 42 … public static View twoButtonsSeparatedByFiller(int position, Context context, int desiredHeight) { in twoButtonsSeparatedByFiller() argument 48 final LinearLayout ll = new LinearLayout(context); in twoButtonsSeparatedByFiller() 56 final Button topButton = new Button(context); in twoButtonsSeparatedByFiller() 62 final TextView middleFiller = new TextView(context); in twoButtonsSeparatedByFiller() 69 final Button bottomButton = new Button(context); in twoButtonsSeparatedByFiller() 91 public static View horizontalButtonSlots(Context context, int desiredHeight, Slot... slots) { in horizontalButtonSlots() argument 93 final LinearLayout ll = new LinearLayout(context); in horizontalButtonSlots() 119 final Button button = new Button(context); in horizontalButtonSlots() 123 ll.addView(new View(context), lp); in horizontalButtonSlots() 127 final Button button = new Button(context); in horizontalButtonSlots() [all …]
|
/cts/hostsidetests/devicepolicy/app/CorpOwnedManagedProfile/src/com/android/cts/comp/ |
D | AdminReceiver.java | 31 public static ComponentName getComponentName(Context context) { in getComponentName() argument 32 return new ComponentName(context, AdminReceiver.class); in getComponentName() 36 public void onProfileProvisioningComplete(Context context, Intent intent) { in onProfileProvisioningComplete() argument 37 super.onProfileProvisioningComplete(context, intent); in onProfileProvisioningComplete() 40 getManager(context).setProfileEnabled(getWho(context)); in onProfileProvisioningComplete() 41 getManager(context).setProfileName(getWho(context), "Corp owned Managed Profile"); in onProfileProvisioningComplete()
|
/cts/tests/tests/bluetooth/src/android/bluetooth/cts/ |
D | TestUtils.java | 61 static int getLocationMode(Context context) { in getLocationMode() argument 62 return Settings.Secure.getInt(context.getContentResolver(), in getLocationMode() 69 static void setLocationMode(Context context, int mode) { in setLocationMode() argument 70 Settings.Secure.putInt(context.getContentResolver(), Settings.Secure.LOCATION_MODE, in setLocationMode() 77 static boolean isLocationOn(Context context) { in isLocationOn() argument 78 return getLocationMode(context) != Settings.Secure.LOCATION_MODE_OFF; in isLocationOn() 84 static void enableLocation(Context context) { in enableLocation() argument 85 setLocationMode(context, Settings.Secure.LOCATION_MODE_SENSORS_ONLY); in enableLocation() 91 static void disableLocation(Context context) { in disableLocation() argument 92 setLocationMode(context, Settings.Secure.LOCATION_MODE_OFF); in disableLocation()
|
/cts/tests/tests/uirendering/src/android/uirendering/cts/testclasses/view/ |
D | UnclippedBlueView.java | 26 public UnclippedBlueView(Context context) { in UnclippedBlueView() argument 27 this(context, null); in UnclippedBlueView() 30 public UnclippedBlueView(Context context, AttributeSet attrs) { in UnclippedBlueView() argument 31 this(context, attrs, 0); in UnclippedBlueView() 34 public UnclippedBlueView(Context context, AttributeSet attrs, int defStyleAttr) { in UnclippedBlueView() argument 35 this(context, attrs, defStyleAttr, 0); in UnclippedBlueView() 38 public UnclippedBlueView(Context context, AttributeSet attrs, in UnclippedBlueView() argument 40 super(context, attrs, defStyleAttr, defStyleRes); in UnclippedBlueView()
|