package epson.print;

import android.support.multidex.MultiDexApplication;

import com.epson.mobilephone.common.EpLog;
import com.google.android.gms.analytics.GoogleAnalytics;
import com.google.android.gms.analytics.Tracker;

import epson.print.Util.EPLog;

public class IprintApplication extends MultiDexApplication {
    private static String STAGE_BETA = "Beta";
    private static String STAGE_FC = "FC";
    private static String STAGE_FFE = "FFE";
    private static IprintApplication sInstance;
    private boolean mPrinting;
    private Tracker mTracker;

    public static synchronized IprintApplication getInstance() {
        IprintApplication iprintApplication;
        synchronized (IprintApplication.class) {
            if (sInstance == null) {
                sInstance = new IprintApplication();
            }
            iprintApplication = sInstance;
        }
        return iprintApplication;
    }

    public void onCreate() {
        super.onCreate();
        sInstance = this;
        EPLog.setDebuggable(false);
        EpLog.setDebuggable(false);
    }

    public synchronized Tracker getDefaultTracker() {
        if (mTracker == null) {
            mTracker = GoogleAnalytics.getInstance(this).newTracker((int) R.C2139xml.ga_global_tracker);
            mTracker.setAnonymizeIp(true);
        }
        return mTracker;
    }

    public static boolean isConnectStaging() {
        return BuildConfig.FLAVOR.equals(STAGE_BETA) || BuildConfig.FLAVOR.equals(STAGE_FFE);
    }

    public static boolean isReleaseUnlimited() {
        return BuildConfig.FLAVOR.equals(STAGE_FFE);
    }

    public String getGoEpsonServerName() {
        return getString(R.string.go_epson_servername);
    }

    public void setPrinting(boolean z) {
        mPrinting = z;
    }

    public boolean getPrinting() {
        return mPrinting;
    }
}
