protected static void interactResult(int decisionId, int choice) { MTMDecision d; synchronized (openDecisions) { d = openDecisions.get(decisionId); openDecisions.remove(decisionId); } if (d == null) { LOGGER.log(Level.SEVERE, "interactResult: aborting due to stale decision reference!"); return; } synchronized (d) { d.state = choice; d.notify(); } }
public static void interactResult(Intent i) { int decisionId = i.getIntExtra(DECISION_INTENT_ID, MTMDecision.DECISION_INVALID); int choice = i.getIntExtra(DECISION_INTENT_CHOICE, MTMDecision.DECISION_INVALID); Log.d(TAG, "interactResult: " + decisionId + " chose " + choice); Log.d(TAG, "openDecisions: " + openDecisions); MTMDecision d; synchronized (openDecisions) { d = openDecisions.get(decisionId); openDecisions.remove(decisionId); } if (d == null) { Log.e(TAG, "interactResult: aborting due to stale decision reference!"); return; } synchronized (d) { d.state = choice; d.notify(); } }