mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 00:08:39 +09:00
import FIREFOX_52_6_0esr_RELEASE from mozilla-esr52 hg repo
This commit is contained in:
commit
dcd9973243
150858 changed files with 23884658 additions and 0 deletions
141
mobile/android/thirdparty/com/adjust/sdk/AdjustFactory.java
vendored
Normal file
141
mobile/android/thirdparty/com/adjust/sdk/AdjustFactory.java
vendored
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
package com.adjust.sdk;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import ch.boye.httpclientandroidlib.client.HttpClient;
|
||||
import ch.boye.httpclientandroidlib.impl.client.DefaultHttpClient;
|
||||
import ch.boye.httpclientandroidlib.params.HttpParams;
|
||||
|
||||
public class AdjustFactory {
|
||||
private static IPackageHandler packageHandler = null;
|
||||
private static IRequestHandler requestHandler = null;
|
||||
private static IAttributionHandler attributionHandler = null;
|
||||
private static IActivityHandler activityHandler = null;
|
||||
private static ILogger logger = null;
|
||||
private static HttpClient httpClient = null;
|
||||
|
||||
private static long timerInterval = -1;
|
||||
private static long timerStart = -1;
|
||||
private static long sessionInterval = -1;
|
||||
private static long subsessionInterval = -1;
|
||||
|
||||
public static IPackageHandler getPackageHandler(ActivityHandler activityHandler,
|
||||
Context context,
|
||||
boolean startPaused) {
|
||||
if (packageHandler == null) {
|
||||
return new PackageHandler(activityHandler, context, startPaused);
|
||||
}
|
||||
packageHandler.init(activityHandler, context, startPaused);
|
||||
return packageHandler;
|
||||
}
|
||||
|
||||
public static IRequestHandler getRequestHandler(IPackageHandler packageHandler) {
|
||||
if (requestHandler == null) {
|
||||
return new RequestHandler(packageHandler);
|
||||
}
|
||||
requestHandler.init(packageHandler);
|
||||
return requestHandler;
|
||||
}
|
||||
|
||||
public static ILogger getLogger() {
|
||||
if (logger == null) {
|
||||
// Logger needs to be "static" to retain the configuration throughout the app
|
||||
logger = new Logger();
|
||||
}
|
||||
return logger;
|
||||
}
|
||||
|
||||
public static HttpClient getHttpClient(HttpParams params) {
|
||||
if (httpClient == null) {
|
||||
return new DefaultHttpClient(params);
|
||||
}
|
||||
return httpClient;
|
||||
}
|
||||
|
||||
public static long getTimerInterval() {
|
||||
if (timerInterval == -1) {
|
||||
return Constants.ONE_MINUTE;
|
||||
}
|
||||
return timerInterval;
|
||||
}
|
||||
|
||||
public static long getTimerStart() {
|
||||
if (timerStart == -1) {
|
||||
return 0;
|
||||
}
|
||||
return timerStart;
|
||||
}
|
||||
|
||||
public static long getSessionInterval() {
|
||||
if (sessionInterval == -1) {
|
||||
return Constants.THIRTY_MINUTES;
|
||||
}
|
||||
return sessionInterval;
|
||||
}
|
||||
|
||||
public static long getSubsessionInterval() {
|
||||
if (subsessionInterval == -1) {
|
||||
return Constants.ONE_SECOND;
|
||||
}
|
||||
return subsessionInterval;
|
||||
}
|
||||
|
||||
public static IActivityHandler getActivityHandler(AdjustConfig config) {
|
||||
if (activityHandler == null) {
|
||||
return ActivityHandler.getInstance(config);
|
||||
}
|
||||
activityHandler.init(config);
|
||||
return activityHandler;
|
||||
}
|
||||
|
||||
public static IAttributionHandler getAttributionHandler(IActivityHandler activityHandler,
|
||||
ActivityPackage attributionPackage,
|
||||
boolean startPaused) {
|
||||
if (attributionHandler == null) {
|
||||
return new AttributionHandler(activityHandler, attributionPackage, startPaused);
|
||||
}
|
||||
attributionHandler.init(activityHandler, attributionPackage, startPaused);
|
||||
return attributionHandler;
|
||||
}
|
||||
|
||||
public static void setPackageHandler(IPackageHandler packageHandler) {
|
||||
AdjustFactory.packageHandler = packageHandler;
|
||||
}
|
||||
|
||||
public static void setRequestHandler(IRequestHandler requestHandler) {
|
||||
AdjustFactory.requestHandler = requestHandler;
|
||||
}
|
||||
|
||||
public static void setLogger(ILogger logger) {
|
||||
AdjustFactory.logger = logger;
|
||||
}
|
||||
|
||||
public static void setHttpClient(HttpClient httpClient) {
|
||||
AdjustFactory.httpClient = httpClient;
|
||||
}
|
||||
|
||||
public static void setTimerInterval(long timerInterval) {
|
||||
AdjustFactory.timerInterval = timerInterval;
|
||||
}
|
||||
|
||||
public static void setTimerStart(long timerStart) {
|
||||
AdjustFactory.timerStart = timerStart;
|
||||
}
|
||||
|
||||
public static void setSessionInterval(long sessionInterval) {
|
||||
AdjustFactory.sessionInterval = sessionInterval;
|
||||
}
|
||||
|
||||
public static void setSubsessionInterval(long subsessionInterval) {
|
||||
AdjustFactory.subsessionInterval = subsessionInterval;
|
||||
}
|
||||
|
||||
public static void setActivityHandler(IActivityHandler activityHandler) {
|
||||
AdjustFactory.activityHandler = activityHandler;
|
||||
}
|
||||
|
||||
public static void setAttributionHandler(IAttributionHandler attributionHandler) {
|
||||
AdjustFactory.attributionHandler = attributionHandler;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue