summaryrefslogtreecommitdiffstats
path: root/src/com/android/fmradio/FmService.java
diff options
context:
space:
mode:
authorBenson Huang <benson.huang@mediatek.com>2014-12-22 14:21:37 +0800
committerleozwang <leozwang@google.com>2014-12-22 15:31:45 -0800
commit10f39cd23b5d7e01655c6b0a2a9b3e59271127e6 (patch)
tree500dac7486614a1c679ac7cf5ae48258e205f897 /src/com/android/fmradio/FmService.java
parent0f37d60a1cc38c9233a2298f2851ac2b408eabca (diff)
downloadandroid_packages_apps_FMRadio-10f39cd23b5d7e01655c6b0a2a9b3e59271127e6.tar.gz
android_packages_apps_FMRadio-10f39cd23b5d7e01655c6b0a2a9b3e59271127e6.tar.bz2
android_packages_apps_FMRadio-10f39cd23b5d7e01655c6b0a2a9b3e59271127e6.zip
[FM] Radio text should not display in notification bar after changing channel
Launch FM and play a channel that has radio text -> Change to other channel that doesn't radio text -> Press home button and pull down notification bar -> Check the FM information in notification bar, Radio text will display in notification bar after changing channel. The fix is to update notification when the channel doesn't have radio text. https://partner-android-review.git.corp.google.com/#/c/189803/ Bug 18826692 Change-Id: I8746f223acdbf5a316e3b6553f494d1f30bd84f4 Signed-off-by: Benson Huang <benson.huang@mediatek.com>
Diffstat (limited to 'src/com/android/fmradio/FmService.java')
-rw-r--r--src/com/android/fmradio/FmService.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/android/fmradio/FmService.java b/src/com/android/fmradio/FmService.java
index edd491d..86ddba7 100644
--- a/src/com/android/fmradio/FmService.java
+++ b/src/com/android/fmradio/FmService.java
@@ -1636,7 +1636,7 @@ public class FmService extends Service implements FmRecorder.OnRecorderStateChan
return;
}
String stationName = "";
- String ratioText = "";
+ String radioText = "";
ContentResolver resolver = mContext.getContentResolver();
Cursor cursor = null;
try {
@@ -1652,7 +1652,7 @@ public class FmService extends Service implements FmRecorder.OnRecorderStateChan
if (TextUtils.isEmpty(stationName)) {
stationName = cursor.getString(cursor.getColumnIndex(Station.PROGRAM_SERVICE));
}
- ratioText = cursor.getString(cursor.getColumnIndex(Station.RADIO_TEXT));
+ radioText = cursor.getString(cursor.getColumnIndex(Station.RADIO_TEXT));
} else {
Log.d(TAG, "showPlayingNotification, cursor is null");
@@ -1697,9 +1697,9 @@ public class FmService extends Service implements FmRecorder.OnRecorderStateChan
stationName = getString(R.string.app_name);
}
mNotificationBuilder.setContentTitle(stationName);
- if (!TextUtils.isEmpty(ratioText)) {
- mNotificationBuilder.setContentText(ratioText);
- }
+ // If radio text is "" or null, we also need to update notification.
+ mNotificationBuilder.setContentText(radioText);
+ Log.d(TAG, "showPlayingNotification PS:" + stationName + ", RT:" + radioText);
Notification n = mNotificationBuilder.build();
n.flags &= ~Notification.FLAG_NO_CLEAR;