bluetoothengine/btmac/src/BTMonoCmdHandler/btmcvolume.cpp
changeset 25 9c3798b88e30
parent 22 4255033c5d30
equal deleted inserted replaced
24:8930e1d1d530 25:9c3798b88e30
   201         ( aPrevPhVol <= iAccSpkrVol && iPhnSpkrVol >= iAccSpkrVol ) )
   201         ( aPrevPhVol <= iAccSpkrVol && iPhnSpkrVol >= iAccSpkrVol ) )
   202         {
   202         {
   203         diff1 = Abs( aPrevPhVol - iAccSpkrVol );
   203         diff1 = Abs( aPrevPhVol - iAccSpkrVol );
   204         diff2 = Abs( iPhnSpkrVol - iAccSpkrVol );
   204         diff2 = Abs( iPhnSpkrVol - iAccSpkrVol );
   205         
   205         
   206         if( diff2 >= diff1  )
   206         if (diff2 > diff1)
   207             {
   207             {
   208             // the previous phone volume is closer to current headset volume setting
   208             // the previous phone volume is closer to current headset volume setting
       
   209             volClick = ( aPrevPhVol < iPhnSpkrVol ) ? KPSVolumeDownClicked : KPSVolumeUpClicked;
       
   210             }
       
   211         else if ( (diff2 == diff1) && (diff1 !=0) )
       
   212             {
   209             volClick = ( aPrevPhVol < iPhnSpkrVol ) ? KPSVolumeDownClicked : KPSVolumeUpClicked;
   213             volClick = ( aPrevPhVol < iPhnSpkrVol ) ? KPSVolumeDownClicked : KPSVolumeUpClicked;
   210             }
   214             }
   211         // otherwise we have roughly synchronized vol in both ends.
   215         // otherwise we have roughly synchronized vol in both ends.
   212         }
   216         }
   213     else if( iAccSpkrVol != iPhnSpkrVol )
   217     else if( iAccSpkrVol != iPhnSpkrVol )