diff --git a/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceNodeFactory.java b/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceNodeFactory.java index 5fe069b523..49ae86d62b 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceNodeFactory.java +++ b/Core/src/org/sleuthkit/autopsy/communications/AccountDeviceInstanceNodeFactory.java @@ -24,6 +24,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.openide.nodes.ChildFactory; import org.openide.nodes.Node; +import org.sleuthkit.datamodel.Account; import org.sleuthkit.datamodel.AccountDeviceInstance; import org.sleuthkit.datamodel.CommunicationsFilter; import org.sleuthkit.datamodel.CommunicationsManager; @@ -53,8 +54,11 @@ final class AccountDeviceInstanceNodeFactory extends ChildFactory accountDeviceInstancesWithRelationships = commsManager.getAccountDeviceInstancesWithRelationships(commsFilter); for (AccountDeviceInstance accountDeviceInstance : accountDeviceInstancesWithRelationships) { - long communicationsCount = commsManager.getRelationshipSourcesCount(accountDeviceInstance, commsFilter); - accountDeviceInstanceKeys.add(new AccountDeviceInstanceKey(accountDeviceInstance, commsFilter, communicationsCount)); + //Filter out device accounts, in the table. + if (Account.Type.DEVICE.equals(accountDeviceInstance.getAccount().getAccountType()) ==false) { + long communicationsCount = commsManager.getRelationshipSourcesCount(accountDeviceInstance, commsFilter); + accountDeviceInstanceKeys.add(new AccountDeviceInstanceKey(accountDeviceInstance, commsFilter, communicationsCount)); + } } } catch (TskCoreException tskCoreException) { logger.log(Level.SEVERE, "Error getting filtered account device instances", tskCoreException); diff --git a/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.java b/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.java index 6585f6324a..11ae8809e8 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/communications/CVTTopComponent.java @@ -57,6 +57,7 @@ public final class CVTTopComponent extends TopComponent { browseVisualizeTabPane.addChangeListener(changeEvent -> { Lookup.Provider selectedComponent = (Lookup.Provider) browseVisualizeTabPane.getSelectedComponent(); proxyLookup.changeLookups(selectedComponent.getLookup()); + filtersPane.setDeviceAccountTypeEnabled(browseVisualizeTabPane.getSelectedIndex() != 0); }); diff --git a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java index 36232eaf15..248412b07a 100644 --- a/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java +++ b/Core/src/org/sleuthkit/autopsy/communications/FiltersPanel.java @@ -78,6 +78,7 @@ final public class FiltersPanel extends JPanel { * results) */ private final ItemListener validationListener; + private boolean deviceAccountTypeEnabled = false; @NbBundle.Messages({"refreshText=Refresh Results", "applyText=Apply"}) @@ -196,8 +197,8 @@ final public class FiltersPanel extends JPanel { Account.Type.PREDEFINED_ACCOUNT_TYPES.forEach(type -> { if (type.equals(Account.Type.CREDIT_CARD)) { //don't show a check box for credit cards - } else if (type.equals(Account.Type.DEVICE)) { - //don't show a check box fro device +// } else if (type.equals(Account.Type.DEVICE)) { +// //don't show a check box fro device } else { accountTypeMap.computeIfAbsent(type, t -> { final JCheckBox jCheckBox = new JCheckBox( @@ -209,6 +210,9 @@ final public class FiltersPanel extends JPanel { ); jCheckBox.addItemListener(validationListener); accountTypePane.add(jCheckBox); + if (t.equals(Account.Type.DEVICE)) { + jCheckBox.setEnabled(deviceAccountTypeEnabled); + } return jCheckBox; }); } @@ -485,7 +489,7 @@ final public class FiltersPanel extends JPanel { validateFilters(); } - private CommunicationsFilter getFilter() { + private CommunicationsFilter getFilter() { CommunicationsFilter commsFilter = new CommunicationsFilter(); commsFilter.addAndFilter(getDeviceFilter()); commsFilter.addAndFilter(getAccountTypeFilter()); @@ -618,4 +622,11 @@ final public class FiltersPanel extends JPanel { private final javax.swing.JButton unCheckAllDevicesButton = new javax.swing.JButton(); // End of variables declaration//GEN-END:variables + void setDeviceAccountTypeEnabled(boolean enableDeviceAccountType) { + deviceAccountTypeEnabled = enableDeviceAccountType; + JCheckBox deviceCheckbox = accountTypeMap.get(Account.Type.DEVICE); + if (deviceCheckbox != null) { + deviceCheckbox.setEnabled(deviceAccountTypeEnabled); + } + } }