FM2: Fix the issue with ShowTags menu item

Menu item showing even the channel not supports the RT+.
Showing the ShowTags only if the current tuned channel supports RT+.

Change-Id: I53ad83c86bb83ba238c06347ad955ecd3b344960
CRs-Fixed: 588039
diff --git a/fmapp2/src/com/caf/fmradio/FMRadio.java b/fmapp2/src/com/caf/fmradio/FMRadio.java
index 0acbc63..6fa9298 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadio.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadio.java
@@ -234,6 +234,7 @@
 
    /* Current Status Indicators */
    private static boolean mRecording = false;
+   private static boolean mRtPlusSupported = false;
    private static boolean mIsScaning = false;
    private static boolean mIsSeeking = false;
    private static boolean mIsSearching = false;
@@ -648,6 +649,7 @@
       MenuItem item;
       boolean radioOn = isFmOn();
       boolean recording = isRecording();
+      boolean RtPlusSupported = isRtPlusSupported();
       boolean mSpeakerPhoneOn = isSpeakerEnabled();
       boolean searchActive = isScanActive() || isSeekActive();
 
@@ -681,6 +683,9 @@
       if (item != null) {
           item.setVisible(sleepActive && radioOn);
       }
+      item = menu.findItem(MENU_TAGS);
+      if (item != null)
+          item.setVisible(RtPlusSupported);
       return true;
    }
 
@@ -1831,6 +1836,19 @@
       return(mRecording);
    }
 
+   private boolean isRtPlusSupported() {
+      mRtPlusSupported = false;
+      if (mService != null) {
+          try {
+             mRtPlusSupported = mService.isRtPlusSupported();
+          } catch (RemoteException e) {
+             e.printStackTrace();
+         }
+      }
+      Log.d(LOGTAG, "mRtPlusSupported: " + mRtPlusSupported);
+      return(mRtPlusSupported);
+   }
+
    private boolean isSpeakerEnabled() {
       boolean speakerEnabled = false;
       if (mService != null) {
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index e26a75e..c7f1682 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -125,6 +125,7 @@
    MediaRecorder mA2dp = null;
    private boolean mFMOn = false;
    private boolean mFmRecordingOn = false;
+   private static boolean mRtPlusSupport = false;
    private boolean mSpeakerPhoneOn = false;
    private int mCallStatus = 0;
    private BroadcastReceiver mScreenOnOffReceiver = null;
@@ -1504,6 +1505,11 @@
          return(mService.get().isFmRecordingOn());
       }
 
+      public boolean isRtPlusSupported()
+      {
+         return(mService.get().isRtPlusSupported());
+      }
+
       public boolean isSpeakerEnabled()
       {
          return(mService.get().isSpeakerEnabled());
@@ -2038,6 +2044,10 @@
       return mFmRecordingOn;
    }
 
+   public boolean isRtPlusSupported() {
+      return mRtPlusSupport;
+   }
+
    public boolean isSpeakerEnabled() {
       return mSpeakerPhoneOn;
    }
@@ -2706,6 +2716,7 @@
 
    public void clearStationInfo() {
        if(mFMRxRDSData != null) {
+          mRtPlusSupport = false;
           mFMRxRDSData.setRadioText("");
           mFMRxRDSData.setPrgmId(0);
           mFMRxRDSData.setPrgmType(0);
@@ -3000,6 +3011,7 @@
       {
          int tag_nums;
          Log.d(LOGTAG, "FmRxEvRTPlusInfo");
+         mRtPlusSupport =  true;
          if (mReceiver != null) {
              mFMRxRDSData = mReceiver.getRTPlusInfo();
              tag_nums = mFMRxRDSData.getTagNums();
diff --git a/fmapp2/src/com/caf/fmradio/IFMRadioService.aidl b/fmapp2/src/com/caf/fmradio/IFMRadioService.aidl
index 7b04d71..7a2062d 100644
--- a/fmapp2/src/com/caf/fmradio/IFMRadioService.aidl
+++ b/fmapp2/src/com/caf/fmradio/IFMRadioService.aidl
@@ -73,5 +73,6 @@
     long getRecordingStartTime();
     boolean isSleepTimerActive();
     boolean isSSRInProgress();
+    boolean isRtPlusSupported();
 }