We know in application layer, how to broadcast an Intent to other
component of application, So let’s look how to do it in native layer.
There may be use cases when we have a native service and we want to notify applications running in the system.
For example, we can create a limited no. of video codec instances for a particular type(avc, mpeg4 etc.) based on resolution/fps limits. At user level there may be some scenario like transcoding, side by side or multiapp video playback, so it’s an easier approach if native layer broadcasts an intent notifying codec instances already reached to maximum allowed number.
Background
As in previous post we saw how to use ActivityManager Service in native code, here we will follow same approach and use BROADCAST_INTENT_TRANSACTION transaction.
The important thing is to make parcel for this transaction so that Activities running in app layer can parse it correctly.
When we look IActivityManager.java code, we see
int BROADCAST_INTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+13;
There may be use cases when we have a native service and we want to notify applications running in the system.
For example, we can create a limited no. of video codec instances for a particular type(avc, mpeg4 etc.) based on resolution/fps limits. At user level there may be some scenario like transcoding, side by side or multiapp video playback, so it’s an easier approach if native layer broadcasts an intent notifying codec instances already reached to maximum allowed number.
Background
As in previous post we saw how to use ActivityManager Service in native code, here we will follow same approach and use BROADCAST_INTENT_TRANSACTION transaction.
The important thing is to make parcel for this transaction so that Activities running in app layer can parse it correctly.
When we look IActivityManager.java code, we see
int BROADCAST_INTENT_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+13;