Search in sources :

Example 6 with ServiceScheduler

use of com.optimizely.ab.android.shared.ServiceScheduler in project android-sdk by optimizely.

the class EventIntentService method onCreate.

/**
 * Create the event dispatcher {@link EventDispatcher}
 * @see IntentService#onCreate()
 */
@Override
public void onCreate() {
    super.onCreate();
    OptlyStorage optlyStorage = new OptlyStorage(this);
    EventClient eventClient = new EventClient(new Client(optlyStorage, LoggerFactory.getLogger(Client.class)), LoggerFactory.getLogger(EventClient.class));
    EventDAO eventDAO = EventDAO.getInstance(this, "1", LoggerFactory.getLogger(EventDAO.class));
    ServiceScheduler serviceScheduler = new ServiceScheduler(this, new ServiceScheduler.PendingIntentFactory(this), LoggerFactory.getLogger(ServiceScheduler.class));
    eventDispatcher = new EventDispatcher(this, optlyStorage, eventDAO, eventClient, serviceScheduler, LoggerFactory.getLogger(EventDispatcher.class));
}
Also used : OptlyStorage(com.optimizely.ab.android.shared.OptlyStorage) Client(com.optimizely.ab.android.shared.Client) ServiceScheduler(com.optimizely.ab.android.shared.ServiceScheduler)

Aggregations

ServiceScheduler (com.optimizely.ab.android.shared.ServiceScheduler)6 Intent (android.content.Intent)4 AlarmManager (android.app.AlarmManager)3 Context (android.content.Context)3 Test (org.junit.Test)3 OptlyStorage (com.optimizely.ab.android.shared.OptlyStorage)2 JobScheduler (android.app.job.JobScheduler)1 PackageInfo (android.content.pm.PackageInfo)1 PackageManager (android.content.pm.PackageManager)1 RequiresApi (androidx.annotation.RequiresApi)1 SdkSuppress (androidx.test.filters.SdkSuppress)1 Client (com.optimizely.ab.android.shared.Client)1 DatafileConfig (com.optimizely.ab.android.shared.DatafileConfig)1 DefaultUserProfileService (com.optimizely.ab.android.user_profile.DefaultUserProfileService)1 UserProfileService (com.optimizely.ab.bucketing.UserProfileService)1 Before (org.junit.Before)1 Ignore (org.junit.Ignore)1 Logger (org.slf4j.Logger)1