@Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action.equals(GBDevice.ACTION_DEVICE_CHANGED)) { GBDevice device = intent.getParcelableExtra("device"); if (mGBDevice.equals(device)) { mGBDevice = device; boolean enableReceivers = mDeviceSupport != null && (mDeviceSupport.useAutoConnect() || mGBDevice.isConnected()); GB.setReceiversEnableState(enableReceivers, context); GB.updateNotification( mGBDevice.getName() + " " + mGBDevice.getStateString(), context); } } }