Skip to content

Commit 97e2dee

Browse files
committed
Reformat base Java files
1 parent ec96925 commit 97e2dee

60 files changed

Lines changed: 206 additions & 157 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

base/src/main/java/com/smartdevicelink/managers/AlertCompletionListener.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ public interface AlertCompletionListener {
44

55
/**
66
* Returns whether an Alert operation was successful or not along with tryAgainTime
7-
* @param success - Boolean that is True if Operation was a success, False otherwise.
7+
*
8+
* @param success - Boolean that is True if Operation was a success, False otherwise.
89
* @param tryAgainTime - Amount of time (in seconds) that an app must wait before resending an alert.
910
*/
1011
void onComplete(boolean success, Integer tryAgainTime);

base/src/main/java/com/smartdevicelink/managers/ISdl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ public interface ISdl {
8989
/**
9090
* Starts the video streaming service
9191
*
92-
* @param parameters desired video streaming params for this service to be started with
93-
* @param encrypted flag to start this service with encryption or not
92+
* @param parameters desired video streaming params for this service to be started with
93+
* @param encrypted flag to start this service with encryption or not
9494
* @param withPendingRestart flag to start this service right after OnSystemCapabilityUpdated
9595
*/
9696
void startVideoService(VideoStreamingParameters parameters, boolean encrypted, boolean withPendingRestart);

base/src/main/java/com/smartdevicelink/managers/file/UploadFileOperation.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ private void closeInputStream() {
244244
try {
245245
this.inputStream.close();
246246
} catch (IOException e) {
247-
DebugTool.logError(TAG,"Error attempting to close input stream", e);
247+
DebugTool.logError(TAG, "Error attempting to close input stream", e);
248248
}
249249
}
250250

@@ -353,7 +353,7 @@ private byte[] getDataChunkWithSize(int size, InputStream inputStream) {
353353
try {
354354
bytesRead = inputStream.read(buffer, 0, size);
355355
} catch (IOException e) {
356-
DebugTool.logError(TAG,"Error attempting to read from input stream", e);
356+
DebugTool.logError(TAG, "Error attempting to read from input stream", e);
357357
}
358358

359359
if (bytesRead > 0) {
@@ -388,7 +388,7 @@ private int getFileSizeFromInputStream(InputStream inputStream) {
388388
try {
389389
size = inputStream.available();
390390
} catch (IOException e) {
391-
DebugTool.logError(TAG,"Error trying to get input stream size", e);
391+
DebugTool.logError(TAG, "Error trying to get input stream size", e);
392392
}
393393
}
394394
return size;

base/src/main/java/com/smartdevicelink/managers/lifecycle/BaseLifecycleManager.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public void start() {
153153
try {
154154
session.startSession();
155155
} catch (SdlException e) {
156-
DebugTool.logError(TAG,"Error attempting to start session", e);
156+
DebugTool.logError(TAG, "Error attempting to start session", e);
157157
}
158158
}
159159

@@ -843,7 +843,7 @@ private void sendRPCMessagePrivate(RPCMessage message, boolean isInternalMessage
843843
}
844844
// HAX: Issue #1690, Ford Sync bug returning incorrect display capabilities (https://github.com/smartdevicelink/sdl_java_suite/issues/1690). Save the next desired layout type to the update capabilities when the SetDisplayLayout response is received
845845
if (FunctionID.SET_DISPLAY_LAYOUT.toString().equals(message.getFunctionName())) {
846-
lastDisplayLayoutRequestTemplate = ((SetDisplayLayout)message).getDisplayLayout();
846+
lastDisplayLayoutRequestTemplate = ((SetDisplayLayout) message).getDisplayLayout();
847847
}
848848
} else if (RPCMessage.KEY_RESPONSE.equals(message.getMessageType())) { // Response Specifics
849849
RPCResponse response = (RPCResponse) message;
@@ -871,7 +871,7 @@ private void sendRPCMessagePrivate(RPCMessage message, boolean isInternalMessage
871871
session.sendMessage(pm);
872872

873873
} catch (OutOfMemoryError e) {
874-
DebugTool.logError(TAG,"Error attempting to send RPC message.", e);
874+
DebugTool.logError(TAG, "Error attempting to send RPC message.", e);
875875
}
876876
}
877877

@@ -1034,7 +1034,7 @@ public boolean isConnected() {
10341034
@Override
10351035
public void addServiceListener(SessionType serviceType, ISdlServiceListener sdlServiceListener) {
10361036
synchronized (BaseLifecycleManager.this) {
1037-
if(BaseLifecycleManager.this.session != null ){
1037+
if (BaseLifecycleManager.this.session != null) {
10381038
BaseLifecycleManager.this.session.addServiceListener(serviceType, sdlServiceListener);
10391039
}
10401040
}
@@ -1125,11 +1125,11 @@ public boolean isTransportForServiceAvailable(SessionType serviceType) {
11251125
@Override
11261126
public SdlMsgVersion getSdlMsgVersion() {
11271127
SdlMsgVersion msgVersion;
1128-
if(rpcSpecVersion != null) {
1128+
if (rpcSpecVersion != null) {
11291129
msgVersion = new SdlMsgVersion(rpcSpecVersion.getMajor(), rpcSpecVersion.getMinor());
11301130
msgVersion.setPatchVersion(rpcSpecVersion.getPatch());
11311131
} else {
1132-
msgVersion = new SdlMsgVersion(1,0);
1132+
msgVersion = new SdlMsgVersion(1, 0);
11331133
}
11341134

11351135
return msgVersion;
@@ -1272,6 +1272,7 @@ public void setSdlSecurity(@NonNull List<Class<? extends SdlSecurityBase>> secLi
12721272
/**
12731273
* Using the vehicle type information, specifically the make, the library will attempt to init
12741274
* the security library that is associated with that OEM.
1275+
*
12751276
* @param vehicleType type of vehicle that is currently connected
12761277
*/
12771278
private void setSecurityLibraryIfAvailable(VehicleType vehicleType) {
@@ -1328,7 +1329,7 @@ void initialize() {
13281329

13291330
abstract void cycle(SdlDisconnectedReason disconnectedReason);
13301331

1331-
void saveVehicleType(String address, VehicleType type){
1332+
void saveVehicleType(String address, VehicleType type) {
13321333
}
13331334

13341335
void saveVehicleType(List<TransportRecord> activeTransports, VehicleType type) {

base/src/main/java/com/smartdevicelink/managers/screen/AlertView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public Builder setTertiaryText(String tertiaryText) {
9898
* Timeout in seconds. Defaults to 0, which will use `defaultTimeout`. If this is set below the
9999
* minimum, it will be capped at 3 seconds. Minimum 3 seconds, maximum 10 seconds. If this is
100100
* set above the maximum, it will be capped at 10 seconds. Defaults to 0.
101-
*
101+
* <p>
102102
* Please note that if a button is added to the alert, the defaultTimeout and timeout values will be ignored.
103103
*/
104104
public Builder setTimeout(Integer timeout) {

base/src/main/java/com/smartdevicelink/managers/screen/BaseAlertManager.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public BaseAlertManager(@NonNull ISdl internalInterface, @NonNull FileManager fi
9595

9696
/**
9797
* Starts the manager
98+
*
9899
* @param listener CompletionListener that is called once the BaseSubManager's state is READY, LIMITED, or ERROR
99100
*/
100101
@Override

base/src/main/java/com/smartdevicelink/managers/screen/BaseScreenManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ public void presentAlert(AlertView alert, AlertCompletionListener listener) {
738738
* Used across managers to check and assign SoftButton ID's to prevent conflicts.
739739
*
740740
* @param softButtonObjects - list of SoftButtonObjects
741-
* @param location - location from which the button came from, so if new buttons get set on screen, we can clear the old ID's out
741+
* @param location - location from which the button came from, so if new buttons get set on screen, we can clear the old ID's out
742742
* @return True if ButtonID's are good, False if not.
743743
*/
744744
static boolean checkAndAssignButtonIds(List<SoftButtonObject> softButtonObjects, @ManagerLocation int location) {

base/src/main/java/com/smartdevicelink/managers/screen/BaseSoftButtonManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ protected void setSoftButtonObjects(@NonNull List<SoftButtonObject> list) {
298298
return;
299299
}
300300

301-
if (!BaseScreenManager.checkAndAssignButtonIds(softButtonObjects, BaseScreenManager.ManagerLocation.SOFTBUTTON_MANAGER)) {
301+
if (!BaseScreenManager.checkAndAssignButtonIds(softButtonObjects, BaseScreenManager.ManagerLocation.SOFTBUTTON_MANAGER)) {
302302
DebugTool.logError(TAG, "Attempted to set soft button objects, but multiple buttons had the same id");
303303
return;
304304
}

base/src/main/java/com/smartdevicelink/managers/screen/DispatchGroup.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,25 @@
3838
class DispatchGroup {
3939
private int count;
4040
private Runnable runnable;
41+
4142
DispatchGroup() {
4243
count = 0;
4344
}
45+
4446
synchronized void enter() {
4547
count++;
4648
}
49+
4750
synchronized void leave() {
4851
count--;
4952
run();
5053
}
54+
5155
void notify(Runnable runnable) {
5256
this.runnable = runnable;
5357
run();
5458
}
59+
5560
private void run() {
5661
if (count <= 0 && runnable != null) {
5762
runnable.run();

base/src/main/java/com/smartdevicelink/managers/screen/PresentAlertOperation.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
/**
6464
* Operation that handles uploading images and audio data needed by the alert and, once the data uploads are complete, sending the alert.
65-
*
65+
* <p>
6666
* Created by Julian Kast on 12/10/20.
6767
*/
6868
public class PresentAlertOperation extends Task {
@@ -156,6 +156,7 @@ public void onComplete(boolean success) {
156156

157157
/**
158158
* Checks the `AlertView` data to make sure it conforms to the RPC Spec, which says that at least either `alertText1`, `alertText2` or `TTSChunks` need to be provided.
159+
*
159160
* @param alertView - Alert data that needs to be presented
160161
* @return true if AlertView data conforms to RPC Spec
161162
*/
@@ -194,7 +195,7 @@ private void uploadAudioFiles(final CompletionListener listener) {
194195

195196
List<SdlFile> filesToBeUploaded = new ArrayList<>();
196197
for (TTSChunk ttsChunk : alertView.getAudio().getAudioData()) {
197-
if(ttsChunk.getType() != SpeechCapabilities.FILE){
198+
if (ttsChunk.getType() != SpeechCapabilities.FILE) {
198199
continue;
199200
}
200201
SdlFile audioFile = alertView.getAudio().getAudioFiles().get(ttsChunk.getText());
@@ -300,7 +301,7 @@ private void presentAlert() {
300301
public void onResponse(int correlationId, RPCResponse response) {
301302
if (!response.getSuccess()) {
302303
DebugTool.logError(TAG, "There was an error presenting the alert: " + response.getInfo());
303-
} else {
304+
} else {
304305
DebugTool.logInfo(TAG, "Alert finished presenting");
305306
}
306307
finishOperation(response.getSuccess(), ((AlertResponse) response).getTryAgainTime());
@@ -395,18 +396,19 @@ private int getSoftButtonCount() {
395396

396397
/**
397398
* Checks if AudioFiles are supported by module and removes them form audioData list if they are not
399+
*
398400
* @param alertView
399401
* @return List of ttsChunks
400402
*/
401403
private List<TTSChunk> getTTSChunksForAlert(AlertView alertView) {
402404
AlertAudioData alertAudioData = alertView.getAudio();
403405
List<TTSChunk> ttsChunks = new ArrayList<>();
404-
for (TTSChunk chunk : alertAudioData.getAudioData()) {
405-
if (chunk.getType() == SpeechCapabilities.FILE && !supportsAlertAudioFile()) {
406-
continue;
407-
}
408-
ttsChunks.add(chunk);
406+
for (TTSChunk chunk : alertAudioData.getAudioData()) {
407+
if (chunk.getType() == SpeechCapabilities.FILE && !supportsAlertAudioFile()) {
408+
continue;
409409
}
410+
ttsChunks.add(chunk);
411+
}
410412
return ttsChunks.size() > 0 ? ttsChunks : null;
411413
}
412414

@@ -446,7 +448,7 @@ private Alert assembleAlertText(Alert alert) {
446448
if (nonNullFields.isEmpty()) {
447449
return alert;
448450
}
449-
int numberOfLines = currentWindowCapability!= null ? ManagerUtility.WindowCapabilityUtility.getMaxNumberOfAlertFieldLines(currentWindowCapability) : 3;
451+
int numberOfLines = currentWindowCapability != null ? ManagerUtility.WindowCapabilityUtility.getMaxNumberOfAlertFieldLines(currentWindowCapability) : 3;
450452
switch (numberOfLines) {
451453
case 1:
452454
alert = assembleOneLineAlertText(alert, nonNullFields);

0 commit comments

Comments
 (0)