Xserver - start dummy service, so OS won't kill us

This commit is contained in:
pelya
2014-02-23 20:37:49 +02:00
parent 6691181f21
commit e82df3c78f
6 changed files with 81 additions and 42 deletions

View File

@@ -22,8 +22,10 @@ freely, subject to the following restrictions:
package net.sourceforge.clonekeenplus;
import android.app.Activity;
import android.app.Service;
import android.content.Context;
import android.os.Bundle;
import android.os.IBinder;
import android.view.MotionEvent;
import android.view.KeyEvent;
import android.view.Window;
@@ -212,6 +214,11 @@ public class MainActivity extends Activity
}
};
(new Thread(new Callback(this))).start();
if( Globals.CreateService )
{
Intent intent = new Intent(this, DummyService.class);
startService(intent);
}
}
public void setUpStatusLabel()
@@ -1275,3 +1282,25 @@ abstract class SetLayerType
}
}
}
class DummyService extends Service
{
public DummyService()
{
super();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId)
{
return Service.START_STICKY;
}
@Override
public void onDestroy()
{
}
@Override
public IBinder onBind(Intent intent)
{
return null;
}
}