summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Kast <julian@livio.com>2020-03-26 12:43:24 -0400
committerJulian Kast <julian@livio.com>2020-03-26 12:43:24 -0400
commit765e47d5e6ad8a3f15e9e8b26f36bc496f973567 (patch)
treec3bb5ad3ad6eb7fca68787f44fe6ee217e6584dd
parent9ad10826080a790a289ad65dc50ceb94549b23ea (diff)
downloadsdl_android-765e47d5e6ad8a3f15e9e8b26f36bc496f973567.tar.gz
removed redudant checks in BaseTextAndGraphicManager
-rw-r--r--base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java8
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/WindowCapability.java6
2 files changed, 4 insertions, 10 deletions
diff --git a/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java b/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
index b62cedc53..7c4a5e45d 100644
--- a/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
+++ b/base/src/main/java/com/smartdevicelink/managers/screen/BaseTextAndGraphicManager.java
@@ -747,7 +747,7 @@ abstract class BaseTextAndGraphicManager extends BaseSubManager {
* @return true if primaryGraphic should be updated, false if not
*/
private boolean shouldUpdatePrimaryImage() {
- boolean templateSupportsPrimaryArtwork = (defaultMainWindowCapability != null && defaultMainWindowCapability.getImageFields() != null) ? defaultMainWindowCapability.hasImageFieldOfName(ImageFieldName.graphic) : true;
+ boolean templateSupportsPrimaryArtwork = (defaultMainWindowCapability != null) ? defaultMainWindowCapability.hasImageFieldOfName(ImageFieldName.graphic) : true;
if (currentScreenData.getGraphic() == null) {
return templateSupportsPrimaryArtwork && primaryGraphic != null;
@@ -763,7 +763,7 @@ abstract class BaseTextAndGraphicManager extends BaseSubManager {
* @return true if secondaryGraphic should be updated, false if not
*/
private boolean shouldUpdateSecondaryImage() {
- boolean templateSupportsSecondaryArtwork = (defaultMainWindowCapability != null && defaultMainWindowCapability.getImageFields() != null) ? defaultMainWindowCapability.hasImageFieldOfName(ImageFieldName.secondaryGraphic) : true;
+ boolean templateSupportsSecondaryArtwork = (defaultMainWindowCapability != null) ? defaultMainWindowCapability.hasImageFieldOfName(ImageFieldName.secondaryGraphic) : true;
if (currentScreenData.getSecondaryGraphic() == null) {
return templateSupportsSecondaryArtwork && secondaryGraphic != null;
@@ -779,7 +779,7 @@ abstract class BaseTextAndGraphicManager extends BaseSubManager {
* @return true if mediaTrackTextField should be updated, false if not
*/
private boolean shouldUpdateMediaTrackField(){
- return (defaultMainWindowCapability != null && defaultMainWindowCapability.getTextFields() != null) ? defaultMainWindowCapability.hasTextFieldOfName(TextFieldName.mediaTrack) : true;
+ return (defaultMainWindowCapability != null) ? defaultMainWindowCapability.hasTextFieldOfName(TextFieldName.mediaTrack) : true;
}
/**
@@ -787,7 +787,7 @@ abstract class BaseTextAndGraphicManager extends BaseSubManager {
* @return true if title textField should be updated, false if not
*/
private boolean shouldUpdateTitleField(){
- return (defaultMainWindowCapability != null && defaultMainWindowCapability.getTextFields() != null) ? defaultMainWindowCapability.hasTextFieldOfName(TextFieldName.templateTitle) : true;
+ return (defaultMainWindowCapability != null) ? defaultMainWindowCapability.hasTextFieldOfName(TextFieldName.templateTitle) : true;
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowCapability.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowCapability.java
index d64de33b6..c4b1e1a56 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowCapability.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/WindowCapability.java
@@ -214,9 +214,6 @@ public class WindowCapability extends RPCStruct {
* @return true if name exist in WindowCapability else false
*/
public boolean hasImageFieldOfName(ImageFieldName name) {
- if (this == null) {
- return false;
- }
if (this.getImageTypeSupported() == null || this.getImageTypeSupported().isEmpty()) {
return false;
}
@@ -236,9 +233,6 @@ public class WindowCapability extends RPCStruct {
* @return true if name exist in WindowCapability else false
*/
public boolean hasTextFieldOfName(TextFieldName name) {
- if (this == null) {
- return false;
- }
if (this.getTextFields() != null) {
for (TextField field : this.getTextFields()) {
if (field != null && field.getName() != null && field.getName().equals(name)) {