2019-05-13 03:19:17 +02:00
|
|
|
package org.mercury_im.messenger.di.module;
|
|
|
|
|
2019-08-03 19:05:50 +02:00
|
|
|
import android.app.Application;
|
|
|
|
|
2019-12-20 10:41:55 +01:00
|
|
|
import org.jivesoftware.smackx.ping.android.ServerPingWithAlarmManager;
|
2019-05-13 03:19:17 +02:00
|
|
|
import org.mercury_im.messenger.MercuryImApplication;
|
|
|
|
|
|
|
|
import javax.inject.Singleton;
|
|
|
|
|
2019-11-18 23:51:27 +01:00
|
|
|
import dagger.Module;
|
|
|
|
import dagger.Provides;
|
|
|
|
|
2019-12-09 15:49:59 +01:00
|
|
|
@Module
|
2019-05-13 03:19:17 +02:00
|
|
|
public class AppModule {
|
|
|
|
|
|
|
|
private MercuryImApplication mApplication;
|
|
|
|
|
|
|
|
public AppModule(MercuryImApplication application) {
|
|
|
|
this.mApplication = application;
|
2019-12-20 10:41:55 +01:00
|
|
|
ServerPingWithAlarmManager.onCreate(application);
|
2019-05-13 03:19:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Provides
|
|
|
|
@Singleton
|
2019-08-03 19:05:50 +02:00
|
|
|
Application provideApplication() {
|
2019-05-13 03:19:17 +02:00
|
|
|
return mApplication;
|
|
|
|
}
|
|
|
|
}
|