FM: User Switch handling change
Do FM Off and kill the FM process for all ACTION_USER_SWITCHED Intent recieved.
Change-Id: I2ead00fa7103a8ac9d0ced4446fe95a2c63c1457
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index fce1a32..879678d 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -682,21 +682,19 @@
Log.d(LOGTAG, "ACTION_USER_SWITCHED Intent received");
int userId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0);
Log.d(LOGTAG, "ACTION_USER_SWITCHED, user ID:" + userId);
- if (userId == 0) {
- if (isFmOn()){
- fmOff();
- try {
- if ((mServiceInUse) && (mCallbacks != null) ) {
- mCallbacks.onDisabled();
- }
- } catch (RemoteException e) {
- e.printStackTrace();
+ if (isFmOn()){
+ fmOff();
+ try {
+ if ((mServiceInUse) && (mCallbacks != null) ) {
+ mCallbacks.onDisabled();
}
+ } catch (RemoteException e) {
+ e.printStackTrace();
}
+ }
stop();
android.os.Process.killProcess(android.os.Process.myPid());
System.exit(0);
- }
}
}
};