<commit_before>package org.kamol.nefete;

import android.content.Context;
import android.location.LocationManager;

import org.kamol.nefete.data.DataModule;
import org.kamol.nefete.ui.gallery.GalleryView;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

import static android.content.Context.LOCATION_SERVICE;

/**
 * A module for Android-specific dependencies which require a {@link Context} or
 * {@link android.app.Application} to create.
 */
@Module(
    includes = DataModule.class,
//    injects = DataModule.class,
    complete = false,
    library = true
)
public class AndroidModule {
  private final NefeteApp application;

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

  /**
   * Allow the application context to be injected but require that it be annotated with
   * {@link ForApplication @ForApplication} to explicitly differentiate it
   * from an activity context.
   */
  @Provides @Singleton @ForApplication Context provideApplicationContext() {
    return application;
  }

  @Provides @Singleton LocationManager provideLocationManager() {
    return (LocationManager) application.getSystemService(LOCATION_SERVICE);
  }
}<commit_msg>BUG FIX: I would recommend instead binding Application and having things depend on the more concrete type - <NAME><commit_after>package org.kamol.nefete;

import android.app.Application;
import android.content.Context;
import android.location.LocationManager;

import org.kamol.nefete.data.DataModule;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

import static android.content.Context.LOCATION_SERVICE;

/**
 * A module for Android-specific dependencies which require a {@link Context} or
 * {@link android.app.Application} to create.
 */
@Module(
    includes = DataModule.class,
    complete = false,
    library = true
)
public class AndroidModule {
  private final NefeteApp application;

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

  /**
   * Allow the application context to be injected but require that it be annotated with
   * {@link ForApplication @ForApplication} to explicitly differentiate it
   * from an activity context.
   */
  //@Provides @Singleton @ForApplication Context provideApplicationContext() {
  //  return application;
  //}

  //http://stackoverflow.com/questions/22942327/no-injectable-members-on-android-app-application
  // -do-you-want-to-add-an-injectab
  @Provides @Singleton Application provideApplicationContext() {
    return application;
  }

  @Provides @Singleton LocationManager provideLocationManager() {
    return (LocationManager) application.getSystemService(LOCATION_SERVICE);
  }

}
{'fraction_non_alphanumeric': 0.09094229364499634, 'fraction_numerical': 0.0029218407596785976, 'mean_word_length': 4.4453280318091455, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6812826', 'n_tokens_mistral': 769, 'n_tokens_neox': 745, 'n_words': 211}