fm/qcom/fmradio/FmReceiver.java
public boolean searchStationList (int mode,
                                     int direction,
                                     int maximumStations,
                                     int pty){

      int state = getFMState();
      boolean bStatus = true;
      int re = 0;

      /* Check current state of FM device */
      if (state == FMState_Turned_Off || state == FMState_Srch_InProg) {
          Log.d(TAG, "searchStationList: Device currently busy in executing another command.");
          return false;
      }

      Log.d (TAG, "searchStations: mode " + mode);
      Log.d (TAG, "searchStations: direction " + direction);
      Log.d (TAG, "searchStations: maximumStations " + maximumStations);
      Log.d (TAG, "searchStations: pty " + pty);

      /* Validate the arguments */
      if ( (mode != FM_RX_SRCHLIST_MODE_STRONG)
           && (mode != FM_RX_SRCHLIST_MODE_WEAK )
           && (mode != FM_RX_SRCHLIST_MODE_STRONGEST )
           && (mode != FM_RX_SRCHLIST_MODE_WEAKEST )
         )
      {
         bStatus = false;
      }
      if ( (maximumStations < 0) ||
           (maximumStations > FM_RX_SRCHLIST_MAX_STATIONS))
      {
         bStatus = false;
      }
      if ( (direction != FM_RX_SEARCHDIR_DOWN) &&
           (direction != FM_RX_SEARCHDIR_UP))
      {
         bStatus = false;
      }

      if (bStatus)
      {
         setSearchState(subSrchLevel_SrchListInProg);
         Log.v(TAG, "searchStationList: CURRENT-STATE : FMRxOn ---> NEW-STATE : SearchInProg");
         if ((mode == FM_RX_SRCHLIST_MODE_STRONGEST) || (mode == FM_RX_SRCHLIST_MODE_WEAKEST)) {
             mode = (mode == FM_RX_SRCHLIST_MODE_STRONGEST)?
                               FM_RX_SRCHLIST_MODE_STRONG: FM_RX_SRCHLIST_MODE_WEAK;
            re = mControl.searchStationList(sFd, mode, 0, direction, pty);
         }
         else
            re = mControl.searchStationList(sFd, mode, maximumStations, direction, pty);

         if (re != 0) {
             Log.e(TAG, "search station list failed");
             if (getFMState() == FMState_Srch_InProg)
                 setSearchState(subSrchLevel_SrchComplete);
             bStatus =  false;
         }
      }

      return bStatus;
   }
/** Initiates station list search operations.
   *    <p> This method will initate a search that will generate
   *    frequency lists based on strong and weak stations found in
   *    the FM band.
   *    <p>
   *    <ul>
   *    This API is used to generate station lists which consist of:
   *    <li>strong stations (FM_RX_SRCHLIST_MODE_STRONG,FM_RX_SRCHLIST_MODE_STRONGEST)
   *    <li>weak stations   (FM_RX_SRCHLIST_MODE_WEAK, FM_RX_SRCHLIST_MODE_WEAKEST)
   *    </ul>
   *    <p>
   *    The range of frequencies scanned depends on the currently set band.
   *    The driver searches for all valid stations in the band and when complete,
   *    returns a channel list based on the client's selection. The client can
   *    choose to search for a list of the strongest stations in the band, the
   *    weakest stations in the band, or the first N strong or weak
   *    stations. By setting the maximumStations argument, the
   *    client can constrain the number of frequencies returned in
   *    the list. If user specifies argument maximumStations to be
   *    0, the search will generate the maximum number of stations
   *    possible.
   *    <p>
   *    Each time the driver initiates a list-based search, the client will be
   *    notified via an FmRxEvSearchInProgress event. Similarly, each
   *    time a list-based search completes, the client will be
   *    notified via an FmRxEvSearchListComplete event.
   *    <p>
   *    On completion of the search, the originally tuned station
   *    will be tuned and the following events will be generated:
   *    FmRxEvSearchListComplete - The search has completed.
   *    FmRxEvRadioTuneStatus - The original frequency has been
   *    re-tuned.
   *    <p>
   *    Once issuing a search command, several commands from the client may be
   *    disallowed until the search is completed or cancelled.
   *    <p>
   *    The search can be canceled at any time by using API
   *    cancelSearch (). A cancelled search is treated as a completed
   *    search and the following events will be generated:
   *    FmRxEvSearchComplete  - The search has completed.
   *    FmRxEvRadioTuneStatus - The original frequency has been re-tuned.
   *    <p>
   *    Valid Values for argument 'mode':
   *    <ul>
   *    <li>{@link #FM_RX_SRCHLIST_MODE_STRONG}
   *    <li>{@link #FM_RX_SRCHLIST_MODE_WEAK}
   *    <li>{@link #FM_RX_SRCHLIST_MODE_STRONGEST}
   *    <li>{@link #FM_RX_SRCHLIST_MODE_WEAKEST}
   *    <li>FM_RX_SRCHLIST_MODE_PTY (Will be implemented in the
   *    future)
   *    </ul>
   *    <p>
   *    Valid Values for argument 'direction' :
   *    <ul>
   *    <li>{@link #FM_RX_SEARCHDIR_DOWN}
   *    <li>{@link #FM_RX_SEARCHDIR_UP}
   *    </ul>
   *    <p>
   *    Valid Values for argument 'maximumStations' : 1-12
   *    <p>
   *    @param mode the FM search mode.
   *    @param direction the Search Direction.
   *    @param maximumStations the maximum number of stations that
   *                           can be returned from a search. This parameter is
   *                           ignored and 12 stations are returned if the
   *                           search mode is either FM_RX_SRCHLIST_MODE_STRONGEST or
   *                           FM_RX_SRCHLIST_MODE_WEAKEST
   *
   *    @param pty the FM RDS search Program Type (Not used
   *               currently)
   *   <p>
   *    @return true if Search Initiate succeeded, false if
   *            Search Initiate  failed.
   *
   *   @see #searchStations(int, int, int)
   *   @see #searchStations(int, int, int, int, int)
   */
Initiates station list search operations.
 This method will initate a search that will generate
frequency lists based on strong and weak stations found in
the FM band.


This API is used to generate station lists which consist of:
strong stations (FM_RX_SRCHLIST_MODE_STRONG,FM_RX_SRCHLIST_MODE_STRONGEST)
weak stations   (FM_RX_SRCHLIST_MODE_WEAK, FM_RX_SRCHLIST_MODE_WEAKEST)


The range of frequencies scanned depends on the currently set band.
The driver searches for all valid stations in the band and when complete,
returns a channel list based on the client's selection. The client can
choose to search for a list of the strongest stations in the band, the
weakest stations in the band, or the first N strong or weak
stations. By setting the maximumStations argument, the
client can constrain the number of frequencies returned in
the list. If user specifies argument maximumStations to be
0, the search will generate the maximum number of stations
possible.

Each time the driver initiates a list-based search, the client will be
notified via an FmRxEvSearchInProgress event. Similarly, each
time a list-based search completes, the client will be
notified via an FmRxEvSearchListComplete event.

On completion of the search, the originally tuned station
will be tuned and the following events will be generated:
FmRxEvSearchListComplete - The search has completed.
FmRxEvRadioTuneStatus - The original frequency has been
re-tuned.

Once issuing a search command, several commands from the client may be
disallowed until the search is completed or cancelled.

The search can be canceled at any time by using API
cancelSearch (). A cancelled search is treated as a completed
search and the following events will be generated:
FmRxEvSearchComplete  - The search has completed.
FmRxEvRadioTuneStatus - The original frequency has been re-tuned.

@param pty the FM RDS search Program Type (Not used
currently)

@return true if Search Initiate succeeded, false if
Search Initiate  failed.


Initiates station list search operations . This method will initate a search that will generate frequency lists based on strong and weak stations found in the FM band . This API is used to generate station lists which consist of : strong stations ( FM_RX_SRCHLIST_MODE_STRONG FM_RX_SRCHLIST_MODE_STRONGEST ) weak stations ( FM_RX_SRCHLIST_MODE_WEAK FM_RX_SRCHLIST_MODE_WEAKEST ) The range of frequencies scanned depends on the currently set band . The driver searches for all valid stations in the band and when complete returns a channel list based on the client ' s selection . The client can choose to search for a list of the strongest stations in the band the weakest stations in the band or the first N strong or weak stations . By setting the maximumStations argument the client can constrain the number of frequencies returned in the list . If user specifies argument maximumStations to be 0 the search will generate the maximum number of stations possible . Each time the driver initiates a list - based search the client will be notified via an FmRxEvSearchInProgress event . Similarly each time a list - based search completes the client will be notified via an FmRxEvSearchListComplete event . On completion of the search the originally tuned station will be tuned and the following events will be generated : FmRxEvSearchListComplete - The search has completed . FmRxEvRadioTuneStatus - The original frequency has been re - tuned . Once issuing a search command several commands from the client may be disallowed until the search is completed or cancelled . The search can be canceled at any time by using API cancelSearch () . A cancelled search is treated as a completed search and the following events will be generated : FmRxEvSearchComplete - The search has completed . FmRxEvRadioTuneStatus - The original frequency has been re - tuned . @param pty the FM RDS search Program Type ( Not used currently ) @return true if Search Initiate succeeded false if Search Initiate failed .
public boolean searchStationList (int mode,
                                     int direction,
                                     int maximumStations,
                                     int pty){
      int state = getFMState();
      boolean bStatus = true;
      int re = 0;
      /* Check current state of FM device */
      if (state == FMState_Turned_Off || state == FMState_Srch_InProg) {
          Log.d(TAG, "searchStationList: Device currently busy in executing another command.");
          return false;
      }
      Log.d (TAG, "searchStations: mode " + mode);
      Log.d (TAG, "searchStations: direction " + direction);
      Log.d (TAG, "searchStations: maximumStations " + maximumStations);
      Log.d (TAG, "searchStations: pty " + pty);
      /* Validate the arguments */
      if ( (mode != FM_RX_SRCHLIST_MODE_STRONG)
           && (mode != FM_RX_SRCHLIST_MODE_WEAK )
           && (mode != FM_RX_SRCHLIST_MODE_STRONGEST )
           && (mode != FM_RX_SRCHLIST_MODE_WEAKEST )
         )
      {
         bStatus = false;
      }
      if ( (maximumStations < 0) ||
           (maximumStations > FM_RX_SRCHLIST_MAX_STATIONS))
      {
         bStatus = false;
      }
      if ( (direction != FM_RX_SEARCHDIR_DOWN) &&
           (direction != FM_RX_SEARCHDIR_UP))
      {
         bStatus = false;
      }
      if (bStatus)
      {
         setSearchState(subSrchLevel_SrchListInProg);
         Log.v(TAG, "searchStationList: CURRENT-STATE : FMRxOn ---> NEW-STATE : SearchInProg");
         if ((mode == FM_RX_SRCHLIST_MODE_STRONGEST) || (mode == FM_RX_SRCHLIST_MODE_WEAKEST)) {
             mode = (mode == FM_RX_SRCHLIST_MODE_STRONGEST)?
                               FM_RX_SRCHLIST_MODE_STRONG: FM_RX_SRCHLIST_MODE_WEAK;
            re = mControl.searchStationList(sFd, mode, 0, direction, pty);
         }
         else
            re = mControl.searchStationList(sFd, mode, maximumStations, direction, pty);
         if (re != 0) {
             Log.e(TAG, "search station list failed");
             if (getFMState() == FMState_Srch_InProg)
                 setSearchState(subSrchLevel_SrchComplete);
             bStatus =  false;
         }
      }
      return bStatus;
   }
public boolean searchStationList ( int mode , int direction , int maximumStations , int pty ) { int state = getFMState ( ) ; boolean bStatus = true ; int re = 0 ; /* Check current state of FM device */ if ( state == FMState_Turned_Off || state == FMState_Srch_InProg ) { Log . d ( TAG , "searchStationList: Device currently busy in executing another command." ) ; return false ; } Log . d ( TAG , "searchStations: mode " + mode ) ; Log . d ( TAG , "searchStations: direction " + direction ) ; Log . d ( TAG , "searchStations: maximumStations " + maximumStations ) ; Log . d ( TAG , "searchStations: pty " + pty ) ; /* Validate the arguments */ if ( ( mode != FM_RX_SRCHLIST_MODE_STRONG ) && ( mode != FM_RX_SRCHLIST_MODE_WEAK ) && ( mode != FM_RX_SRCHLIST_MODE_STRONGEST ) && ( mode != FM_RX_SRCHLIST_MODE_WEAKEST ) ) { bStatus = false ; } if ( ( maximumStations < 0 ) || ( maximumStations > FM_RX_SRCHLIST_MAX_STATIONS ) ) { bStatus = false ; } if ( ( direction != FM_RX_SEARCHDIR_DOWN ) && ( direction != FM_RX_SEARCHDIR_UP ) ) { bStatus = false ; } if ( bStatus ) { setSearchState ( subSrchLevel_SrchListInProg ) ; Log . v ( TAG , "searchStationList: CURRENT-STATE : FMRxOn ---> NEW-STATE : SearchInProg" ) ; if ( ( mode == FM_RX_SRCHLIST_MODE_STRONGEST ) || ( mode == FM_RX_SRCHLIST_MODE_WEAKEST ) ) { mode = ( mode == FM_RX_SRCHLIST_MODE_STRONGEST ) ? FM_RX_SRCHLIST_MODE_STRONG : FM_RX_SRCHLIST_MODE_WEAK ; re = mControl . searchStationList ( sFd , mode , 0 , direction , pty ) ; } else re = mControl . searchStationList ( sFd , mode , maximumStations , direction , pty ) ; if ( re != 0 ) { Log . e ( TAG , "search station list failed" ) ; if ( getFMState ( ) == FMState_Srch_InProg ) setSearchState ( subSrchLevel_SrchComplete ) ; bStatus = false ; } } return bStatus ; }
Initiates station list search operations.
Initiates station list search operations .