Merge "FM: Remove blank space in Settings UI"
diff --git a/fmapp2/res/values-zh-rTW/strings.xml b/fmapp2/res/values-zh-rTW/strings.xml
index ccf9db9..11a4cf7 100644
--- a/fmapp2/res/values-zh-rTW/strings.xml
+++ b/fmapp2/res/values-zh-rTW/strings.xml
@@ -1,33 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
<!--
-Copyright (c) 2012, The Linux Foundation. All Rights Reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
- * Neither the name of the Linux Foundation nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--->
+/*
+ * Copyright (C) 2012-2013, The Linux Foundation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of The Linux Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ -->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <string name="app_name">FM 收音機</string>
+ <string name="app_name">調頻收音機</string>
<string name="menu_settings">設定</string>
<string name="menu_record_start">開始錄音</string>
<string name="menu_record_stop">停止錄音</string>
@@ -37,14 +40,14 @@
<string name="button_cancel">取消</string>
<string name="button_delete">取消</string>
<string name="error_sdcard_access">不能訪問SD卡</string>
- <string name="fm_service_started">FM 服務</string>
+ <string name="fm_service_started">調頻 服務</string>
<string name="menu_sleep">自動關閉</string>
<string name="menu_sleep_cancel">取消自動關閉</string>
<string name="menu_scan_start">搜索</string>
<string name="button_text_stop">停止</string>
<string name="menu_scan_stop">停止搜索</string>
- <string name="msg_seeking">搜索 FM 電台</string>
- <string name="msg_scanning">搜索所有 FM 電台</string>
+ <string name="msg_seeking">搜索 調頻 電台</string>
+ <string name="msg_scanning">搜索所有 調頻 電台</string>
<string name="msg_scanning_pty">搜索 "<xliff:g id="pty_name">%1$s</xliff:g>"</string>
<string name="msg_noantenna">請插入耳機</string>
<string name="dialog_sleep_title">收音機自動關閉</string>
@@ -77,16 +80,16 @@
<string name="alert_dialog_cancel">取消</string>
<string name="search_dialog_title">搜索電台</string>
<string name="fm_command_timeout_title">超時</string>
- <string name="fm_tune_timeout_msg">打開FM 電台無響應。如果問題持續,請重新啟動FM 收音機。</string>
- <string name="fm_command_failed_title">FM 操作失敗</string>
- <string name="fm_cmd_failed_msg">FM 操作失敗。如果問題持續,請重新啟動FM 收音機。</string>
- <string name="fm_cmd_failed_msg_hdmi">FM 操作失敗。不支持FM和 HDMI 並發。 </string>
- <string name="fm_cmd_failed_call_on">FM 操作失敗。通話期間禁止FM音頻 </string>
+ <string name="fm_tune_timeout_msg">打開調頻 電台無響應。如果問題持續,請重新啟動調頻 收音機。</string>
+ <string name="fm_command_failed_title">調頻 操作失敗</string>
+ <string name="fm_cmd_failed_msg">調頻 操作失敗。如果問題持續,請重新啟動調頻 收音機。</string>
+ <string name="fm_cmd_failed_msg_hdmi">調頻 操作失敗。不支持調頻和 HDMI 並發。 </string>
+ <string name="fm_cmd_failed_call_on">調頻 操作失敗。通話期間禁止調頻音頻 </string>
<string name="station_name">電台:</string>
<string name="station_exists">此頻率已存在!</string>
- <string name="stat_notif_frequency">FM 收音機 "<xliff:g id="frequency">%1$s</xliff:g>" MHz</string>
- <string name="cannot_startup_during_call">通话中不能启动FM!</string>
- <string name="cannot_startup_during_airplane">"通話中不能啟動FM!"</string>
+ <string name="stat_notif_frequency">調頻 收音機 "<xliff:g id="frequency">%1$s</xliff:g>" MHz</string>
+ <string name="cannot_startup_during_call">通话中不能启动調頻!</string>
+ <string name="cannot_startup_during_airplane">"通話中不能啟動調頻!"</string>
<string name="station_list_delete_station">删除:<xliff:g id="name">%s</xliff:g></string>
<string name="station_list_delete_station_prompt">要删除 <xliff:g id="name">%s</xliff:g> 吗?</string>
<string name="sdcard_no_space_cannot_recording">SD卡空間不足,不能錄音</string>
@@ -94,5 +97,8 @@
<string name="station_name_empty">電台名字不能為空,請新重輸入</string>
<string name="station_name_exist">已存在名為\"<xliff:g id="name">%s</xliff:g>\"的電台,請輸入其他名稱。</string>
<string name="dialog_presetlist_rename_title">請輸入名字</string>
+ <string name="user_defind_band_msg">请输入有效的频段范围 76.0 - 108.0</string>
+ <string name="FMRecording_reach_size_limit">已到达最长限制.</string>
+ <string name="unable_to_store">无法保存已录音频</string>
</resources>
diff --git a/fmapp2/src/com/caf/fmradio/FMRadio.java b/fmapp2/src/com/caf/fmradio/FMRadio.java
index d8cdab3..5b858c4 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadio.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadio.java
@@ -458,17 +458,12 @@
public void onStart() {
super.onStart();
Log.d(LOGTAG, "FMRadio: onStart");
- if (isHdmiOn()) {
- showDialog(DIALOG_CMD_FAILED_HDMI_ON);
+ if ((mService == null ) && (false == bindToService(this, osc))) {
+ Log.d(LOGTAG, "onStart: Failed to Start Service");
+ } else {
+ Log.d(LOGTAG, "onStart: Start Service completed successfully");
}
- else {
- if ((mService == null ) && (false == bindToService(this, osc))) {
- Log.d(LOGTAG, "onStart: Failed to Start Service");
- } else {
- Log.d(LOGTAG, "onStart: Start Service completed successfully");
- }
- registerFMSettingListner();
- }
+ registerFMSettingListner();
mPrefs.Load();
if (mPicker != null) {
setDisplayvalue();
@@ -736,16 +731,6 @@
return super.onOptionsItemSelected(item);
}
- private boolean isHdmiOn() {
- //HDMI and FM concurrecny is not supported.
- try {
- String hdmiUserOption = android.provider.Settings.System.getString(
- getContentResolver(), "HDMI_USEROPTION");
- }catch (Exception ex) {
- }
- return false;
- }
-
private void enableSpeaker() {
//This method with toggle Speaker phone based on existing state .
boolean bSpeakerPhoneOn = isSpeakerEnabled();
@@ -1625,33 +1610,29 @@
mIsSeeking = false;
mIsSearching = false;
boolean bStatus = false;
- if (isHdmiOn()) {
- showDialog(DIALOG_CMD_FAILED_HDMI_ON);
- }else {
- if (mService != null) {
- try {
- if((false == mService.isFmOn()) && isAntennaAvailable()) {
- bStatus = mService.fmOn();
- if(bStatus) {
- tuneRadio(FmSharedPreferences.getTunedFrequency());
- enableRadioOnOffUI();
- }else {
- Log.e(LOGTAG, "mService.fmOn failed");
- mCommandFailed = CMD_FMON;
- if(isCallActive()) {
- enableRadioOnOffUI();
- showDialog(DIALOG_CMD_FAILED_CALL_ON);
- }else {
- showDialog(DIALOG_CMD_FAILED);
- }
- }
+ if (mService != null) {
+ try {
+ if((false == mService.isFmOn()) && isAntennaAvailable()) {
+ bStatus = mService.fmOn();
+ if(bStatus) {
+ tuneRadio(FmSharedPreferences.getTunedFrequency());
+ enableRadioOnOffUI();
}else {
- enableRadioOnOffUI();
+ Log.e(LOGTAG, "mService.fmOn failed");
+ mCommandFailed = CMD_FMON;
+ if(isCallActive()) {
+ enableRadioOnOffUI();
+ showDialog(DIALOG_CMD_FAILED_CALL_ON);
+ }else {
+ showDialog(DIALOG_CMD_FAILED);
+ }
}
- }catch (RemoteException e) {
- e.printStackTrace();
- }
- }
+ }else {
+ enableRadioOnOffUI();
+ }
+ }catch (RemoteException e) {
+ e.printStackTrace();
+ }
}
}
@@ -2042,6 +2023,7 @@
*/
for (int buttonIndex = 0; (buttonIndex < MAX_PRESETS_PER_PAGE); buttonIndex++) {
if (mPresetButtons[buttonIndex] != null) {
+ mPresetButtons[buttonIndex].setHeight(-1);
int stationIdex = (mPresetPageNumber * MAX_PRESETS_PER_PAGE)
+ buttonIndex;
PresetStation station = FmSharedPreferences.getStationInList(stationIdex);
@@ -2053,7 +2035,6 @@
mPresetButtons[buttonIndex].setEllipsize(TextUtils.TruncateAt.END);
mPresetButtons[buttonIndex].setText(display);
mPresetButtons[buttonIndex].setTag(station);
- mPresetButtons[buttonIndex].setHeight(-1);
addedStations++;
}else {
mPresetButtons[buttonIndex].setText(R.string.add_station);
@@ -2643,9 +2624,15 @@
Runnable mOnStereo = new Runnable() {
public void run() {
if (FMRADIO_UI_STATION_AUDIO_STEREO == mStereo) {
- mStereoTV.setText(R.string.audio_type_stereo);
- }else if (FMRADIO_UI_STATION_AUDIO_MONO == mStereo) {
- mStereoTV.setText(R.string.audio_type_mono);
+ if ((Locale.getDefault().getLanguage().equals("zh")))
+ mStereoTV.setText("立體聲");
+ else
+ mStereoTV.setText(R.string.audio_type_stereo);
+ } else if (FMRADIO_UI_STATION_AUDIO_MONO == mStereo) {
+ if ((Locale.getDefault().getLanguage().equals("zh")))
+ mStereoTV.setText("單聲道");
+ else
+ mStereoTV.setText(R.string.audio_type_mono);
}else {
mStereoTV.setText("");
}
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index 12e6841..41947da 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -1056,12 +1056,6 @@
if((TelephonyManager.CALL_STATE_OFFHOOK == state)||
(TelephonyManager.CALL_STATE_RINGING == state)) {
- if (state == TelephonyManager.CALL_STATE_RINGING) {
- int ringvolume = audioManager.getStreamVolume(AudioManager.STREAM_RING);
- if (ringvolume == 0) {
- return;
- }
- }
boolean bTempSpeaker = mSpeakerPhoneOn; //need to restore SpeakerPhone
boolean bTempMute = mMuted;// need to restore Mute status
int bTempCall = mCallStatus;//need to restore call status
diff --git a/fmapp2/src/com/caf/fmradio/PresetStation.java b/fmapp2/src/com/caf/fmradio/PresetStation.java
index bcbb55e..6d677f0 100644
--- a/fmapp2/src/com/caf/fmradio/PresetStation.java
+++ b/fmapp2/src/com/caf/fmradio/PresetStation.java
@@ -634,12 +634,14 @@
public static String getRBDSPtyString(int pty)
{
String ptyStr = "";
+
switch (pty)
{
case 1:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "新聞";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "新闻";
else
ptyStr = "News";
@@ -647,8 +649,9 @@
}
case 2:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "資訊";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "信息频道";
else
ptyStr = "Information";
@@ -656,8 +659,9 @@
}
case 3:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "体育";
else
ptyStr = "Sports";
@@ -665,8 +669,9 @@
}
case 4:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "討論";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "交流";
else
ptyStr = "Talk";
@@ -674,8 +679,9 @@
}
case 5:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "搖滾";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "摇滚";
else
ptyStr = "Rock";
@@ -683,8 +689,9 @@
}
case 6:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "古典搖滾";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "经典摇滚";
else
ptyStr = "Classic Rock";
@@ -692,8 +699,9 @@
}
case 7:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "成人熱門精選";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "成人点击";
else
ptyStr = "Adult Hits";
@@ -701,8 +709,9 @@
}
case 8:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "輕柔搖滾樂";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "轻摇滚";
else
ptyStr = "Soft Rock";
@@ -710,8 +719,9 @@
}
case 9:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "前40首最熱門歌曲";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "前40";
else
ptyStr = "Top 40";
@@ -719,8 +729,9 @@
}
case 10:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "鄉村音樂";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "乡村";
else
ptyStr = "Country";
@@ -728,8 +739,9 @@
}
case 11:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "懷舊";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "老歌";
else
ptyStr = "Oldies";
@@ -737,8 +749,9 @@
}
case 12:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "輕柔";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "轻音乐";
else
ptyStr = "Soft";
@@ -746,8 +759,9 @@
}
case 13:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "思鄉";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "怀旧";
else
ptyStr = "Nostalgia";
@@ -755,8 +769,9 @@
}
case 14:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "爵士樂";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "爵士";
else
ptyStr = "Jazz";
@@ -764,8 +779,9 @@
}
case 15:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "古典";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "古典";
else
ptyStr = "Classical";
@@ -773,8 +789,9 @@
}
case 16:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "節奏藍調";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "节奏布鲁斯";
else
ptyStr = "Rhythm and Blues";
@@ -782,8 +799,9 @@
}
case 17:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "輕柔節奏藍調";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "轻节奏布鲁斯";
else
ptyStr = "Soft Rhythm and Blues";
@@ -791,8 +809,9 @@
}
case 18:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "外語";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "外语频道";
else
ptyStr = "Foreign Language";
@@ -800,8 +819,9 @@
}
case 19:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "宗教音樂";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "宗教音乐";
else
ptyStr = "Religious Music";
@@ -809,8 +829,9 @@
}
case 20:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "宗教討論";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "宗教交流";
else
ptyStr = "Religious Talk";
@@ -818,8 +839,9 @@
}
case 21:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "個人";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "个性";
else
ptyStr = "Personality";
@@ -827,8 +849,9 @@
}
case 22:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "公開";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "公共频道";
else
ptyStr = "Public";
@@ -836,8 +859,9 @@
}
case 23:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "學院";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "校园";
else
ptyStr = "College";
@@ -845,8 +869,9 @@
}
case 29:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "天氣";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "天气";
else
ptyStr = "Weather";
@@ -854,8 +879,9 @@
}
case 30:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "緊急測試";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "紧急 测试";
else
ptyStr = "Emergency Test";
@@ -863,8 +889,9 @@
}
case 31:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "緊急";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "紧急";
else
ptyStr = "Emergency";
@@ -888,8 +915,9 @@
{
case 1:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "新聞";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "新闻";
else
ptyStr = "News";
@@ -897,8 +925,9 @@
}
case 2:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "新聞時事";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "新闻时事";
else
ptyStr = "Current Affairs";
@@ -906,8 +935,9 @@
}
case 3:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "資訊";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "信息";
else
ptyStr = "Information";
@@ -915,8 +945,9 @@
}
case 4:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "體育";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "体育";
else
ptyStr = "Sport";
@@ -924,8 +955,9 @@
}
case 5:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "教育";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "教育";
else
ptyStr = "Education";
@@ -933,8 +965,9 @@
}
case 6:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "戲劇";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "戏剧";
else
ptyStr = "Drama";
@@ -942,8 +975,9 @@
}
case 7:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "文化";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "文化";
else
ptyStr = "Culture";
@@ -951,8 +985,9 @@
}
case 8:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "科學";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "科学";
else
ptyStr = "Science";
@@ -960,8 +995,9 @@
}
case 9:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "多樣化";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "变奏";
else
ptyStr = "Varied";
@@ -969,8 +1005,9 @@
}
case 10:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "流行音樂";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "流行音乐";
else
ptyStr = "Pop Music";
@@ -978,8 +1015,9 @@
}
case 11:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "搖滾樂";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "摇滚音乐";
else
ptyStr = "Rock Music";
@@ -987,8 +1025,9 @@
}
case 12:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "輕音樂";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "轻音乐";
else
ptyStr = "Easy Listening Music";
@@ -996,8 +1035,9 @@
}
case 13:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "輕古典音樂";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "轻古典音乐";
else
ptyStr = "Light classical";
@@ -1005,8 +1045,9 @@
}
case 14:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "正統古典";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "古典";
else
ptyStr = "Serious classical";
@@ -1014,8 +1055,9 @@
}
case 15:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "其他音樂";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "其他音乐";
else
ptyStr = "Other Music";
@@ -1023,8 +1065,9 @@
}
case 16:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "天氣";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "天气";
else
ptyStr = "Weather";
@@ -1032,8 +1075,9 @@
}
case 17:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "財政";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "经济";
else
ptyStr = "Finance";
@@ -1041,8 +1085,9 @@
}
case 18:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "少兒節目";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "儿童节目";
else
ptyStr = "Children programs";
@@ -1050,8 +1095,9 @@
}
case 19:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "社會事務";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "社会事务";
else
ptyStr = "Social Affairs";
@@ -1059,8 +1105,9 @@
}
case 20:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "宗教";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "宗教";
else
ptyStr = "Religion";
@@ -1068,8 +1115,9 @@
}
case 21:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "聽眾來得";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "听众来电";
else
ptyStr = "Phone In";
@@ -1077,8 +1125,9 @@
}
case 22:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "旅遊";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "旅行";
else
ptyStr = "Travel";
@@ -1086,8 +1135,9 @@
}
case 23:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "休閒";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "休闲";
else
ptyStr = "Leisure";
@@ -1095,8 +1145,9 @@
}
case 24:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "爵士樂";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "爵士音乐";
else
ptyStr = "Jazz Music";
@@ -1104,8 +1155,9 @@
}
case 25:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "鄉村音樂";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "乡村音乐";
else
ptyStr = "Country Music";
@@ -1113,8 +1165,9 @@
}
case 26:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "國樂";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "民族音乐";
else
ptyStr = "National Music";
@@ -1122,8 +1175,9 @@
}
case 27:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "懷舊金曲";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "怀旧";
else
ptyStr = "Oldies Music";
@@ -1131,8 +1185,9 @@
}
case 28:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "民俗音樂";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "民族音乐";
else
ptyStr = "Folk Music";
@@ -1140,8 +1195,9 @@
}
case 29:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "紀實";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "记录";
else
ptyStr = "Documentary";
@@ -1149,8 +1205,9 @@
}
case 30:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "緊急測試";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "紧急测试";
else
ptyStr = "Emergency Test";
@@ -1158,8 +1215,9 @@
}
case 31:
{
- if ((Locale.getDefault().getLanguage().equals("zh"))
- || (Locale.getDefault().getLanguage().equals("zh_CN")))
+ if (Locale.getDefault().getLanguage().equals("zh"))
+ ptyStr = "緊急";
+ else if (Locale.getDefault().getLanguage().equals("zh_CN"))
ptyStr = "紧急";
else
ptyStr = "Emergency";
diff --git a/fmapp2/src/com/caf/fmradio/Settings.java b/fmapp2/src/com/caf/fmradio/Settings.java
index 7d186a3..0ad85f1 100644
--- a/fmapp2/src/com/caf/fmradio/Settings.java
+++ b/fmapp2/src/com/caf/fmradio/Settings.java
@@ -313,7 +313,11 @@
setBandSummary(summaryBandItems.length - 1);
clearStationList();
}else {
- Toast.makeText(this, getString(R.string.user_defind_band_msg),
+ if ((Locale.getDefault().getLanguage().equals("zh")))
+ Toast.makeText(this,"請輸入有效的頻道範圍76.0-108.0",
+ Toast.LENGTH_SHORT).show();
+ else
+ Toast.makeText(this, getString(R.string.user_defind_band_msg),
Toast.LENGTH_SHORT).show();
}
}else if(key.equals(USER_DEFINED_BAND_MAX_KEY)) {
@@ -333,7 +337,11 @@
setBandSummary(summaryBandItems.length - 1);
clearStationList();
}else {
- Toast.makeText(this, getString(R.string.user_defind_band_msg),
+ if ((Locale.getDefault().getLanguage().equals("zh")))
+ Toast.makeText(this,"請輸入有效的頻道範圍76.0-108.0",
+ Toast.LENGTH_SHORT).show();
+ else
+ Toast.makeText(this, getString(R.string.user_defind_band_msg),
Toast.LENGTH_SHORT).show();
}
}else {
diff --git a/jni/android_hardware_fm.cpp b/jni/android_hardware_fm.cpp
index 46ae7c4..5954be8 100644
--- a/jni/android_hardware_fm.cpp
+++ b/jni/android_hardware_fm.cpp
@@ -103,28 +103,35 @@
} else {
return FM_JNI_FAILURE;
}
- /*Set the mode for soc downloader*/
- property_set("hw.fm.mode", "normal");
- /* Need to clear the hw.fm.init firstly */
- property_set("hw.fm.init", "0");
- property_set("ctl.start", "fm_dl");
- sched_yield();
- for(i=0; i<45; i++) {
- property_get("hw.fm.init", value, NULL);
- if (strcmp(value, "1") == 0) {
+
+ property_get("qcom.bluetooth.soc", value, NULL);
+
+ ALOGD("BT soc is %s\n", value);
+
+ if (strcmp(value, "rome") != 0)
+ {
+ /*Set the mode for soc downloader*/
+ property_set("hw.fm.mode", "normal");
+ /* Need to clear the hw.fm.init firstly */
+ property_set("hw.fm.init", "0");
+ property_set("ctl.start", "fm_dl");
+ sched_yield();
+ for(i=0; i<45; i++) {
+ property_get("hw.fm.init", value, NULL);
+ if (strcmp(value, "1") == 0) {
init_success = 1;
break;
- } else {
+ } else {
usleep(WAIT_TIMEOUT);
- }
- }
- ALOGE("init_success:%d after %f seconds \n", init_success, 0.2*i);
- if(!init_success) {
- property_set("ctl.stop", "fm_dl");
- // close the fd(power down)
-
- close(fd);
- return FM_JNI_FAILURE;
+ }
+ }
+ ALOGE("init_success:%d after %f seconds \n", init_success, 0.2*i);
+ if(!init_success) {
+ property_set("ctl.stop", "fm_dl");
+ // close the fd(power down)
+ close(fd);
+ return FM_JNI_FAILURE;
+ }
}
return fd;
}
@@ -135,9 +142,17 @@
{
int i = 0;
int cleanup_success = 0;
- char value = 0, retval =0;
+ char retval =0;
+ char value[PROPERTY_VALUE_MAX] = {'\0'};
- property_set("ctl.stop", "fm_dl");
+ property_get("qcom.bluetooth.soc", value, NULL);
+
+ ALOGD("BT soc is %s\n", value);
+
+ if (strcmp(value, "rome") != 0)
+ {
+ property_set("ctl.stop", "fm_dl");
+ }
close(fd);
return FM_JNI_SUCCESS;
}
@@ -418,40 +433,48 @@
char notch[PROPERTY_VALUE_MAX] = {0x00};
struct v4l2_control control;
int err;
- /*Enable/Disable the WAN avoidance*/
- property_set("hw.fm.init", "0");
- if (aValue)
- property_set("hw.fm.mode", "wa_enable");
- else
- property_set("hw.fm.mode", "wa_disable");
- property_set("ctl.start", "fm_dl");
- sched_yield();
- for(i=0; i<10; i++) {
- property_get("hw.fm.init", value, NULL);
- if (strcmp(value, "1") == 0) {
- init_success = 1;
- break;
- } else {
- usleep(WAIT_TIMEOUT);
+ property_get("qcom.bluetooth.soc", value, NULL);
+
+ ALOGD("BT soc is %s\n", value);
+
+ if (strcmp(value, "rome") != 0)
+ {
+ /*Enable/Disable the WAN avoidance*/
+ property_set("hw.fm.init", "0");
+ if (aValue)
+ property_set("hw.fm.mode", "wa_enable");
+ else
+ property_set("hw.fm.mode", "wa_disable");
+
+ property_set("ctl.start", "fm_dl");
+ sched_yield();
+ for(i=0; i<10; i++) {
+ property_get("hw.fm.init", value, NULL);
+ if (strcmp(value, "1") == 0) {
+ init_success = 1;
+ break;
+ } else {
+ usleep(WAIT_TIMEOUT);
+ }
}
- }
- ALOGE("init_success:%d after %f seconds \n", init_success, 0.2*i);
+ ALOGE("init_success:%d after %f seconds \n", init_success, 0.2*i);
- property_get("notch.value", notch, NULL);
- ALOGE("Notch = %s",notch);
- if (!strncmp("HIGH",notch,strlen("HIGH")))
- control.value = HIGH_BAND;
- else if(!strncmp("LOW",notch,strlen("LOW")))
- control.value = LOW_BAND;
- else
- control.value = 0;
+ property_get("notch.value", notch, NULL);
+ ALOGE("Notch = %s",notch);
+ if (!strncmp("HIGH",notch,strlen("HIGH")))
+ control.value = HIGH_BAND;
+ else if(!strncmp("LOW",notch,strlen("LOW")))
+ control.value = LOW_BAND;
+ else
+ control.value = 0;
- ALOGE("Notch value : %d", control.value);
- control.id = id;
- err = ioctl(fd, VIDIOC_S_CTRL,&control );
- if(err < 0){
- return FM_JNI_FAILURE;
+ ALOGE("Notch value : %d", control.value);
+ control.id = id;
+ err = ioctl(fd, VIDIOC_S_CTRL,&control );
+ if(err < 0){
+ return FM_JNI_FAILURE;
+ }
}
return FM_JNI_SUCCESS;
}
@@ -464,22 +487,29 @@
char value[PROPERTY_VALUE_MAX] = {'\0'};
char firmwareVersion[80];
- /*Enable/Disable Analog Mode FM*/
- property_set("hw.fm.init", "0");
- if (aValue) {
- property_set("hw.fm.isAnalog", "true");
- } else {
- property_set("hw.fm.isAnalog", "false");
- }
- property_set("hw.fm.mode","config_dac");
- property_set("ctl.start", "fm_dl");
- sched_yield();
- for(i=0; i<10; i++) {
- property_get("hw.fm.init", value, NULL);
- if (strcmp(value, "1") == 0) {
- return 1;
+ property_get("qcom.bluetooth.soc", value, NULL);
+
+ ALOGD("BT soc is %s\n", value);
+
+ if (strcmp(value, "rome") != 0)
+ {
+ /*Enable/Disable Analog Mode FM*/
+ property_set("hw.fm.init", "0");
+ if (aValue) {
+ property_set("hw.fm.isAnalog", "true");
} else {
- usleep(WAIT_TIMEOUT);
+ property_set("hw.fm.isAnalog", "false");
+ }
+ property_set("hw.fm.mode","config_dac");
+ property_set("ctl.start", "fm_dl");
+ sched_yield();
+ for(i=0; i<10; i++) {
+ property_get("hw.fm.init", value, NULL);
+ if (strcmp(value, "1") == 0) {
+ return 1;
+ } else {
+ usleep(WAIT_TIMEOUT);
+ }
}
}