Compare commits

...

4 Commits

3 changed files with 51 additions and 57 deletions

View File

@ -255,13 +255,12 @@ public abstract class AbstractSDParentActivity extends TabActivity {
return res;
}
public boolean getAlarms(long userID)
{
if(tcp == null)
public boolean getAlarms(long userID) {
if (tcp == null)
return false;
boolean res = tcp.Write("0.0", "#27#" + userID + "#");
if(res)
if (res)
SM.Debug("Message [GetAlarms] sent to app server");
else
SM.Debug("Could not send message [GetAlarms]!!");

View File

@ -42,7 +42,6 @@ public class GoogleMapsInfoBubble implements GoogleMap.InfoWindowAdapter {
public GoogleMapsInfoBubble(LayoutInflater layoutInflater, Context context) {
isLiveTab = false;
this.context = context;
// this.superVehHash = vehicles;
mWindow = layoutInflater.inflate(R.layout.map_marker_info_bubble, null);
}
@ -73,7 +72,7 @@ public class GoogleMapsInfoBubble implements GoogleMap.InfoWindowAdapter {
}
} else {
try {
position = Integer.getInteger(marker.getTitle());
position = Integer.parseInt(marker.getTitle());
} catch (Exception e) {
Log.v(TAG, "Unable to parse Google Maps Info Bubble title on History");
}

View File

@ -1688,64 +1688,61 @@ public class TabLayoutActivity extends AbstractSDParentActivity {
SM.Debug("Unit imei:" + tempArr[0]);
String unitIMEI = tempArr[0];
//list for SMS
if (AppParams.crtTab == AppParams.Tabs.alarms) {
SM.Debug("currentActivity instanceof AlarmActivity - newSMS | " + tempArr[0] + " | " + tempArr[1]);
getAlarms(AppParams.USERID);
}
// if tab is not TextTab
if (tabHost.getCurrentTab() != 5) {
// change Visual Elements
setImei(unitIMEI);
switch (msg.opCode) {
case 135:
setMess("speed " + tempArr[1]);
break;
case 136:
setMess("landmark " + tempArr[1]);
break;
case 137:
setMess("zone " + tempArr[1]);
break;
case 140:
setMess("telemetry " + tempArr[1]);
break;
default:
// change Visual Elements
setImei(unitIMEI);
switch (msg.opCode) {
case 135:
setMess("speed " + tempArr[1]);
break;
case 136:
setMess("landmark " + tempArr[1]);
break;
case 137:
setMess("zone " + tempArr[1]);
break;
case 140:
setMess("telemetry " + tempArr[1]);
break;
default:
// 138
setMess("emergency");
}
myHandler.post(updateResultsAlarm);
setMess("emergency");
}
myHandler.post(updateResultsAlarm);
if ((msg.opCode == 138) && (AppParams.crtTab == AppParams.Tabs.live)) {
SuperVehicle superVehicle = getSuperVehHash().get(Long.parseLong(unitIMEI));
if ((msg.opCode == 138) && (AppParams.crtTab == AppParams.Tabs.live)) {
SuperVehicle superVehicle = getSuperVehHash().get(Long.parseLong(unitIMEI));
if (superVehicle != null) {
//if is not check i need to force check to put on the map
boolean forceChecked = false;
if (!superVehicle.needUpdate) {
superVehicle.needUpdate = true;
forceChecked = true;
}
try {
int x = 0;
if (forceChecked) {
for (Vehicle veh : getAllVehicle()) {
if (veh.imei.compareTo(unitIMEI) == 0) break;
x++;
}
} else x = -1;
if (getLiveActivity() != null) {
if (x != getAllVehicle().size())
getLiveActivity().emergencyAlarmReceived(x, superVehicle.lat, superVehicle.lng);
else
getLiveActivity().emergencyAlarmReceived(-1, superVehicle.lat, superVehicle.lng);
if (superVehicle != null) {
//if is not check i need to force check to put on the map
boolean forceChecked = false;
if (!superVehicle.needUpdate) {
superVehicle.needUpdate = true;
forceChecked = true;
}
try {
int x = 0;
if (forceChecked) {
for (Vehicle veh : getAllVehicle()) {
if (veh.imei.compareTo(unitIMEI) == 0) break;
x++;
}
} catch (Exception ex) {
SM.Debug(HASH_ERROR_MESSAGE + ex);
} else x = -1;
if (getLiveActivity() != null) {
if (x != getAllVehicle().size())
getLiveActivity().emergencyAlarmReceived(x, superVehicle.lat, superVehicle.lng);
else
getLiveActivity().emergencyAlarmReceived(-1, superVehicle.lat, superVehicle.lng);
}
} catch (Exception ex) {
SM.Debug(HASH_ERROR_MESSAGE + ex);
}
}
}
//list for SMS
if (AppParams.crtTab == AppParams.Tabs.alarms)
getAlarms(AppParams.USERID);
}
@Override
@ -2052,7 +2049,6 @@ public class TabLayoutActivity extends AbstractSDParentActivity {
.setAutoCancel(true)
.setContentIntent(pendingIntent);
Log.v("test111", "test");
NotificationManagerCompat managerCompat = NotificationManagerCompat.from(context);
managerCompat.notify(icon, builder.build());
}