I'm trying to implement listening to a headset being (un)plugged, but it's not really working out as I hoped.
The code (for S60 5th edition and Symbian^3 also I think):
I think I should be getting callback events to 'ConnectedL(CAccMonitorInfo* aAccessoryInfo)' and 'DisconnectedL(CAccMonitorInfo* aAccessoryInfo)' but I'm not receiving anything.
// registering observer
CAccMonitor* accMonitor = CAccMonitor::NewLC();
accMonitor->StartObservingL(this); // with 'this' being my observer (implementing 'MAccMonitorObserver')
Could someone shed some light if I'm doing something wrong or am I not doing enough to register for these events?
I also want to have this functionality on S60 3rd edition devices, but I read that 'KAccessoryModeChanged' is to be used there.
Does this API work on all S60 3rd devices, because the note (see first link at bottom) says: 'While the API is include in the S60 3rd Edition FP1 version of the SDK API Plug-in it is a known issue that it will not work with S60 3rd Edition FP1 phones.'
Isn't it possible to also use the accMonitor on S60 3rd devices by including the needed libraries somehow?
An alternative would be to just check if a headset is connected. I don't know if there is possible way to just check for that instead of listening to (un)plugged-events?
Another alternative which I saw somewhere, would be to check the 'Indicator pane' from the status pane and check for the headset icon (EAknIndicatorHeadset), but I think an application cannot access that pane for it's state, am I right?
Any help is greatly appreciated!