bluetoothengine/btmac/src/BTMonoCmdHandler/btmcvolume.cpp
branchRCL_3
changeset 13 b6f55cd40afd
parent 10 0707dd69d236
equal deleted inserted replaced
11:a42ed326b458 13:b6f55cd40afd
   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 )