public void onManagementStopped() {
super.onManagementStopped();
if (getManagementContext().isRunning()) {
recordApplicationEvent(Lifecycle.DESTROYED);
}
<BUG>}
private void recordApplicationEvent(Lifecycle state) {
</BUG>
try {
((ManagementContextInternal)getManagementContext()).getUsageManager().recordApplicationEvent(this, state);

public void onManagementStopped() {
super.onManagementStopped();
if (getManagementContext().isRunning()) {
recordApplicationEvent(Lifecycle.DESTROYED);
}
}
protected void setExpectedStateAndRecordLifecycleEvent(Lifecycle state) {
ServiceStateLogic.setExpectedState(this, state);
recordApplicationEvent(state);
}
protected void recordApplicationEvent(Lifecycle state) {
try {
((ManagementContextInternal)getManagementContext()).getUsageManager().recordApplicationEvent(this, state);
