mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
Change enum PublicCredentialType to enum class.
PiperOrigin-RevId: 486243753
This commit is contained in:
committed by
Copybara-Service
parent
f0440e96a9
commit
5faa395f24
@@ -16,6 +16,7 @@
|
||||
#define THIRD_PARTY_NEARBY_INTERNAL_PLATFORM_IMPLEMENTATION_CREDENTIAL_CALLBACKS_H_
|
||||
|
||||
#include <functional>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -37,7 +38,7 @@ struct CredentialSelector {
|
||||
::nearby::internal::IdentityType identity_type;
|
||||
};
|
||||
|
||||
enum PublicCredentialType {
|
||||
enum class PublicCredentialType {
|
||||
kLocalPublicCredential = 1,
|
||||
kRemotePublicCredential = 2,
|
||||
};
|
||||
@@ -62,6 +63,13 @@ struct GetPublicCredentialsResultCallback {
|
||||
credentials_fetched_cb;
|
||||
std::function<void(CredentialOperationStatus)> get_credentials_failed_cb;
|
||||
};
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& os,
|
||||
const PublicCredentialType& credential_type) {
|
||||
return os << "PublicCredentialType(" << static_cast<int>(credential_type)
|
||||
<< ")";
|
||||
}
|
||||
|
||||
} // namespace presence
|
||||
} // namespace nearby
|
||||
|
||||
|
||||
@@ -296,7 +296,8 @@ absl::StatusOr<std::string> CredentialManagerImpl::DecryptDataElements(
|
||||
.identity_type = internal::IDENTITY_TYPE_PUBLIC,
|
||||
};
|
||||
ExceptionOr<std::vector<PublicCredential>> credentials =
|
||||
GetPublicCredentialsSync(selector, kRemotePublicCredential, kTimeout);
|
||||
GetPublicCredentialsSync(
|
||||
selector, PublicCredentialType::kRemotePublicCredential, kTimeout);
|
||||
if (!credentials.ok()) {
|
||||
return absl::UnavailableError("Failed to fetch credentials");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user