Android Open Source - WifiCallingControls Query Receiver






From Project

Back to project page WifiCallingControls.

License

The source code is released under:

MIT License

If you think the Android project WifiCallingControls 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.ajhodges.wificallingcontrols.receiver;
/*from w ww.j a va2  s . c  om*/
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import com.ajhodges.wificallingcontrols.Constants;
import com.ajhodges.wificallingcontrols.bundle.BundleScrubber;
import com.ajhodges.wificallingcontrols.bundle.PluginBundleManager;
import com.ajhodges.wificallingcontrols.ipphone.WifiCallingManager;

/**
 * Created by Adam on 3/25/2014.
 */
public class QueryReceiver extends BroadcastReceiver{

    @Override
    public void onReceive(Context context, Intent intent) {
        if (com.twofortyfouram.locale.Intent.ACTION_QUERY_CONDITION.equals(intent.getAction())){
            Log.v(Constants.LOG_TAG, "Query from Locale!");
            BundleScrubber.scrub(intent);
            final Bundle bundle = intent.getBundleExtra(com.twofortyfouram.locale.Intent.EXTRA_BUNDLE);
            BundleScrubber.scrub(bundle);

            if(PluginBundleManager.isBundleValid(bundle)){
                final Boolean ipphoneEnabled = WifiCallingManager.getInstance(context).getIPPhoneEnabled(context);
                final boolean conditionState = bundle.getInt(PluginBundleManager.BUNDLE_EXTRA_INT_MODE) == 1;
                if(ipphoneEnabled){
                    if(conditionState){
                        setResultCode(com.twofortyfouram.locale.Intent.RESULT_CONDITION_SATISFIED);
                    }else{
                        setResultCode(com.twofortyfouram.locale.Intent.RESULT_CONDITION_UNSATISFIED);
                    }
                } else{
                    if(conditionState){
                        setResultCode(com.twofortyfouram.locale.Intent.RESULT_CONDITION_UNSATISFIED);
                    }else{
                        setResultCode(com.twofortyfouram.locale.Intent.RESULT_CONDITION_SATISFIED);
                    }
                }
            }
        }
    }
}




Java Source Code List

com.ajhodges.wificallingcontrols.Constants.java
com.ajhodges.wificallingcontrols.PluginApplication.java
com.ajhodges.wificallingcontrols.bundle.BundleScrubber.java
com.ajhodges.wificallingcontrols.bundle.PluginBundleManager.java
com.ajhodges.wificallingcontrols.ipphone.MovialCallingManager.java
com.ajhodges.wificallingcontrols.ipphone.SamsungCallingManager.java
com.ajhodges.wificallingcontrols.ipphone.WifiCallingManager.java
com.ajhodges.wificallingcontrols.receiver.QueryReceiver.java
com.ajhodges.wificallingcontrols.receiver.ToggleReceiver.java
com.ajhodges.wificallingcontrols.receiver.UpdateReceiver.java
com.ajhodges.wificallingcontrols.ui.AbstractPluginActivity.java
com.ajhodges.wificallingcontrols.ui.EditConditionActivity.java
com.ajhodges.wificallingcontrols.ui.EditSettingActivity.java
com.ajhodges.wificallingcontrols.ui.InfoActivity.java
com.ajhodges.wificallingcontrols.widget.ToggleWidgetProvider.java
com.twofortyfouram.locale.BreadCrumber.java
com.twofortyfouram.locale.Constants.java
com.twofortyfouram.locale.Intent.java
com.twofortyfouram.locale.PackageUtilities.java
com.twofortyfouram.locale.api.BuildConfig.java
com.twofortyfouram.locale.api.BuildConfig.java