Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
fixes for background operation and memory clearing
Browse files Browse the repository at this point in the history
  • Loading branch information
iamironrabbit committed Nov 21, 2018
1 parent 366ee0c commit b4480f7
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,11 @@ public void sendHeartbeat() {
@Override
public int onStartCommand(Intent intent, int flags, int startId) {

startForeground(notifyId, getForegroundNotification());

//if the service restarted, then we need to reconnect/reinit to cacheword
// if ((flags & START_FLAG_REDELIVERY)!=0) // if crash restart..
connectToCacheWord();
if ((flags & START_FLAG_REDELIVERY)!=0) // if crash restart..
connectToCacheWord();

if (intent != null)
{
Expand Down Expand Up @@ -434,7 +436,7 @@ public int onStartCommand(Intent intent, int flags, int startId) {

@Override
public void onLowMemory() {

debug ("onLowMemory()!");
}


Expand Down Expand Up @@ -473,7 +475,7 @@ public void onTrimMemory(int level) {
If the event is TRIM_MEMORY_RUNNING_CRITICAL, then the system will
begin killing background processes.
*/
clearMemoryMedium();
// clearMemoryMedium();

break;

Expand All @@ -488,7 +490,7 @@ public void onTrimMemory(int level) {
If the event is TRIM_MEMORY_COMPLETE, the process will be one of
the first to be terminated.
*/
clearMemoryComplete();
// clearMemoryComplete();


break;
Expand Down Expand Up @@ -524,7 +526,6 @@ private void clearMemoryComplete ()
{
clearMemoryMedium ();

/**
for (ImConnectionAdapter conn : mConnections.values())
{
conn.suspend();
Expand All @@ -533,7 +534,7 @@ private void clearMemoryComplete ()
for (ImConnectionAdapter conn : mConnectionsByUser.values())
{
conn.suspend();
}**/
}

SecureMediaStore.unmount();
System.gc();
Expand Down

0 comments on commit b4480f7

Please sign in to comment.