Back to project page HeadphoneController.
The source code is released under:
GNU General Public License
If you think the Android project HeadphoneController listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package ca.mbabic.headphonecontroller.models; // w w w.ja v a2 s .c o m import android.telephony.TelephonyManager; /** * Model representing a state to be used by the views. * @author Marko Babic * */ public class HCInputSequence { private String id; private String name; private HCCmd idleCmd, offHookCmd, ringingCmd; public HCInputSequence(String stateKey, String stateName, HCCmd idleCmd, HCCmd offHookCmd, HCCmd callActiveCmd) { id = stateKey; name = stateName; } public String getId() { return id; } public String getName() { return name; } public String getCmdStr(int callState) { switch (callState) { case TelephonyManager.CALL_STATE_IDLE: return idleCmd.getName(); case TelephonyManager.CALL_STATE_OFFHOOK: return offHookCmd.getName(); case TelephonyManager.CALL_STATE_RINGING: return ringingCmd.getName(); } return null; } @Override public String toString() { return getName(); } }