fm/qcom/fmradio/FmReceiver.java
public boolean disable(){
      boolean status = false;
      /*
       * Check for FM State. If search is in progress, then cancel the search prior
       * to disabling FM.
      */
      int state = getFMState();
      switch(state) {
      case FMState_Turned_Off:
         Log.d(TAG, "FM already tuned Off.");
         return false;
      case FMState_Srch_InProg:
         Log.v(TAG, "disable: Cancelling the on going search operation prior to disabling FM");
         setSearchState(subSrchLevel_SrchAbort);
         cancelSearch();
         Log.v(TAG, "disable: Wait for the state to change from : Search ---> FMRxOn");
         try {
            /*
             *    The delay of 50ms here is very important.
             *    This delay is useful for the cleanup purpose
             *    when HS is abruptly plugged out when search
             *    is in progress.
            */
            Thread.sleep(50);
         } catch (InterruptedException e) {
            e.printStackTrace();
         }
         break;
      case subPwrLevel_FMRx_Starting:
      /*
       * If, FM is in the process of turning On, then wait for
       * the turn on operation to complete before turning off.
      */
         Log.d(TAG, "disable: FM not yet turned On...");
         try {
            Thread.sleep(100);
         } catch (InterruptedException e) {
            e.printStackTrace();
         }
         /* Check for the state of FM device */
         state = getFMState();
         if(state == subPwrLevel_FMRx_Starting) {
            Log.e(TAG, "disable: FM in bad state");
            return status;
         }
         break;
      case subPwrLevel_FMTurning_Off:
      /*
       * If, FM is in the process of turning Off, then wait for
       * the turn off operation to complete.
      */
         Log.v(TAG, "disable: FM is getting turned Off.");
            return status;
      }

      setFMPowerState(subPwrLevel_FMTurning_Off);
      Log.v(TAG, "disable: CURRENT-STATE : FMRxOn ---> NEW-STATE : FMTurningOff");
      super.disable();

      return true;
   }
/**
   *    Disables the FM Device.
   *    <p>
   *    This is a synchronous command used to disable the FM
   *    device. This function is expected to be used when the
   *    client no longer requires use of the FM device. Once
   *    called, most functionality offered by the FM device will be
   *    disabled until the client re-enables the device again via
   *    {@link #enable}.
   *    <p>
   *    @return true if disabling succeeded, false if disabling
   *            failed.
   *    @see #enable
   *    @see #registerClient
   */
Disables the FM Device.

This is a synchronous command used to disable the FM
device. This function is expected to be used when the
client no longer requires use of the FM device. Once
called, most functionality offered by the FM device will be
disabled until the client re-enables the device again via
#enable.

@return true if disabling succeeded, false if disabling
failed.
@see #enable
@see #registerClient
Disables the FM Device . This is a synchronous command used to disable the FM device . This function is expected to be used when the client no longer requires use of the FM device . Once called most functionality offered by the FM device will be disabled until the client re - enables the device again via #enable . @return true if disabling succeeded false if disabling failed . @see #enable @see #registerClient
public boolean disable(){
      boolean status = false;
      /*
       * Check for FM State. If search is in progress, then cancel the search prior
       * to disabling FM.
      */
      int state = getFMState();
      switch(state) {
      case FMState_Turned_Off:
         Log.d(TAG, "FM already tuned Off.");
         return false;
      case FMState_Srch_InProg:
         Log.v(TAG, "disable: Cancelling the on going search operation prior to disabling FM");
         setSearchState(subSrchLevel_SrchAbort);
         cancelSearch();
         Log.v(TAG, "disable: Wait for the state to change from : Search ---> FMRxOn");
         try {
            /*
             *    The delay of 50ms here is very important.
             *    This delay is useful for the cleanup purpose
             *    when HS is abruptly plugged out when search
             *    is in progress.
            */
            Thread.sleep(50);
         } catch (InterruptedException e) {
            e.printStackTrace();
         }
         break;
      case subPwrLevel_FMRx_Starting:
      /*
       * If, FM is in the process of turning On, then wait for
       * the turn on operation to complete before turning off.
      */
         Log.d(TAG, "disable: FM not yet turned On...");
         try {
            Thread.sleep(100);
         } catch (InterruptedException e) {
            e.printStackTrace();
         }
         /* Check for the state of FM device */
         state = getFMState();
         if(state == subPwrLevel_FMRx_Starting) {
            Log.e(TAG, "disable: FM in bad state");
            return status;
         }
         break;
      case subPwrLevel_FMTurning_Off:
      /*
       * If, FM is in the process of turning Off, then wait for
       * the turn off operation to complete.
      */
         Log.v(TAG, "disable: FM is getting turned Off.");
            return status;
      }
      setFMPowerState(subPwrLevel_FMTurning_Off);
      Log.v(TAG, "disable: CURRENT-STATE : FMRxOn ---> NEW-STATE : FMTurningOff");
      super.disable();
      return true;
   }
public boolean disable ( ) { boolean status = false ; /*
       * Check for FM State. If search is in progress, then cancel the search prior
       * to disabling FM.
      */ int state = getFMState ( ) ; switch ( state ) { case FMState_Turned_Off : Log . d ( TAG , "FM already tuned Off." ) ; return false ; case FMState_Srch_InProg : Log . v ( TAG , "disable: Cancelling the on going search operation prior to disabling FM" ) ; setSearchState ( subSrchLevel_SrchAbort ) ; cancelSearch ( ) ; Log . v ( TAG , "disable: Wait for the state to change from : Search ---> FMRxOn" ) ; try { /*
             *    The delay of 50ms here is very important.
             *    This delay is useful for the cleanup purpose
             *    when HS is abruptly plugged out when search
             *    is in progress.
            */ Thread . sleep ( 50 ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } break ; case subPwrLevel_FMRx_Starting : /*
       * If, FM is in the process of turning On, then wait for
       * the turn on operation to complete before turning off.
      */ Log . d ( TAG , "disable: FM not yet turned On..." ) ; try { Thread . sleep ( 100 ) ; } catch ( InterruptedException e ) { e . printStackTrace ( ) ; } /* Check for the state of FM device */ state = getFMState ( ) ; if ( state == subPwrLevel_FMRx_Starting ) { Log . e ( TAG , "disable: FM in bad state" ) ; return status ; } break ; case subPwrLevel_FMTurning_Off : /*
       * If, FM is in the process of turning Off, then wait for
       * the turn off operation to complete.
      */ Log . v ( TAG , "disable: FM is getting turned Off." ) ; return status ; } setFMPowerState ( subPwrLevel_FMTurning_Off ) ; Log . v ( TAG , "disable: CURRENT-STATE : FMRxOn ---> NEW-STATE : FMTurningOff" ) ; super . disable ( ) ; return true ; }
Disables the FM Device.
Disables the FM Device .