solved it
??????
بتاريخ الأربعاء، 23 يناير، 2013 6:34:16 ص UTC+2، كتب scadaguru:
>
> I have BroadcastReceiver to listen PHONE_STATE when it receives the
> incoming call it does not ring.
> I see logcat shows it set the correct ringer stream volume level but still
> it does not ring.
> I am testing this on Nexus 4 running xylon custom ROM.
> Any help?
>
> Below is the code:
>
> public class callListnerClass extends BroadcastReceiver de
> {
> @Override
> public void onReceive(Context context, Intent intent)
> {
> Bundle bundle = intent.getExtras();
> if (bundle != null)
> {
> String state = bundle.getString(TelephonyManager.EXTRA_STATE);
> if (state.equalsIgnoreCase(TelephonyManager.EXTRA_STATE_RINGING))
> {
> AudioManager am = (AudioManager)
> context.getSystemService(Context.AUDIO_SERVICE);
> int maxVol = am.getStreamMaxVolume(AudioManager.STREAM_RING);
> am.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
> am.setStreamVolume(AudioManager.STREAM_RING, maxVol, 0);
> int actualVol = am.getStreamVolume(AudioManager.STREAM_RING);
> Log.v(MY_TAG, "Turning Ringer to max(" + maxVol + ") actual(" + actualVol
> + ") for incoming call");
> }
> }
> }
> }
>
>
--
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-developers/3eac4f54-df59-4959-b954-7d9020018a50%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.