diff options
author | Rupesh Tatiya <rtatiya@codeaurora.org> | 2015-10-29 16:18:01 +0530 |
---|---|---|
committer | Rupesh Tatiya <rtatiya@codeaurora.org> | 2015-10-29 16:24:23 +0530 |
commit | f931fa5ddb2fa6719560923939c36458cd63a964 (patch) | |
tree | b6e310abda35826ada40d60fcfc8bddb64f06a6f /fmapp2/src/com | |
parent | e4643d19aff6978f05b0050758ec38b3b9c53f3e (diff) | |
download | android_hardware_qcom_fm-f931fa5ddb2fa6719560923939c36458cd63a964.tar.gz android_hardware_qcom_fm-f931fa5ddb2fa6719560923939c36458cd63a964.tar.bz2 android_hardware_qcom_fm-f931fa5ddb2fa6719560923939c36458cd63a964.zip |
Do not stop FM Radio Service during unbind using stopSelf.
During Unbind, do not kill FM Radio service. The service might restart again
and it will end up getting Media Button events starving other eligible
applications. Use explicit stopService call in FM Radio. This calls Destroy
callback resulting in proper clean up of FM Radio Service.
Change-Id: Idf3d768e66bd4bafc7d1ef40aefa15982454889c
Diffstat (limited to 'fmapp2/src/com')
-rw-r--r-- | fmapp2/src/com/caf/fmradio/FMRadio.java | 2 | ||||
-rw-r--r-- | fmapp2/src/com/caf/fmradio/FMRadioService.java | 7 |
2 files changed, 2 insertions, 7 deletions
diff --git a/fmapp2/src/com/caf/fmradio/FMRadio.java b/fmapp2/src/com/caf/fmradio/FMRadio.java index 20270e3..45b68bc 100644 --- a/fmapp2/src/com/caf/fmradio/FMRadio.java +++ b/fmapp2/src/com/caf/fmradio/FMRadio.java @@ -2999,6 +2999,8 @@ public class FMRadio extends Activity return; } context.unbindService(sb); + Log.e(LOGTAG, "stop FM radio service"); + context.stopService(new Intent(context, FMRadioService.class)); if (sConnectionMap.isEmpty()) { // presumably there is nobody interested in the service at this point, // so don't hang on to the ServiceConnection diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java index 35e7e24..ca16b9e 100644 --- a/fmapp2/src/com/caf/fmradio/FMRadioService.java +++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java @@ -885,13 +885,6 @@ public class FMRadioService extends Service /* Application/UI is not attached, so go into lower power mode */ unregisterCallbacks(); setLowPowerMode(true); - if (isFmOn()) - { - // something is currently playing, or will be playing once - // an in-progress call ends, so don't stop the service now. - return true; - } - stopSelf(mServiceStartId); return true; } |