[add custom action intent to My custon ROM]

Search This thread

01tarik007

Member
Apr 22, 2015
11
0
Hi friends,
I try to make my own ROM by adding my own intent actions, this actions will brodcasted by the system when i click on the camera button ,
where i can add this two lines :
Code:
Intent myintent =new Intent("ACTION_MY_OWN_INTENT"); 
context.sendBroadcast(myintent);

Thanks for any help.
 

01tarik007

Member
Apr 22, 2015
11
0
Hi friends,
I try to make my own ROM by adding my own intent actions, this actions will brodcasted by the system when i click on the camera button ,
where i can add this two lines :
Code:
Intent myintent =new Intent("ACTION_MY_OWN_INTENT"); 
context.sendBroadcast(myintent);

Thanks for any help.
Now my action is broadcasted by the system , only when i click on Volume up or down physique button by doing this:
open the AudioService.java path/to/android_root/frameworks/base/media/java/android/media/AudioService.java.

search for sendVolumeUpdate function
Code:
// UI update and Broadcast Intent
    private void sendVolumeUpdate(int streamType, int oldIndex, int index, int flags) {
        if (!isPlatformVoice() && (streamType == AudioSystem.STREAM_RING)) {
            streamType = AudioSystem.STREAM_NOTIFICATION;
        }

        if (streamType == AudioSystem.STREAM_MUSIC) {
            flags = updateFlagsForSystemAudio(flags);
        }
        mVolumeController.postVolumeChanged(streamType, flags);

        if ((flags & AudioManager.FLAG_FIXED_VOLUME) == 0) {
            oldIndex = (oldIndex + 5) / 10;
            index = (index + 5) / 10;
            Intent intent = new Intent(AudioManager.VOLUME_CHANGED_ACTION);
            intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_TYPE, streamType);
            intent.putExtra(AudioManager.EXTRA_VOLUME_STREAM_VALUE, index);
            intent.putExtra(AudioManager.EXTRA_PREV_VOLUME_STREAM_VALUE, oldIndex);
            sendBroadcastToAll(intent);

			
        }
    }
and add your own action in the end of this function
Code:
Intent myintent =new Intent("ACTION_MY_OWN_INTENT") }
use
Code:
sendBroadcastToAll
function to broadcast the intent, so you can be sure that the context had been well initiated.
now I try to make my own module for sending my own action intent, any helps are welcome.
:laugh::D
 

01tarik007

Member
Apr 22, 2015
11
0
offfff
finally the secret is here
Code:
android_root/frameworks/base/policy/src/com/android/internal/policy/impl/ PhoneFallbackEventHandler.java

Thanks t me