diff --git a/smoothie/src/main/java/toothpick/smoothie/module/ApplicationModule.java b/smoothie/src/main/java/toothpick/smoothie/module/ApplicationModule.java index 0d6c414f..ed31f9be 100644 --- a/smoothie/src/main/java/toothpick/smoothie/module/ApplicationModule.java +++ b/smoothie/src/main/java/toothpick/smoothie/module/ApplicationModule.java @@ -1,6 +1,7 @@ package toothpick.smoothie.module; import android.accounts.AccountManager; +import android.annotation.TargetApi; import android.app.ActivityManager; import android.app.AlarmManager; import android.app.Application; @@ -89,9 +90,13 @@ private void bindSystemServices(Application application) { bindSystemService(application, TelephonyManager.class, TELEPHONY_SERVICE); bindSystemService(application, AudioManager.class, AUDIO_SERVICE); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { - bindSystemService(application, DownloadManager.class, DOWNLOAD_SERVICE); + bindForGingerBreadAndAbove(application); } - bind(Application.class).to(application); + } + + @TargetApi(Build.VERSION_CODES.GINGERBREAD) + private void bindForGingerBreadAndAbove(Application application) { + bindSystemService(application, DownloadManager.class, DOWNLOAD_SERVICE); } private void bindSystemService(Application application, Class serviceClass, String serviceName) {