Bug 1243931 - Use Context.getPackageName() instead of AppConstants.ANDROID_PACKAGE_NAME. r=nalexander

This patch just modifies the search widget to use the Android Context function instead of the hard-coded (at compile time) value.
This commit is contained in:
Nathan Toone 2016-01-28 16:30:52 -07:00
parent a7859ae4f3
commit 622fcfe878
2 changed files with 4 additions and 4 deletions

View File

@ -134,7 +134,7 @@ public class PostSearchFragment extends Fragment {
// If the intent URI didn't specify a package, open this in Fennec.
if (i.getPackage() == null) {
i.setClassName(AppConstants.ANDROID_PACKAGE_NAME, AppConstants.MOZ_ANDROID_BROWSER_INTENT_CLASS);
i.setClassName(view.getContext().getPackageName(), AppConstants.MOZ_ANDROID_BROWSER_INTENT_CLASS);
Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL,
TelemetryContract.Method.CONTENT, "search-result");
} else {

View File

@ -67,7 +67,7 @@ public class SearchWidget extends AppWidgetProvider {
switch (intent.getAction()) {
case ACTION_LAUNCH_BROWSER:
redirect = buildRedirectIntent(Intent.ACTION_MAIN,
AppConstants.ANDROID_PACKAGE_NAME,
context.getPackageName(),
AppConstants.MOZ_ANDROID_BROWSER_INTENT_CLASS,
intent);
Telemetry.sendUIEvent(TelemetryContract.Event.LAUNCH,
@ -75,7 +75,7 @@ public class SearchWidget extends AppWidgetProvider {
break;
case ACTION_LAUNCH_NEW_TAB:
redirect = buildRedirectIntent(Intent.ACTION_VIEW,
AppConstants.ANDROID_PACKAGE_NAME,
context.getPackageName(),
AppConstants.MOZ_ANDROID_BROWSER_INTENT_CLASS,
intent);
Telemetry.sendUIEvent(TelemetryContract.Event.LAUNCH,
@ -83,7 +83,7 @@ public class SearchWidget extends AppWidgetProvider {
break;
case ACTION_LAUNCH_SEARCH:
redirect = buildRedirectIntent(Intent.ACTION_VIEW,
AppConstants.ANDROID_PACKAGE_NAME,
context.getPackageName(),
AppConstants.MOZ_ANDROID_SEARCH_INTENT_CLASS,
intent);
Telemetry.sendUIEvent(TelemetryContract.Event.LAUNCH,