Fix Android file lock portability and NativeActivity window insets
android-ci / android-arm64 (push) Successful in 18m47s
android-ci / android-arm64 (push) Successful in 18m47s
This commit is contained in:
1 parent
fd41389d63
commit
3cc9565fab
13 files changed
+119
-25
No files matched your search
@@ -204,7 +204,7 @@ pub fn save_migration(root: &Path, state: &MigrationState) -> Result<()> {
|
||||
/// Caller persists the OS secret first. Failure leaves the re-entry requirement in place.
|
||||
pub fn clear_required_password(root: &Path, bookmark_id: &str, purpose: &str, address: &str) -> Result<()> {
|
||||
let file = OpenOptions::new().write(true).create(true).truncate(false).open(root.join("migration.lock"))?;
|
||||
file.lock()?;
|
||||
teamspeach_core::file_lock::lock(&file, false)?;
|
||||
if let Some(mut state) = load_migration(root)? {
|
||||
let before = state.required_passwords.len();
|
||||
state.required_passwords.retain(|m| !(m.bookmark_id == bookmark_id && m.purpose == purpose && m.address == address.trim()));
|
||||
@@ -420,7 +420,10 @@ impl ConfinedSource {
|
||||
let relative = Path::new(name);
|
||||
if self.metadata(relative)?.is_none() { continue; }
|
||||
let file = self.open_file(relative)?;
|
||||
file.try_lock().map_err(|_| err("profile_occupied", "Close the legacy client before importing its profile"))?;
|
||||
teamspeach_core::file_lock::try_lock(&file, false).map_err(|error| match error {
|
||||
std::fs::TryLockError::WouldBlock => err("profile_occupied", "Close the legacy client before importing its profile"),
|
||||
std::fs::TryLockError::Error(error) => error.into(),
|
||||
})?;
|
||||
locks.push(file);
|
||||
}
|
||||
Ok(locks)
|
||||
|
||||
Reference in new issue
Block a user