Android Open Source - AUXManager Notification Action Broadcast Receiver






From Project

Back to project page AUXManager.

License

The source code is released under:

GNU General Public License

If you think the Android project AUXManager listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.easysoft.auxmanager.receiver;
/*  w ww.j a  v a2 s  . com*/
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.easysoft.auxmanager.service.AUXManagerService;
import com.easysoft.auxmanager.shared.Constants;


/**
 * Manages actions received from notification shadow
 * <p/>
 * <br/><i>Created at 2/16/14 2:03 AM, user: mishalov</i>
 *
 * @author Michael Mishalov
 * @since Android SDK 4.1, JDK 1.7
 */
public class NotificationActionBroadcastReceiver extends BroadcastReceiver {

    public static String STOP_ACTION        = "com.easysoft.auxmanager.action.ACTION_STOP";
    public static String RESTART_ACTION     = "com.easysoft.auxmanager.action.ACTION_RESTART";

    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        Log.d(Constants.LOGGER_CONTEXT, "Notification action received:" + action);
        Intent auxManagerIntent  = new Intent(context, AUXManagerService.class);
        if(STOP_ACTION.equals(action) || RESTART_ACTION.equals(action) ){
            context.stopService(auxManagerIntent);
            if(RESTART_ACTION.equals(action)){
                context.startService(auxManagerIntent);
            }
        }
    }

}




Java Source Code List

com.easysoft.auxmanager.activity.EditProfileActivity.java
com.easysoft.auxmanager.activity.MainActivity.java
com.easysoft.auxmanager.activity.adapter.ApplicationAdapter.java
com.easysoft.auxmanager.activity.adapter.ApplicationModel.java
com.easysoft.auxmanager.activity.profile.ProfileSharedData.java
com.easysoft.auxmanager.listener.CallStateListener.java
com.easysoft.auxmanager.receiver.HeadsetActionBroadcastReceiver.java
com.easysoft.auxmanager.receiver.NotificationActionBroadcastReceiver.java
com.easysoft.auxmanager.service.AUXManagerService.java
com.easysoft.auxmanager.shared.ActiveProfileActivitiesExecutor.java
com.easysoft.auxmanager.shared.Constants.java
com.easysoft.auxmanager.widget.AUXManagerWidgetProvider.java