diff -Ndaur GBCoid.pristine/GBCoid/AndroidManifest.xml GBCoid.new/GBCoid/AndroidManifest.xml --- GBCoid.pristine/GBCoid/AndroidManifest.xml 2012-06-29 13:58:27.769929717 +1100 +++ GBCoid.new/GBCoid/AndroidManifest.xml 2012-06-29 14:11:31.035631588 +1100 @@ -4,13 +4,14 @@ android:versionName="1.8.5" android:installLocation="preferExternal"> - + + android:icon="@drawable/app_icon" android:hardwareAccelerated="true" + android:theme="@style/MyTheme"> diff -Ndaur GBCoid.pristine/GBCoid/res/values/themes.xml GBCoid.new/GBCoid/res/values/themes.xml --- GBCoid.pristine/GBCoid/res/values/themes.xml 1970-01-01 10:00:00.000000000 +1000 +++ GBCoid.new/GBCoid/res/values/themes.xml 2012-06-29 14:12:08.058761757 +1100 @@ -0,0 +1,5 @@ + + + diff -Ndaur GBCoid.pristine/GBCoid/res/values-v11/themes.xml GBCoid.new/GBCoid/res/values-v11/themes.xml --- GBCoid.pristine/GBCoid/res/values-v11/themes.xml 1970-01-01 10:00:00.000000000 +1000 +++ GBCoid.new/GBCoid/res/values-v11/themes.xml 2012-06-29 14:12:46.791882546 +1100 @@ -0,0 +1,5 @@ + + + diff -Ndaur GBCoid.pristine/GBCoid/res/values-v14/themes.xml GBCoid.new/GBCoid/res/values-v14/themes.xml --- GBCoid.pristine/GBCoid/res/values-v14/themes.xml 1970-01-01 10:00:00.000000000 +1000 +++ GBCoid.new/GBCoid/res/values-v14/themes.xml 2012-06-29 14:12:46.791882546 +1100 @@ -0,0 +1,5 @@ + + + diff -Ndaur GBCoid.pristine/GBCoid/src/com/androidemu/gbc/EmulatorService.java GBCoid.new/GBCoid/src/com/androidemu/gbc/EmulatorService.java --- GBCoid.pristine/GBCoid/src/com/androidemu/gbc/EmulatorService.java 2012-06-29 13:58:27.819929442 +1100 +++ GBCoid.new/GBCoid/src/com/androidemu/gbc/EmulatorService.java 2012-06-29 14:20:13.526097780 +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