Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 350dcf82 authored by xinyu's avatar xinyu Committed by Steve Kondik
Browse files

support FM Radio audio routing in audio flinger

parent e1237a90
Loading
Loading
Loading
Loading
+188 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2009, Code Aurora Forum. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *    * Redistributions of source code must retain the above copyright
 *      notice, this list of conditions and the following disclaimer.
 *    * Redistributions in binary form must reproduce the above copyright
 *      notice, this list of conditions and the following disclaimer in the
 *      documentation and/or other materials provided with the distribution.
 *    * Neither the name of Code Aurora nor
 *      the names of its contributors may be used to endorse or promote
 *      products derived from this software without specific prior written
 *      permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package android.hardware.fmradio;

import android.util.Log;


/**
 *
 * Class to be used when changing radio settings
 * @hide
 */
public class FmConfig {


    /**
     * FMConfigure FM Radio band setting for US/Europe
     */
     private static final int FM_US_BAND        =0;
    /**
     * FMConfigure FM Radio band setting for US/Europe
     */
     private static final int FM_EU_BAND        =1;
   /**
     * FMConfigure FM Radio band setting for Japan
     */
     private static final int FM_JAPAN_WIDE_BAND       =2;
   /**
     * FMConfigure FM Radio band setting for Japan-Wideband
     */
     private static final int FM_JAPAN_STANDARD_BAND   =3;
   /**
     * FMConfigure FM Radio band setting for "User defined" band
     */
     private static final int FM_USER_DEFINED_BAND     =4;

     private static final int V4L2_CID_PRIVATE_BASE                 =0x8000000;
     private static final int V4L2_CID_PRIVATE_TAVARUA_REGION       =V4L2_CID_PRIVATE_BASE + 7;
     private static final int V4L2_CID_PRIVATE_TAVARUA_EMPHASIS     =V4L2_CID_PRIVATE_BASE + 12;
     private static final int V4L2_CID_PRIVATE_TAVARUA_RDS_STD      =V4L2_CID_PRIVATE_BASE + 13;
     private static final int V4L2_CID_PRIVATE_TAVARUA_SPACING      =V4L2_CID_PRIVATE_BASE + 14;

     private static final String TAG = "FmConfig";



    private int mRadioBand;
    /**
     * FM pre-emphasis/de-emphasis
     *
     * Possible Values:
     *
     * FmTransceiver.FM_DE_EMP75,
     * FmTransceiver.FM_DE_EMP50
     */
    private int mEmphasis;
    /**
     * Channel spacing
     *
     * Possible Values:
     *
     * FmTransceiver.FM_CHSPACE_200_KHZ,
     * FmTransceiver.FM_CHSPACE_100_KHZ,
     * FmTransceiver.FM_CHSPACE_50_KHZ
     */
    private int mChSpacing;

    /**
     * RDS standard type
     *
     * Possible Values:
     *
     * FmTransceiver.FM_RDS_STD_RBDS,
     * FmTransceiver.FM_RDS_STD_RDS,
     * FmTransceiver.FM_RDS_STD_NONE
     */
    private int mRdsStd;

    /**
     * FM Frequency Band Lower Limit in KHz
     */
    private int mBandLowerLimit;
    /**
     * FM Frequency Band Upper Limit in KHz
     */
    private int mBandUpperLimit;

    public int getRadioBand(){
        return mRadioBand;
    }

    public void setRadioBand (int band){
        mRadioBand = band;
    }

    public int getEmphasis(){
        return mEmphasis;
    }

    public void setEmphasis (int emp){
        mEmphasis = emp;
    }

    public int getChSpacing (){
        return mChSpacing;
    }

    public void setChSpacing(int spacing) {
        mChSpacing = spacing;
    }

    public int getRdsStd () {
        return mRdsStd;
    }

    public void setRdsStd (int rdsStandard) {
        mRdsStd = rdsStandard;
    }

    public int getLowerLimit(){
        return mBandLowerLimit;
    }

    public void setLowerLimit(int lowLimit){
        mBandLowerLimit = lowLimit;
    }

    public int getUpperLimit(){
        return mBandUpperLimit;
    }

    public void setUpperLimit(int upLimit){
        mBandUpperLimit = upLimit;
    }

    /*
     * fmConfigure()
     * This method call v4l2 private controls to set regional settings for the
     * FM core
     */
    protected static boolean fmConfigure (int fd, FmConfig configSettings) {

        int re;

        Log.d (TAG, "In fmConfigure");

        re = FmReceiverJNI.setControlNative (fd, V4L2_CID_PRIVATE_TAVARUA_EMPHASIS, configSettings.getEmphasis());
        re = FmReceiverJNI.setControlNative (fd, V4L2_CID_PRIVATE_TAVARUA_RDS_STD, configSettings.getRdsStd() );
        re = FmReceiverJNI.setControlNative (fd, V4L2_CID_PRIVATE_TAVARUA_SPACING, configSettings.getChSpacing() );
        re = FmReceiverJNI.setBandNative    (fd, configSettings.getLowerLimit(), configSettings.getUpperLimit() );

        re = FmReceiverJNI.setControlNative (fd, V4L2_CID_PRIVATE_TAVARUA_REGION, FM_USER_DEFINED_BAND );

        // setControlNative for V4L2_CID_PRIVATE_TAVARUA_REGION triggers the
        // config change.
        if (re < 0)
          return false;

        return true;
    }

}
+1684 −0

File added.

Preview size limit exceeded, changes collapsed.

+176 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2009, Code Aurora Forum. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *        * Redistributions of source code must retain the above copyright
 *            notice, this list of conditions and the following disclaimer.
 *        * Redistributions in binary form must reproduce the above copyright
 *            notice, this list of conditions and the following disclaimer in the
 *            documentation and/or other materials provided with the distribution.
 *        * Neither the name of Code Aurora nor
 *            the names of its contributors may be used to endorse or promote
 *            products derived from this software without specific prior written
 *            permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NON-INFRINGEMENT ARE DISCLAIMED.    IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package android.hardware.fmradio;


class FmReceiverJNI {
    /**
     * General success
     */
    static final int FM_JNI_SUCCESS = 0;

    /**
     * General failure
     */
    static final int FM_JNI_FAILURE = -1;

    /**
     * native method: Open device
     * @return The file descriptor of the device
     *
     */
    static native int acquireFdNative(String path);


    /**
     * native method:
     * @param fd
     * @param control
     * @param field
     * @return
     */
    static native int audioControlNative(int fd, int control, int field);

    /**
     * native method: cancels search
     * @param fd file descriptor of device
     * @return May return
     *             {@link #FM_JNI_SUCCESS}
     *             {@link #FM_JNI_FAILURE}
     */
    static native int cancelSearchNative(int fd);

    /**
     * native method: release control of device
     * @param fd file descriptor of device
     * @return May return
     *             {@link #FM_JNI_SUCCESS}
     *             {@link #FM_JNI_FAILURE}
     */
    static native int closeFdNative(int fd);

    /**
     * native method: get frequency
     * @param fd file descriptor of device
     * @return Returns frequency in int form
     */
    static native int getFreqNative(int fd);

    /**
     * native method: set frequency
     * @param fd file descriptor of device
     * @param freq freq to be set in int form
     * @return {@link #FM_JNI_SUCCESS}
     *         {@link #FM_JNI_FAILURE}
     *
     */
    static native int setFreqNative(int fd, int freq);

    /**
     * native method: get v4l2 control
     * @param fd file descriptor of device
     * @param id v4l2 id to be retrieved
     * @return Returns current value of the
     *         v4l2 control
     */
    static native int getControlNative (int fd, int id);

    /**
     * native method: set v4l2 control
     * @param fd file descriptor of device
     * @param id v4l2 control to be set
     * @param value value to be set
     * @return {@link #FM_JNI_SUCCESS}
     *         {@link #FM_JNI_FAILURE}
     */
    static native int setControlNative (int fd, int id, int value);

    /**
     * native method: start search
     * @param fd file descriptor of device
     * @param dir search direction
     * @return {@link #FM_JNI_SUCCESS}
     *         {@link #FM_JNI_FAILURE}
     */
    static native int startSearchNative (int fd, int dir);

    /**
     * native method: get buffer
     * @param fd file descriptor of device
     * @param buff[] buffer
     * @param index index of the buffer to be retrieved
     * @return {@link #FM_JNI_SUCCESS}
     *         {@link #FM_JNI_FAILURE}
     */
    static native int getBufferNative (int fd, byte  buff[], int index);

    /**
     * native method: get RSSI value of the
     *                received signal
     * @param fd file descriptor of device
     * @return Returns signal strength in int form
     *         Signal value range from -120 to 10
     */
    static native int getRSSINative (int fd);

    /**
     * native method: set FM band
     * @param fd file descriptor of device
     * @param low lower band
     * @param high higher band
     * @return {@link #FM_JNI_SUCCESS}
     *         {@link #FM_JNI_FAILURE}
     */
    static native int setBandNative (int fd, int low, int high);

    /**
     * native method: get lower band
     * @param fd file descriptor of device
     * @return Returns lower band in int form
     */
    static native int getLowerBandNative (int fd);

    /**
     * native method: force Mono/Stereo mode
     * @param fd file descriptor of device
     * @param val force mono/stereo indicator
     * @return {@link #FM_JNI_SUCCESS}
     *         {@link #FM_JNI_FAILURE}
     */
    static native int setMonoStereoNative (int fd, int val);

    /**
     * native method: get Raw RDS data
     * @param fd file descriptor of device
     * @param buff[] buffer
     * @param count number of bytes to be read
     * @return Returns number of bytes read
     */
    static native int getRawRdsNative (int fd, byte  buff[], int count);
}
+313 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2009, Code Aurora Forum. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *        * Redistributions of source code must retain the above copyright
 *            notice, this list of conditions and the following disclaimer.
 *        * Redistributions in binary form must reproduce the above copyright
 *            notice, this list of conditions and the following disclaimer in the
 *            documentation and/or other materials provided with the distribution.
 *        * Neither the name of Code Aurora nor
 *            the names of its contributors may be used to endorse or promote
 *            products derived from this software without specific prior written
 *            permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NON-INFRINGEMENT ARE DISCLAIMED.    IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package android.hardware.fmradio;

import android.util.Log;


class FmRxControls
{

   private boolean mStateStereo;
   private boolean mStateMute;
   private int mFreq;

   static final int SEEK_FORWARD = 0;
   static final int SEEK_BACKWARD = 1;
   static final int SCAN_FORWARD = 2;
   static final int SCAN_BACKWARD = 3;
   private int mSrchMode;
   private int mScanTime;
   private int mSrchDir;
   private int mSrchListMode;
   private int mPrgmType;
   private int mPrgmId;
   private static final String TAG = "FmRxControls";


   /* V4l2 Controls */
   private static final int V4L2_CID_PRIVATE_BASE = 0x8000000;
   private static final int V4L2_CID_PRIVATE_TAVARUA_SRCHMODE = V4L2_CID_PRIVATE_BASE + 1;
   private static final int V4L2_CID_PRIVATE_TAVARUA_SCANDWELL = V4L2_CID_PRIVATE_BASE + 2;
   private static final int V4L2_CID_PRIVATE_TAVARUA_SRCHON = V4L2_CID_PRIVATE_BASE + 3;
   private static final int V4L2_CID_PRIVATE_TAVARUA_STATE = V4L2_CID_PRIVATE_BASE + 4;
   private static final int V4L2_CID_PRIVATE_TAVARUA_TRANSMIT_MODE = V4L2_CID_PRIVATE_BASE + 5;
   private static final int V4L2_CID_PRIVATE_TAVARUA_RDSGROUP_MASK = V4L2_CID_PRIVATE_BASE + 6;;
   private static final int V4L2_CID_PRIVATE_TAVARUA_REGION = V4L2_CID_PRIVATE_BASE + 7;
   private static final int V4L2_CID_PRIVATE_TAVARUA_SIGNAL_TH = V4L2_CID_PRIVATE_BASE + 8;
   private static final int V4L2_CID_PRIVATE_TAVARUA_SRCH_PTY = V4L2_CID_PRIVATE_BASE + 9;
   private static final int V4L2_CID_PRIVATE_TAVARUA_SRCH_PI = V4L2_CID_PRIVATE_BASE + 10;
   private static final int V4L2_CID_PRIVATE_TAVARUA_SRCH_CNT = V4L2_CID_PRIVATE_BASE + 11;
   private static final int V4L2_CID_PRIVATE_TAVARUA_EMPHASIS = V4L2_CID_PRIVATE_BASE + 12;
   private static final int V4L2_CID_PRIVATE_TAVARUA_RDS_STD = V4L2_CID_PRIVATE_BASE + 13;
   private static final int V4L2_CID_PRIVATE_TAVARUA_SPACING = V4L2_CID_PRIVATE_BASE + 14;
   private static final int V4L2_CID_PRIVATE_TAVARUA_RDSON = V4L2_CID_PRIVATE_BASE + 15;
   private static final int V4L2_CID_PRIVATE_TAVARUA_RDSGROUP_PROC = V4L2_CID_PRIVATE_BASE + 16;
   private static final int V4L2_CID_PRIVATE_TAVARUA_LP_MODE = V4L2_CID_PRIVATE_BASE + 17;

   private static final int V4L2_CTRL_CLASS_USER = 0x980000;
   private static final int V4L2_CID_BASE = V4L2_CTRL_CLASS_USER | 0x900;

   private static final int V4L2_CID_AUDIO_MUTE = V4L2_CID_BASE + 9;



   /*
    * Turn on FM Rx/Tx.
    * Rx = 1 and Tx = 2
    */
   public void fmOn(int fd, int device) {
      FmReceiverJNI.setControlNative(fd, V4L2_CID_PRIVATE_TAVARUA_STATE, 1 );
   }

   /*
    * Turn off FM Rx/Tx
    */
   public void fmOff(int fd){
      FmReceiverJNI.setControlNative(fd, V4L2_CID_PRIVATE_TAVARUA_STATE, 2 );
   }

   /*
    * set mute control
    */
   public void muteControl(int fd, boolean on) {
      if (on)
      {
         int err = FmReceiverJNI.setControlNative(fd, V4L2_CID_AUDIO_MUTE, 3 );
      } else
      {
         int err = FmReceiverJNI.setControlNative(fd, V4L2_CID_AUDIO_MUTE, 4 );
      }
   }

   /*
    * Tune FM core to specified freq.
    */
   public void setStation(int fd) {
      Log.d(TAG, "** Tune Using: "+fd);
      int ret = FmReceiverJNI.setFreqNative(fd, mFreq);
      Log.d(TAG, "** Returned: "+ret);
   }

  /*
   * Get currently tuned freq
   */
   public int getTunedFrequency(int fd) {
      int frequency = FmReceiverJNI.getFreqNative(fd);
      Log.d(TAG, "getTunedFrequency: "+frequency);
      return frequency;
   }

   public int getFreq (){
      return mFreq;
   }

   public void setFreq (int f){
      mFreq = f;
   }

   /*
    * Start search list for auto presets
    */
   public int searchStationList (int fd, int mode, int preset_num,
                                   int dir, int pty )
   {
      int re;


     /* set search mode. */
      re = FmReceiverJNI.setControlNative (fd, V4L2_CID_PRIVATE_TAVARUA_SRCHMODE, mode);
      if (re != 0) {
         return re;
      }

      /* set number of stations to be returned in the list */
      re = FmReceiverJNI.setControlNative (fd, V4L2_CID_PRIVATE_TAVARUA_SRCH_CNT, preset_num);
      if (re != 0) {
         return re;
      }

      // RDS search list?
      if (pty > 0 ){
        re = FmReceiverJNI.setControlNative (fd, V4L2_CID_PRIVATE_TAVARUA_SRCH_PTY, pty);
      }
      if (re != 0) {
         return re;
      }

      /* This triigers the search and once completed the FM core generates
       * searchListComplete event */
      re = FmReceiverJNI.startSearchNative (fd, dir );
      if (re != 0) {
         return re;
      }
      else {
         return 0;
      }

   }

   /* Read search list from buffer */
   public int[] stationList (int fd)
   {
         int freq = 0;
         int i=0;
         int station_num;
         float real_freq = 0;
         int [] stationList;
         byte [] sList = new byte[100];
         int tmpFreqByte1=0;
         int tmpFreqByte2=0;
         float lowBand;


         lowBand = (float) (FmReceiverJNI.getLowerBandNative(fd) / 1000.00);
         Log.d(TAG, "lowBand: " + lowBand);
         FmReceiverJNI.getBufferNative(fd, sList, 0);

         station_num = (int)sList[0];
         stationList = new int[station_num+1];
         Log.d(TAG, "station_num: " + station_num);

         for (i=0;i<station_num;i++) {
            freq = 0;
            Log.d(TAG, " Byte1 = " + sList[i*2+1]);
            Log.d(TAG, " Byte2 = " + sList[i*2+2]);
            tmpFreqByte1 = sList[i*2+1] & 0xFF;
            tmpFreqByte2 = sList[i*2+2] & 0xFF;
            Log.d(TAG, " tmpFreqByte1 = " + tmpFreqByte1);
            Log.d(TAG, " tmpFreqByte2 = " + tmpFreqByte2);
            freq = (tmpFreqByte1 & 0x03) << 8;
            freq |= tmpFreqByte2;
            Log.d(TAG, " freq: " + freq);
            real_freq  = (float)(freq * 0.05) + lowBand;//tuner.rangelow / FREQ_MUL;
            Log.d(TAG, " real_freq: " + real_freq);
            stationList[i] = (int)(real_freq*1000);
            Log.d(TAG, " stationList: " + stationList[i]);
        }

        try {
          // mark end of list
           stationList[station_num] = 0;
        }
        catch (ArrayIndexOutOfBoundsException e) {
           Log.d(TAG, "ArrayIndexOutOfBoundsException !!");
        }

        return stationList;

   }


   /* configure various search parameters and start search */
   public void searchStations (int fd, int mode, int dwell,
                               int dir, int pty, int pi){
      int re = 0;


      Log.d(TAG, "Mode is " + mode + " Dwell is " + dwell);
      Log.d(TAG, "dir is "  + dir + " PTY is " + pty);
      Log.d(TAG, "pi is " + pi + " id " +  V4L2_CID_PRIVATE_TAVARUA_SRCHMODE);



      re = FmReceiverJNI.setControlNative (fd, V4L2_CID_PRIVATE_TAVARUA_SRCHMODE, mode);

      re = FmReceiverJNI.setControlNative (fd, V4L2_CID_PRIVATE_TAVARUA_SCANDWELL, dwell);

      if (pty != 0)
      {
         re = FmReceiverJNI.setControlNative (fd, V4L2_CID_PRIVATE_TAVARUA_SRCH_PTY, pty);
      }

      if (pi != 0)
      {
         re = FmReceiverJNI.setControlNative (fd, V4L2_CID_PRIVATE_TAVARUA_SRCH_PI, pi);
      }

      re = FmReceiverJNI.startSearchNative (fd, dir );

   }

   /* force mono/stereo mode */
   public int stereoControl(int fd, boolean stereo) {

     if (stereo){
       return  FmReceiverJNI.setMonoStereoNative (fd, 1);
     }
     else {
       return  FmReceiverJNI.setMonoStereoNative (fd, 0);
     }


   }


   public void searchRdsStations(int mode,int dwelling,
                                 int direction, int RdsSrchPty, int RdsSrchPI){
   }

   /*   public void searchStationList(int listMode,int direction,
                                 int listMax,int pgmType) {
   }
   */

   /* cancel search in progress */
   public void cancelSearch (int fd){
      FmReceiverJNI.cancelSearchNative(fd);
   }

   /* Set LPM. This disables all FM core interrupts */
   public int setLowPwrMode (int fd, boolean lpmOn){

      int re=0;

      if (lpmOn){
        re = FmReceiverJNI.setControlNative (fd, V4L2_CID_PRIVATE_TAVARUA_LP_MODE, 1);
      }
      else {
        re = FmReceiverJNI.setControlNative (fd, V4L2_CID_PRIVATE_TAVARUA_LP_MODE, 0);
      }

      return re;

   }

   /* get current powermode of the FM core. 1 for LPM and 0 Normal mode */
   public int getPwrMode (int fd) {

      int re=0;

      re = FmReceiverJNI.getControlNative (fd, V4L2_CID_PRIVATE_TAVARUA_LP_MODE);

      return re;

   }

}
+46 −0
Original line number Diff line number Diff line
/*
 * Copyright (c) 2009, Code Aurora Forum. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *        * Redistributions of source code must retain the above copyright
 *            notice, this list of conditions and the following disclaimer.
 *        * Redistributions in binary form must reproduce the above copyright
 *            notice, this list of conditions and the following disclaimer in the
 *            documentation and/or other materials provided with the distribution.
 *        * Neither the name of Code Aurora nor
 *            the names of its contributors may be used to endorse or promote
 *            products derived from this software without specific prior written
 *            permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NON-INFRINGEMENT ARE DISCLAIMED.    IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package android.hardware.fmradio;
interface FmRxEvCallbacks {

    public void FmRxEvEnableReceiver();
    public void FmRxEvDisableReceiver();
    public void FmRxEvRadioTuneStatus(int freq);
    public void FmRxEvRdsLockStatus(boolean rdsAvail);
    public void FmRxEvStereoStatus(boolean stereo);
    public void FmRxEvServiceAvailable(boolean service);
    public void FmRxEvSearchInProgress();
    public void FmRxEvSearchComplete(int freq);
    public void FmRxEvSearchListComplete();
    public void FmRxEvRdsGroupData();
    public void FmRxEvRdsPsInfo();
    public void FmRxEvRdsRtInfo();
    public void FmRxEvRdsAfInfo();

}
Loading