// Path: application/src/open/java/com/projectsexception/myapplist/app/MyAppListApplication.java
// public class MyAppListApplication extends Application {
// 
//     public static final String LOG_TAG = "MyAppList";
//     public static final int LOG_LEVEL = BuildConfig.DEBUG ? Log.DEBUG : Log.INFO;
// 
//     public void analyticsSetScreenName(String screenName) {
// 
//     }
// 
//     public void analyticsSend() {
// 
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         CustomLog.initLog(LOG_TAG, LOG_LEVEL);
//     }
// }


import java.util.HashMap;
import java.util.Map;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import com.projectsexception.myapplist.app.MyAppListApplication;
import com.projectsexception.util.CustomLog;
package com.projectsexception.myapplist.util;




public class ApplicationsReceiver extends BroadcastReceiver {
    
    private static ApplicationsReceiver instance;
    
    public static ApplicationsReceiver getInstance(Context context) {
        if (instance == null) {
            instance = new ApplicationsReceiver();
            IntentFilter intentFilter = new IntentFilter();
            intentFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
            intentFilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
            intentFilter.addDataScheme("package");
            context.registerReceiver(instance, intentFilter);
        }
        return instance;
    }
    
    public static void unregisterListener(Context context) {
        if (instance != null) {
            try {
                context.unregisterReceiver(instance);                
            } catch (IllegalArgumentException e) {
// Path: application/src/open/java/com/projectsexception/myapplist/app/MyAppListApplication.java
// public class MyAppListApplication extends Application {
// 
//     public static final String LOG_TAG = "MyAppList";
//     public static final int LOG_LEVEL = BuildConfig.DEBUG ? Log.DEBUG : Log.INFO;
// 
//     public void analyticsSetScreenName(String screenName) {
// 
//     }
// 
//     public void analyticsSend() {
// 
//     }
// 
//     @Override
//     public void onCreate() {
//         super.onCreate();
//         CustomLog.initLog(LOG_TAG, LOG_LEVEL);
//     }
// }


// Path: application/src/main/java/com/projectsexception/myapplist/util/ApplicationsReceiver.java
import java.util.HashMap;
import java.util.Map;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import com.projectsexception.myapplist.app.MyAppListApplication;
import com.projectsexception.util.CustomLog;

package com.projectsexception.myapplist.util;




public class ApplicationsReceiver extends BroadcastReceiver {
    
    private static ApplicationsReceiver instance;
    
    public static ApplicationsReceiver getInstance(Context context) {
        if (instance == null) {
            instance = new ApplicationsReceiver();
            IntentFilter intentFilter = new IntentFilter();
            intentFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
            intentFilter.addAction(Intent.ACTION_PACKAGE_REMOVED);
            intentFilter.addDataScheme("package");
            context.registerReceiver(instance, intentFilter);
        }
        return instance;
    }
    
    public static void unregisterListener(Context context) {
        if (instance != null) {
            try {
                context.unregisterReceiver(instance);                
            } catch (IllegalArgumentException e) {
                CustomLog.initLog(MyAppListApplication.LOG_TAG, MyAppListApplication.LOG_LEVEL);