Skip to content

Commit

Permalink
TEMP: Disable duplicate line logic
Browse files Browse the repository at this point in the history
Samsung tablets currently crash due to this for some reason
  • Loading branch information
deadman96385 committed Feb 29, 2024
1 parent 8dbe6f7 commit f4ee3f3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

Expand Down Expand Up @@ -338,21 +336,21 @@ private void saveData(String bar_string) {
//raw_data.add(new String[] {bar_string});

// Create a HashSet to keep track of the lines we've already seen
Set<String> seenLines = listPreference.getObject("seen_lines", Set.class,
new HashSet<>());
//Set<String> seenLines = listPreference.getObject("seen_lines", Set.class,
// new HashSet<>());

// Check for duplicate and don't upload role qr data
if (!seenLines.contains(bar_string) & !bar_string.contains("Role")) {
//if (!seenLines.contains(bar_string) & !bar_string.contains("Role")) {

// Add the line to the HashSet so we can check for duplicates in the future
seenLines.add(bar_string);
//seenLines.add(bar_string);

// Save the HashSet to the shared preferences
listPreference.setObject("seen_lines", seenLines);
//listPreference.setObject("seen_lines", seenLines);

// Save the data to the shared preferences
matchPreference.setObject("upload_data", raw_data);
}
//}
}

private void set_team(int id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import static com.databits.androidscouting.util.GoogleAuthActivity.REQUEST_ACCOUNT_PICKER;

Expand Down Expand Up @@ -106,18 +104,18 @@ public SheetsUpdateTask(Activity activity) {
String removeTimeStamp = lineStringT.substring(0, lineStringT.lastIndexOf(','));

// Create a HashSet to keep track of the lines we've already seen
Set<String> seenLines = listPreference.getObject("seen_lines", Set.class,
new HashSet<>());
//Set<String> seenLines = listPreference.getObject("seen_lines", Set.class,
// new HashSet<>());

// Check for duplicate and don't upload role qr data
if (!seenLines.contains(removeTimeStamp) & !removeTimeStamp.contains("Role")) {
//if (!seenLines.contains(removeTimeStamp) & !removeTimeStamp.contains("Role")) {
// If we haven't seen this line before, add it to the unique list
uniqueList.add(line);
//uniqueList.add(line);

// Add the line minus the timestamp to the HashSet so we can check for duplicates later
seenLines.add(removeTimeStamp);
listPreference.setObject("seen_lines", seenLines);
}
//seenLines.add(removeTimeStamp);
//listPreference.setObject("seen_lines", seenLines);
//}
}

configPreference.setBoolean("upload_unique_toggle", true);
Expand Down

0 comments on commit f4ee3f3

Please sign in to comment.