// Path: app/src/main/java/org/noorganization/instalist/presenter/PluginControllerActions.java
// public class PluginControllerActions {
//     public static final String ACTION_PING = "org.noorganization.instalist.action.PING_PLUGIN";
//     public static final String ACTION_PONG = "org.noorganization.instalist.action.PONG_PLUGIN";
// }
// 
// Path: app/src/main/java/org/noorganization/instalist/presenter/broadcast/IPluginBroadCast.java
// public interface IPluginBroadCast {
// 
//     /**
//      * @see IPluginBroadCast#searchPlugins()
//      */
//     void searchPlugins();
// }


import java.util.List;
import dalvik.system.DexClassLoader;
import dalvik.system.PathClassLoader;
import de.greenrobot.event.EventBus;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import org.noorganization.instalist.presenter.PluginControllerActions;
import org.noorganization.instalist.presenter.broadcast.IPluginBroadCast;
import org.noorganization.instalist.presenter.event.PluginFoundMessage;
import java.io.File;
/*
 * Copyright 2016 Tino Siegmund, Michael Wodniok
 *
 * 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 org.noorganization.instalist.presenter.broadcast.implementation;





/**
 * Broadcast Receiver for the Plugin infrastructure.
 * Created by tinos_000 on 07.01.2016.
 */
public class PluginBroadcastReceiver extends BroadcastReceiver implements IPluginBroadCast {

    static final String PLUGIN_INFO_KEY_NAME = "name";
    static final String PLUGIN_INFO_KEY_SETTINGS_ACTIVITY = "settings";
    static final String PLUGIN_INFO_KEY_MAIN_ACTIVITY = "main";
    static final String PLUGIN_INFO_KEY_PACKAGE = "package";

    private Context mContext;

    /**
     * Empty construtor for receive.
     */
    public PluginBroadcastReceiver() {
        super();
    }

    public PluginBroadcastReceiver(Context _context) {
        super();
        mContext = _context;
    }

    @Override
    public void searchPlugins() {
// Path: app/src/main/java/org/noorganization/instalist/presenter/PluginControllerActions.java
// public class PluginControllerActions {
//     public static final String ACTION_PING = "org.noorganization.instalist.action.PING_PLUGIN";
//     public static final String ACTION_PONG = "org.noorganization.instalist.action.PONG_PLUGIN";
// }
// 
// Path: app/src/main/java/org/noorganization/instalist/presenter/broadcast/IPluginBroadCast.java
// public interface IPluginBroadCast {
// 
//     /**
//      * @see IPluginBroadCast#searchPlugins()
//      */
//     void searchPlugins();
// }


// Path: app/src/main/java/org/noorganization/instalist/presenter/broadcast/implementation/PluginBroadcastReceiver.java
import java.util.List;
import dalvik.system.DexClassLoader;
import dalvik.system.PathClassLoader;
import de.greenrobot.event.EventBus;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.util.Log;
import org.noorganization.instalist.presenter.PluginControllerActions;
import org.noorganization.instalist.presenter.broadcast.IPluginBroadCast;
import org.noorganization.instalist.presenter.event.PluginFoundMessage;
import java.io.File;

/*
 * Copyright 2016 Tino Siegmund, Michael Wodniok
 *
 * 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 org.noorganization.instalist.presenter.broadcast.implementation;





/**
 * Broadcast Receiver for the Plugin infrastructure.
 * Created by tinos_000 on 07.01.2016.
 */
public class PluginBroadcastReceiver extends BroadcastReceiver implements IPluginBroadCast {

    static final String PLUGIN_INFO_KEY_NAME = "name";
    static final String PLUGIN_INFO_KEY_SETTINGS_ACTIVITY = "settings";
    static final String PLUGIN_INFO_KEY_MAIN_ACTIVITY = "main";
    static final String PLUGIN_INFO_KEY_PACKAGE = "package";

    private Context mContext;

    /**
     * Empty construtor for receive.
     */
    public PluginBroadcastReceiver() {
        super();
    }

    public PluginBroadcastReceiver(Context _context) {
        super();
        mContext = _context;
    }

    @Override
    public void searchPlugins() {
        Log.d("PluginBroadcastReceiver", "Sending " + PluginControllerActions.ACTION_PING);