22 #ifndef STATUSBARSERVICESCONNECTOR_H
23 #define STATUSBARSERVICESCONNECTOR_H
27 #include <lunaservice.h>
109 void setDemoBuild(
bool demo);
110 void requestNetworkAndSignalStatus();
111 void handleTILDisconnected();
112 void setAirplaneMode(
bool on);
113 void setRadioStatesForMSMMode(
bool on);
114 void setTelephonyPowerState(
bool on,
bool saveState,
bool msmMode =
false);
115 void updateAirplaneModeProgress(
int radio);
117 static bool statusBarStorageMSMEntryCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
118 static bool statusBarStorageMSMProgressCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
119 static bool statusBarPowerdServiceUpCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
120 static bool statusBarPowerdBatteryEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
121 static bool statusBarPowerdChargerEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
122 static bool statusBarGetBuildNameCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
123 static bool statusBarPlatformQueryCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
124 static bool statusBarTelephonyServiceUpCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
125 static bool statusBarTelephonyPowerEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
126 static bool statusBarTelephonyNetworkEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
127 static bool statusBarTelephonySignalEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
128 static bool statusBarTelephonySIMEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
129 static bool statusBarTelephonyPowerStateChangeCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
130 static bool statusBarTelephonyTTYEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
131 static bool statusBarTelephonyHACEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
132 static bool statusBarWanServiceUpCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
133 static bool statusBarWanStatusEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
134 static bool statusBarBtMonitorServiceUpCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
135 static bool statusBarBtMonitorEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
136 static bool statusBarBtConnectedProfilesInfoCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
137 static bool statusBarCallForwardRequestCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
138 static bool statusBarBluetoothServiceUpCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
139 static bool statusBarBluetoothEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
140 static bool statusBarBluetoothTurnOnCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
141 static bool statusBarBluetoothTurnOffCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
142 static bool statusBarBluetoothTruestedListCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
143 static bool statusBarBluetoothNumProfilesCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
144 static bool statusBarConnMgrServiceUpCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
145 static bool statusBarConnMgrEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
146 static bool statusBarWiFiServiceUpCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
147 static bool statusBarWifiEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
148 static bool statusBarWifiAvailableNetworksListCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
149 static bool statusBarWifiConnectCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
150 static bool statusBarWifiPowerStateChangeCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
151 static bool statusBarVpnServiceUpCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
152 static bool statusBarHandleVPNStatusNotification(LSHandle* handle, LSMessage* message,
void* ctxt);
153 static bool statusBarVpnDisconnectResponse(LSHandle* handle, LSMessage* message,
void* ctxt);
154 static bool statusBarGetSystemTimeCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
156 bool storageMSMEntryCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
157 bool storageMSMProgressCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
158 bool powerdServiceUpCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
159 bool powerdBatteryEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
160 bool powerdChargerEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
161 bool platformQueryCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
162 bool telephonyServiceUpCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
163 bool telephonyPowerEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
164 bool telephonyNetworkEventsCallback(LSHandle* handle,
const char* messagePayload,
void* ctxt);
165 bool telephonySignalEventsCallback(LSHandle* handle,
const char* messagePayload,
void* ctxt);
166 bool telephonySIMEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
167 bool telephonyPowerStateChangeCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
168 bool telephonyTTYEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
169 bool telephonyHACEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
170 bool wanServiceUpCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
171 bool wanStatusEventsCallback(LSHandle* handle,
const char* messagePayload,
void* ctxt);
172 bool btMonitorServiceUpCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
173 bool btMonitorEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
174 bool btConnectedProfilesInfoCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
175 bool callForwardRequestCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
176 bool bluetoothServiceUpCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
177 bool bluetoothEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
178 bool bluetoothTurnOnCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
179 bool bluetoothTurnOffCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
180 bool bluetoothTruestedListCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
181 bool bluetoothNumProfilesCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
182 bool connMgrServiceUpCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
183 bool connMgrEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
184 bool wiFiServiceUpCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
185 bool wifiEventsCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
186 bool wifiAvailableNetworksListCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
187 bool wifiConnectCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
188 bool wifiPowerStateChangeCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
189 bool vpnServiceUpCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
190 bool handleVPNStatusNotification(LSHandle* handle, LSMessage* message,
void* ctxt);
191 bool vpnDisconnectResponse(LSHandle* handle, LSMessage* message,
void* ctxt);
192 bool getSystemTimeCallback(LSHandle* handle, LSMessage* message,
void* ctxt);
194 void handlePowerStatus(
const char* radioState,
bool queryResponse =
false);
195 void handleNetworkStatus(
const char* networkState,
struct json_object* event);
219 void signalWifiStateChanged(
bool wifiOn,
bool wifiConnected, std::string wifiSSID, std::string wifiConnState);
232 void slotAirplaneModeChanged(
bool enabled);
233 void slotRoamingIndicatorChanged();
234 void slotEnterBrickMode(
bool);
235 void slotExitBrickMode();
251 enum BluetoothState {
258 struct BluetoothProfState {
259 BluetoothState status;
264 std::vector<unsigned int> m_SIMRejectCodes;
265 std::vector<std::string> m_bluetoothProfiles;
266 std::set<std::string> m_bluetoothMenuProfiles;
267 std::map<std::string, BluetoothProfState> m_bluetoothProfileStates;
269 static const int kNumChargeSources = 2;
270 static const char* m_chargeSource[kNumChargeSources];
271 bool m_powerdConnected;
276 bool m_phoneRadioState;
280 bool m_phoneInLimitedService;
281 PhoneService m_phoneService;
283 bool m_callFwdStatusRequested;
289 bool m_initialAirplaneModeStatus;
290 bool m_airplaneModeTriggered;
293 bool m_apModeBluetooth;
294 bool m_msmStartingRadiosInProgress;
297 bool m_msmModeBluetooth;
299 bool m_showBlankStatusOnLimited;
300 bool m_bluetoothRadionOn;
301 bool m_btRadioTurningOn;
302 std::string m_wifiSSID;
304 bool m_wifiConnected;
305 LSMessageToken m_wifiFindNetworksReq;
306 LSMessageToken m_bluetoothDeviceListReq;
309 std::string m_connectedVpnInfo;
310 std::string m_pendingVpnProfile;
313 bool m_isInternetConnectionAvailable;
317 std::string m_cmPayloadBuffer;
318 std::string m_signalMsgPayloadBuffer;
319 std::string m_phoneEventNetworkPayload;
325 void requestBluetoothConnectedProfilesInfo();
326 void requestCallForwardStatus();
328 void updateBluetoothIcon();
329 void updateBtDeviceInfo(BluetoothProfState* info);
331 bool validSIMRejectCode(
unsigned int code);