// Path: app/src/main/java/com/github/istin/schedule/CoreApplication.java
// public class CoreApplication extends Application {
// 
//     private ConfigurationManager mConfigurationManager;
// 
//     private ThreadManager mThreadManager;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         mConfigurationManager = new ConfigurationManager(this);
//         mThreadManager = new ThreadManager();
//     }
// 
//     @Override
//     public Object getSystemService(String name) {
//         if (ConfigurationManager.APP_SERVICE_KEY.equals(name)) {
//             return mConfigurationManager;
//         }
//         if (ThreadManager.APP_SERVICE_KEY.equals(name)) {
//             return mThreadManager;
//         }
//         return super.getSystemService(name);
//     }
// 
//     public static <T> T get(Context context, String name) {
//         if (context == null || name == null) {
//             throw new IllegalArgumentException("Context and key must not be null");
//         }
//         T systemService = (T) context.getSystemService(name);
//         if (systemService == null) {
//             context = context.getApplicationContext();
//             systemService = (T) context.getSystemService(name);
//         }
//         if (systemService == null) {
//             throw new IllegalStateException(name + " not available");
//         }
//         return systemService;
//     }
// }


import android.content.Context;
import android.os.Handler;
import com.github.istin.schedule.CoreApplication;
package com.github.istin.schedule.manager;



/**
 * Created by uladzimir_klyshevich on 10/19/15.
 */
public class ThreadManager {

    public static final String APP_SERVICE_KEY = "thread:manager";

    public static ThreadManager get(Context pContext) {
// Path: app/src/main/java/com/github/istin/schedule/CoreApplication.java
// public class CoreApplication extends Application {
// 
//     private ConfigurationManager mConfigurationManager;
// 
//     private ThreadManager mThreadManager;
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         mConfigurationManager = new ConfigurationManager(this);
//         mThreadManager = new ThreadManager();
//     }
// 
//     @Override
//     public Object getSystemService(String name) {
//         if (ConfigurationManager.APP_SERVICE_KEY.equals(name)) {
//             return mConfigurationManager;
//         }
//         if (ThreadManager.APP_SERVICE_KEY.equals(name)) {
//             return mThreadManager;
//         }
//         return super.getSystemService(name);
//     }
// 
//     public static <T> T get(Context context, String name) {
//         if (context == null || name == null) {
//             throw new IllegalArgumentException("Context and key must not be null");
//         }
//         T systemService = (T) context.getSystemService(name);
//         if (systemService == null) {
//             context = context.getApplicationContext();
//             systemService = (T) context.getSystemService(name);
//         }
//         if (systemService == null) {
//             throw new IllegalStateException(name + " not available");
//         }
//         return systemService;
//     }
// }


// Path: app/src/main/java/com/github/istin/schedule/manager/ThreadManager.java
import android.content.Context;
import android.os.Handler;
import com.github.istin.schedule.CoreApplication;

package com.github.istin.schedule.manager;



/**
 * Created by uladzimir_klyshevich on 10/19/15.
 */
public class ThreadManager {

    public static final String APP_SERVICE_KEY = "thread:manager";

    public static ThreadManager get(Context pContext) {
        return CoreApplication.get(pContext, APP_SERVICE_KEY);