What is the Riva_fm_cal file? What is the Riva_fm_cal file?

It is located in /data/app on many Android devices.

It is typically a very small file (under 25 bytes), and gets recreated if deleted.
Searching the file on Google returned a source code used by GeeksPhone: android_hardware_fm.cpp.

From line #199, it seems the file is related to FM radio receiver calibration.


static jint android_hardware_fmradio_FmReceiverJNI_SetCalibrationNative
     (JNIEnv * env, jobject thiz, jint fd, jbyteArray buff)
{

    struct v4l2_ext_control ext_ctl;
    char tmp[CAL_DATA_SIZE] = {0x00};
    int err;
    FILE* cal_file;

    cal_file = fopen("/data/app/Riva_fm_cal", "r" );
    if(cal_file != NULL) {
        ext_ctl.id = V4L2_CID_PRIVATE_IRIS_SET_CALIBRATION;
        if (fread(&tmp[0],1,CAL_DATA_SIZE,cal_file) = 0){
            return FM_JNI_SUCCESS;
        }
    }else {
        return FM_JNI_SUCCESS;
    }
  return FM_JNI_SUCCESS;
}


The code is implemented inside Android framework, which means that the Android OS is the one who (re)creates this file.