/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package org.mozilla.focus.utils;

import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Build;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Locale;

public class SupportUtils {

    public static String getSumoURLForTopic(final Context context, final String topic) {
        String escapedTopic;
        try {
            escapedTopic = URLEncoder.encode(topic, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            throw new IllegalStateException("utf-8 should always be available", e);
        }

        final String appVersion;
        try {
            appVersion = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
        } catch (PackageManager.NameNotFoundException e) {
            // This should be impossible - we should always be able to get information about ourselves:
            throw new IllegalStateException("Unable find package details for Focus", e);
        }

        final String osTarget = "Android";
        final String langTag = Locales.getLanguageTag(Locale.getDefault());

        return "https://support.mozilla.org/1/mobile/" + appVersion + "/" + osTarget + "/" + langTag + "/" + escapedTopic;
    }
}

@@ -1548,11 +1548,214 @@
 c;%0A    %7D
+%0A%0A    public static String getManifestoURL() %7B%0A        final String langTag = Locales.getLanguageTag(Locale.getDefault());%0A        return %22https://www.mozilla.org/%22 + langTag + %22/about/manifesto/%22;%0A    %7D
 %0A%7D%0A

Add getManifestoURL() to SupportUtils