@@ -0,0 +1,1558 @@
+/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-%0A * This Source Code Form is subject to the terms of the Mozilla Public%0A * License, v. 2.0. If a copy of the MPL was not distributed with this%0A * file, You can obtain one at http://mozilla.org/MPL/2.0/. */%0A%0Apackage org.mozilla.focus.utils;%0A%0Aimport android.content.Context;%0Aimport android.content.pm.PackageManager;%0Aimport android.os.Build;%0A%0Aimport java.io.UnsupportedEncodingException;%0Aimport java.net.URLEncoder;%0Aimport java.util.Locale;%0A%0Apublic class SupportUtils %7B%0A%0A    public static String getSumoURLForTopic(final Context context, final String topic) %7B%0A        String escapedTopic;%0A        try %7B%0A            escapedTopic = URLEncoder.encode(topic, %22UTF-8%22);%0A        %7D catch (UnsupportedEncodingException e) %7B%0A            throw new IllegalStateException(%22utf-8 should always be available%22, e);%0A        %7D%0A%0A        final String appVersion;%0A        try %7B%0A            appVersion = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;%0A        %7D catch (PackageManager.NameNotFoundException e) %7B%0A            // This should be impossible - we should always be able to get information about ourselves:%0A            throw new IllegalStateException(%22Unable find package details for Focus%22, e);%0A        %7D%0A%0A        final String osTarget = %22Android%22;%0A        final String langTag = Locales.getLanguageTag(Locale.getDefault());%0A%0A        return %22https://support.mozilla.org/1/mobile/%22 + appVersion + %22/%22 + osTarget + %22/%22 + langTag + %22/%22 + escapedTopic;%0A    %7D%0A%7D%0A

Implement SupportUtils for SUMO URL preparation (#89)