Home
last modified time | relevance | path

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

12345678910>>...14

/cts/tests/tests/app/src/android/app/cts/
DServiceTest.java43 private Context mContext; field in ServiceTest
140 mContext.startService(new Intent(service).putExtras(bundle)); in startExpectResult()
143 mContext.startService(new Intent(service).putExtras(bundle)); in startExpectResult()
148 mContext.stopService(service); in startExpectResult()
152 mContext.stopService(service); in startExpectResult()
179 mContext.bindService(service, conn, 0); in bindExpectResult()
180 mContext.startService(service); in bindExpectResult()
184 mContext.bindService(service, conn2, 0); in bindExpectResult()
187 mContext.unbindService(conn2); in bindExpectResult()
191 mContext.unbindService(conn); in bindExpectResult()
[all …]
DPendingIntentTest.java35 private Context mContext; field in PendingIntentTest
47 mContext = getContext(); in setUp()
102 mIntent.setClass(mContext, PendingIntentStubActivity.class); in testGetActivity()
104 mPendingIntent = PendingIntent.getActivity(mContext, 1, mIntent, in testGetActivity()
106 assertEquals(mContext.getPackageName(), mPendingIntent.getTargetPackage()); in testGetActivity()
116 mPendingIntent = PendingIntent.getActivity(mContext, 1, mIntent, in testGetActivity()
120 mPendingIntent = PendingIntent.getActivity(mContext, 1, mIntent, in testGetActivity()
142 mIntent.setClass(mContext, MockReceiver.class); in testGetBroadcast()
143 mPendingIntent = PendingIntent.getBroadcast(mContext, 1, mIntent, in testGetBroadcast()
153 mPendingIntent = PendingIntent.getBroadcast(mContext, 1, mIntent, in testGetBroadcast()
[all …]
DProgressDialogTest.java48 private Context mContext; field in ProgressDialogTest
63 mContext = mActivity; in setUp()
70 new ProgressDialog(mContext); in testProgressDialog1()
75 new ProgressDialog(mContext, com.android.cts.app.stub.R.style.Theme_AlertDialog); in testProgressDialog2()
80 MockProgressDialog pd = new MockProgressDialog(mContext); in testOnStartCreateStop()
95 ProgressDialog.show(mContext, TITLE, MESSAGE); in testShow1()
100 ProgressDialog dialog = ProgressDialog.show(mContext, TITLE, MESSAGE, false); in testShow2()
108 dialog = ProgressDialog.show(mContext, TITLE, MESSAGE, true); in testShow2()
122 ProgressDialog dialog = ProgressDialog.show(mContext, TITLE, MESSAGE, true, false); in testShow3()
136 ProgressDialog dialog = ProgressDialog.show(mContext, TITLE, MESSAGE, true, true); in testShow3()
[all …]
DAlertDialog_BuilderTest.java52 private Context mContext; field in AlertDialog_BuilderTest
112 mContext = getActivity(); in setUp()
134 new AlertDialog.Builder(mContext); in testConstructor()
140 mDrawable = mContext.getResources().getDrawable(android.R.drawable.btn_default); in testSetIconWithParamInt()
141 mBuilder = new AlertDialog.Builder(mContext); in testSetIconWithParamInt()
152 mDrawable = mContext.getResources().getDrawable(android.R.drawable.btn_default); in testSetIconWithParamDrawable()
153 mBuilder = new AlertDialog.Builder(mContext); in testSetIconWithParamDrawable()
164 mBuilder = new AlertDialog.Builder(mContext); in testSetPositiveButtonWithParamInt()
173 assertEquals(mContext.getText(android.R.string.yes), mButton.getText()); in testSetPositiveButtonWithParamInt()
180 mBuilder = new AlertDialog.Builder(mContext); in testSetPositiveButtonWithParamCharSequence()
[all …]
/cts/tests/tests/content/src/android/content/cts/
DContextTest.java38 private Context mContext; field in ContextTest
43 mContext = getContext(); in setUp()
44 mContext.setTheme(R.style.Test_Theme); in setUp()
48 String testString = mContext.getString(R.string.context_test_string1); in testGetString()
51 testString = mContext.getString(R.string.context_test_string1, "expected"); in testGetString()
54 testString = mContext.getString(R.string.context_test_string2); in testGetString()
59 testString = mContext.getString(0, "expected"); in testGetString()
66 testString = mContext.getString(0); in testGetString()
73 CharSequence testCharSequence = mContext.getText(R.string.context_test_string2); in testGetText()
78 testCharSequence = mContext.getText(0); in testGetText()
[all …]
DIntent_ShortcutIconResourceTest.java31 Context mContext; field in Intent_ShortcutIconResourceTest
38 mContext = getContext(); in setUp()
42 String resourceName = mContext.getResources().getResourceName( in testToString()
44 mShortcutIconResource = ShortcutIconResource.fromContext(mContext, in testToString()
52 String resourceName = mContext.getResources().getResourceName( in testFromContext()
54 mShortcutIconResource = ShortcutIconResource.fromContext(mContext, in testFromContext()
59 assertEquals(mContext.getPackageName(), in testFromContext()
65 mShortcutIconResource = ShortcutIconResource.fromContext(mContext, in testWriteToParcel()
/cts/tests/tests/widget/src/android/widget/cts/
DRadioButtonTest.java32 private Context mContext; field in RadioButtonTest
37 mContext = getInstrumentation().getTargetContext(); in setUp()
41 AttributeSet attrs = mContext.getResources().getLayout(R.layout.radiogroup_1); in testConstructor()
44 new RadioButton(mContext); in testConstructor()
51 new RadioButton(mContext, attrs); in testConstructor()
57 new RadioButton(mContext, null); in testConstructor()
59 new RadioButton(mContext, attrs, 0); in testConstructor()
65 new RadioButton(mContext, null, 0); in testConstructor()
66 new RadioButton(mContext, attrs, Integer.MAX_VALUE); in testConstructor()
67 new RadioButton(mContext, attrs, Integer.MIN_VALUE); in testConstructor()
[all …]
DZoomControlsTest.java31 private Context mContext; field in ZoomControlsTest
36 mContext = getInstrumentation().getContext(); in setUp()
41 new ZoomControls(mContext); in testConstructor()
43 new ZoomControls(mContext, null); in testConstructor()
48 ZoomControls zoomControls = new ZoomControls(mContext); in testSetOnZoomInClickListener()
66 ZoomControls zoomControls = new ZoomControls(mContext); in testSetOnZoomOutClickListener()
78 ZoomControls zoomControls = new ZoomControls(mContext); in testSetZoomSpeed()
91 final ZoomControls zoomControls = new ZoomControls(mContext); in testShowAndHide()
103 ZoomControls zoomControls = new ZoomControls(mContext); in testSetIsZoomInEnabled()
110 ZoomControls zoomControls = new ZoomControls(mContext); in testSetIsZoomOutEnabled()
[all …]
DCursorAdapterTest.java61 private Context mContext; field in CursorAdapterTest
66 mContext = getInstrumentation().getTargetContext(); in setUp()
67 File dbDir = mContext.getDir("tests", Context.MODE_WORLD_WRITEABLE); in setUp()
80 final LayoutInflater inflater = LayoutInflater.from(mContext); in setUp()
98 new MockCursorAdapter(mContext, mCursor); in testConstructor()
102 new MockCursorAdapter(mContext, mCursor, true); in testConstructor()
118 cursorAdapter.init(mContext, null, false); in testInit()
119 assertSame(mContext, cursorAdapter.getContext()); in testInit()
126 cursorAdapter.init(mContext, null, true); in testInit()
127 assertSame(mContext, cursorAdapter.getContext()); in testInit()
[all …]
DTimePickerTest.java37 private Context mContext; field in TimePickerTest
49 mContext = mInstrumentation.getTargetContext(); in setUp()
55 mContext.getResources().getLayout(com.android.cts.widget.R.layout.timepicker); in testConstructors()
58 new TimePicker(mContext); in testConstructors()
66 new TimePicker(mContext, attrs); in testConstructors()
73 new TimePicker(mContext, null); in testConstructors()
75 new TimePicker(mContext, attrs, 0); in testConstructors()
82 new TimePicker(mContext, null, 0); in testConstructors()
83 new TimePicker(mContext, attrs, 0); in testConstructors()
84 new TimePicker(mContext, attrs, Integer.MIN_VALUE); in testConstructors()
[all …]
DSwitchTest.java39 new Switch(mContext); in testConstructor()
41 XmlResourceParser parser = mContext.getResources().getLayout(R.layout.switch_layout); in testConstructor()
44 new Switch(mContext, parser); in testConstructor()
46 new Switch(mContext, parser, 0); in testConstructor()
48 new Switch(mContext, parser, 0, 0); in testConstructor()
52 XmlResourceParser parser = mContext.getResources().getLayout(R.layout.switch_layout); in testAccessThumbTint()
54 Switch aSwitch = new Switch(mContext, parser); in testAccessThumbTint()
67 XmlResourceParser parser = mContext.getResources().getLayout(R.layout.switch_layout); in testAccessTrackTint()
69 Switch aSwitch = new Switch(mContext, parser); in testAccessTrackTint()
DTextSwitcherTest.java31 private Context mContext; field in TextSwitcherTest
45 mContext = getInstrumentation().getContext(); in setUp()
49 new TextSwitcher(mContext); in testConstructor()
51 new TextSwitcher(mContext, null); in testConstructor()
59 TextSwitcher textSwitcher = new TextSwitcher(mContext); in testSetText()
61 TextView tv1 = new TextView(mContext); in testSetText()
62 TextView tv2 = new TextView(mContext); in testSetText()
99 TextSwitcher textSwitcher = new TextSwitcher(mContext); in testSetCurrentText()
101 TextView tv1 = new TextView(mContext); in testSetCurrentText()
102 TextView tv2 = new TextView(mContext); in testSetCurrentText()
[all …]
DExpandableListViewTest.java45 new ExpandableListView(mContext); in testConstructor()
47 new ExpandableListView(mContext, null); in testConstructor()
49 new ExpandableListView(mContext, null, 0); in testConstructor()
54 new ExpandableListView(mContext, attrs); in testConstructor()
55 new ExpandableListView(mContext, attrs, 0); in testConstructor()
77 ExpandableListView expandableListView = new ExpandableListView(mContext); in testSetChildDivider()
78 Drawable drawable = mContext.getResources().getDrawable(R.drawable.scenery); in testSetChildDivider()
83 ExpandableListView expandableListView = new ExpandableListView(mContext); in testSetAdapter()
92 ExpandableListView expandableListView = new ExpandableListView(mContext); in testGetAdapter()
101 ExpandableListView expandableListView = new ExpandableListView(mContext); in testAccessExpandableListAdapter()
[all …]
DLinearLayoutTest.java40 private Context mContext; field in LinearLayoutTest
51 mContext = getInstrumentation().getTargetContext(); in setUp()
55 new LinearLayout(mContext); in testConstructor()
57 new LinearLayout(mContext, null); in testConstructor()
59 XmlPullParser parser = mContext.getResources().getXml(R.layout.linearlayout_layout); in testConstructor()
61 new LinearLayout(mContext, attrs); in testConstructor()
71 LinearLayout linearLayout = new LinearLayout(mContext); in testAccessBaselineAligned()
93 LinearLayout linearLayout = new LinearLayout(mContext); in testGetBaseline()
95 ListView lv1 = new ListView(mContext); in testGetBaseline()
99 ListView lv2 = new ListView(mContext); in testGetBaseline()
[all …]
/cts/tests/tests/view/src/android/view/cts/
DOrientationListenerTest.java29 private Context mContext; field in OrientationListenerTest
34 mContext = getContext(); in setUp()
38 new MockOrientationListener(mContext); in testConstructor()
40 new MockOrientationListener(mContext, SensorManager.SENSOR_DELAY_UI); in testConstructor()
45 MockOrientationListener listener = new MockOrientationListener(mContext); in testRegisterationOfOrientationListener()
52 new MockOrientationListener(mContext).onAccuracyChanged(SensorManager.SENSOR_ACCELEROMETER, in testOnAccuracyChanged()
55 new MockOrientationListener(mContext).onAccuracyChanged(SensorManager.SENSOR_ORIENTATION, in testOnAccuracyChanged()
61 MockOrientationListener listener = new MockOrientationListener(mContext); in testOnSensorChanged()
66 new MockOrientationListener(mContext).onSensorChanged(SensorManager.SENSOR_ACCELEROMETER, in testOnSensorChanged()
73 new MockOrientationListener(mContext).onSensorChanged(SensorManager.SENSOR_MAGNETIC_FIELD, in testOnSensorChanged()
[all …]
DViewGroupTest.java66 private Context mContext; field in ViewGroupTest
78 mContext = getInstrumentation().getTargetContext(); in setUp()
82 new MockViewGroup(mContext); in testConstructor()
83 new MockViewGroup(mContext, null); in testConstructor()
84 new MockViewGroup(mContext, null, 0); in testConstructor()
88 MockViewGroup vg = new MockViewGroup(mContext); in testAddFocusables()
92 TextView textView = new TextView(mContext); in testAddFocusables()
108 MockViewGroup vg = new MockViewGroup(mContext); in testAddStatesFromChildren()
109 TextView textView = new TextView(mContext); in testAddStatesFromChildren()
120 MockViewGroup vg = new MockViewGroup(mContext); in testAddTouchables()
[all …]
/cts/tests/tests/text/src/android/text/format/cts/
DFormatterTest.java35 assertEquals("0.00 B", Formatter.formatFileSize(mContext, 0)); in testFormatFileSize()
37 assertEquals("899 B", Formatter.formatFileSize(mContext, 899)); in testFormatFileSize()
39 assertEquals("1.00 KB", Formatter.formatFileSize(mContext, bd.pow(1).longValue())); in testFormatFileSize()
41 assertEquals("1.00 MB", Formatter.formatFileSize(mContext, bd.pow(2).longValue())); in testFormatFileSize()
43 assertEquals("1.00 GB", Formatter.formatFileSize(mContext, bd.pow(3).longValue())); in testFormatFileSize()
45 assertEquals("1.00 TB", Formatter.formatFileSize(mContext, bd.pow(4).longValue())); in testFormatFileSize()
47 assertEquals("1.00 PB", Formatter.formatFileSize(mContext, bd.pow(5).longValue())); in testFormatFileSize()
49 assertEquals("1024 PB", Formatter.formatFileSize(mContext, bd.pow(6).longValue())); in testFormatFileSize()
52 assertEquals("-1.00 B", Formatter.formatFileSize(mContext, -1)); in testFormatFileSize()
/cts/tests/tests/telecom2/src/android/telecom/cts/
DDefaultDialerOperationsNoPermissionsTest.java28 private Context mContext; field in DefaultDialerOperationsNoPermissionsTest
36 mContext = getInstrumentation().getContext(); in setUp()
37 if (!TestUtils.shouldTestTelecom(mContext)) { in setUp()
40 TestUtils.PACKAGE = mContext.getPackageName(); in setUp()
48 mTelecomManager = (TelecomManager) mContext.getSystemService(Context.TELECOM_SERVICE); in setUp()
62 if (!TestUtils.shouldTestTelecom(mContext)) { in testShowInCallScreenPermissions()
74 if (!TestUtils.shouldTestTelecom(mContext)) { in testGetCallCapableAccountsPermissions()
86 if (!TestUtils.shouldTestTelecom(mContext)) { in testGetDefaultOutgoingPhoneAccount()
98 if (!TestUtils.shouldTestTelecom(mContext)) { in testGetLine1Number()
110 if (!TestUtils.shouldTestTelecom(mContext)) { in testGetVoicemailNumber()
[all …]
/cts/tests/tests/telecom/src/android/telecom/cts/
DDefaultDialerOperationsTest.java36 private Context mContext; field in DefaultDialerOperationsTest
45 mContext = getInstrumentation().getContext(); in setUp()
47 if (!TestUtils.shouldTestTelecom(mContext)) { in setUp()
57 mTelecomManager = (TelecomManager) mContext.getSystemService(Context.TELECOM_SERVICE); in setUp()
75 if (!TestUtils.shouldTestTelecom(mContext)) { in testGetDefaultDialerPackage()
84 if (!TestUtils.shouldTestTelecom(mContext)) { in testVoicemailReadWritePermissions()
88 mContext.getContentResolver().query(Voicemails.CONTENT_URI, null, null, null, null); in testVoicemailReadWritePermissions()
94 mContext.getContentResolver().delete(Voicemails.CONTENT_URI, in testVoicemailReadWritePermissions()
101 mContext.getContentResolver().update( in testVoicemailReadWritePermissions()
112 mContext.getContentResolver().query(Voicemails.CONTENT_URI, null, null, null, null); in testVoicemailReadWritePermissions()
[all …]
/cts/apps/CtsVerifier/src/com/android/cts/verifier/p2p/testcase/
DTestCase.java49 protected Context mContext; field in TestCase
69 mContext = context; in TestCase()
89 mListener.onTestFailed(mContext.getString(R.string.p2p_setup_error)); in start()
102 mContext.getString(R.string.p2p_unexpected_error)); in start()
145 mP2pMgr = (WifiP2pManager) mContext.getSystemService(Context.WIFI_P2P_SERVICE); in setUp()
146 mWifiMgr = (WifiManager) mContext.getSystemService(Context.WIFI_SERVICE); in setUp()
147 mChannel = mP2pMgr.initialize(mContext, mContext.getMainLooper(), null); in setUp()
148 mSubChannel = mP2pMgr.initialize(mContext, mContext.getMainLooper(), null); in setUp()
166 mListener.onTestMsgReceived(mContext.getString(id)); in notifyTestMsg()
175 return mContext.getString(R.string.p2p_unexpected_error); in getReason()
/cts/tests/ProcessTest/src/com/android/cts/process/
DProcessTest.java38 String testApp = mContext.getPackageName(); in testUid()
39 int uid1 = mContext.getPackageManager().getApplicationInfo(enableApp, in testUid()
41 int uid2 = mContext.getPackageManager().getApplicationInfo(disableApp, in testUid()
43 int uid3 = mContext.getPackageManager().getApplicationInfo(testApp, in testUid()
50 ActivityManager am = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE); in testPid()
51 String shareProcessName = mContext.getPackageName() + ":shareProcess"; in testPid()
52 String noShareProcessName = mContext.getPackageName() + ":noShareProcess"; in testPid()
57 sharePidIntent.setClass(mContext, SharePidActivity.class); in testPid()
59 mContext.startActivity(sharePidIntent); in testPid()
65 sharePidStubIntent.setClass(mContext, SharePidSubActivity.class); in testPid()
[all …]
/cts/tests/tests/media/src/android/media/cts/
DRingtoneTest.java33 private Context mContext; field in RingtoneTest
45 mContext = getInstrumentation().getContext(); in setUp()
46 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); in setUp()
47 mRingtone = RingtoneManager.getRingtone(mContext, Settings.System.DEFAULT_RINGTONE_URI); in setUp()
59 mDefaultRingUri = RingtoneManager.getActualDefaultRingtoneUri(mContext, in setUp()
87 RingtoneManager.setActualDefaultRingtoneUri(mContext, RingtoneManager.TYPE_RINGTONE, in tearDown()
103 assertNotNull(mRingtone.getTitle(mContext)); in testRingtone()
115 RingtoneManager.setActualDefaultRingtoneUri(mContext, RingtoneManager.TYPE_RINGTONE, null); in testRingtone()
116 mRingtone = RingtoneManager.getRingtone(mContext, Settings.System.DEFAULT_RINGTONE_URI); in testRingtone()
121 Uri uri = RingtoneManager.getValidRingtoneUri(mContext); in testRingtone()
[all …]
DRingtoneManagerTest.java42 private Context mContext; field in RingtoneManagerTest
57 mContext = mInstrumentation.getContext(); in setUp()
58 Utils.enableAppOps(mContext.getPackageName(), "android:write_settings", mInstrumentation); in setUp()
60 mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE); in setUp()
63 mDefaultUri = RingtoneManager.getActualDefaultRingtoneUri(mContext, in setUp()
76 RingtoneManager.setActualDefaultRingtoneUri(mContext, RingtoneManager.TYPE_RINGTONE, in tearDown()
78 Utils.disableAppOps(mContext.getPackageName(), "android:write_settings", mInstrumentation); in tearDown()
83 return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUDIO_OUTPUT); in hasAudioOutput()
88 new RingtoneManager(mContext); in testConstructors()
101 assertNotNull(RingtoneManager.getRingtone(mContext, Settings.System.DEFAULT_RINGTONE_URI)); in testAccessMethods()
[all …]
/cts/tests/tests/text/src/android/text/style/cts/
DImageSpanTest.java43 Drawable d = mContext.getResources().getDrawable(R.drawable.pass); in testConstructor()
52 new ImageSpan(mContext, Uri.parse("content://user/a/b")); in testConstructor()
53 new ImageSpan(mContext, Uri.parse("content://user/a/b"), in testConstructor()
55 new ImageSpan(mContext, Uri.parse("content://user/a/b"), in testConstructor()
58 new ImageSpan(mContext, R.drawable.pass); in testConstructor()
59 new ImageSpan(mContext, R.drawable.pass, DynamicDrawableSpan.ALIGN_BOTTOM); in testConstructor()
60 new ImageSpan(mContext, R.drawable.pass, DynamicDrawableSpan.ALIGN_BASELINE); in testConstructor()
73 Drawable d = mContext.getResources().getDrawable(R.drawable.pass); in testGetSource()
83 imageSpan = new ImageSpan(mContext, Uri.parse(source)); in testGetSource()
88 Drawable drawable = mContext.getResources().getDrawable(R.drawable.pass); in testGetDrawable()
[all …]
/cts/tests/tests/permission/src/android/permission/cts/
DNoBroadcastPackageRemovedPermissionTest.java40 mContext.sendStickyBroadcast(createIntent(Intent.ACTION_WALLPAPER_CHANGED)); in testSendOrRemoveStickyBroadcast()
47 mContext.removeStickyBroadcast(createIntent(Intent.ACTION_WALLPAPER_CHANGED)); in testSendOrRemoveStickyBroadcast()
67 mContext.sendBroadcast(createIntent(Intent.ACTION_PACKAGE_REMOVED)); in testSendBroadcast()
74 mContext.sendBroadcast(createIntent(Intent.ACTION_PACKAGE_REMOVED), in testSendBroadcast()
82 mContext.sendOrderedBroadcast(createIntent(Intent.ACTION_PACKAGE_REMOVED), in testSendBroadcast()
90 mContext.sendOrderedBroadcast(createIntent(Intent.ACTION_PACKAGE_REMOVED), in testSendBroadcast()

12345678910>>...14