Merge "FMRecord: Add Chinese language strings resource"
diff --git a/FMRecord/src/com/codeaurora/fmrecording/FMRecordingService.java b/FMRecord/src/com/codeaurora/fmrecording/FMRecordingService.java
index a5e899c..62f4a94 100644
--- a/FMRecord/src/com/codeaurora/fmrecording/FMRecordingService.java
+++ b/FMRecord/src/com/codeaurora/fmrecording/FMRecordingService.java
@@ -259,7 +259,10 @@
}
mSampleFile = null;
- File sampleDir = Environment.getExternalStorageDirectory();
+ File sampleDir = new File(Environment.getExternalStorageDirectory().getAbsolutePath() +"/FMRecording");
+
+ if(!(sampleDir.mkdirs() || sampleDir.isDirectory()))
+ return false;
try {
mSampleFile = File.createTempFile("FMRecording", ".3gpp", sampleDir);
@@ -309,9 +312,12 @@
Log.d(TAG, "Maximum file size/duration reached, stopping the recording");
stopRecord();
}
- // Show the toast.
- Toast.makeText(FMRecordingService.this, R.string.FMRecording_reach_size_limit,
- Toast.LENGTH_LONG).show();
+ if (what == MediaRecorder.MEDIA_RECORDER_INFO_MAX_FILESIZE_REACHED) {
+ // Show the toast.
+ Toast.makeText(FMRecordingService.this,
+ R.string.FMRecording_reach_size_limit,
+ Toast.LENGTH_LONG).show();
+ }
}
}
// from MediaRecorder.OnErrorListener
diff --git a/fmapp2/res/values-zh-rCN/strings.xml b/fmapp2/res/values-zh-rCN/strings.xml
index 76936b7..d32c0cd 100644
--- a/fmapp2/res/values-zh-rCN/strings.xml
+++ b/fmapp2/res/values-zh-rCN/strings.xml
@@ -115,5 +115,6 @@
<string name="chanl_spacing">信道间隔</string>
<string name="set">设置</string>
<string name="cancel">取消</string>
- <string name="rt_plus_tags">标签</string>
+ <string name="rt_plus_tags">标签</string>
+ <string name="user_defind_band_msg">请输入有效的频段范围 76.0 - 108.0</string>
</resources>
diff --git a/fmapp2/res/values/strings.xml b/fmapp2/res/values/strings.xml
index 146866a..a2bf1d4 100644
--- a/fmapp2/res/values/strings.xml
+++ b/fmapp2/res/values/strings.xml
@@ -263,5 +263,6 @@
<string name="band_sweep_choose">Choose Band Sweep Method</string>
<string name="set">Set</string>
<string name="cancel">Cancel</string>
+ <string name="user_defind_band_msg">Enter Freq from range 76.0 - 108.0</string>
</resources>
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index a218893..565537f 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -1735,6 +1735,12 @@
if (isFmRecordingOn())
{
stopRecording();
+ try {
+ Thread.sleep(300);
+ } catch (Exception ex) {
+ Log.d( LOGTAG, "RunningThread InterruptedException");
+ return;
+ }
}
AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
if(audioManager != null)
diff --git a/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java b/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java
index ac886bb..505097f 100644
--- a/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java
+++ b/fmapp2/src/com/caf/fmradio/HorizontalNumberPicker.java
@@ -1600,7 +1600,11 @@
for (int i = 0; i < mSelectorIndices.length; i++) {
int selectorIndex = current + (i - mSelectorMiddleItemIndex);
if (mWrapSelectorWheel) {
- selectorIndex = getWrappedSelectorIndex(selectorIndex);
+ try {
+ selectorIndex = getWrappedSelectorIndex(selectorIndex);
+ } catch(RuntimeException e) {
+ e.printStackTrace();
+ }
}
mSelectorIndices[i] = selectorIndex;
ensureCachedScrollSelectorValue(mSelectorIndices[i]);
@@ -1622,7 +1626,11 @@
}
// Wrap around the values if we go past the start or end
if (mWrapSelectorWheel) {
- current = getWrappedSelectorIndex(current);
+ try {
+ current = getWrappedSelectorIndex(current);
+ } catch(RuntimeException e) {
+ e.printStackTrace();
+ }
}
int previous = mValue;
setValue(current);
diff --git a/fmapp2/src/com/caf/fmradio/Settings.java b/fmapp2/src/com/caf/fmradio/Settings.java
index d64621b..03f88c1 100644
--- a/fmapp2/src/com/caf/fmradio/Settings.java
+++ b/fmapp2/src/com/caf/fmradio/Settings.java
@@ -317,7 +317,8 @@
setBandSummary(summaryBandItems.length - 1);
clearStationList();
}else {
- displayToast(USR_BAND_MSG);
+ Toast.makeText(this, getString(R.string.user_defind_band_msg),
+ Toast.LENGTH_SHORT).show();
}
}else if(key.equals(USER_DEFINED_BAND_MAX_KEY)) {
String valStr = mUserBandMaxPref.getText();
@@ -336,7 +337,8 @@
setBandSummary(summaryBandItems.length - 1);
clearStationList();
}else {
- displayToast(USR_BAND_MSG);
+ Toast.makeText(this, getString(R.string.user_defind_band_msg),
+ Toast.LENGTH_SHORT).show();
}
}else {
if(mRxMode) {