/*
 * Copyright 2016 Peter Kenji Yamanaka
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.pyamsoft.powermanager.dagger.modifier.state;

import android.content.Context;
import android.support.annotation.NonNull;
import com.pyamsoft.powermanager.PowerManagerPreferences;
import com.pyamsoft.powermanager.app.modifier.BooleanInterestModifier;
import dagger.Module;
import dagger.Provides;
import javax.inject.Named;
import javax.inject.Singleton;
import rx.Scheduler;

@Module public class StateModifierModule {

  @Singleton @Named("mod_wifi_state") @Provides BooleanInterestModifier provideWifiModifier(
      @NonNull Context context, @NonNull PowerManagerPreferences preferences,
      @NonNull @Named("io") Scheduler subscribeScheduler,
      @NonNull @Named("main") Scheduler observeScheduler) {
    return new WifiStateModifier(context, preferences, observeScheduler, subscribeScheduler);
  }

  @Singleton @Named("mod_data_state") @Provides BooleanInterestModifier provideDataModifier(
      @NonNull Context context, @NonNull PowerManagerPreferences preferences,
      @NonNull @Named("io") Scheduler subscribeScheduler,
      @NonNull @Named("main") Scheduler observeScheduler) {
    return new DataStateModifier(context, preferences, observeScheduler, subscribeScheduler);
  }

  @Singleton @Named("mod_bluetooth_state") @Provides
  BooleanInterestModifier provideBluetoothModifier(@NonNull Context context,
      @NonNull PowerManagerPreferences preferences,
      @NonNull @Named("io") Scheduler subscribeScheduler,
      @NonNull @Named("main") Scheduler observeScheduler) {
    return new BluetoothStateModifier(context, preferences, observeScheduler, subscribeScheduler);
  }

  @Singleton @Named("mod_sync_state") @Provides BooleanInterestModifier provideSyncModifier(
      @NonNull Context context, @NonNull PowerManagerPreferences preferences,
      @NonNull @Named("io") Scheduler subscribeScheduler,
      @NonNull @Named("main") Scheduler observeScheduler) {
    return new SyncStateModifier(context, preferences, observeScheduler, subscribeScheduler);
  }

  @Singleton @Named("mod_doze_state") @Provides BooleanInterestModifier provideDozeModifier(
      @NonNull Context context, @NonNull PowerManagerPreferences preferences,
      @NonNull @Named("io") Scheduler subscribeScheduler,
      @NonNull @Named("main") Scheduler observeScheduler) {
    return new DozeStateModifier(context, preferences, observeScheduler, subscribeScheduler);
  }
}

@@ -967,29 +967,8 @@
 ton;
-%0Aimport rx.Scheduler;
 %0A%0A@M
@@ -1182,124 +1182,8 @@
 nces
-,%0A      @NonNull @Named(%22io%22) Scheduler subscribeScheduler,%0A      @NonNull @Named(%22main%22) Scheduler observeScheduler
 ) %7B%0A
@@ -1239,46 +1239,8 @@
 nces
-, observeScheduler, subscribeScheduler
 );%0A 
@@ -1416,124 +1416,8 @@
 nces
-,%0A      @NonNull @Named(%22io%22) Scheduler subscribeScheduler,%0A      @NonNull @Named(%22main%22) Scheduler observeScheduler
 ) %7B%0A
@@ -1473,46 +1473,8 @@
 nces
-, observeScheduler, subscribeScheduler
 );%0A 
@@ -1661,124 +1661,8 @@
 nces
-,%0A      @NonNull @Named(%22io%22) Scheduler subscribeScheduler,%0A      @NonNull @Named(%22main%22) Scheduler observeScheduler
 ) %7B%0A
@@ -1723,46 +1723,8 @@
 nces
-, observeScheduler, subscribeScheduler
 );%0A 
@@ -1900,124 +1900,8 @@
 nces
-,%0A      @NonNull @Named(%22io%22) Scheduler subscribeScheduler,%0A      @NonNull @Named(%22main%22) Scheduler observeScheduler
 ) %7B%0A
@@ -1957,46 +1957,8 @@
 nces
-, observeScheduler, subscribeScheduler
 );%0A 
@@ -2134,124 +2134,8 @@
 nces
-,%0A      @NonNull @Named(%22io%22) Scheduler subscribeScheduler,%0A      @NonNull @Named(%22main%22) Scheduler observeScheduler
 ) %7B%0A
@@ -2191,46 +2191,8 @@
 nces
-, observeScheduler, subscribeScheduler
 );%0A 

Remove schedulers