[HTC One V] anders3408:
Hi xda,

Over at sensation xl forum we are trying to port a ROM from HTC One V to HTC Sensation Xl, we are so close to a fully working rom, but we have a bug left we just can't fix.

The ROM is on Android 4.0.4 with Sense 4.1 but we also trying to port Android 4.0.4 with Sense 4.0 and it has the same bug.

Here is the problem:

When I am calling someone and a SMS message comes in the phone are trying to make a sound so I know I got a SMS, but it does not play a sound. The only thing it does is muting the sound from speaker. I can get the speaker working again if I press mute and unmute again. We had tried many different things but no luck finding the bug. I am then thinking what about adding a function so when on call and SMS comes in the phone does not making notification, only when calls end I can see in SMS app that there is a new SMS.

I had found a way to cancel notification but that will cancel all notifications on SMS no matter on call or not.

I went to Message.apk ------ MessagingNotification.smali and found this:

const-string v2, "MessagingNotification"

const-string v3, ">> enter initiateEffectOfNotification"

invoke-static {v2, v3}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

.line 2078
if-eqz p1, :cond_174

.line 2079

And I changed to this:

const-string v2, "MessagingNotification"

#const-string v3, ">> enter initiateEffectOfNotification"

invoke-static {v2, v3}, Landroid/util/Log;->d (Ljava/lang/String;Ljava/lang/String;)I

.line 2078
if-eqz p1, :cond_174

.line 2079

And then no notifications while in call and the speaker don't mute, but it will remove all notifications no matter in call or not.

I am then thinking what code can I make to remove notifications while in call but still gets notifications when I am not in call?

I have made a logcat for you and in line 764 this is found:

11-07 22:42:00.407: D/MessagingNotification(2446): Thread id > 3
11-07 22:42:00.407: D/MessagingNotification(2446): Contact id > 11
11-07 22:42:00.417: D/MessagingNotification(2446): Unread count: 1, 1
11-07 22:42:00.417: D/MessagingNotification(2446): Notify notification complete, can cancel notification now
11-07 22:42:00.427: D/MessagingNotification(2446): deliverNotification
11-07 22:42:00.427: D/MessagingNotification(2446): New message
11-07 22:42:00.427: D/MessagingNotification(2446): RECEIVED_NOTIFICATION_ENABLED> true
11-07 22:42:00.427: D/MessagingNotification(2446): updateNotification>
11-07 22:42:00.437: D/SmsReceiverService(2446): sms notification unlock
11-07 22:42:00.457: D/PhoneRemoteUtil(2446): isSupportPhoneRemote = false
11-07 22:42:00.497: V/CarModeProvider(6806): content://com.htc.AutoMotive/mode
11-07 22:42:00.507: D/MessagingNotification(2446): Charm indicator: 0
11-07 22:42:00.507: D/MessagingNotification(2446): >> enter initiateEffectOfNotification
11-07 22:42:00.507: D/xxxx!!(2446): ringtoneStr= content://media/internal/audio/media/94
11-07 22:42:00.517: V/AudioTrack(2446): setVolume(0.316228, 0.316228), mAudioSession (io) -1
11-07 22:42:00.517: V/AudioTrack(2446): start 0x2688e78
11-07 22:42:00.527: V/AudioTrack(2446): start 0x2688e78 before lock cblk 0x528ac000
11-07 22:42:00.527: D/AudioPolicyManager(105): startOutput() output 3, stream 0, session 19
11-07 22:42:00.527: V/AudioPolicyManagerBase(105): changeRefCount() stream 0, count 1
11-07 22:42:00.527: D/AudioPolicyManager(105): getDeviceForStrategy() from cache strategy 1, device 1
11-07 22:42:00.527: V/AudioPolicyManagerBase(105): getNewDevice() selected device 1
11-07 22:42:00.527: D/AudioPolicyManager(105): getDeviceForStrategy() from cache strategy 1, device 1
11-07 22:42:00.527: V/AudioPolicyManagerBase(105): getNewDevice() selected device 1
11-07 22:42:00.527: D/AudioPolicyManager(105): setOutputDevice() output 3 device 1 delayMs 0
11-07 22:42:00.527: D/AudioPolicyManager(105): setOutputDevice() prevDevice 1
11-07 22:42:00.527: D/AudioPolicyManager(105): setOutputDevice() prevHWDevice 1
11-07 22:42:00.527: D/AudioPolicyManager(105): setOutputDevice() setting same device 1 or null device for output 3
11-07 22:42:00.527: D/AudioPolicyManager(105): linearToSpecifyHtcVolume(volume:100, streamType:0, audio_devices:1)

The rest of the logcat can be found Here

Please have a look and help us:) it doesn't matter if the notify don't comes when in call, only thing that is important is that it doesn't mute when incall:)