public boolean call ( Context context , String dataName , Bundle data ) { boolean useLocalBroadcast = BeaconManager . getInstanceForApplication ( context ) . isMainProcess ( ) ; boolean success = false ; if ( useLocalBroadcast ) { String action = null ; if ( dataName == "rangingData" ) { action = BeaconLocalBroadcastProcessor . RANGE_NOTIFICATION ; } else { action = BeaconLocalBroadcastProcessor . MONITOR_NOTIFICATION ; } Intent intent = new Intent ( action ) ; intent . putExtra ( dataName , data ) ; LogManager . d ( TAG , "attempting callback via local broadcast intent: %s" , action ) ; success = LocalBroadcastManager . getInstance ( context ) . sendBroadcast ( intent ) ; } else { Intent intent = new Intent ( ) ; intent . setComponent ( new ComponentName ( context . getPackageName ( ) , "org.altbeacon.beacon.BeaconIntentProcessor" ) ) ; intent . putExtra ( dataName , data ) ; LogManager . d ( TAG , "attempting callback via global broadcast intent: %s" , intent . getComponent ( ) ) ; try { context . startService ( intent ) ; success = true ; } catch ( Exception e ) { LogManager . e ( TAG , "Failed attempting to start service: " + intent . getComponent ( ) . flattenToString ( ) , e ) ; } } return success ; }
Tries making the callback first via messenger then via intent