Skip to content

Commit

Permalink
Bug 618535 - Add new ACTIVITY_SHUTDOWN event on android r=mwu. a=bloc…
Browse files Browse the repository at this point in the history
…king-fennec
  • Loading branch information
Doug Turner committed Dec 11, 2010
1 parent 4c6064e commit ba1d10c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
5 changes: 2 additions & 3 deletions embedding/android/GeckoApp.java
Expand Up @@ -277,8 +277,7 @@ public void onStop()
// etc., and generally mark the profile as 'clean', and then
// dirty it again if we get an onResume.

// XXX do the above.

GeckoAppShell.sendEventToGecko(new GeckoEvent(GeckoEvent.ACTIVITY_STOPPING));
super.onStop();
}

Expand All @@ -303,7 +302,7 @@ public void onDestroy()
// Tell Gecko to shutting down; we'll end up calling System.exit()
// in onXreExit.
if (isFinishing())
GeckoAppShell.sendEventToGecko(new GeckoEvent(GeckoEvent.ACTIVITY_STOPPING));
GeckoAppShell.sendEventToGecko(new GeckoEvent(GeckoEvent.ACTIVITY_SHUTDOWN));

super.onDestroy();
}
Expand Down
3 changes: 2 additions & 1 deletion embedding/android/GeckoEvent.java
Expand Up @@ -65,7 +65,8 @@ public class GeckoEvent {
public static final int SIZE_CHANGED = 7;
public static final int ACTIVITY_STOPPING = 8;
public static final int ACTIVITY_PAUSING = 9;
public static final int LOAD_URI = 10;
public static final int ACTIVITY_SHUTDOWN = 10;
public static final int LOAD_URI = 11;

public static final int IME_COMPOSITION_END = 0;
public static final int IME_COMPOSITION_BEGIN = 1;
Expand Down
3 changes: 2 additions & 1 deletion widget/src/android/AndroidJavaWrappers.h
Expand Up @@ -449,7 +449,8 @@ class AndroidGeckoEvent : public WrappedJavaObject
SIZE_CHANGED = 7,
ACTIVITY_STOPPING = 8,
ACTIVITY_PAUSING = 9,
LOAD_URI = 10,
ACTIVITY_SHUTDOWN = 10,
LOAD_URI = 11,
dummy_java_enum_list_end
};

Expand Down
5 changes: 5 additions & 0 deletions widget/src/android/nsAppShell.cpp
Expand Up @@ -234,6 +234,11 @@ nsAppShell::ProcessNextNativeEvent(PRBool mayWait)
break;

case AndroidGeckoEvent::ACTIVITY_STOPPING: {
// Do nothing yet.
break;
}

case AndroidGeckoEvent::ACTIVITY_SHUTDOWN: {
nsCOMPtr<nsIObserverService> obsServ =
mozilla::services::GetObserverService();
NS_NAMED_LITERAL_STRING(context, "shutdown-persist");
Expand Down

0 comments on commit ba1d10c

Please sign in to comment.