Skip to content
Snippets Groups Projects
Commit 833970d0 authored by Kamal Negi's avatar Kamal Negi
Browse files

Update FM UI after service bind complete

On activity start, bind service callback can be delayed and is received after
activity life cycle i.e after onResume(). Because of the delay, UI
update won't happen. Hence update FM user interface, i.e. RDS, frequency etc.,
if service callback received or retry once after 100ms.

CRs-Fixed: 1090643
Change-Id: Icef5922c3e3972f5e44cd1d3f873f864785e26be
parent 7e407490
No related branches found
No related tags found
No related merge requests found
......@@ -505,10 +505,19 @@ public class FMRadio extends Activity
super.onResume();
if (!isAntennaAvailable()) {
if (mService == null) {
Log.d(LOGTAG,"bind callback has not received yet - wait for 100ms");
mHandler.postDelayed(UpdateFm, 100);
return;
}
mHandler.post(UpdateFm);
}
Runnable UpdateFm = new Runnable() {
public void run() {
// TODO: We should return on exception or continue?
if (!isAntennaAvailable()) {
return;
}
try {
if (mService != null)
mService.registerCallbacks(mServiceCallbacks);
......@@ -560,6 +569,7 @@ public class FMRadio extends Activity
updateStationInfoToUI();
enableRadioOnOffUI();
}
};
private static class LoadedDataAndState {
public LoadedDataAndState(){};
public boolean onOrOff;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment