Searched refs:getContext (Results 1 - 25 of 1472) sorted by relevance

1234567891011>>

/packages/apps/TV/tests/unit/src/com/android/tv/util/
H A DUtilsTest_GetDurationString.java18 import static android.support.test.InstrumentationRegistry.getContext;
92 assertEquals("3:00 AM", Utils.getDurationString(getContext(), DATE_THIS_YEAR_2_1_MS,
95 assertEquals("03:00", Utils.getDurationString(getContext(), DATE_THIS_YEAR_2_1_MS,
103 Utils.getDurationString(getContext(), DATE_THIS_YEAR_2_1_MS, DATE_THIS_YEAR_2_1_MS,
107 Utils.getDurationString(getContext(), DATE_THIS_YEAR_2_1_MS, DATE_THIS_YEAR_2_1_MS,
115 Utils.getDurationString(getContext(), DATE_THIS_YEAR_2_1_MS,
119 Utils.getDurationString(getContext(), DATE_THIS_YEAR_2_1_MS,
123 Utils.getDurationString(getContext(), DATE_THIS_YEAR_2_1_MS,
127 Utils.getDurationString(getContext(), DATE_THIS_YEAR_2_1_MS,
135 Utils.getDurationString(getContext(), DATE_THIS_YEAR_2_1_M
[all...]
/packages/apps/Messaging/tests/src/com/android/messaging/
H A DBugleTestCase.java40 TestUtil.testSetup(super.getContext(), this);
50 public Context getContext() { method in class:BugleTestCase
57 return super.getContext();
/packages/apps/Settings/src/com/android/settings/dashboard/conditional/
H A DBackgroundDataCondition.java33 setActive(NetworkPolicyManager.from(mManager.getContext()).getRestrictBackground());
38 return Icon.createWithResource(mManager.getContext(), R.drawable.ic_data_saver);
43 return mManager.getContext().getString(R.string.condition_bg_data_title);
48 return mManager.getContext().getString(R.string.condition_bg_data_summary);
53 return new CharSequence[] { mManager.getContext().getString(R.string.condition_turn_off) };
58 mManager.getContext().startActivity(new Intent(mManager.getContext(),
70 NetworkPolicyManager.from(mManager.getContext()).setRestrictBackground(false);
H A DBatterySaverCondition.java32 PowerManager powerManager = mManager.getContext().getSystemService(PowerManager.class);
38 return Icon.createWithResource(mManager.getContext(), R.drawable.ic_settings_battery);
43 return mManager.getContext().getString(R.string.condition_battery_title);
48 return mManager.getContext().getString(R.string.condition_battery_summary);
53 return new CharSequence[] { mManager.getContext().getString(R.string.condition_turn_off) };
58 Utils.startWithFragment(mManager.getContext(), BatterySaverSettings.class.getName(), null,
65 mManager.getContext().getSystemService(PowerManager.class).setPowerSaveMode(false);
H A DNightDisplayCondition.java34 mController = new NightDisplayController(manager.getContext());
45 return Icon.createWithResource(mManager.getContext(), R.drawable.ic_settings_night_display);
50 return mManager.getContext().getString(R.string.condition_night_display_title);
55 return mManager.getContext().getString(R.string.condition_night_display_summary);
60 return new CharSequence[] { mManager.getContext().getString(R.string.condition_turn_off) };
65 Utils.startWithFragment(mManager.getContext(), NightDisplaySettings.class.getName(), null,
H A DDndCondition.java53 mManager.getContext().registerReceiver(mReceiver, DND_FILTER);
60 mManager.getContext().getSystemService(NotificationManager.class);
86 return mManager.getContext().getString(R.string.zen_mode_option_alarms);
88 return mManager.getContext().getString(
91 return mManager.getContext().getString(R.string.zen_mode_option_no_interruptions);
98 return Icon.createWithResource(mManager.getContext(), R.drawable.ic_zen);
103 return mManager.getContext().getString(R.string.condition_zen_title, getZenState());
110 return isForever ? mManager.getContext().getString(com.android.internal.R.string.zen_mode_forever_dnd)
111 : ZenModeConfig.getConditionSummary(mManager.getContext(), mConfig,
118 return new CharSequence[] { mManager.getContext()
[all...]
H A DWorkModeCondition.java38 mUm = (UserManager) mManager.getContext().getSystemService(Context.USER_SERVICE);
63 return Icon.createWithResource(mManager.getContext(),
69 return mManager.getContext().getString(R.string.condition_work_title);
74 return mManager.getContext().getString(R.string.condition_work_summary);
80 mManager.getContext().getString(R.string.condition_turn_on)
86 mManager.getContext().startActivity(new Intent(mManager.getContext(),
H A DCellularDataCondition.java39 ConnectivityManager connectivity = mManager.getContext().getSystemService(
41 TelephonyManager telephony = mManager.getContext().getSystemService(TelephonyManager.class);
62 return Icon.createWithResource(mManager.getContext(), R.drawable.ic_cellular_off);
67 return mManager.getContext().getString(R.string.condition_cellular_title);
72 return mManager.getContext().getString(R.string.condition_cellular_summary);
77 return new CharSequence[] { mManager.getContext().getString(R.string.condition_turn_on) };
82 mManager.getContext().startActivity(new Intent(mManager.getContext(),
89 TelephonyManager telephony = mManager.getContext().getSystemService(
H A DAirplaneModeCondition.java46 setActive(WirelessUtils.isAirplaneModeOn(mManager.getContext()));
61 return Icon.createWithResource(mManager.getContext(), R.drawable.ic_airplane);
72 return mManager.getContext().getString(R.string.condition_airplane_title);
77 return mManager.getContext().getString(R.string.condition_airplane_summary);
82 return new CharSequence[] { mManager.getContext().getString(R.string.condition_turn_off) };
87 mManager.getContext().startActivity(new Intent(mManager.getContext(),
94 ConnectivityManager.from(mManager.getContext()).setAirplaneMode(false);
/packages/providers/DownloadProvider/tests/src/com/android/providers/downloads/
H A DHelpersTest.java36 IoUtils.deleteContents(getContext().getFilesDir());
37 IoUtils.deleteContents(getContext().getCacheDir());
43 final File expected = new File(getContext().getFilesDir(), "file.mp4");
44 final String actual = Helpers.generateSaveFile(getContext(),
51 final File expected1 = new File(getContext().getFilesDir(), "file.txt");
52 final String actual1 = Helpers.generateSaveFile(getContext(), "http://example.com/file.txt",
55 final File expected2 = new File(getContext().getFilesDir(), "file-1.txt");
56 final String actual2 = Helpers.generateSaveFile(getContext(), "http://example.com/file.txt",
64 final File expected = new File(getContext().getFilesDir(), "file.mp4");
65 final String actual = Helpers.generateSaveFile(getContext(),
[all...]
/packages/apps/Contacts/tests/src/com/android/contacts/interactions/
H A DContactInteractionUtilTest.java70 calendar.getTimeInMillis(), getContext()));
79 getContext()));
92 getContext()));
97 ContactInteractionUtil.formatDuration(0, getContext()));
102 ContactInteractionUtil.formatDuration(60, getContext()));
107 ContactInteractionUtil.formatDuration(1809, getContext()));
112 ContactInteractionUtil.formatDuration(3600, getContext()));
117 ContactInteractionUtil.formatDuration(9876, getContext()));
122 Resources res = getContext().getResources();
/packages/apps/Email/tests/src/com/android/emailcommon/
H A DDeviceTests.java32 (TelephonyManager) getContext().getSystemService(Context.TELEPHONY_SERVICE);
39 final String deviceId = Device.getConsistentDeviceId(getContext());
40 final String deviceId2 = Device.getConsistentDeviceId(getContext());
/packages/apps/Calendar/src/com/android/calendar/
H A DCalendarRecentSuggestionsProvider.java29 setupSuggestions(Utils.getSearchAuthority(getContext()), MODE);
/packages/apps/Dialer/java/com/android/voicemail/impl/settings/
H A DVoicemailSettingsFragment.java66 omtpVvmCarrierConfigHelper = new OmtpVvmCarrierConfigHelper(getContext(), phoneAccountHandle);
72 Logger.get(getContext()).logImpression(DialerImpression.Type.VVM_SETTINGS_VIEWED);
91 Logger.get(getContext())
105 if (!VoicemailComponent.get(getContext())
107 .isVoicemailArchiveAvailable(getContext())) {
116 new Intent(new Intent(getContext(), VoicemailChangePinActivity.class));
125 Logger.get(getContext()).logImpression(DialerImpression.Type.VVM_CHANGE_PIN_CLICKED);
130 if (VoicemailChangePinActivity.isDefaultOldPinSet(getContext(), phoneAccountHandle)) {
139 VisualVoicemailSettingsUtil.isEnabled(getContext(), phoneAccountHandle));
143 VisualVoicemailSettingsUtil.isArchiveEnabled(getContext(), phoneAccountHandl
[all...]
/packages/apps/DocumentsUI/src/com/android/documentsui/dirlist/
H A DMessage.java113 mEnv.getContext().getDrawable(R.drawable.ic_dialog_alert));
116 mEnv.getContext().getDrawable(R.drawable.ic_dialog_info));
125 .getProvidersCache(mEnv.getContext()).getApplicationName(root.authority);
126 update(mEnv.getContext().getString(R.string.authentication_required, appName),
127 mEnv.getContext().getResources().getText(R.string.sign_in),
128 mEnv.getContext().getDrawable(R.drawable.ic_dialog_info));
156 update(mEnv.getContext().getResources().getText(R.string.query_error), null,
157 mEnv.getContext().getDrawable(R.drawable.hourglass));
161 update(mEnv.getContext().getResources().getText(R.string.cant_display_content), null,
162 mEnv.getContext()
[all...]
/packages/apps/Dialer/java/com/android/voicemail/impl/
H A DStatusCheckTask.java60 getContext()
77 new OmtpVvmCarrierConfigHelper(getContext(), getPhoneAccountHandle());
82 VvmAccountManager.removeAccount(getContext(), getPhoneAccountHandle());
87 try (StatusSmsFetcher fetcher = new StatusSmsFetcher(getContext(), getPhoneAccountHandle())) {
116 getContext(), DialerImpression.Type.VVM_STATUS_CHECK_READY);
117 VvmAccountManager.addAccount(getContext(), getPhoneAccountHandle(), message);
122 VvmAccountManager.removeAccount(getContext(), getPhoneAccountHandle());
124 getContext(), DialerImpression.Type.VVM_STATUS_CHECK_REACTIVATION);
125 ActivationTask.start(getContext(), getPhoneAccountHandle(), data);
/packages/apps/Dialer/java/com/android/dialer/app/settings/
H A DDefaultRingtonePreference.java49 if (!Settings.System.canWrite(getContext())) {
51 getContext(),
52 getContext().getResources().getString(R.string.toast_cannot_write_system_settings),
57 RingtoneManager.setActualDefaultRingtoneUri(getContext(), getRingtoneType(), ringtoneUri);
62 return RingtoneManager.getActualDefaultRingtoneUri(getContext(), getRingtoneType());
/packages/apps/Settings/src/com/android/settings/datausage/
H A DDataUsagePreference.java43 DataUsageController controller = new DataUsageController(getContext());
45 setSummary(getContext().getString(R.string.data_usage_template,
46 Formatter.formatFileSize(getContext(), usageInfo.usageLevel), usageInfo.period));
55 return Utils.onBuildStartFragmentIntent(getContext(), DataUsageList.class.getName(), args,
56 getContext().getPackageName(), 0, getTitle(), false,
/packages/apps/Settings/src/com/android/settings/fuelgauge/
H A DDebugEstimatesLoader.java44 Context context = getContext();
50 Intent batteryBroadcast = getContext().registerReceiver(null,
54 BatteryInfo oldinfo = BatteryInfo.getBatteryInfoOld(getContext(), batteryBroadcast,
58 powerUsageFeatureProvider.getEnhancedBatteryPrediction(getContext()));
59 BatteryInfo newinfo = BatteryInfo.getBatteryInfo(getContext(), batteryBroadcast, stats,
/packages/apps/Car/Settings/src/com/android/car/settings/system/
H A DSystemSettingsFragment.java43 lineItems.add(new SystemUpdatesLineItem(getContext()));
44 lineItems.add(new AboutSystemLineItem(getContext(), mFragmentController));
45 lineItems.add(new LegalInfoLineItem(getContext()));
/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/
H A DAbstractInternalSource.java51 return getContext().getPackageName();
61 return getContext().getResources().getDrawable(getSourceIconResource());
66 return Uri.parse("android.resource://" + getContext().getPackageName()
/packages/apps/Car/Settings/src/com/android/car/settings/datetime/
H A DDatetimeSettingsFragment.java57 lineItems.add(new DateTimeToggleLineItem(getContext(),
61 lineItems.add(new DateTimeToggleLineItem(getContext(),
65 lineItems.add(new SetDateLineItem(getContext(), mFragmentController));
66 lineItems.add(new SetTimeLineItem(getContext(), mFragmentController));
67 lineItems.add(new SetTimeZoneLineItem(getContext(), mFragmentController));
68 lineItems.add(new TimeFormatToggleLineItem(getContext()));
/packages/apps/Email/tests/src/com/android/email/
H A DVendorPolicyLoaderTest.java34 mTestApkPackageName = getContext().getPackageName() + ".tests";
47 VendorPolicyLoader pl = new VendorPolicyLoader(getContext(), "no.such.package",
55 final Context c = getContext();
66 MockVendorPolicy.inject(getContext());
67 VendorPolicyLoader pl = VendorPolicyLoader.getInstance(getContext());
94 VendorPolicyLoader pl = new VendorPolicyLoader(getContext(), mTestApkPackageName,
115 VendorPolicyLoader pl = VendorPolicyLoader.getInstance(getContext());
147 VendorPolicyLoader pl = VendorPolicyLoader.getInstance(getContext());
/packages/apps/TvSettings/Settings/src/com/android/tv/settings/system/development/
H A DCaptionCustomFragment.java199 final String typeface = Settings.Secure.getString(getContext().getContentResolver(),
206 Settings.Secure.putString(getContext().getContentResolver(),
209 Settings.Secure.putString(getContext().getContentResolver(),
215 return Integer.toHexString(Settings.Secure.getInt(getContext().getContentResolver(),
221 final int alpha = Settings.Secure.getInt(getContext().getContentResolver(),
223 Settings.Secure.putInt(getContext().getContentResolver(),
228 return opacityToString(Settings.Secure.getInt(getContext().getContentResolver(),
233 final int color = Settings.Secure.getInt(getContext().getContentResolver(),
236 Settings.Secure.putInt(getContext().getContentResolver(),
241 return Integer.toString(Settings.Secure.getInt(getContext()
[all...]
/packages/apps/Bluetooth/tests/src/com/android/bluetooth/hdp/
H A DHealthServiceTest.java13 testService.attach(getInstrumentation().getContext(), null, null, null, null, null);

Completed in 913 milliseconds

1234567891011>>