修改FMRadio频率的工作范围

1.修改alps\vendor\mediatek\proprietary\packages\apps\FMRadio\src\com\android\fmradio\FmUtils.java

 

public class FmUtils {
    private static final String TAG = "FmUtils";

    // FM station variables
    public static final int DEFAULT_STATION = 760;
    public static final float DEFAULT_STATION_FLOAT = computeFrequency(DEFAULT_STATION);
    // maximum station frequency
    private static final int HIGHEST_STATION = 950;
    // minimum station frequency
    private static final int LOWEST_STATION = 760;


2.修改alps\vendor\mediatek\proprietary\packages\apps\FMRadio\src\com\android\fmradio\FmService.java

 

 

        if (mPowerStatus != POWER_UP) {
            Log.w(TAG, "firstPlaying, FM is not powered up");
            return false;
        }
	// delete 20170407
    /*    boolean isSeekTune = false;
        float seekStation = FmNative.seek(frequency, false);
        int station = FmUtils.computeStation(seekStation);
        if (FmUtils.isValidStation(station)) {
            isSeekTune = FmNative.tune(seekStation);
            if (isSeekTune) {
                playFrequency(seekStation);
            }
        }
	
        // if tune fail, pass current station to update ui
        if (!isSeekTune) {
            seekStation = FmUtils.computeFrequency(mCurrentStation);
        }
	*/
	//delete end
	//add 20170407 
		boolean isSeekTune =true;
		playFrequency(frequency);
	//end
        return isSeekTune;
    }


3.alps\device\mediatek\common\kernel-headers\linux\fm.h

 

--- a/alps/device/mediatek/common/kernel-headers/linux/fm.h
+++ b/alps/device/mediatek/common/kernel-headers/linux/fm.h
@@ -44,8 +44,8 @@ enum {
 #define FMR_SEEK_SPACE      1           //FM radio seek space,1:100KHZ; 2:200KHZ
 #define FMR_SCAN_CH_SIZE    80          //FM radio scan max channel size
 #define FMR_BAND            1           //FM radio band, 1:87.5MHz~108.0MHz; 2:76.0MHz~90.0MHz; 3:76.0MHz~108.0MHz; 4:special
-#define FMR_BAND_FREQ_L     875         //FM radio special band low freq(Default 87.5MHz)
-#define FMR_BAND_FREQ_H     1080        //FM radio special band high freq(Default 108.0MHz)
+#define FMR_BAND_FREQ_L     760         //FM radio special band low freq(Default 87.5MHz)
+#define FMR_BAND_FREQ_H     950        //FM radio special band high freq(Default 108.0MHz)
 #define FM_SCAN_SORT_SELECT FM_SCAN_SORT_NON
 #define FM_SCAN_SELECT      FM_SCAN_SEL_HW
 #define FM_SCAN_SOFT_MUTE_GAIN_TH  3    //soft-mute threshold when software scan, rang: 0~3, 0 means better audio quality but less channel
@@ -91,10 +91,10 @@ enum {
 #define FM_UE_FREQ_MIN  875
 #define FM_UE_FREQ_MAX  1080
 #define FM_JP_FREQ_MIN  760
-#define FM_JP_FREQ_MAX  1080
+#define FM_JP_FREQ_MAX  950
 #define FM_FREQ_MIN  FMR_BAND_FREQ_L
 #define FM_FREQ_MAX  FMR_BAND_FREQ_H
-#define FM_RAIDO_BAND FM_BAND_UE
+#define FM_RAIDO_BAND FM_BAND_JAPAN//FM_BAND_UE
 
 // space

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(MTK随记)