// Path: app/src/main/java/com/microsoft/o365_android_onenote_rest/inject/AppModule.java
// @Module(library = true,
//         injects = {
//                 SnippetApp.class
//         }
// )
// public class AppModule {
// 
//     public static final String PREFS = "com.microsoft.o365_android_onenote_rest";
// 
//     @Provides
//     public String providesRestEndpoint() {
//         return ServiceConstants.ONENOTE_API;
//     }
// 
//     @Provides
//     public RestAdapter.LogLevel providesLogLevel() {
//         return RestAdapter.LogLevel.FULL;
//     }
// 
//     @Provides
//     public Converter providesConverter() {
//         return new GsonConverter(GsonDateTime.getOneNoteBuilder()
//                 .create());
//     }
// 
//     @Provides
//     public RequestInterceptor providesRequestInterceptor() {
//         return new RequestInterceptor() {
//             @Override
//             public void intercept(RequestFacade request) {
//                 // apply the Authorization header if we had a token...
//                 final SharedPreferences preferences
//                         = SnippetApp.getApp().getSharedPreferences(PREFS, Context.MODE_PRIVATE);
//                 final String token =
//                         preferences.getString(SharedPrefsUtil.PREF_AUTH_TOKEN, null);
//                 if (null != token) {
//                     request.addHeader("Authorization", "Bearer " + token);
//                 }
//             }
//         };
//     }
// 
//     @Provides
//     @Singleton
//     public LiveAuthClient providesLiveAuthClient() {
//         return new LiveAuthClient(SnippetApp.getApp(), ServiceConstants.MSA_CLIENT_ID);
//     }
// }


import android.app.Application;
import com.microsoft.o365_android_onenote_rest.BuildConfig;
import com.microsoft.o365_android_onenote_rest.inject.AppModule;
import javax.inject.Inject;
import dagger.ObjectGraph;
import retrofit.RequestInterceptor;
import retrofit.RestAdapter;
import retrofit.converter.Converter;
import timber.log.Timber;
/*
*  Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file.
*/

package com.microsoft.o365_android_onenote_rest.application;





public class SnippetApp extends Application {
    /**
     * The {@link dagger.ObjectGraph} used by Dagger to fulfill <code>@inject</code> annotations
     *
     * @see javax.inject.Inject
     * @see dagger.Provides
     * @see javax.inject.Singleton
     */
    public ObjectGraph mObjectGraph;

    private static SnippetApp sSnippetApp;

    @Inject
    protected String endpoint;

    @Inject
    protected Converter converter;

    @Inject
    protected RestAdapter.LogLevel logLevel;

    @Inject
    protected RequestInterceptor requestInterceptor;

    @Override
    public void onCreate() {
        super.onCreate();
        sSnippetApp = this;
// Path: app/src/main/java/com/microsoft/o365_android_onenote_rest/inject/AppModule.java
// @Module(library = true,
//         injects = {
//                 SnippetApp.class
//         }
// )
// public class AppModule {
// 
//     public static final String PREFS = "com.microsoft.o365_android_onenote_rest";
// 
//     @Provides
//     public String providesRestEndpoint() {
//         return ServiceConstants.ONENOTE_API;
//     }
// 
//     @Provides
//     public RestAdapter.LogLevel providesLogLevel() {
//         return RestAdapter.LogLevel.FULL;
//     }
// 
//     @Provides
//     public Converter providesConverter() {
//         return new GsonConverter(GsonDateTime.getOneNoteBuilder()
//                 .create());
//     }
// 
//     @Provides
//     public RequestInterceptor providesRequestInterceptor() {
//         return new RequestInterceptor() {
//             @Override
//             public void intercept(RequestFacade request) {
//                 // apply the Authorization header if we had a token...
//                 final SharedPreferences preferences
//                         = SnippetApp.getApp().getSharedPreferences(PREFS, Context.MODE_PRIVATE);
//                 final String token =
//                         preferences.getString(SharedPrefsUtil.PREF_AUTH_TOKEN, null);
//                 if (null != token) {
//                     request.addHeader("Authorization", "Bearer " + token);
//                 }
//             }
//         };
//     }
// 
//     @Provides
//     @Singleton
//     public LiveAuthClient providesLiveAuthClient() {
//         return new LiveAuthClient(SnippetApp.getApp(), ServiceConstants.MSA_CLIENT_ID);
//     }
// }


// Path: app/src/main/java/com/microsoft/o365_android_onenote_rest/application/SnippetApp.java
import android.app.Application;
import com.microsoft.o365_android_onenote_rest.BuildConfig;
import com.microsoft.o365_android_onenote_rest.inject.AppModule;
import javax.inject.Inject;
import dagger.ObjectGraph;
import retrofit.RequestInterceptor;
import retrofit.RestAdapter;
import retrofit.converter.Converter;
import timber.log.Timber;

/*
*  Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See full license at the bottom of this file.
*/

package com.microsoft.o365_android_onenote_rest.application;





public class SnippetApp extends Application {
    /**
     * The {@link dagger.ObjectGraph} used by Dagger to fulfill <code>@inject</code> annotations
     *
     * @see javax.inject.Inject
     * @see dagger.Provides
     * @see javax.inject.Singleton
     */
    public ObjectGraph mObjectGraph;

    private static SnippetApp sSnippetApp;

    @Inject
    protected String endpoint;

    @Inject
    protected Converter converter;

    @Inject
    protected RestAdapter.LogLevel logLevel;

    @Inject
    protected RequestInterceptor requestInterceptor;

    @Override
    public void onCreate() {
        super.onCreate();
        sSnippetApp = this;
        mObjectGraph = ObjectGraph.create(new AppModule());