Skip to content

Commit

Permalink
fix(inventory): some fix
Browse files Browse the repository at this point in the history
  • Loading branch information
stonebuzz committed Apr 7, 2022
1 parent 3e87675 commit 8ac08ad
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public Cameras(Context xCtx) {
for (int index = 0; index < count; index++) {
Category c = new Category("CAMERAS", "cameras");
CameraCharacteristics chars = getCharacteristics(xCtx, index);
c.put("DESIGNATION", new CategoryValue(Integer.toString(index), "DESIGNATION", "designation"));
c.put("DESIGNATION", new CategoryValue("Camera "+Integer.toString(index), "DESIGNATION", "designation"));
if (chars != null) {

c.put("RESOLUTION", new CategoryValue(getResolution(chars), "RESOLUTION", "resolution"));
Expand Down Expand Up @@ -236,11 +236,11 @@ public String getFacingState(CameraCharacteristics characteristics) {
* @return String 0 no available, 1 is available
*/
public String getFlashUnit(CameraCharacteristics characteristics) {
String value = "N/A";
String value = "0";
try {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
Boolean bool = characteristics.get(CameraCharacteristics.FLASH_INFO_AVAILABLE);
return bool != null ? bool ? "1" : "0" : "N/A";
return bool != null ? bool ? "1" : "0" : "0";
}
} catch (Exception ex) {
InventoryLog.e(InventoryLog.getMessage(context, CommonErrorType.CAMERA_FLASH_UNIT, ex.getMessage()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public CategoryValue(List<String> values, String xmlName, String jsonName) {
this.jsonName = jsonName;
this.xmlName = xmlName;
this.isPrivate = false;
this.hasCDATA = true;
this.hasCDATA = false;
}

/** Embed an category inside in another category
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ public String getSSID() {
} catch (Exception ex) {
InventoryLog.e(InventoryLog.getMessage(context, CommonErrorType.NETWORKS_SS_ID, ex.getMessage()));
}

//remove char ex: <unknown ssid>
value = value.replace("<","");
value = value.replace(">","");
return value;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public Software(Context xCtx) {

Category c = new Category("SOFTWARES", "softwares");

c.put("NAME", new CategoryValue(getName(p), "NAME", "name", false, true));
c.put("NAME", new CategoryValue(getName(p), "NAME", "name"));
c.put("COMMENTS", new CategoryValue(getPackage(p), "COMMENTS", "comments"));
c.put("VERSION", new CategoryValue(getVersion(p), "VERSION", "version"));
c.put("FILESIZE", new CategoryValue(getFileSize(p), "FILESIZE", "fileSize"));
Expand Down

0 comments on commit 8ac08ad

Please sign in to comment.