/*
 * Copyright 2013 Prateek Srivastava (@f2prateek)
 *
 * 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.f2prateek.dfg;

import android.accounts.AccountManager;
import android.app.NotificationManager;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.preference.PreferenceManager;
import android.telephony.TelephonyManager;
import android.view.inputmethod.InputMethodManager;
import dagger.Module;
import dagger.Provides;
import javax.inject.Singleton;

/** Module for all Android related provisions */
@Module(
    library = true,
    complete = false)
public class AndroidModule {

  private final DFGApplication application;

  public AndroidModule(DFGApplication application) {
    this.application = application;
  }

  @Provides @Singleton Context provideAppContext() {
    return application;
  }

  @Provides SharedPreferences provideDefaultSharedPreferences(final Context context) {
    return PreferenceManager.getDefaultSharedPreferences(context);
  }

  @Provides PackageInfo providePackageInfo(Context context) {
    try {
      return context.getPackageManager().getPackageInfo(context.getPackageName(), 0);
    } catch (PackageManager.NameNotFoundException e) {
      throw new RuntimeException(e);
    }
  }

  @Provides TelephonyManager provideTelephonyManager(Context context) {
    return getSystemService(context, Context.TELEPHONY_SERVICE);
  }

  @SuppressWarnings("unchecked")
  public <T> T getSystemService(Context context, String serviceConstant) {
    return (T) context.getSystemService(serviceConstant);
  }

  @Provides InputMethodManager provideInputMethodManager(final Context context) {
    return (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
  }

  @Provides ApplicationInfo provideApplicationInfo(final Context context) {
    return context.getApplicationInfo();
  }

  @Provides AccountManager provideAccountManager(final Context context) {
    return AccountManager.get(context);
  }

  @Provides ClassLoader provideClassLoader(final Context context) {
    return context.getClassLoader();
  }

  @Provides NotificationManager provideNotificationManager(final Context context) {
    return (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
  }
}
@@ -640,48 +640,8 @@
 g;%0A%0A
-import android.accounts.AccountManager;%0A
 impo
@@ -754,51 +754,8 @@
 es;%0A
-import android.content.pm.ApplicationInfo;%0A
 impo
@@ -880,103 +880,8 @@
 er;%0A
-import android.telephony.TelephonyManager;%0Aimport android.view.inputmethod.InputMethodManager;%0A
 impo
@@ -1317,16 +1317,27 @@
 rovides 
+@Singleton 
 SharedPr
@@ -1487,16 +1487,27 @@
 rovides 
+@Singleton 
 PackageI
@@ -1529,16 +1529,22 @@
 ageInfo(
+final 
 Context 
@@ -1757,150 +1757,8 @@
  %7D%0A%0A
-  @Provides TelephonyManager provideTelephonyManager(Context context) %7B%0A    return getSystemService(context, Context.TELEPHONY_SERVICE);%0A  %7D%0A%0A
   @S
@@ -1814,24 +1814,30 @@
 stemService(
+final 
 Context cont
@@ -1840,16 +1840,22 @@
 context,
+ final
  String 
@@ -1952,533 +1952,18 @@
 des 
-InputMethodManager provideInputMethodManager(final Context context) %7B%0A    return (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);%0A  %7D%0A%0A  @Provides ApplicationInfo provideApplicationInfo(final Context context) %7B%0A    return context.getApplicationInfo();%0A  %7D%0A%0A  @Provides AccountManager provideAccountManager(final Context context) %7B%0A    return AccountManager.get(context);%0A  %7D%0A%0A  @Provides ClassLoader provideClassLoader(final Context context) %7B%0A    return context.getClassLoader();%0A  %7D%0A%0A  @Provides
+@Singleton
  Not

Update the module