summaryrefslogtreecommitdiff
path: root/SDL_Core/mobile/android/SyncProxyAndroid/src/com/ford/syncV4/proxy/rpc/DeviceStatus.java
blob: d2e7f5785488219d0724fe51d10cae083bfb731e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
package com.ford.syncV4.proxy.rpc;

import java.util.Hashtable;

import com.ford.syncV4.proxy.RPCStruct;
import com.ford.syncV4.proxy.constants.Names;
import com.ford.syncV4.proxy.rpc.enums.DeviceLevelStatus;
import com.ford.syncV4.proxy.rpc.enums.PrimaryAudioSource;
import com.ford.syncV4.util.DebugTool;

public class DeviceStatus extends RPCStruct {

    public DeviceStatus() {}
    public DeviceStatus(Hashtable hash) {
        super(hash);
    }
    public void setVoiceRecOn(Boolean voiceRecOn) {
        if (voiceRecOn != null) {
        	store.put(Names.voiceRecOn, voiceRecOn);
        } else {
        	store.remove(Names.voiceRecOn);
        }
    }
    public Boolean getVoiceRecOn() {
        return (Boolean) store.get(Names.voiceRecOn);
    }
    public void setBtIconOn(Boolean btIconOn) {
        if (btIconOn != null) {
        	store.put(Names.btIconOn, btIconOn);
        } else {
        	store.remove(Names.btIconOn);
        }
    }
    public Boolean getBtIconOn() {
        return (Boolean) store.get(Names.btIconOn);
    }
    public void setCallActive(Boolean callActive) {
        if (callActive != null) {
        	store.put(Names.callActive, callActive);
        } else {
        	store.remove(Names.callActive);
        }
    }
    public Boolean getCallActive() {
        return (Boolean) store.get(Names.callActive);
    }
    public void setPhoneRoaming(Boolean phoneRoaming) {
        if (phoneRoaming != null) {
        	store.put(Names.phoneRoaming, phoneRoaming);
        } else {
        	store.remove(Names.phoneRoaming);
        }
    }
    public Boolean getPhoneRoaming() {
        return (Boolean) store.get(Names.phoneRoaming);
    }
    public void setTextMsgAvailable(Boolean textMsgAvailable) {
        if (textMsgAvailable != null) {
        	store.put(Names.textMsgAvailable, textMsgAvailable);
        } else {
        	store.remove(Names.textMsgAvailable);
        }
    }
    public Boolean getTextMsgAvailable() {
        return (Boolean) store.get(Names.textMsgAvailable);
    }
    public void setBattLevelStatus(DeviceLevelStatus battLevelStatus) {
        if (battLevelStatus != null) {
        	store.put(Names.battLevelStatus, battLevelStatus);
        } else {
        	store.remove(Names.battLevelStatus);
        }
    }
    public DeviceLevelStatus getBattLevelStatus() {
        Object obj = store.get(Names.battLevelStatus);
        if (obj instanceof DeviceLevelStatus) {
            return (DeviceLevelStatus) obj;
        } else if (obj instanceof String) {
        	DeviceLevelStatus theCode = null;
            try {
                theCode = DeviceLevelStatus.valueForString((String) obj);
            } catch (Exception e) {
                DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.battLevelStatus, e);
            }
            return theCode;
        }
        return null;
    }
    public void setStereoAudioOutputMuted(Boolean stereoAudioOutputMuted) {
        if (stereoAudioOutputMuted != null) {
        	store.put(Names.stereoAudioOutputMuted, stereoAudioOutputMuted);
        } else {
        	store.remove(Names.stereoAudioOutputMuted);
        }
    }
    public Boolean getStereoAudioOutputMuted() {
        return (Boolean) store.get(Names.stereoAudioOutputMuted);
    }
    public void setMonoAudioOutputMuted(Boolean monoAudioOutputMuted) {
        if (monoAudioOutputMuted != null) {
        	store.put(Names.monoAudioOutputMuted, monoAudioOutputMuted);
        } else {
        	store.remove(Names.monoAudioOutputMuted);
        }
    }
    public Boolean getMonoAudioOutputMuted() {
        return (Boolean) store.get(Names.monoAudioOutputMuted);
    }
    public void setSignalLevelStatus(DeviceLevelStatus signalLevelStatus) {
        if (signalLevelStatus != null) {
        	store.put(Names.signalLevelStatus, signalLevelStatus);
        } else {
        	store.remove(Names.signalLevelStatus);
        }
    }
    public DeviceLevelStatus getSignalLevelStatus() {
        Object obj = store.get(Names.signalLevelStatus);
        if (obj instanceof DeviceLevelStatus) {
            return (DeviceLevelStatus) obj;
        } else if (obj instanceof String) {
        	DeviceLevelStatus theCode = null;
            try {
                theCode = DeviceLevelStatus.valueForString((String) obj);
            } catch (Exception e) {
                DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.signalLevelStatus, e);
            }
            return theCode;
        }
        return null;
    }
    public void setPrimaryAudioSource(PrimaryAudioSource primaryAudioSource) {
        if (primaryAudioSource != null) {
        	store.put(Names.primaryAudioSource, primaryAudioSource);
        } else {
        	store.remove(Names.primaryAudioSource);
        }
    }
    public PrimaryAudioSource getPrimaryAudioSource() {
        Object obj = store.get(Names.primaryAudioSource);
        if (obj instanceof PrimaryAudioSource) {
            return (PrimaryAudioSource) obj;
        } else if (obj instanceof String) {
        	PrimaryAudioSource theCode = null;
            try {
                theCode = PrimaryAudioSource.valueForString((String) obj);
            } catch (Exception e) {
                DebugTool.logError("Failed to parse " + getClass().getSimpleName() + "." + Names.primaryAudioSource, e);
            }
            return theCode;
        }
        return null;
    }
    public void setECallEventActive(Boolean eCallEventActive) {
        if (eCallEventActive != null) {
        	store.put(Names.eCallEventActive, eCallEventActive);
        } else {
        	store.remove(Names.eCallEventActive);
        }
    }
    public Boolean getECallEventActive() {
        return (Boolean) store.get(Names.eCallEventActive);
    }
}