FM: clean up unused code

Remove code support for unused property.

CRs-fixed: 2595138
Change-Id: Ia4ba13bdbea959accaa7d61c1a48afc4fff76eee
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index f44eb42..dca9d72 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -132,7 +132,6 @@
    private BroadcastReceiver mAudioBecomeNoisyListener = null;
    private SharedPreferences mPref = null;
    private Editor mEditor = null;
-   private boolean mOverA2DP = false;
    private BroadcastReceiver mFmMediaButtonListener;
    private BroadcastReceiver mAirplaneModeChanged;
    private BroadcastReceiver mRegisterUserSwitched;
@@ -155,7 +154,6 @@
    private int mCallStatus = 0;
    private BroadcastReceiver mScreenOnOffReceiver = null;
    final Handler mHandler = new Handler();
-   private boolean misAnalogModeSupported = false;
    private boolean misAnalogPathEnabled = false;
    private boolean mA2dpDisconnected = false;
    private boolean mA2dpConnected = false;
@@ -192,7 +190,6 @@
    private boolean mA2dpDeviceSupportInHal = false;
    //on shutdown not to send start Intent to AudioManager
    private boolean mAppShutdown = false;
-   private boolean mSingleRecordingInstanceSupported = false;
    private AudioManager mAudioManager;
    public static final long UNAVAILABLE = -1L;
    public static final long PREPARING = -2L;
@@ -254,7 +251,6 @@
       PowerManager pm = (PowerManager)getSystemService(Context.POWER_SERVICE);
       mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, this.getClass().getName());
       mWakeLock.setReferenceCounted(false);
-      misAnalogModeSupported  = SystemProperties.getBoolean("ro.fm.analogpath.supported",false);
       /* Register for Screen On/off broadcast notifications */
       mA2dpDeviceState = new A2dpDeviceStatus(getApplicationContext());
       registerScreenOnOffListener();
@@ -270,9 +266,6 @@
       mSession = new MediaSession(getApplicationContext(), this.getClass().getName());
       mSession.setCallback(mSessionCallback);
       mSession.setFlags(MediaSession.FLAG_EXCLUSIVE_GLOBAL_PRIORITY);
-      if ( false == SystemProperties.getBoolean("ro.fm.mulinst.recording.support",true)) {
-           mSingleRecordingInstanceSupported = true;
-      }
 
       // Register for pause commands from other apps to stop FM
       registerMusicServiceCommandReceiver();
@@ -1166,13 +1159,7 @@
       int mRecordDuration = -1;
 
       Log.d(LOGTAG, "In startRecording of Recorder");
-      if((true == mSingleRecordingInstanceSupported) &&
-         (true == mOverA2DP )) {
-                Toast.makeText( this,
-                                "playback on BT in progress,can't record now",
-                                Toast.LENGTH_SHORT).show();
-                return false;
-       }
+
        stopRecording();
 
        if (!Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
@@ -1602,10 +1589,7 @@
                   case AudioManager.AUDIOFOCUS_LOSS:
                       Log.v(LOGTAG, "AudioFocus: received AUDIOFOCUS_LOSS mspeakerphone= " +
                                mSpeakerPhoneOn);
-                      if (mSpeakerPhoneOn) {
-                          if (isAnalogModeSupported())
-                              setAudioPath(false);
-                      }
+
                       if (mSession.isActive()) {
                           mSession.setActive(false);
                       }
@@ -2147,28 +2131,6 @@
    }
    private final IBinder mBinder = new ServiceStub(this);
 
-   private boolean setAudioPath(boolean analogMode) {
-
-        if (mReceiver == null) {
-              return false;
-        }
-        if (isAnalogModeEnabled() == analogMode) {
-                Log.d(LOGTAG,"Analog Path already is set to "+analogMode);
-                return false;
-        }
-        if (!isAnalogModeSupported()) {
-                Log.d(LOGTAG,"Analog Path is not supported ");
-                return false;
-        }
-
-        boolean state = mReceiver.setAnalogMode(analogMode);
-        if (false == state) {
-            Log.d(LOGTAG, "Error in toggling analog/digital path " + analogMode);
-            return false;
-        }
-        misAnalogPathEnabled = analogMode;
-        return true;
-   }
    private boolean waitForEvent() {
        boolean status = false;
 
@@ -2230,11 +2192,7 @@
        if (mReceiver.isCherokeeChip()) {
            bStatus = waitForEvent();
        }
-       if (isSpeakerEnabled()) {
-           setAudioPath(false);
-       } else {
-           setAudioPath(true);
-       }
+
        Log.d(LOGTAG, "mReceiver.enable done, Status :" +  bStatus);
 
          if (bStatus == true)
@@ -2341,11 +2299,6 @@
        bStatus = waitForEvent();
        mReceiver.setRawRdsGrpMask();
 
-       if (isSpeakerEnabled()) {
-           setAudioPath(false);
-       } else {
-           setAudioPath(true);
-       }
        Log.d(LOGTAG, "mReceiver.enable done, Status :" +  bStatus);
 
        if (bStatus == true) {
@@ -2622,10 +2575,6 @@
          return misAnalogPathEnabled;
    }
 
-   public boolean isAnalogModeSupported() {
-        return misAnalogModeSupported;
-   }
-
    public boolean isFmRecordingOn() {
       return mFmRecordingOn;
    }
diff --git a/jni/android_hardware_fm.cpp b/jni/android_hardware_fm.cpp
index 8e0c1bb..9e01b3a 100644
--- a/jni/android_hardware_fm.cpp
+++ b/jni/android_hardware_fm.cpp
@@ -81,7 +81,6 @@
     SCAN_DN
 };
 
-static JNIEnv *g_jEnv = NULL;
 static JavaVM *g_jVM = NULL;
 
 namespace android {
@@ -99,7 +98,6 @@
 static JNIEnv *mCallbackEnv = NULL;
 static jobject mCallbacksObj = NULL;
 static bool mCallbacksObjCreated = false;
-static jfieldID sCallbacksField;
 
 static jclass javaClassRef;
 static jmethodID method_psInfoCallback;
@@ -248,7 +246,7 @@
 {
     ALOGD("RT_EVT: " );
     jbyteArray rt_buff = NULL;
-    int i,len;
+    int len;
 
     if (!checkCallbackThread())
         return;
@@ -274,7 +272,7 @@
 void fm_ps_update_cb(char *ps)
 {
     jbyteArray ps_data = NULL;
-    int i,len;
+    int len;
     int numPs;
     if (!checkCallbackThread())
         return;
@@ -325,7 +323,7 @@
 {
     ALOGD("ERT_EVT");
     jbyteArray ert_buff = NULL;
-    int i,len;
+    int len;
 
     if (!checkCallbackThread())
         return;
@@ -350,7 +348,7 @@
 {
     ALOGI("Extended Contry code ");
     jbyteArray ecc_buff = NULL;
-    int i,len;
+    int len;
 
     if (!checkCallbackThread())
         return;
@@ -606,7 +604,7 @@
         (JNIEnv* env, jobject thiz, jstring path)
 {
     int fd;
-    int i, retval=0, err;
+    int i,err;
     char value[PROPERTY_VALUE_MAX] = {'\0'};
     int init_success = 0;
     jboolean isCopy;
@@ -664,10 +662,6 @@
 static jint android_hardware_fmradio_FmReceiverJNI_closeFdNative
     (JNIEnv * env, jobject thiz, jint fd)
 {
-    int i = 0;
-    int cleanup_success = 0;
-    char retval =0;
-
     if (is_soc_pronto() && bt_configstore_intf != NULL)
     {
         bt_configstore_intf->set_vendor_property(FM_PROP_CTL_STOP,"fm_dl");
@@ -1190,14 +1184,6 @@
     return err;
 }
 
-
-/* native interface */
-static jint android_hardware_fmradio_FmReceiverJNI_setAnalogModeNative(JNIEnv * env, jobject thiz, jboolean aValue)
-{
-    /*DAC configuration is applicable only msm7627a target*/
-    return 0;
-}
-
 /*
  * Interfaces added for Tx
 */
@@ -1713,8 +1699,6 @@
             (void*)android_hardware_fmradio_FmReceiverJNI_setPSRepeatCountNative},
         { "setTxPowerLevelNative", "(II)I",
             (void*)android_hardware_fmradio_FmReceiverJNI_setTxPowerLevelNative},
-       { "setAnalogModeNative", "(Z)I",
-            (void*)android_hardware_fmradio_FmReceiverJNI_setAnalogModeNative},
         { "SetCalibrationNative", "(I)I",
             (void*)android_hardware_fmradio_FmReceiverJNI_SetCalibrationNative},
         { "configureSpurTable", "(I)I",
diff --git a/qcom/fmradio/FmConfig.java b/qcom/fmradio/FmConfig.java
index 7b076fe..df2f114 100644
--- a/qcom/fmradio/FmConfig.java
+++ b/qcom/fmradio/FmConfig.java
@@ -203,19 +203,6 @@
 	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() );
-
-        boolean fmSrchAlg = SystemProperties.getBoolean("persist.fm.new.srch.algorithm",false);
-        if (fmSrchAlg) {
-          Log.v (TAG, "fmConfigure() : FM Srch Alg : NEW ");
-          re = FmReceiverJNI.setControlNative (fd, V4L2_CID_PRIVATE_TAVARUA_SRCH_ALGORITHM, 1);
-        }
-        else {
-          Log.v (TAG, "fmConfigure() : FM Srch Alg : OLD ");
-          re = FmReceiverJNI.setControlNative (fd, V4L2_CID_PRIVATE_TAVARUA_SRCH_ALGORITHM, 0);
-        }
-        if (re < 0)
-          return false;
-
         re = FmReceiverJNI.setBandNative (fd, configSettings.getLowerLimit(), configSettings.getUpperLimit());
         if (re < 0)
           return false;
diff --git a/qcom/fmradio/FmReceiverJNI.java b/qcom/fmradio/FmReceiverJNI.java
index 9d6c273..d2e929d 100644
--- a/qcom/fmradio/FmReceiverJNI.java
+++ b/qcom/fmradio/FmReceiverJNI.java
@@ -465,11 +465,6 @@
     static native int setNotchFilterNative(int fd, int id, boolean value);
 
     /**
-     * native method: enable/disable Analog Mode
-     */
-    static native int setAnalogModeNative(boolean value);
-
-    /**
      * native method: Starts the RT transmission
      * @param fd file descriptor of device
      * @param buff[] buffer
diff --git a/qcom/fmradio/FmTransceiver.java b/qcom/fmradio/FmTransceiver.java
index b90f033..dcc46cc 100644
--- a/qcom/fmradio/FmTransceiver.java
+++ b/qcom/fmradio/FmTransceiver.java
@@ -540,23 +540,6 @@
    }
 
    /*==============================================================
-   FUNCTION:  SetAnalogMode
-   ==============================================================*/
-   /**
-    *    Enable/Disable the Analog lowpower mode.
-    *    <p>
-    *    This method enables/disables the analog lowpower mode.
-    *
-    */
-   public boolean setAnalogMode(boolean value) {
-        int re = mControl.setAudioPath(sFd, value);
-        re = FmReceiverJNI.setAnalogModeNative(value);
-        if (re == 1)
-            return true;
-        return false;
-   }
-
-   /*==============================================================
    FUNCTION:  getInternalAntenna
    ==============================================================*/
    /**