public APIClientProvider( AppSession appSession, UserAgentProvider userAgentProvider, Context context, CacheProvider cacheProvider, WifiManager wifiManager) { this.appSession = appSession; this.headers = appSession.getHttpHeader().entrySet(); this.client = new OkHttpClient(); this.userAgent = userAgentProvider.get(); this.context = context; this.cacheProvider = cacheProvider; this.wifiManager = wifiManager; this.baseUrl = appSession.getConfigValue("ApiBaseUrl", null); this.wifiLock = wifiManager.createWifiLock(this.getClass().getName()); this.configHttpClient(); instance = this; }