public Session(AbstractLogger logger, IInternalLocalUser localUser, string guestControllerAccessToken, bool pushNotificationsEnabled, INotificationPoller notificationPoller, ICoroutineManager coroutineManager, IDatabase database, IUserDatabase userDatabase, IGuestControllerClient guestControllerClient, IMixWebCallFactory mixWebCallFactory, IEpochTime epochTime, DatabaseCorruptionHandler databaseCorruptionHandler, ISessionStatus sessionStatus, IKeychain keychain, IGetStateResponseParser getStateResponseParser, string clientVersion, INotificationQueue notificationQueue) { this.logger = logger; this.localUser = localUser; this.notificationPoller = notificationPoller; this.coroutineManager = coroutineManager; this.database = database; this.userDatabase = userDatabase; this.guestControllerClient = guestControllerClient; this.mixWebCallFactory = mixWebCallFactory; this.epochTime = epochTime; this.databaseCorruptionHandler = databaseCorruptionHandler; this.sessionStatus = sessionStatus; this.keychain = keychain; this.getStateResponseParser = getStateResponseParser; this.clientVersion = clientVersion; this.notificationQueue = notificationQueue; GuestControllerAccessToken = guestControllerAccessToken; guestControllerClient.OnAccessTokenChanged += HandleGuestControllerAccessTokenChanged; guestControllerClient.OnAuthenticationLost += HandleAuthenticationLost; mixWebCallFactory.OnAuthenticationLost += HandleAuthenticationLost; localUser.OnPushNotificationsToggled += HandlePushNotificationsToggled; localUser.OnPushNotificationReceived += HandlePushNotificationReceived; localUser.OnDisplayNameUpdated += HandleDisplayNameUpdated; databaseCorruptionHandler.OnCorruptionDetected += HandleCorruptionDetected; updateEnumerator = Update(); coroutineManager.Start(updateEnumerator); notificationPoller.OnNotificationsPolled += HandleNotificationsPolled; notificationPoller.UsePollIntervals = !pushNotificationsEnabled; this.sessionStatus.IsPaused = true; notificationPoller.OnSynchronizationError += HandleNotificationPollerSynchronizationError; }
public void Start(string swid, string guestControllerAccessToken, Action<MixSessionStartResult> successCallback, Action failureCallback) { RSAParameters? rSAParameters = database.GetRsaParameters(); if (rSAParameters.HasValue) { Start(swid, guestControllerAccessToken, rSAParameters.Value, successCallback, failureCallback); } else { coroutineManager.Start(GenerateKeychainCoroutine(swid, guestControllerAccessToken, successCallback, failureCallback)); } }
public void Execute() { www = wwwFactory.Create(uri.AbsoluteUri, method, requestBody, requestHeaders); coroutineManager.Start(RunWww()); }