[feat] add privacy unlock controls and remote relocking

This commit is contained in:
dijunkun
2026-10-27 10:22:25 +08:00
parent d1e4a31efb
commit ea3a2e1faa
41 changed files with 470 additions and 72 deletions
@@ -195,6 +195,7 @@ typedef struct {
- (void)sendFileAtURL:(NSURL *)fileURL;
- (void)sendSecureAttentionSequence;
- (void)sendPrivacyCommand:(BOOL)enable
lock:(BOOL)lock
blockLocalInput:(BOOL)blockLocalInput
requestID:(uint32_t)requestID;
@@ -1044,6 +1044,7 @@ Params MakeParams(const RTCState &state, const std::string &user_id,
}
- (void)sendPrivacyCommand:(BOOL)enable
lock:(BOOL)lock
blockLocalInput:(BOOL)blockLocalInput
requestID:(uint32_t)requestID {
const uint64_t generation = _activeControllerGeneration.load();
@@ -1051,7 +1052,8 @@ Params MakeParams(const RTCState &state, const std::string &user_id,
if (![self isControllerGenerationActive:generation]) return;
RemoteAction action{};
action.type = ControlType::privacy_command;
action.pc = {enable ? crossdesk::PrivacyCommandFlag::enable
action.pc = {lock ? crossdesk::PrivacyCommandFlag::lock
: enable ? crossdesk::PrivacyCommandFlag::enable
: crossdesk::PrivacyCommandFlag::disable,
static_cast<bool>(blockLocalInput)};
const auto message = action.to_json();