From ae569a500894da05f1cb0bfda9ad490cf288b955 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Fri, 20 May 2011 19:47:36 +0200 Subject: [PATCH] add service, which just gets root currently --- MS2Debounce/AndroidManifest.xml | 1 + MS2Debounce/res/values/strings.xml | 2 +- .../de/rmdir/ms2debounce/DebounceService.java | 24 +++++++++++++++++++ .../src/de/rmdir/ms2debounce/MS2Debounce.java | 5 ++++ 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 MS2Debounce/src/de/rmdir/ms2debounce/DebounceService.java diff --git a/MS2Debounce/AndroidManifest.xml b/MS2Debounce/AndroidManifest.xml index a1e7f01..ddbbbb3 100644 --- a/MS2Debounce/AndroidManifest.xml +++ b/MS2Debounce/AndroidManifest.xml @@ -11,5 +11,6 @@ + diff --git a/MS2Debounce/res/values/strings.xml b/MS2Debounce/res/values/strings.xml index 3e427ab..b5ae1c6 100644 --- a/MS2Debounce/res/values/strings.xml +++ b/MS2Debounce/res/values/strings.xml @@ -1,4 +1,4 @@ - MS2Debounce + Milestone 2 Debounce diff --git a/MS2Debounce/src/de/rmdir/ms2debounce/DebounceService.java b/MS2Debounce/src/de/rmdir/ms2debounce/DebounceService.java new file mode 100644 index 0000000..f9f81bb --- /dev/null +++ b/MS2Debounce/src/de/rmdir/ms2debounce/DebounceService.java @@ -0,0 +1,24 @@ +package de.rmdir.ms2debounce; + +import android.content.Intent; +import android.app.IntentService; + +public class DebounceService extends IntentService { + + // Create worker thread + public DebounceService() { + super("DebounceService"); + } + + @Override + protected void onHandleIntent(Intent intent) { + } + + @Override + public void onCreate() { + try { + Process ps = Runtime.getRuntime().exec("su"); + } catch (Exception e) {} + super.onCreate(); + } +} diff --git a/MS2Debounce/src/de/rmdir/ms2debounce/MS2Debounce.java b/MS2Debounce/src/de/rmdir/ms2debounce/MS2Debounce.java index c09869b..99ca40d 100644 --- a/MS2Debounce/src/de/rmdir/ms2debounce/MS2Debounce.java +++ b/MS2Debounce/src/de/rmdir/ms2debounce/MS2Debounce.java @@ -2,6 +2,7 @@ package de.rmdir.ms2debounce; import android.app.Activity; import android.os.Bundle; +import android.content.Intent; public class MS2Debounce extends Activity { @@ -10,6 +11,10 @@ public class MS2Debounce extends Activity public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + + Intent debouncesvc = new Intent(this, DebounceService.class); + startService(debouncesvc); + setContentView(R.layout.main); } } -- 2.39.5