fmapp2: don't destroy notification channel on stop
There's no reason for the notification channel to be destroyed on FM
stop and recreated on every app launch.
This also crashes the app because the notification belonging to this
channel is still being displayed.
Even if the intention behind the method would be to remove the actual
notification, this is not necessary as this will happen automatically
when calling stopForeground(true).
Change-Id: Id84d247733edb66fe8755f2fe4625e97066d4958
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index 3d90a8c..57e1edd 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -2020,25 +2020,6 @@
}
}
- /* hide the FM Notification */
- public void stopNotification() {
- Log.d(LOGTAG,"stopNotification");
-
- synchronized (mNotificationLock) {
- Context context = getApplicationContext();
- NotificationManager notificationManager =
- (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
- if((notificationManager != null)
- && (notificationManager.getNotificationChannel(FMRADIO_NOTIFICATION_CHANNEL) != null)) {
- try {
- notificationManager.deleteNotificationChannel(FMRADIO_NOTIFICATION_CHANNEL);
- } catch (Exception e) {
- Log.e(LOGTAG,"exception raised from deleteNotificationChannel");
- }
- }
- }
- }
-
private void stop() {
Log.d(LOGTAG,"in stop");
@@ -2827,9 +2808,6 @@
isfmOffFromApplication = true;
}
- //stop Notification
- stopNotification();
-
return fmOff();
}
/*