Skip to content

Commit 83c3d06

Browse files
committed
Updating method for checking payload protected to isPayloadProtected instead of getPayloadProtected. Created constants instead of hardcoded ints in SdlProxyBase.
1 parent 301071a commit 83c3d06

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

sdl_android_lib/src/com/smartdevicelink/proxy/RPCStruct.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void setPayloadProtected(Boolean bVal) {
7474
protectedPayload = bVal;
7575
}
7676

77-
public Boolean getPayloadProtected() {
77+
public Boolean isPayloadProtected() {
7878
return protectedPayload;
7979
}
8080

sdl_android_lib/src/com/smartdevicelink/proxy/SdlProxyBase.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public abstract class SdlProxyBase<proxyListenerType extends IProxyListenerBase>
102102
public static final String TAG = "SdlProxy";
103103
private static final String SDL_LIB_TRACE_KEY = "42baba60-eb57-11df-98cf-0800200c9a66";
104104
private static final int PROX_PROT_VER_ONE = 1;
105+
private static final int RESPONSE_WAIT_TIME = 2000;
105106

106107
private SdlSession sdlSession = null;
107108
private proxyListenerType _proxyListener = null;
@@ -1648,7 +1649,7 @@ private void sendRPCRequestPrivate(RPCRequest request) throws SdlException {
16481649
pm.setMessageType(MessageType.RPC);
16491650
pm.setSessionType(SessionType.RPC);
16501651
pm.setFunctionID(FunctionID.getFunctionId(request.getFunctionName()));
1651-
pm.setPayloadProtected(request.getPayloadProtected());
1652+
pm.setPayloadProtected(request.isPayloadProtected());
16521653
if (request.getCorrelationID() == null)
16531654
{
16541655
//Log error here
@@ -3441,7 +3442,7 @@ public boolean startH264(InputStream is, boolean isEncrypted) {
34413442

34423443
sdlSession.startService(SessionType.NAV, sdlSession.getSessionId(), isEncrypted);
34433444

3444-
FutureTask<Void> fTask = createFutureTask(new CallableMethod(10000));
3445+
FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
34453446
ScheduledExecutorService scheduler = createScheduler();
34463447
scheduler.execute(fTask);
34473448

@@ -3474,7 +3475,7 @@ public OutputStream startH264(boolean isEncrypted) {
34743475
navServiceStartResponse = false;
34753476
sdlSession.startService(SessionType.NAV, sdlSession.getSessionId(), isEncrypted);
34763477

3477-
FutureTask<Void> fTask = createFutureTask(new CallableMethod(10000));
3478+
FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
34783479
ScheduledExecutorService scheduler = createScheduler();
34793480
scheduler.execute(fTask);
34803481

@@ -3505,7 +3506,7 @@ public boolean endH264() {
35053506
navServiceEndResponse = false;
35063507
sdlSession.stopVideoStream();
35073508

3508-
FutureTask<Void> fTask = createFutureTask(new CallableMethod(10000));
3509+
FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
35093510
ScheduledExecutorService scheduler = createScheduler();
35103511
scheduler.execute(fTask);
35113512

@@ -3572,7 +3573,7 @@ public boolean startPCM(InputStream is, boolean isEncrypted) {
35723573
pcmServiceStartResponse = false;
35733574
sdlSession.startService(SessionType.PCM, sdlSession.getSessionId(), isEncrypted);
35743575

3575-
FutureTask<Void> fTask = createFutureTask(new CallableMethod(10000));
3576+
FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
35763577
ScheduledExecutorService scheduler = createScheduler();
35773578
scheduler.execute(fTask);
35783579

@@ -3604,7 +3605,7 @@ public OutputStream startPCM(boolean isEncrypted) {
36043605
pcmServiceStartResponse = false;
36053606
sdlSession.startService(SessionType.PCM, sdlSession.getSessionId(), isEncrypted);
36063607

3607-
FutureTask<Void> fTask = createFutureTask(new CallableMethod(10000));
3608+
FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
36083609
ScheduledExecutorService scheduler = createScheduler();
36093610
scheduler.execute(fTask);
36103611

@@ -3637,7 +3638,7 @@ public boolean endPCM() {
36373638
pcmServiceEndResponse = false;
36383639
sdlSession.stopAudioStream();
36393640

3640-
FutureTask<Void> fTask = createFutureTask(new CallableMethod(10000));
3641+
FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
36413642
ScheduledExecutorService scheduler = createScheduler();
36423643
scheduler.execute(fTask);
36433644

@@ -3673,7 +3674,7 @@ public Surface createOpenGLInputSurface(int frameRate, int iFrameInterval, int w
36733674
navServiceStartResponse = false;
36743675
sdlSession.startService(SessionType.NAV, sdlSession.getSessionId(), isEncrypted);
36753676

3676-
FutureTask<Void> fTask = createFutureTask(new CallableMethod(2000));
3677+
FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
36773678
ScheduledExecutorService scheduler = createScheduler();
36783679
scheduler.execute(fTask);
36793680

@@ -3777,7 +3778,7 @@ public boolean startProtectedRPCService() {
37773778
rpcProtectedStartResponse = false;
37783779
sdlSession.startService(SessionType.RPC, sdlSession.getSessionId(), true);
37793780

3780-
FutureTask<Void> fTask = createFutureTask(new CallableMethod(10000));
3781+
FutureTask<Void> fTask = createFutureTask(new CallableMethod(RESPONSE_WAIT_TIME));
37813782
ScheduledExecutorService scheduler = createScheduler();
37823783
scheduler.execute(fTask);
37833784

sdl_android_lib/src/com/smartdevicelink/security/SdlSecurityBase.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010

1111
public abstract class SdlSecurityBase {
1212

13-
private SdlSession session = null;
14-
private String appId = null;
15-
private List<String> makeList = null;
16-
private boolean isInitSuccess = false;
17-
private byte sessionId = 0;
18-
private static Service appService = null;
19-
private List<SessionType> startServiceList = new ArrayList<SessionType>();
13+
protected SdlSession session = null;
14+
protected String appId = null;
15+
protected List<String> makeList = null;
16+
protected boolean isInitSuccess = false;
17+
protected byte sessionId = 0;
18+
protected static Service appService = null;
19+
protected List<SessionType> startServiceList = new ArrayList<SessionType>();
2020

2121
public SdlSecurityBase() {
2222
}

sdl_android_lib/src/com/smartdevicelink/streaming/StreamRPCPacketizer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public StreamRPCPacketizer(SdlProxyBase<IProxyListenerBase> proxy, IStreamListen
4545
iInitialCorrID = request.getCorrelationID();
4646
mPauseLock = new Object();
4747
mPaused = false;
48-
isRPCProtected = request.getPayloadProtected();
48+
isRPCProtected = request.isPayloadProtected();
4949
if (proxy != null)
5050
{
5151
_proxy = proxy;

0 commit comments

Comments
 (0)