Commit 5137ad4a authored by Alexandre Lision's avatar Alexandre Lision Committed by Alexandre Lision
Browse files

Clear any notifications on daemon start



Ongoing call notifications are persistent in the status bar.
These notifications are not cleared if something goes wrong in the app,
and user can't delete them.
This patch makes sure that when the daemon starts all previous
notifications are cleared.

Change-Id: Ia568ae9136cab113d09285effbebef514f1b2d5c
Reviewed-by: Adrien Béraud's avatarAdrien Béraud <adrien.beraud@savoirfairelinux.com>
parent d9bc190b
......@@ -22,7 +22,6 @@ package cx.ring.service;
import android.Manifest;
import android.app.PendingIntent;
import android.app.Service;
import android.content.AsyncTaskLoader;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.ContentResolver;
......@@ -45,7 +44,6 @@ import android.net.Uri;
import android.os.AsyncTask;
import android.os.Binder;
import android.os.IBinder;
import android.os.OperationCanceledException;
import android.os.RemoteException;
import android.preference.PreferenceManager;
import android.provider.ContactsContract;
......@@ -321,6 +319,8 @@ public class LocalService extends Service implements SharedPreferences.OnSharedP
mediaManager = new MediaManager(this);
notificationManager = NotificationManagerCompat.from(this);
// Clear any notifications from a previous app instance
notificationManager.cancelAll();
final int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024);
final int cacheSize = maxMemory / 8;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment