This is happening on one of my G2's also and is becoming increasingly frustrating. It just started happening in the last 3-4 weeks, but seems be more frequent and pretty much effects every single call now. I can guarantee you that mine is not from my cheek or sunlight. I was just sitting here at my desk on a conference call with the supplied headphones. The G2 was siting on my desk and it suddenly switched to speaker mode.
I have noticed when it switches, a message pops up on the screen. The message that appears is relay server verified.
I've had mine happen while on wired headset, while on BT headset, and while just on the phone. It also happens frequently right after I answer a call. This is causing issues when I'm connected to BT on my motorcycle helmet and a call comes in and my phone decides to go to speaker mode instead of BT like it should. My phone is usually tucked away in a pocket and instead of the caller hearing me nice and quiet in my helmet, they hear nothing but wind noise. So aggravating especially when its calls I'm expecting.
I actually have two G2 phones (1 work and 1 personal). My work phone is the one being affected, but I do spend a lot more time talking on it for conference calls etc, then my personal phone. I have not seen my personal G2 do this yet.
I would definitely be interested in some more ideas and ways to fix this. The fact this is starting to affect almost every call I use, the phone is becoming increasingly frustrating to use.
Phone details
Stock phone running Android 2.2
Baseband: 12.28b.60.140eU_26.03.02.26_M
Kernal: 2.6.32.17-g9ab3677
htc-kernal@and18-2 #1
Build 1.22.531.8 CL277427 release-keys