Skip to content

Commit

Permalink
Update CDS enclave.
Browse files Browse the repository at this point in the history
  • Loading branch information
greyson-signal committed Sep 9, 2020
1 parent fa30c75 commit cdc7033
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ android {
buildConfigField "String", "CONTENT_PROXY_HOST", "\"contentproxy.signal.org\""
buildConfigField "int", "CONTENT_PROXY_PORT", "443"
buildConfigField "String", "SIGNAL_AGENT", "\"OWA\""
buildConfigField "String", "CDS_MRENCLAVE", "\"a3bfdf9717e35ce4f6fd3888133d65a71a880cd6a26c41d1e47647ed3e7704fa\""
buildConfigField "String", "CDS_MRENCLAVE", "\"c98e00a4e3ff977a56afefe7362a27e4961e4f19e211febfbb19b897e6b80b15\""
buildConfigField "String", "KBS_ENCLAVE_NAME", "\"fe7c1bfae98f9b073d220366ea31163ee82f6d04bead774f71ca8e5c40847bfe\""
buildConfigField "String", "KBS_SERVICE_ID", "\"fe7c1bfae98f9b073d220366ea31163ee82f6d04bead774f71ca8e5c40847bfe\""
buildConfigField "String", "KBS_MRENCLAVE", "\"a3baab19ef6ce6f34ab9ebb25ba722725ae44a8872dc0ff08ad6d83a9489de87\""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ private static void refreshNumbers(@NonNull Context context, @NonNull Set<String
return;
}

Stopwatch stopwatch = new Stopwatch("refresh");

DirectoryResult result;

if (FeatureFlags.cds()) {
Expand All @@ -224,6 +226,8 @@ private static void refreshNumbers(@NonNull Context context, @NonNull Set<String
result = ContactDiscoveryV1.getDirectoryResult(databaseNumbers, systemNumbers);
}

stopwatch.split("network");

if (result.getNumberRewrites().size() > 0) {
Log.i(TAG, "[getDirectoryResult] Need to rewrite some numbers.");
recipientDatabase.updatePhoneNumbers(result.getNumberRewrites());
Expand All @@ -238,10 +242,16 @@ private static void refreshNumbers(@NonNull Context context, @NonNull Set<String
.map(recipientDatabase::getOrInsertFromE164)
.collect(Collectors.toSet());

stopwatch.split("process-cds");

recipientDatabase.bulkUpdatedRegisteredStatus(uuidMap, inactiveIds);

stopwatch.split("update-registered");

updateContactsDatabase(context, activeIds, true, result.getNumberRewrites());

stopwatch.split("contacts-db");

if (TextSecurePreferences.isMultiDevice(context)) {
ApplicationDependencies.getJobManager().add(new MultiDeviceContactUpdateJob());
}
Expand All @@ -258,6 +268,8 @@ private static void refreshNumbers(@NonNull Context context, @NonNull Set<String
} else {
TextSecurePreferences.setHasSuccessfullyRetrievedDirectory(context, true);
}

stopwatch.stop(TAG);
}


Expand Down

0 comments on commit cdc7033

Please sign in to comment.