Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/0293 oem android specific #1604

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
14670bc
[0293]
Jan 13, 2021
5b398da
[0293]
Jan 14, 2021
04abbbf
[0293]
Jan 18, 2021
e95c41c
[0293]
Jan 18, 2021
8033d5e
[0293]
Jan 18, 2021
48006bf
[0293]
Jan 18, 2021
ada7f5e
[0293]
Jan 19, 2021
d352325
[0293]
Jan 19, 2021
5b85bfa
[0293]
Jan 19, 2021
efbca5b
[0293]
Jan 19, 2021
ff4c51e
[0293]
Jan 19, 2021
e14a41e
[0293]
Jan 19, 2021
b59bfc2
[0293]
Jan 20, 2021
15011e7
[0293]
Jan 20, 2021
728fd9e
[0293]
Jan 21, 2021
f386b31
[0293]
Jan 22, 2021
9efe130
[0293]
Jan 22, 2021
6ea63f0
Merge branch 'develop' into feature/0293_oem_android_specific
Jan 22, 2021
fe73662
[0293]
Jan 25, 2021
3269e4d
[0293]
Jan 25, 2021
e341050
Merge branch 'develop' into feature/0293_oem_android_specific
Jan 25, 2021
440d8b6
[0293]
Jan 25, 2021
38793d0
[0293]
Jan 26, 2021
a77b24c
[0293]
Jan 26, 2021
23bc6d5
[0293]
Jan 26, 2021
8f8c8ef
Rollbacking the patch
Jan 27, 2021
43f5ced
Revert "[0293]"
Jan 27, 2021
b1c6075
[0293]
Jan 29, 2021
ff333cd
[0293]
Feb 10, 2021
7097577
[0293]
Feb 10, 2021
154b9bb
Merge branch 'develop' into feature/0293_oem_android_specific
Feb 11, 2021
43d7147
Apply suggestions from code review
kboskin Mar 3, 2021
a7970da
[0296]
Mar 3, 2021
b463d14
[0296]
Mar 3, 2021
eb10c4e
[0293]
Mar 4, 2021
c053659
[0293]
Mar 8, 2021
0a7cb44
Merge branch 'develop' into feature/0293_oem_android_specific
Mar 8, 2021
254d3df
[0293]
Mar 8, 2021
0c3af36
Apply suggestions from code review
kboskin Mar 10, 2021
259d9f2
[0293]
Mar 10, 2021
589d8e8
Merge branch 'feature/0293_oem_android_specific' of https://github.co…
Mar 10, 2021
de5e379
Merge branch 'develop' into Feature/0293_oem_android_specific
kboskin Mar 22, 2021
fb3000a
[0293]
kboskin Apr 1, 2021
9b9be79
[0293]
kboskin Apr 19, 2021
cabf8ea
Merge remote-tracking branch 'origin/develop' into feature/0293_oem_a…
AKalinich-Luxoft May 6, 2021
07c54bf
Increment ROUTER_SERVICE_VERSION_NUMBER
AKalinich-Luxoft May 6, 2021
562f2ee
fixup! Increment ROUTER_SERVICE_VERSION_NUMBER
AKalinich-Luxoft May 13, 2021
f5ed2d6
Fix crash in broadcast receiver
AKalinich-Luxoft May 7, 2021
2ca1ec8
Merge remote-tracking branch 'origin/develop' into feature/0293_oem_a…
AKalinich-Luxoft May 24, 2021
2e60ad7
Add missing vehicle type check
AKalinich-Luxoft May 12, 2021
937afd7
Update onSystemInfoReceived logic
AKalinich-Luxoft May 13, 2021
b91362e
Update old router service check
AKalinich-Luxoft May 13, 2021
4b35040
Fix foreground service icon for unsupported app
AKalinich-Luxoft May 23, 2021
aa56390
Add vehicle type check to SDL receiver
AKalinich-Luxoft May 24, 2021
4099624
Include vehicle type into the ping intent
AKalinich-Luxoft May 24, 2021
07e97dd
Fix extracting metadata from manifest
AKalinich-Luxoft May 26, 2021
6dd3447
Fix initial protocol version for StartService
AKalinich-Luxoft May 26, 2021
7c3003a
Replace broadcast receiver with callback
AKalinich-Luxoft May 28, 2021
50f7a4f
fix notifications on disconnect
VadymLuchko May 31, 2021
5a0b012
fix connection after disconnect
VadymLuchko Jun 1, 2021
a60c9f4
replace ISessionListener
VadymLuchko Jun 1, 2021
37d22d7
Merge pull request #4 from LuxoftSDL/fix/fix_notifications
Jun 1, 2021
027ba6b
Merge pull request #3 from LuxoftSDL/fix/fix_vehicle_data_filter_check
Jun 1, 2021
f9a1072
Merge branch 'develop' into feature/0293_oem_android_specific
VadymLuchko Jun 2, 2021
92a1d4f
Merge branch 'develop' into feature/0293_oem_android_specific
VadymLuchko Jun 8, 2021
20aa80b
Revert changes in the SdlManagerListener
YaroslavLutsenko Jul 16, 2021
c35b6f5
Remove changes in the 'HelloSdlApp'
YaroslavLutsenko Jul 16, 2021
be81783
Fix logic in the deserialization vehicle method
YaroslavLutsenko Jul 16, 2021
1dd00a8
Update after comment discussion
YaroslavLutsenko Jul 16, 2021
ccdbb98
Update after comment discussion
YaroslavLutsenko Jul 16, 2021
13e0cd2
Merge pull request #5 from LuxoftSDL/fix/0293_oem_android_specific
YaroslavLutsenko Jul 19, 2021
67569c3
Revert changes
YaroslavLutsenko Jul 22, 2021
23ad06b
Remove ISessionListener and lifecycle onError call before onClose
YaroslavLutsenko Jul 22, 2021
8243c79
Update unit test and SdlService
YaroslavLutsenko Jul 22, 2021
f82ff82
Merge pull request #6 from LuxoftSDL/fix/0293_oem_android_specific
YaroslavLutsenko Jul 23, 2021
efe078c
Fix shutting down the RPC service
YaroslavLutsenko Jul 26, 2021
0971c14
Add a version check
YaroslavLutsenko Jul 29, 2021
bbbd73d
Add some Java Docs and apply suggested changes
YaroslavLutsenko Aug 4, 2021
688d227
Fix saving vehicle type
YaroslavLutsenko Aug 4, 2021
c5c0e44
Fix Java Docs
YaroslavLutsenko Aug 11, 2021
d236ac8
Fix Java Docs
YaroslavLutsenko Aug 11, 2021
6556ebc
Fix some potential NPE
YaroslavLutsenko Aug 17, 2021
2f71c1e
Refactor some names
YaroslavLutsenko Aug 17, 2021
773779e
Refactor to more generic approach
YaroslavLutsenko Aug 17, 2021
8f0c62a
Remove vehicleType param from callback
YaroslavLutsenko Aug 17, 2021
3fdcab4
Add return statement
YaroslavLutsenko Aug 17, 2021
1112c28
Code Review Fixes
YaroslavLutsenko Aug 18, 2021
d2ef11f
Code Review Fixes
YaroslavLutsenko Aug 19, 2021
1787d36
Merge pull request #8 from LuxoftSDL/review/0293_oem_android_specific
YaroslavLutsenko Aug 19, 2021
a1fe5c0
Fix some potential NPE
YaroslavLutsenko Aug 24, 2021
ee95166
Fix checkIfVehicleSupported
YaroslavLutsenko Aug 30, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
import com.smartdevicelink.util.SdlAppInfo;
import com.smartdevicelink.util.ServiceFinder;

import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import java.util.Locale;
Expand Down Expand Up @@ -147,7 +148,7 @@ public void onReceive(Context context, Intent intent) {
DebugTool.logError(TAG, "You cannot use the default SdlRouterService class, it must be extended in your project. THIS WILL THROW AN EXCEPTION IN FUTURE RELEASES!!");
}

Hashtable<String, Object> vehicleInfoStore = (Hashtable<String, Object>) intent.getSerializableExtra(TransportConstants.CONNECT_VEHICLE_INFO);
HashMap<String, Object> vehicleInfoStore = (HashMap<String, Object>) intent.getSerializableExtra(TransportConstants.CONNECT_VEHICLE_INFO);

VehicleType vehicleType;
JulianKast marked this conversation as resolved.
Show resolved Hide resolved
if (vehicleInfoStore == null || vehicleInfoStore.isEmpty()){
kboskin marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ public void start() {
if (hasSDLConnected(contextWeakReference.get(), connectedDevice.getAddress())) {
DebugTool.logInfo(TAG, ": Confirmed SDL device, should start router service");
//This device has connected to SDL previously, it is ok to start the RS right now
callback.onTransportConnected(contextWeakReference.get(), connectedDevice, new VehicleType(getVehicleTypeFromPrefs(contextWeakReference.get(), connectedDevice.getAddress())));
VehicleType vehicleType = null;
JulianKast marked this conversation as resolved.
Show resolved Hide resolved
Hashtable<String, Object> store = getVehicleTypeFromPrefs(contextWeakReference.get(), connectedDevice.getAddress());
if(store != null){
vehicleType = new VehicleType(store);
}
callback.onTransportConnected(contextWeakReference.get(), connectedDevice,vehicleType);
kboskin marked this conversation as resolved.
Show resolved Hide resolved
return;
}
synchronized (RUNNING_LOCK) {
Expand Down Expand Up @@ -250,7 +255,7 @@ public void notifyConnection(@Nullable VehicleType vehicleType) {
}
}

private static void saveVehicleType(Context context, VehicleType vehicleType, String address) {
public static void saveVehicleType(Context context, VehicleType vehicleType, String address) {
JulianKast marked this conversation as resolved.
Show resolved Hide resolved
synchronized (LOCK) {

if (vehicleType == null || address == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
import java.util.HashMap;
import java.util.List;

import static com.smartdevicelink.util.SdlAppInfo.checkIfVehicleSupported;
kboskin marked this conversation as resolved.
Show resolved Hide resolved

public class AndroidTools {
/**
* Check to see if a component is exported
Expand Down Expand Up @@ -120,7 +122,7 @@ public static List<SdlAppInfo> querySdlAppInfo(Context context, Comparator<SdlAp
try {
packageInfo = packageManager.getPackageInfo(info.serviceInfo.packageName, 0);
SdlAppInfo appInformation = new SdlAppInfo(info, packageInfo, context);
if (type == null || appInformation.vehicleMakesList.isEmpty() || appInformation.vehicleMakesList.contains(type)) {
if (type == null || appInformation.vehicleMakesList.isEmpty() || checkIfVehicleSupported(appInformation.vehicleMakesList,type)) {
sdlAppInfoList.add(appInformation);
}
} catch (NameNotFoundException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,46 @@ public static List<VehicleType> deserializeVehicleMake(XmlResourceParser parser)
}
return vehicleMakesList;
}

static boolean checkIfVehicleSupported(List<VehicleType> supportedVehicleList, VehicleType connectedVehicle){
JulianKast marked this conversation as resolved.
Show resolved Hide resolved
if (null == supportedVehicleList || null == connectedVehicle){
JulianKast marked this conversation as resolved.
Show resolved Hide resolved
return false;
JulianKast marked this conversation as resolved.
Show resolved Hide resolved
}
if (supportedVehicleList.contains(connectedVehicle)){
kboskin marked this conversation as resolved.
Show resolved Hide resolved
return true;
}
for (VehicleType supportedVehicle :supportedVehicleList) {
String svMake = supportedVehicle.getMake();
JulianKast marked this conversation as resolved.
Show resolved Hide resolved
String cvMake = connectedVehicle.getMake();
JulianKast marked this conversation as resolved.
Show resolved Hide resolved
if(svMake != null && cvMake != null && cvMake.equalsIgnoreCase(svMake)) {
JulianKast marked this conversation as resolved.
Show resolved Hide resolved
String svModel = supportedVehicle.getModel();
JulianKast marked this conversation as resolved.
Show resolved Hide resolved
String cvModel = connectedVehicle.getModel();
JulianKast marked this conversation as resolved.
Show resolved Hide resolved
if (svModel != null && cvModel != null) {
if(cvModel.equalsIgnoreCase(svModel)) {
boolean ret = true;
String svMY = supportedVehicle.getModelYear();
String cvMY = connectedVehicle.getModelYear();
if (svMY != null && cvMY != null) {
ret = cvMY.equalsIgnoreCase(svMY);
}
String svTrim = supportedVehicle.getTrim();
String cvTrim = connectedVehicle.getTrim();
if (svTrim != null && cvTrim != null) {
ret &= cvTrim.equalsIgnoreCase(svTrim);
}
if (ret) {
joeygrover marked this conversation as resolved.
Show resolved Hide resolved
return true;
}
}
}
else{
kboskin marked this conversation as resolved.
Show resolved Hide resolved
/* Return true if only make is defined and it matches*/
JulianKast marked this conversation as resolved.
Show resolved Hide resolved
return true;
}
}
}
return false;
}
/**
* This comparator will sort a list to find the best router service to start out of the known SDL enabled apps
*/
Expand Down