diff -Naur Nesoid.pristine/Nesoid/AndroidManifest.xml Nesoid.new/Nesoid/AndroidManifest.xml --- Nesoid.pristine/Nesoid/AndroidManifest.xml 2012-06-28 11:24:39.728928405 +1100 +++ Nesoid.new/Nesoid/AndroidManifest.xml 2012-06-28 14:25:18.930194334 +1100 @@ -4,7 +4,7 @@ android:versionName="2.5" android:installLocation="preferExternal"> - + @@ -14,7 +14,8 @@ + android:icon="@drawable/app_icon" android:hardwareAccelerated="true" + android:theme="@style/MyTheme"> diff -Naur Nesoid.pristine/Nesoid/res/values/themes.xml Nesoid.new/Nesoid/res/values/themes.xml --- Nesoid.pristine/Nesoid/res/values/themes.xml 1970-01-01 10:00:00.000000000 +1000 +++ Nesoid.new/Nesoid/res/values/themes.xml 2012-06-28 12:13:04.642987859 +1100 @@ -0,0 +1,5 @@ + + + diff -Naur Nesoid.pristine/Nesoid/res/values-v11/themes.xml Nesoid.new/Nesoid/res/values-v11/themes.xml --- Nesoid.pristine/Nesoid/res/values-v11/themes.xml 1970-01-01 10:00:00.000000000 +1000 +++ Nesoid.new/Nesoid/res/values-v11/themes.xml 2012-06-28 12:13:34.089492940 +1100 @@ -0,0 +1,5 @@ + + + diff -Naur Nesoid.pristine/Nesoid/res/values-v14/themes.xml Nesoid.new/Nesoid/res/values-v14/themes.xml --- Nesoid.pristine/Nesoid/res/values-v14/themes.xml 1970-01-01 10:00:00.000000000 +1000 +++ Nesoid.new/Nesoid/res/values-v14/themes.xml 2012-06-28 12:14:36.515817043 +1100 @@ -0,0 +1,5 @@ + + + diff -Naur Nesoid.pristine/Nesoid/src/com/androidemu/nes/EmulatorService.java Nesoid.new/Nesoid/src/com/androidemu/nes/EmulatorService.java --- Nesoid.pristine/Nesoid/src/com/androidemu/nes/EmulatorService.java 2012-06-28 11:24:40.682256521 +1100 +++ Nesoid.new/Nesoid/src/com/androidemu/nes/EmulatorService.java 2012-06-28 12:05:08.782265676 +1100 @@ -49,9 +49,10 @@ private NotificationManager mNM; private Method mStartForeground; private Method mStopForeground; + private Method mSetForeground = null; private Object[] mStartForegroundArgs = new Object[2]; private Object[] mStopForegroundArgs = new Object[1]; - + @Override public void onCreate() { mNM = (NotificationManager)getSystemService(NOTIFICATION_SERVICE); @@ -63,6 +64,11 @@ } catch (NoSuchMethodException e) { // Running on an older platform. mStartForeground = mStopForeground = null; + try { + mSetForeground = getClass().getMethod("setForeground", mStopForegroundSignature); + } catch (NoSuchMethodException crap) { + Log.w(LOG_TAG, "OS doesn't have Service.startForeground OR Service.setForeground!", crap); + } } } @@ -128,7 +134,19 @@ } // Fall back on the old API. - setForeground(true); + if (mSetForeground != null) { + mStopForegroundArgs[0] = Boolean.TRUE; + try { + mSetForeground.invoke(this, mStopForegroundArgs); + } catch (InvocationTargetException e) { + // Should not happen. + Log.w(LOG_TAG, "Unable to invoke setForeground", e); + } catch (IllegalAccessException e) { + // Should not happen. + Log.w(LOG_TAG, "Unable to invoke setForeground", e); + } + return; + } mNM.notify(id, notification); } @@ -155,7 +173,19 @@ // Fall back on the old API. Note to cancel BEFORE changing the // foreground state, since we could be killed at that point. mNM.cancel(id); - setForeground(false); + if (mSetForeground != null) { + mStopForegroundArgs[0] = Boolean.FALSE; + try { + mSetForeground.invoke(this, mStopForegroundArgs); + } catch (InvocationTargetException e) { + // Should not happen. + Log.w(LOG_TAG, "Unable to invoke setForeground", e); + } catch (IllegalAccessException e) { + // Should not happen. + Log.w(LOG_TAG, "Unable to invoke setForeground", e); + } + return; + } } @Override