Android Open Source - WifiCallingControls Update 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  w  w  .  ja va  2s  .co m*/
import android.appwidget.AppWidgetManager;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;

import com.ajhodges.wificallingcontrols.ui.EditConditionActivity;
import com.ajhodges.wificallingcontrols.widget.ToggleWidgetProvider;

/**
 * Created by Adam on 3/25/14.
 */
public class UpdateReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        /* Intent com.movial.IMS_REGISTRATION is received when:
        * Wifi calling is disabled (REG_STATUS == false)
        * Wifi calling is being enabled (REG_STATUS == false)
        * Wifi calling is enabled (REG_STATUS == true)
         */
        //Don't need to update in the third case
        if(intent.getAction().equals("com.movial.IMS_REGISTRATION") && intent.getBooleanExtra("IMS_REG_STATUS", false))
            return;

        //Update widgets
        AppWidgetManager widgetManager = AppWidgetManager.getInstance(context);
        ComponentName widgetComponent = new ComponentName(context, ToggleWidgetProvider.class);
        int[] widgetIds = widgetManager.getAppWidgetIds(widgetComponent);
        Intent updateWidgets = new Intent();
        updateWidgets.setAction(AppWidgetManager.ACTION_APPWIDGET_UPDATE);
        updateWidgets.putExtra(ToggleWidgetProvider.EXTRA_WIDGET_IDS, widgetIds);
        context.sendBroadcast(updateWidgets);

        //Notify Locale that state has changed
        Intent notifyLocale = new Intent();
        notifyLocale.setAction(com.twofortyfouram.locale.Intent.ACTION_REQUEST_QUERY);
        notifyLocale.putExtra(com.twofortyfouram.locale.Intent.EXTRA_ACTIVITY, EditConditionActivity.class.getName());
        context.sendBroadcast(notifyLocale);
    }
}




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